How to retrieve cpu info from u-boot fucntion?

Peter Robinson pbrobinson at gmail.com
Thu Aug 29 10:05:19 CEST 2024


Hi Sourabh,

> Thanks for the update. Looking at the board/raspberrypi/rpi/rpi.c I think MAC address is only returned for models that have onboard ethernet. but for models raspberry pi 0w / pi 02w it might not return any value.
> Am I correct? (maybe I overlooked it?) Is there any other approach for this?

TBH I have no idea, in a lot of cases the MACs are written to SoCs
long before they end up in a final product so they may well be there.

I have not tried, I was merely pointing out to you possible solutions
for you to try. I don't have the original pi0 but I also gave you
other possible ways to solve you're problem :)

> Thanks in advance
>
> On Wed, Aug 28, 2024 at 5:31 PM Peter Robinson <pbrobinson at gmail.com> wrote:
>>
>> Hi,
>>
>> I appear to have missed the first post.
>>
>> > Is there any update on the below request? Are there any functions similar
>> > to eth_get_ethaddr() to retrieve device-specific info? I am working with
>> > raspberry pi 0 and there is no network interface card.
>> > So, eth_get_ethaddr() returns null
>>
>> So there's a bunch of drivers for OTP/eFuses in drivers/misc/* which
>> provide access to those sort of unique options such as CPU serial
>> numbers, and possibly stored MACs etc.
>>
>> I know the RPi has a OTP/eFUSE HW IP block, I don't believe U-Boot has
>> a driver for that as yet.
>> The main RPi firmware may have an mbox/API for querying those sorts of
>> things, looking at board/raspberrypi/rpi/rpi.c there's a
>> set_usbethaddr which calls a msg_get_mac_address to request a MAC from
>> the RPi firmware, I suspect that may work for your needs.
>>
>> Peter
>>
>> > Thanks in advance
>> >
>> > On Wed, Jun 19, 2024 at 9:11 AM Sourabh Hegde Ramu <hrsourabh1107 at gmail.com>
>> > wrote:
>> >
>> > > Hello,
>> > >
>> > > Currently, I am using the MAC address from eth_get_ethaddr() function to
>> > > calculate a hash value. But, I would like to replace this with a more
>> > > unique device info such as cpuid or other values. But I could not find any
>> > > function that can retrieve cpu info.
>> > >
>> > > Can anyone please point me in the correct direction? Do we have any
>> > > functions for this? Are these things part of the documentation?
>> > >
>> > > Thanks in advance.
>> > >
>> > > Kind regards,
>> > > Sourabh
>> > >


More information about the U-Boot mailing list