Hey all,

On 16-03-15 09:12, Hans de Goede wrote:
Hi,

On 15-03-15 22:38, Paul Kocialkowski wrote:
As far as I know, there is currently no mechanism in place to give each
device a unique serial number, that would be shown in
e.g. /proc/cpuinfo. This can seem not very useful, but it would be
nice to have that for USB gadget drivers that make use of it (e.g. ADB on
Android, fastboot, etc). This would allow having multiple sunxi devices
connected at the same time.

Normally, the serial number has to be figured out by the bootloader and
passed to the kernel through ATAGs. In U-Boot, it is defined using
get_board_serial, that is not yet implemented on sunxi.

I'm interested in figuring out the best way to do this. As far as I can
see, Allwinner SoCs have some e-fuses, known as SID (Security ID):
http://linux-sunxi.org/SID_Register_Guide for which Oliver has written a
mainline Linux driver. Those should have device-specific values, except
when they are set to 0.

Do you have any better idea to do this, or is there some reference that
I am missing?

AFAIK the only way to do a serial number on sunxi devices is using the SID,
note that Oliver's driver will only work on A10, A13 and A20, with the
A31, A23 and others the SID is burned into the pmic rather then the SoC
I vaguely recall that the A31 had a SID aswell according to its datasheet, I'll go over the datasheets for a23 and a33 to confirm on those, and will look at the a31/a31s/a80's also.
itself, but it should be easy to implement get_board_serial() in u-boot
as we already have a sunxi_get_sid() helper to do that in a SoC
independent way (this is currently used to set the ethernet MAC address).
I'l slowly (in a few weeks time) working on a patch to get the mac from the EEPROM for the olinuxino's, though i think we need to upgrade the i2c driver a bit (multiple adapter support).


Note that sunxi_get_sid() can fail, so you need to error check it,
and currently it will happily return an all 0 SID, you should probably
make it return an error in that case, as that check really belongs
inside sunxi_get_sid().
The big problem with the sunxi-sid, is that it can be often blank :S very annoying. Also, which part of the SID do we want in /proc/cpuinfo? The one is bigger then the other, though looking at http://linux-sunxi.org/SID_Register_Guide there's a lot of non-uniqueness that can be ignored (chip ID (1623 for example).

Olliver

Regards,

Hans

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to