This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] AM625: How to read SOC_UID on AM6x SoC

Part Number: AM625

Tool/software:

SOC_UID is a device specific identifier calculated by ROM based on "KEK of the device which is unique to every single device, plus other ROM mata-data structure".
- unique per SoC and persistent
- available on HS-FS and HS-SE
- multiple usages: unique binding to enable JTAG unlock on HS-SE;  unique serial number for SoC.

There are several ways to retrieve SOC_UID as listed
https://software-dl.ti.com/tisci/esd/latest/6_topic_user_guides/secure_debug.html#retrieveing-soc-uid
ROM
- Reported by ROM from functional boot flow, i.e. peripheral boot modes like UART, USB-DFU
- JTAG in ROM WIR boot flow
TIFS
- TISCI API

  • The FAQ discusses how to read SOC_UID with the TISCI API <TISCI_MSG_GET_SOC_UID> which is callable by SW entity running on any SoC core, for example, R5, A53...
    https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/security/runtime_debug.html#get-soc-uid
    The FAQ gives an example to read SOC_UID with the TISCI API from OPTEE running on A53, and is portable to other SW entity - u-boot, Linux...

    1. OPTEE patch
    - 0001-add-reading-SOC_UID-in-OPTEE-via-TISCI-API.patch which I created with OTEE 4.0 tag as baseline.
    https://git.ti.com/cgit/optee/ti-optee-os/commit/?h=4.0.0

    2. SOC_UID read log
    - am62_soc_uid_read_tee.log: SOC_UID read from OPTEE
    - am62_soc_uid_dump_uart.log: the parsed SOC_UID dump from UART by ROM as cross reference.

    0001-add-reading-SOC_UID-in-OPTEE-via-TISCI-API.patch

    am62_soc_uid_read_tee.log
    I/TC: OP-TEE version: 4.0.0-dev (gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)) #70 Wed Jul  3 21:17:17 UTC 2024 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.8-v09.02.08 (Kool Koala)')
    I/TC: Secure Board Configuration Software: Rev 1
    I/TC: Secure Boot Keys: Count 2, Rev 1
    I/TC: >>>> SOC_UID READ success!!!
    I/TC: SOC_UID[0] = 0x875148A4
    I/TC: SOC_UID[1] = 0xD549F277
    I/TC: SOC_UID[2] = 0x4F89B244
    I/TC: SOC_UID[3] = 0x22CEB238
    I/TC: SOC_UID[4] = 0xA9164BB2
    I/TC: SOC_UID[5] = 0xCA4BA3CF
    I/TC: SOC_UID[6] = 0x833D0503
    I/TC: SOC_UID[7] = 0x2E9CE156
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot
    

    am62_soc_uid_dump_uart.log
    -----------------------
    SoC ID Header Info:
    -----------------------
    NumBlocks            : [2]
    -----------------------
    SoC ID Public ROM Info:
    -----------------------
    SubBlockId           : 1
    SubBlockSize         : 26
    DeviceName           : am62x
    DeviceType           : HSSE
    DMSC ROM Version     : [0, 1, 0, 1]
    R5 ROM Version       : [0, 1, 0, 1]
    -----------------------
    SoC ID Secure ROM Info:
    -----------------------
    Sec SubBlockId       : 2
    Sec SubBlockSize     : 166
    Sec Prime            : 0
    Sec Key Revision     : 1
    Sec Key Count        : 2
    Sec TI MPK Hash      : d68ecb2c055dff11ade95bd927e837d2a53bc23b0a2800cebce4f106bcf309df2213912d77a157a8b7c2df40672a06a918034aa4c7d603e462481475225d49b8
    Sec Cust MPK Hash    : 1f6002b07cd9b0b7c47d9ca8d1aae57b8e8784a12f636b2b760d7d98a18f189760dfd0f23e2b0cb10ec7edc7c6edac3d9bdfefe0eddc3fff7fe9ad875195527d
    Sec Unique ID        : a448518777f249d544b2894f38b2ce22b24b16a9cfa34bca03053d8356e19c2e