public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] AMCC 405EX - EMAC0 + EMAC1 Problems
@ 2009-09-17 18:00 Jonathan Haws
  2009-09-17 18:18 ` Ben Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonathan Haws @ 2009-09-17 18:00 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-18  5:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 18:00 [U-Boot] AMCC 405EX - EMAC0 + EMAC1 Problems Jonathan Haws
2009-09-17 18:18 ` Ben Warren
2009-09-17 20:04 ` Wolfgang Denk
2009-09-18  5:02 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox