From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Fri, 31 May 2013 17:40:41 +0200 Subject: [U-Boot] TFTP timeouts, i.mx fec problem? In-Reply-To: <15AE5A936F5E3A42A9144E66875A0A893090ED@server1-derijp.CLB-Benelux.lokaal> References: <15AE5A936F5E3A42A9144E66875A0A893090E4@server1-derijp.CLB-Benelux.lokaal> <51A86445.3040703@denx.de> <20130531141902.698623831C2@gemini.denx.de> <15AE5A936F5E3A42A9144E66875A0A893090ED@server1-derijp.CLB-Benelux.lokaal> Message-ID: <51A8C479.6010309@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 Hi Ruud, On 31/05/2013 16:36, Ruud Commandeur wrote: > Dear Wolfgang, Stefano, > > I'm pretty sure I found the cause: > > For each tftp transfer the ethernet part is re-initialised. This means > that also fec_init is called. And in fec_init this piece of code > resides: > > #ifndef CONFIG_PHYLIB > if (fec->xcv_type != SEVENWIRE) > miiphy_restart_aneg(dev); > #endif > Indeed, this is wanted. As design, U-Boot should not touch any interface that is not needed and must close/reset the interface after usage. The main reason is that the kernel is expecting a fresh powered on system, and we get a lot of cases (USB, for instance) when the kernel cannot go on because the bootloader let the controller in an unknown status. > This means (in this case) that miiphy_restart_aneg() is called. And here > the phy gets a software reset and autonegotiation restart command, wich > can take up to 500 msces according to the datasheet. So when we would > like to send out the 1st ARP request, the phy is busy with restart and > negotiation. If I skip these commands, any tftp transfer is fast as > lightning! About 150 msecs between pressing enter and the completion of > a small file (68 bytes). > > Of course, re-initialisation of all parts for each transfer sounds like > the safest solution. We discussed this issue many times, yes. > But perhaps the phy could only be reset / > initialised once after start-up. Would this be an option? I know that there is an exception using netconsole - if the FEC driver stops after each packet, it could not work. But again, letting the controller in a well known status should be a must before booting the kernel. In current code, eth_halt() is called before booting linux only if NETCONSOLE is activated (common/cmd_bootm.c). Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================