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

Ben Warren biggerbadderben at gmail.com
Thu Sep 17 20:18:33 CEST 2009


Hi Jonathan ,

Jonathan Haws wrote:
> 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.)
>
>   
Instead of modifying net/eth.c, I recommend creating a board_eth_init() 
function. Something like this should do:

int board_eth_init(bd_t *bis)
{
    struct eth_device *dev;
    cpu_eth_init(bis);    /* Initialize both EMACs */
    dev = eth_get_dev_by_index(1);
    dev->init(dev, bis);     /* Initialize EMAC1 */
    return 0;
}

This way you don't have to monkey around with any of the current/prime 
stuff.
Of course, we would never allow this sort of thing to be submitted to 
mainline because you're not allowed to touch hardware that doesn't get 
used, but what you do in your private code is your business.

regards,
Ben


More information about the U-Boot mailing list