[U-Boot] [PATCH 16/27] cpu/: get mac address from environment

Wolfgang Denk wd at denx.de
Mon Feb 16 23:52:55 CET 2009


Dear Mike Frysinger,

In message <1234596190-524-17-git-send-email-vapier at 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.
...
> --- a/cpu/mpc8260/ether_scc.c
> +++ b/cpu/mpc8260/ether_scc.c
> @@ -199,6 +199,7 @@ static int sec_init(struct eth_device *dev, bd_t *bis)
>      volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
>      scc_enet_t *pram_ptr;
>      uint dpaddr;
> +	uchar ea[6];
>  
>      rxIdx = 0;
>      txIdx = 0;
> @@ -261,11 +262,10 @@ static int sec_init(struct eth_device *dev, bd_t *bis)
>      pram_ptr->sen_gaddr3 = 0x0;   /* Group Address Filter 3 (unused) */
>      pram_ptr->sen_gaddr4 = 0x0;   /* Group Address Filter 4 (unused) */
>  
> -#  define ea bis->bi_enetaddr
> +	eth_getenv_enetaddr("ethaddr", ea);
>      pram_ptr->sen_paddrh = (ea[5] << 8) + ea[4];
>      pram_ptr->sen_paddrm = (ea[3] << 8) + ea[2];
>      pram_ptr->sen_paddrl = (ea[1] << 8) + ea[0];
> -#  undef ea

I see that we have bad indentations here, but please either provide a
separate patch to fix the cosing style, or stich with your new code to
the existing one.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's an old proverb that says just about whatever you want it to.


More information about the U-Boot mailing list