[U-Boot] [PATCH] mvgbe: remove setting of ethaddr within the driver

Michael Walle
2011-11-08T22:45:12Z

Am Dienstag 08 November 2011, 21:49:49 schrieb Mike Frysinger:
> On Tuesday 08 November 2011 12:34:17 Michael Walle wrote:
> > Am Di, 8.11.2011, 16:17 schrieb Wolfgang Denk:
> > > Michael Walle wrote:
> > >> >> +#define CONFIG_ETH_ADDR 02:50:43:00:00:01
> > >> >
> > >> > NAK to this. board configs are not allow to hardcode MACs.
> > >>
> > >> mh, so why is there a CONFIG_ETH_ADDR macro? is it deprecated?
> > >> README.enetaddr explicitly refers to that config option.
> > >
> > > There are situations where it cannot be helped, like when programming
> > > the U-Boot image into a ROM (yes, a real ROM that cannot be changed
> > > any more by software alone).
> > >
> > > But in almost all normal situations this must not be used. In any
> > > case, we will not accept it into mainline.
> >
> > I have a Buffalo Linkstation Pro LS-XHL for which i plan to submit a BSP.
> > On this board, the MAC address is saved within the environment, which is
> > in turn stored in flash. Additionally this board does not have a serial
> > port, thus the only available console is the network console.
> >
> > If someone will mess up the environment, it is possible to clear it by
> > holding a button upon powerup. Atm i have the CONFIG_ETH_ADDR set to a
> > default MAC address to be able to use the network console with the
> > default environment. To restore the original MAC address, a user have to
> > manually replace ethaddr with the one printed on the case.
> >
> > But now, if i can't use the CONFIG_ETH_ADDR, i think i'm stuck :) Or do i
> > miss something? (Yeah there may be the MAC randomization, if accepted).
>
> the "default" MAC address would collide with other Buffalo stations which
> have the "default" MAC address
yeah of course, but it is only a recovery mechanism. i would be happy with a
generated mac address, too.

> by default, ethaddr is not writable, so people can't simply "set ethaddr
> xxx" to screw it up.
well a user could screw it up in many other ways too ;)

there are plenty of boards which has CONFIG_ETHADDR and
CONFIG_OVERWRITE_ETHADDR_ONCE set. This should exactly be the configuration i
need, too.

btw only ethaddr is protected and not ethNaddr, which is a bug imho ;)

--
Michael