[U-Boot] How to random my mac in u-boot

Peter Pan pppeterpppan at gmail.com
Mon Feb 8 12:30:08 CET 2010


I understand what your mean. But we need to setup the boards' information
including the MAC address through ethernet. With the same MAC address,
only one board can be configured at a time, which is not efficient enough.

Because of the quantity of the boards comparing with the number of workers,
we can not set the MAC address by hand. So what I means is to make the
u-boot generate a temporarily random local-administration MAC and get the
correct information later.

May I know how other set their boards' MAC address. Is there any trick to
do this job.

2010/2/8 Wolfgang Denk <wd at denx.de>:
> Dear Peter Pan,
>
> In message <48abf2c21002072147t7e67ba44i4298b39acc5d7380 at mail.gmail.com> you wrote:
>> Recently, we had a issue that we need to start more than one board at
>> a time. The problem
>> we are facing is that every board is using the same u-boot, which
>> makes them all have the
>> same mac address.
>
> This means that you have a serious configuration problem in ypur
> U-Boot port: the U-Boot binary should never contain any MAN accress at
> all. I recommend to fix this now.
>
>> Firstly, I think I can gives out a random MAC as we need, but I can
>> not find any rand() or srand()
>> function in U-Boot.
>
> Instead of doing random things you should read the FAQ, especially
> here:
>
>
>http://www.denx.de/wiki/view/DULG/WhereCanIGetAValidMACAddress
>> Is there a chance that I can do this random job when U-Boot starts?
>
> You are not supposed to  do  that.  For  testing,  you  can  use  the
> gen_eth_addr  program  in  the  tools/ directory to generate "locally
> administered"  MAC  addresses,  but  these  are  NOT   suitable   for
> productions boards.
>
> 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
> Objects in mirror are closer than they appear.
>


More information about the U-Boot mailing list