From: Wolfgang Denk Date: Tue, 01 Jun 2010 10:48:25 +0200 Subject: [U-Boot] Defer net initialization In-Reply-To: <201006011035.38778.alexander.stein@systec-electronic.com> References: <201005311458.18454.alexander.stein@systec-electronic.com> <201006010824.25437.alexander.stein@systec-electronic.com> <20100601071736.245DFAFC6B3@gemini.denx.de> <201006011035.38778.alexander.stein@systec-electronic.com> Message-ID: <20100601084825.52B15AFC6B3@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Alexander Stein, please keep the mailing list on Cc: In message <201006011035.38778.alexander.stein@systec-electronic.com> you wrote: > > > network command is being run in U-Boot. There have been some > > discussions about this topic recently (see for example thread starting > > here: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/76507). > > I think this thread focus on another problem: setting the MAC address. I have > a MAC in the ethaddr environment variable which gets used properly. You are wrong. The thread is exactly discussing the issue you are suffering from. The whole discussion is basicly around the decision which parts of the hardware (especially the Ethernet hardware) should be initialized where and when. > I traced the call graph a bit down. So on every startup eth_initialize is > called from start_armboot which then calls board_eth_init which calls > macb_eth_initialize (in my board source). And macb_eth_initialize takes very > long if no cable is plugged. Please read the docs referred to in the thread mentioned above (especially doc/README.drivers.eth, but there are some pretty explanative comments in the thread, which is why I point you at it) to understand why the implementationon your board is not in line with the intended design. eth_initialize should NOT wait for a link state. > How could I avoid calling eth_initialize during startup but before using the > first net related command? You ask the wrong question. Ity is perfectly OK to call eth_initialize() which is supposed to register the available network drivers, but this should NOT include to actually initialize the hardware. So it's the lower layers that are wrong in your port. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." - Howard Aiken