public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug in ARM/LPC32XX eth init code / probably OF related
@ 2015-07-04 18:31 Martin Devera
  0 siblings, 0 replies; only message in thread
From: Martin Devera @ 2015-07-04 18:31 UTC (permalink / raw)
  To: linux-kernel

Hi,

I compiled vanilla 4.1.1 for LPC3240 MPU without loadable module support.
I created own dts and board .c source:

static void __init lpc3250_machine_init(void)
{
         __raw_writel(0x1600 ,LPC32XX_GPIO_P_MUX_SET); // SSP0
         __raw_writel(1<<6 , io_p2v(0x40028004)); // ETH unreset

         lpc32xx_serial_init();
         of_platform_populate(NULL, of_default_bus_match_table,
                              lpc32xx_auxdata_lookup, NULL);
}

All seems to be ok, only ETH doesn't work. I found the problem -
Micrel PHY driver is inited later than lpc_eth driver and it doesn't bind
to the eth.
I solved it by ugly hack - set status="disabled" for eth in dts and adding:

static struct of_device_id __initdata of_ids[] = {
                  { .compatible = "nxp,lpc-eth" },{}
};
static void __init devik_late_init(void) // errorchecking omited
{
         struct device_node *np;
         np = of_find_compatible_node(NULL, NULL, "nxp,lpc-eth");
         struct property *p = of_find_property(np,"status",NULL);
         of_remove_property(np,p);
         of_node_clear_flag(np, OF_POPULATED);
         of_platform_bus_probe(np,of_ids,NULL);
}

Other solutiuon is to make it module a load later (we prefer no modules 
here),
or editing lpc_eth.c to register in device_initcall_sync.

Is there some better solution for the bug ?

devik

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-05 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-04 18:31 bug in ARM/LPC32XX eth init code / probably OF related Martin Devera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox