This page gives an overview of the zynqmp_nvmem driver which is available as part of the ZynqMP Linux distribution. Paths, files, links and documentation on this page are given relative to the Linux kernel source tree.
...
HW IP Features
- SoC revision information
- Efuse memory access.
Features supported in driver
- SoC revision information
- Programming and reading efuse memory
Missing Features, Known Issues and Limitations
- None.
Kernel Configuration
Device Drivers ---> NVMEM Support ---> <*> Xilinx ZYNQMP SoC ID suppor
Devicetree
Code Block | ||
---|---|---|
| ||
nvmem_firmware { compatible = "xlnx,zynqmp-nvmem-fw"; #address-cells = <1>; #size-cells = <1>; soc_revision: soc_revision@0 { reg = <0x0 0x4>; }; /* efuse access */ efuse_dna: efuse_dna@c { reg = <0xc 0xc>; }; efuse_usr0: efuse_usr0@20 { reg = <0x20 0x4>; }; efuse_usr1: efuse_usr1@24 { reg = <0x24 0x4>; }; efuse_usr2: efuse_usr2@28 { reg = <0x28 0x4>; }; efuse_usr3: efuse_usr3@2c { reg = <0x2c 0x4>; }; efuse_usr4: efuse_usr4@30 { reg = <0x30 0x4>; }; efuse_usr5: efuse_usr5@34 { reg = <0x34 0x4>; }; efuse_usr6: efuse_usr6@38 { reg = <0x38 0x4>; }; efuse_usr7: efuse_usr7@3c { reg = <0x3c 0x4>; }; efuse_miscusr: efuse_miscusr@40 { reg = <0x40 0x4>; }; efuse_chash: efuse_chash@50 { reg = <0x50 0x4>; }; efuse_pufmisc: efuse_pufmisc@54 { reg = <0x54 0x4>; }; efuse_sec: efuse_sec@58 { reg = <0x58 0x4>; }; efuse_spkid: efuse_spkid@5c { reg = <0x5c 0x4>; }; efuse_ppk0hash: efuse_ppk0hash@a0 { reg = <0xa0 0x30>; }; efuse_ppk1hash: efuse_ppk1hash@d0 { reg = <0xd0 0x30>; }; }; |
...
Register | Read | Write | Size in bytes | Offset is |
---|---|---|---|---|
Version | YES | NO | 0x0 | 0x4 |
DNA | YES | NO | 0xc | 0xC |
User0 | YES | YES | 0x4 | 0x20 |
User1 | YES | YES | 0x4 | 0x24 |
User2 | YES | YES | 0x4 | 0x28 |
User3 | YES | YES | 0x4 | 0x2c |
User4 | YES | YES | 0x4 | 0x30 |
User5 | YES | YES | 0x4 | 0x34 |
User6 | YES | YES | 0x4 | 0x38 |
User7 | YES | YES | 0x4 | 0x3C |
Misc user | YES | YES | 0x4 | 0x40 |
Secure control | YES | YES | 0x4 | 0x58 |
SPK ID | YES | YES | 0x4 | 0x5C |
AES key | NO | YES | 0x20 | 0x60 |
PPK0 hash | YES | YES | 0x30 | 0xA0 |
PPK1 hash | YES | YES | 0x30 | 0xD0 |
Reading/writing unrestricted number of bytes results into an error.
Restricted bits from programming:
Secure Control eFuses :
- RSA_EN (BITS - [25:11])
- DFT_DIS (BIT-6 )
- JTAG_DIS (BIT-5)
- ENC_ONLY (BIT - 2)
Misc User Control eFuses :
- LBIST_EN (BIT - 10)
Expected Output
Code Block | ||
---|---|---|
| ||
For Version reading: offset is 0x0 and bytes are 4 ########## For Silicon 1.0 ############ root@plnx_aarch64:~# dd if=/sys/bus/nvmem/devices/zynqmp-nvmem0/nvmem of=/tmp/version.bin bs=4 count=1 root@plnx_aarch64:~# hexdump -v /tmp/version.bin 0000000 0000 0000001 ########## For Silicon 2.0 ############ root@plnx_aarch64:~# dd if=/sys/bus/nvmem/devices/zynqmp-nvmem0/nvmem of=/tmp/version.bin bs=4 count=1 root@plnx_aarch64:~# hexdump -v /tmp/version.bin 0000000 0001 0000001 ########## For Silicon 3.0 ############ root@plnx_aarch64:~# dd if=/sys/bus/nvmem/devices/zynqmp-nvmem0/nvmem of=/tmp/version.bin bs=4 count=1 root@plnx_aarch64:~# hexdump -v /tmp/version.bin 0000000 0002 0000001 ########## For Silicon 4.0 ############ root@plnx_aarch64:~# dd if=/sys/bus/nvmem/devices/zynqmp-nvmem0/nvmem of=/tmp/version.bin bs=4 count=1 root@plnx_aarch64:~# hexdump -v /tmp/version.bin 0000000 0003 0000001 EFUSE access To read user fuse 7 root@xilinx-zcu102-2018_3:/mnt# dd if=/sys/bus/nvmem/devices/zynqmp-nvmem0/nvmem of=/tmp/userfuse.bin bs=4 count=1 skip=15 1+0 records in 1+0 records out root@xilinx-zcu102-2018_3:/mnt# hexdump -v /tmp/userfuse.bin 0000000 0000 af00 0000004 |
Register | Size in bytes(hex) | Offset (hex) | bs(dec) | count(dec) | skip(dec) |
---|---|---|---|---|---|
Version | 0 | 4 | 4 | 0 | 1 |
User7 | 4 | 3C | 4 | 1 | 15 |
User6 | 4 | 38 | 4 | 1 | 14 |
User5 | 4 | 34 | 4 | 1 | 13 |
User4 | 4 | 30 | 4 | 1 | 12 |
User3 | 4 | 2C | 4 | 1 | 11 |
User2 | 4 | 28 | 4 | 1 | 10 |
User1 | 4 | 24 | 4 | 1 | 9 |
User0 | 4 | 20 | 4 | 1 | 8 |
SPK ID | 4 | 5C | 4 | 1 | 23 |
Secure Control | 4 | 58 | 4 | 1 | 22 |
PPK1 hash | 30 | D0 | 4 | 12 | 52 |
PPK0 hash | 30 | A0 | 4 | 12 | 40 |
Misc user | 4 | 40 | 4 | 1 | 16 |
DNA | C | C | 12 | 1 | 1 |
Known Limitation : dd command can be used to read one word of data only (This means bs =4 and count =1). Therefore dd command cannot be used for reading PPK0/1. Linux application provided in wiki page can be used to read PPK0/1 values .
Using linux application
As an alternative to dd command, a linux application can be used to read/write into eFuse from linux.
...