SoC Unique ID (Linux)
Every SoC has a unique ID - sometimes referred to as SoC serial number - written into the chip by the manufacturer during production. The SoC ID is unique and can not be altered. In the currently used SoCs the SoC ID is 64 bit wide.
The SoC unique ID can be used among other things for copy protection of an application binary, creating unique network addresses, tracking individual hardware.
The SoC unique ID - or SoC serial number - is a feature of the silicon vendor as NXP or NVIDIA. It must not be confused with the Toradex Serial Number, which is also a unique number and also accessible from the Linux user space.
How to Read the SoC Unique ID (UID)
SoC unique ID is exposed through the soc bus sysfs interface. It may vary depending on the SoC and the version of your BSP.
List the content of the SoC bus sysfs interface:
# ls /sys/bus/soc/devices/soc0/
Then, depending on the files listed in the previous command, use
cat to read the corresponding UID file. Here are some examples for different SoCs and BSPs to illustrate it:
# cat /sys/bus/soc/devices/soc0/soc_id
# cat /sys/bus/soc/devices/soc0/soc_uid
# cat /sys/bus/soc/devices/soc0/unique_id
# cat /sys/devices/soc0/serial_number