[U-Boot] [PATCH 1/3] net: Adds Fast Ethernet Controller driver for Armada100

Marek Vasut marek.vasut at gmail.com
Tue Aug 23 12:33:30 CEST 2011


On Tuesday, August 23, 2011 08:11:57 AM Ajay Bhargav wrote:
> ----- "Marek Vasut" <marek.vasut at gmail.com> wrote:
> > On Monday, August 22, 2011 07:11:57 AM Ajay Bhargav wrote:
> > > This patch adds support for Fast Ethernet Controller driver for
> > > Armada100 series.
> > > 
> > > Signed-off-by: Ajay Bhargav <ajay.bhargav at einfochips.com>
> > > ---
> > > 
> > >  arch/arm/include/asm/arch-armada100/armada100.h |    1 +
> > >  drivers/net/Makefile                            |    1 +
> > >  drivers/net/armada100_fec.c                     |  802
> > > 
> > > +++++++++++++++++++++++ drivers/net/armada100_fec.h
> > > 
> > > 225 +++++++
> > > 
> > >  include/netdev.h                                |    1 +
> > >  5 files changed, 1030 insertions(+), 0 deletions(-)
> > >  create mode 100644 drivers/net/armada100_fec.c
> > >  create mode 100644 drivers/net/armada100_fec.h
> 
> [...]
> 
> > > +static u8 get_random_byte(u8 seed)
> > > +{
> > > +	udelay(seed * 1000);
> > > +	return (u8)(read_timer());
> > 
> > Parens not needed, anyway, don't we have any better "random()" here ?
> 
> I could not find random() function anywhere in the u-boot source.
> 
> [...]
> 
> > > +		/* Generate random lower MAC half */
> > > +		dev->enetaddr[3] = get_random_byte((u8)read_timer());
> > > +		dev->enetaddr[4] = get_random_byte(dev->enetaddr[3]);
> > > +		dev->enetaddr[5] = get_random_byte(dev->enetaddr[4]);
> > > +#endif
> > 
> > Won't uboot handle this ... or aren't there some mechanisms to
> > generate random
> > MAC that can be reused?
> 
> There is a program given in tools directory for generating ethernet mac
> "gen_eth_addr.c" but nothing as such in u-boot source as far as i checked.
> 
> Please let me know if I missed something to check.

Hi,

I think someone NAKed this whole part with MAC randomisation and he was right 
about it ... you're supposed to configure the MAC properly yourself. Cheers
> 
> Thanks & Regards,
> Ajay Bhargav


More information about the U-Boot mailing list