[U-Boot] [RFC PATCH 2/3] net: fec_mxc: query mac address from environment

Damien Riegel damien.riegel at savoirfairelinux.com
Wed Jun 3 18:08:37 CEST 2015


On Wed, Jun 03, 2015 at 09:05:23AM -0500, Joe Hershberger wrote:
> Hi Damien,
> 
> On Tue, Jun 2, 2015 at 3:22 PM, Damien Riegel
> <damien.riegel at savoirfairelinux.com> wrote:
> > The TS-4800 doesn't have its MAC address fused, therefore the
> > fec_mxc driver can not currently fetch it.
> >
> > This commit adds the capability to fetch the MAC address from
> > environment if not found in fuses.
> >
> > Signed-off-by: Damien Riegel <damien.riegel at savoirfairelinux.com>
> > Cc: Stefano Babic <sbabic at denx.de>
> > Cc: Joe Hershberger <joe.hershberger at ni.com>
> > ---
> >  drivers/net/fec_mxc.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> > index 9225d37..a789ecc 100644
> > --- a/drivers/net/fec_mxc.c
> > +++ b/drivers/net/fec_mxc.c
> > @@ -1040,6 +1040,10 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
> >                 if (!getenv("ethaddr"))
> >                         eth_setenv_enetaddr("ethaddr", ethaddr);
> >         }
> > +       else if (eth_getenv_enetaddr("ethaddr", ethaddr)) {
> > +               debug("got MAC%d address from env: %pM\n", dev_id, ethaddr);
> > +               memcpy(edev->enetaddr, ethaddr, 6);
> > +       }
> 
> This is not the appropriate way to handle this.
> 
> The network stack should already be setting this for you. Line 696 in net/eth.c
> 
> Is this attempting to fix a problem that you've observed?
I did my tests with Buildroot and the U-Boot version I used at that time
required this change. When rebasing and testing on master, I haven't
thought about checking if this patch was still useful. 

But now, indeed, the network stack takes care of that for me, this
patch can be dropped.

-- 
Damien


More information about the U-Boot mailing list