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 17/30] lan91c96/smc91111/smc911x: get mac address from environment
Date: Tue, 9 Jun 2009 20:30:48 -0400	[thread overview]
Message-ID: <200906092030.49884.vapier@gentoo.org> (raw)
In-Reply-To: <20090609115311.5E751832E416@gemini.denx.de>

On Tuesday 09 June 2009 07:53:11 Wolfgang Denk wrote:
> Dear Mike,
>
> In message <1234847451-3210-18-git-send-email-vapier@gentoo.org> you wrote:
> > The environment is the canonical storage location of the mac address, so
> > we're killing off the global data location and moving everything to
> > querying the env directly.
> >
> > Also, do not bother checking the EEPROM if the env is setup.  This
> > simplifies the code greatly.
>
> ...
>
> This patch (see also commit 03f3d8d3b39c,
> http://git.denx.de/?p=u-boot.git;a=commit;h=03f3d8d3b39cf85c0ce7ca903b43670
>1e8aa610b) changed behaviour of some network drivers.
>
> As I just learned (sorry, I missed this in the initial review) it
> drops a warning printed by the old code, when there were valid MAC
> addresses stored both in the U-Boot environment ("ethaddr" variable)
>
> and in the controller's EEPROM:
> > -	if (env_present && rom_valid) { /* if both env and ROM are good */
> > -		if (memcmp (v_env_mac, v_rom_mac, 6) != 0) {
> > -			printf ("\nWarning: MAC addresses don't match:\n");
> > -			printf ("\tHW MAC address:  "
> > -				"%02X:%02X:%02X:%02X:%02X:%02X\n",
> > -				v_rom_mac[0], v_rom_mac[1],
> > -				v_rom_mac[2], v_rom_mac[3],
> > -				v_rom_mac[4], v_rom_mac[5] );
> > -			printf ("\t\"ethaddr\" value: "
> > -				"%02X:%02X:%02X:%02X:%02X:%02X\n",
> > -				v_env_mac[0], v_env_mac[1],
> > -				v_env_mac[2], v_env_mac[3],
> > -				v_env_mac[4], v_env_mac[5]) ;
> > -			debug ("### Set MAC addr from environment\n");
> > -		}
> > -	}
>
> This affects other drivers as well (cs8900 for example, in another
> patch).
>
> Can you please explain what your rationale was for removing this code?

i thought the u-boot design was to not touch hardware it shouldnt be.  if the 
canonical location for eth addr is the env, then what is in the attached 
eeproms is irrelevant as it wont be used if the env is available.  it's also 
not specific to either of these drivers, so if we did choose to make this 
behavior optional via some define, it would make more sense to do it in the 
common eth code rather than copying & pasting it everywhere.
-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/20090609/5bce5289/attachment.pgp 

  reply	other threads:[~2009-06-10  0:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  5:10 [U-Boot] [PATCH 00/30] standardize mac address handling in u-boot (v2) Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 01/30] vsprintf: pull updates from Linux kernel Mike Frysinger
2009-02-18 15:18   ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-18 16:40     ` Mike Frysinger
2009-02-18 16:55       ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-18 17:05         ` Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 02/30] convert print_IPaddr() to %pI4 Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 03/30] net: new utility functions for working with enetaddr's Mike Frysinger
2009-02-17 21:53   ` Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 04/30] doc/README.enetaddr: document proper MAC usage Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 05/30] Blackfin: bfin_mac: force boards to setup the MAC themselves Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 06/30] net: get mac address from environment and use eth util funcs Mike Frysinger
2009-02-17 16:21   ` Peter Tyser
2009-02-17 16:54     ` Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 07/30] bdinfo: get mac address from environment Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 08/30] bootvx: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 09/30] lynxkdi: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 10/30] nvedit: do not update global bi_enetaddr and do not call eth_set_enetaddr() Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 11/30] AmigaOneG3SE/enet: get mac address from environment Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 12/30] boards: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 13/30] drivers/net/: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 14/30] bcm570x: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 15/30] cs8900: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 16/30] sh_eth: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 17/30] lan91c96/smc91111/smc911x: " Mike Frysinger
2009-06-09 11:53   ` Wolfgang Denk
2009-06-10  0:30     ` Mike Frysinger [this message]
2009-07-13 21:58       ` Wolfgang Denk
2009-07-16  0:36         ` Mike Frysinger
2009-07-16 17:41           ` Ben Warren
2009-07-16 18:30             ` Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 18/30] cpu/: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 19/30] npe: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 20/30] lib_*/board.c: do not initialize bi_enet*addr in global data Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 21/30] nx823: get mac address from environment Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 22/30] arm: " Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 23/30] boards: move board_get_enetaddr() into board-specific init Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 24/30] cmc_pu2: get mac address from environment Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 25/30] pcs440ep: get mac address from environment and move load_sernum_ethaddr() to board init Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 26/30] kup4k/kup4x: rename load_sernum_ethaddr() to kup_load_sernum_ethaddr() Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 27/30] tqm8xx: rename load_sernum_ethaddr() to tqc_load_sernum_ethaddr() Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 28/30] ppc: mark global bi_enet*addr as legacy Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 29/30] drop now unused load_sernum_ethaddr() function Mike Frysinger
2009-02-17  5:10 ` [U-Boot] [PATCH 30/30] remove bi_enet*addr from global data for all arches Mike Frysinger

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=200906092030.49884.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