
Hi,
On 26 Mar 2010 at 14:13, w.wegner@astro-kom.de wrote: [...]
When a command like dhcp times out and eth_init tries to switch to the other interface (FEC1) with eth_current->init(), U-Boot locks up. I still have to look further into this what exactly fails.
the lockup itself is caused by mii_discover_phy in mcfmii.c.
Apparently, phytype is detected as 0x0, and then in this loop
for (i = 0; i < (sizeof(phyinfo) / sizeof(phy_info_t)); i++) { if (phyinfo[i].phyid == phytype) { #ifdef ET_DEBUG printf("phyid %x - %s\n", phyinfo[i].phyid, phyinfo[i].strid); #endif strcpy(info->phy_name, phyinfo[i].strid); info->phyname_init = 1; found = 1; break; } }
phytype is matched against the last entry of phyinfo erroneously:
phy_info_t phyinfo[] = { {0x0022561B, "AMD79C784VC"}, /* AMD 79C784VC */ [...] {0, 0} };
However, I did not yet find out why phytype is detected as 0x0...
In any case, what should be the correct termination condition for the above loop? Of course for (i = 0; i < (sizeof(phyinfo) / sizeof(phy_info_t) - 1); i++) would do the trick, but it seems overly complicated to me. Any better ideas?
Wolfgang