[U-Boot] [PATCH V3 3/5] mv_egiga: CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION

Prafulla Wadaskar prafulla at marvell.com
Mon Jul 12 07:53:58 CEST 2010


 

> -----Original Message-----
> From: u-boot-bounces at lists.denx.de 
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
> Sent: Sunday, July 11, 2010 1:32 PM
> To: u-boot at lists.denx.de
> Subject: [U-Boot] [PATCH V3 3/5] mv_egiga: 
> CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION
> 
> Add a configuration option to allow SoCs without random
> generation capability to fill in local MACs with a fixed
> rather than random value
> 
> Signed-off-by: Albert Aribaud <albert.aribaud at free.fr>
> ---
>  drivers/net/mv_egiga.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/mv_egiga.c b/drivers/net/mv_egiga.c
> index 4fecf1e..e8315fa 100644
> --- a/drivers/net/mv_egiga.c
> +++ b/drivers/net/mv_egiga.c
> @@ -705,13 +705,21 @@ int mv_egiga_initialize(bd_t * bis)
>  		}
>  
>  		while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
> -			/* Generate Random Private MAC addr if 
> not set */
> +			/* Generate Private MAC addr if not set */
>  			dev->enetaddr[0] = 0x02;
>  			dev->enetaddr[1] = 0x50;
>  			dev->enetaddr[2] = 0x43;
> +#if defined (CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION)
> +			/* Generate fixed lower MAC half using devnum */
> +			dev->enetaddr[3] = 0;
> +			dev->enetaddr[4] = 0;
> +			dev->enetaddr[5] = devnum;
> +#else
> +			/* Generate random lower MAC half */
>  			dev->enetaddr[3] = get_random_hex();
>  			dev->enetaddr[4] = get_random_hex();
>  			dev->enetaddr[5] = get_random_hex();
> +#endif
>  			eth_setenv_enetaddr(s, dev->enetaddr);
>  		}
>  

This is standalone patch,
Pls make this patch independent on the top of current driver version.
Acked otherwise

Regards..
Prafulla . .



More information about the U-Boot mailing list