public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 08/12] SPEAr : Support for HW mac id read/write from i2c mem
Date: Mon, 18 Jan 2010 02:08:38 -0500	[thread overview]
Message-ID: <201001180208.39950.vapier@gentoo.org> (raw)
In-Reply-To: <4B53FC8F.2000909@gmail.com>

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 

  parent reply	other threads:[~2010-01-18  7:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-15 13:45 [U-Boot] [PATCH v5 00/12] Support for SPEAr SoCs Vipin KUMAR
2010-01-15 13:45 ` [U-Boot] [PATCH v5 01/12] SPEAr : Adding README.spear in doc Vipin KUMAR
2010-01-15 13:45   ` [U-Boot] [PATCH v5 02/12] SPEAr : Adding basic SPEAr architecture support Vipin KUMAR
2010-01-15 13:45     ` [U-Boot] [PATCH v5 03/12] SPEAr : i2c driver support added for SPEAr SoCs Vipin KUMAR
2010-01-15 13:45       ` [U-Boot] [PATCH v5 04/12] SPEAr : smi driver support " Vipin KUMAR
2010-01-15 13:45         ` [U-Boot] [PATCH v5 05/12] SPEAr : nand " Vipin KUMAR
2010-01-15 13:45           ` [U-Boot] [PATCH v5 06/12] SPEAr : usbd " Vipin KUMAR
2010-01-15 13:45             ` [U-Boot] [PATCH v5 07/12] SPEAr : Support added for SPEAr600 board Vipin KUMAR
2010-01-15 13:45               ` [U-Boot] [PATCH v5 08/12] SPEAr : Support for HW mac id read/write from i2c mem Vipin KUMAR
2010-01-15 13:45                 ` [U-Boot] [PATCH v5 09/12] SPEAr : Support added for SPEAr300 board Vipin KUMAR
2010-01-15 13:45                   ` [U-Boot] [PATCH v5 10/12] SPEAr : emi controller initialization for CFI driver support Vipin KUMAR
2010-01-15 13:45                     ` [U-Boot] [PATCH v5 11/12] SPEAr : Support added for SPEAr310 board Vipin KUMAR
2010-01-15 13:45                       ` [U-Boot] [PATCH v5 12/12] SPEAr : Support added for SPEAr320 board Vipin KUMAR
2010-01-18  6:15                 ` [U-Boot] [PATCH v5 08/12] SPEAr : Support for HW mac id read/write from i2c mem Ben Warren
2010-01-18  7:05                   ` Vipin KUMAR
2010-01-18  7:19                     ` Ben Warren
2010-01-18  7:24                       ` Vipin KUMAR
2010-01-18 12:59                         ` Tom
2010-01-18  7:08                   ` Mike Frysinger [this message]
2010-02-01  5:15                 ` Ben Warren
2010-02-01 13:55                   ` Tom
2010-01-18 18:02           ` [U-Boot] [PATCH v5 05/12] SPEAr : nand driver support for SPEAr SoCs Scott Wood
2010-01-17 20:12 ` [U-Boot] [PATCH v5 00/12] Support " Tom
2010-01-18  4:39   ` Vipin KUMAR
2010-01-18 12:51     ` Tom
2010-01-18 19:19       ` Remy Bohmer
2010-01-19 11:52         ` Armando VISCONTI
2010-01-21 21:30 ` Tom
2010-01-22  3:33   ` Vipin KUMAR

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001180208.39950.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox