public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Devera <devik@cdi.cz>
To: linux-kernel@vger.kernel.org
Subject: bug in ARM/LPC32XX eth init code / probably OF related
Date: Sat, 04 Jul 2015 20:31:33 +0200	[thread overview]
Message-ID: <55982685.70201@cdi.cz> (raw)

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

                 reply	other threads:[~2015-07-05 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55982685.70201@cdi.cz \
    --to=devik@cdi.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox