[U-Boot] [PATCH 6/8] AM35xx: Read and set ethaddr for EMAC

Wolfgang Denk wd at denx.de
Wed Dec 7 18:41:30 CET 2011


Dear Tom Rini,

In message <4EDF7E34.1070007 at ti.com> you wrote:
>
> > This is a wrong place for this code...
> > You force every board to use the EFUSE'd MAC address - this is wrong.
> > The board must have a freedom to choose what MAC address it wants to use.
> > You don't even check if ethaddr variable is already set...
> > 
> > What you can do is put this implementation into a separate function
> > and let board to make a decision if it wants to call it or use another
> > MAC address.
> > Something like:
> > int am3517_get_efuse_enetaddr(u8 *enetaddr)
> > {
> > 	/* read the address and shift or whatever */
> > 	...
> > 	return is_valid_ether_addr(enetaddr);
> > }
> 
> That's reasonable enough.  I wasn't sure where the custom boards were
> getting their MAC as the EVM and Crane both need this change.

The rule is that the settings in the environment always have
precedence, and you must never overwrite an existing "eth*addr" in
the environment.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"They that can give up essential liberty to obtain a little temporary
saftey deserve neither liberty not saftey." - Benjamin Franklin, 1759


More information about the U-Boot mailing list