Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
Image Modified

Devicetree


Code Block
themeMidnight
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>;
};

};


...


RegisterReadWriteSize in bytesOffset is
VersionYESNO0x00x4
DNAYESNO0xc0xC
User0YESYES0x40x20
User1YESYES0x40x24
User2YESYES0x40x28
User3YESYES0x40x2c
User4YESYES0x40x30
User5YESYES0x40x34
User6YESYES0x40x38
User7YESYES0x40x3C
Misc userYESYES0x40x40
Secure controlYESYES0x40x58
SPK IDYESYES0x40x5C
AES keyNOYES0x200x60
PPK0 hashYESYES0x300xA0
PPK1 hashYESYES0x300xD0

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
themeMidnight
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


Please refer to below table for values of bs, count , skip for various eFuses:


RegisterSize in bytes(hex)Offset (hex)bs(dec)count(dec)skip(dec)
Version04401
User743C4115
User64384114
User54344113
User44304112
User342C4111
User24284110
User1424419
User0420418
SPK ID45C4123
Secure Control4584122
PPK1 hash30D041252
PPK0 hash30A041240
Misc user4404116
DNACC1211


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. 

...