[U-Boot] TFTP timeouts, i.mx fec problem?
Stefano Babic
sbabic at denx.de
Fri May 31 17:40:41 CEST 2013
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
=====================================================================
More information about the U-Boot
mailing list