[U-Boot] [PATCH v5 08/12] SPEAr : Support for HW mac id read/write from i2c mem
Mike Frysinger
vapier at gentoo.org
Mon Jan 18 08:08:38 CET 2010
On Monday 18 January 2010 01:15:43 Ben Warren wrote:
> Vipin KUMAR wrote:
> > This patch adds the support to read and write mac id from i2c
> > memory.
> > For reading:
> > if (env contains ethaddr)
> > pick env ethaddr
> > else
> > pick ethaddr from i2c memory
> > For writing:
> > chip_config ethaddr XX:XX:XX:XX:XX:XX writes the mac id
> > in i2c memory
> >
> > --- a/board/spear/common/spr_misc.c
> > +++ b/board/spear/common/spr_misc.c
> > @@ -67,6 +67,12 @@ int dram_init(void)
> >
> > int misc_init_r(void)
> > {
> > +#if defined(CONFIG_CMD_NET)
> > + uchar mac_id[6];
> > +
> > + if (!eth_getenv_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id))
> > + eth_setenv_enetaddr("ethaddr", mac_id);
>
> It's really not a good idea to programatically set an environment
> variable like this. Also, there's already a well-defined and documented
> protocol for how MAC addresses should be read and the precedence
> between EEPROM storage and environment storage. Please find a way to
> fit into that model. Since you don't have network support yet, I have
> no idea which network controller you're using, and recommend waiting
> until this is really needed.
he's doing it the way doc/README.enetaddr suggests ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100118/e56d51d9/attachment.pgp
More information about the U-Boot
mailing list