public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] AMCC 405EX - EMAC0 + EMAC1 Problems
Date: Thu, 17 Sep 2009 11:18:33 -0700	[thread overview]
Message-ID: <4AB27D79.6030004@gmail.com> (raw)
In-Reply-To: <BB99A6BA28709744BF22A68E6D7EB51F0324BBB96D@midas.usurf.usu.edu>

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

  reply	other threads:[~2009-09-17 18:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 18:00 [U-Boot] AMCC 405EX - EMAC0 + EMAC1 Problems Jonathan Haws
2009-09-17 18:18 ` Ben Warren [this message]
2009-09-17 20:04 ` Wolfgang Denk
2009-09-18  5:02 ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AB27D79.6030004@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox