[U-Boot] AMCC 405EX - EMAC0 + EMAC1 Problems

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Thu Sep 17 20:00:42 CEST 2009


All,

I am having issues getting EMAC1 working alongside EMAC0.  We need 
both EMACs running at the same time in U-Boot (U-Boot handles the PHY 
configuration, since the VxWorks implementation of PHY initialization 
is buggy).

What I have done is this:

In net/eth.c I have modified the eth_init(bd_t *bis) function to 
simply initialize both EMACs (line 443).  We use EMAC0 by default, so 
I set eth_current back to EMAC0 when I am finished and return 0 on 
success.  Here is what the function looks like right now:  (I know I 
can clean this up better, but I am looking for a first cut solution 
that works.  When I have it working, I will clean up the code.)

int eth_init(bd_t *bis)
{
	struct eth_device* old_current;

	if (!eth_current) {
		puts ("No ethernet found.\n");
		return -1;
	}

	old_current = eth_current;
	do {
		debug ("Trying %s\n", eth_current->name);

		if (eth_current->init(eth_current,bis) < 0) {
			debug  ("FAIL\n");
			eth_try_another(0);
			return -1;
		}
		eth_current->state = ETH_STATE_ACTIVE;
		eth_try_another(0);

		debug ("Trying %s\n", eth_current->name);
		if (eth_current->init(eth_current,bis) < 0) {
			debug  ("FAIL\n");
			eth_try_another(0);
			return -1;
		}
		eth_current->state = ETH_STATE_ACTIVE;

		eth_current = old_current;
		return 0;
	} while (old_current != eth_current);

	return -1;
}

What happens is this, when I boot via TFTP, both EMACs and PHYs get
initialized, but the system hangs as soon as it starts the protocol's 
request (ping, tftp, etc.).

It seems that I am missing something somewhere - I am overwriting some
configuration that I should not be or something of that sort.  But 
shouldn't the EMAC data structure be separated to the point where I 
should be able to initialize them individually without causing 
problems?

Thanks for any insight!

Jonathan




More information about the U-Boot mailing list