[U-Boot] [PATCH] ne2000: take MAC address from config if available

Daniel Mack daniel at caiaq.de
Sun Dec 14 12:39:10 CET 2008


Hi Wolfgang,

On Sun, Dec 14, 2008 at 12:12:24PM +0100, Wolfgang Denk wrote:
> > This adds CONFIG_NE2000_NOPROM. If set, the ethernet MAC address is taken
> > from the environment variable 'ethaddr' and the NIC is configured
> > accordingly. Needed for boards that don't have an EEPROM to store this
> > setting permanently.
> > 
> > Signed-off-by: Daniel Mack <daniel at caiaq.de>
> > 
> > ---
> >  ne2000_base.c |   38 ++++++++++++++++++++++++++++----------
> >   1 file changed, 28 insertions(+), 10 deletions(-)
> 
> Why do we need a special CONFIG_ option? is it not possible to detect
> (by software) that there is no EEPROM available, and auto-adjust?

Hmm, what's bad about a special config variable? I agree that in
general, auto-probing is a good thing, but in U-Boot with its per-board
configuration file concept, I don't see much advantage. It is very
unlikely that a certain board is produced with and without an EEPROM.

> Note that there is existing policy how to handle the  situation  that
> we have both a MAC address stored in some other storeage (like EEPROM
> on  the  NIC)  and  in  the  "ethaddr"  environment variable (see for
> example drivers/net/cs8900.c). In the end, the code shall always only
> rely on the U-Boot environment settings.

I can send a new version of this patch following this, but I wonder
why such a logic has to be implemented in the ethernet drivers and did
not find a well-defined place in some kind of layer all drivers make use
of? Wouldn't it make more sense to put some effort in this direction?

Best regards,
Daniel



More information about the U-Boot mailing list