IMX6 - How to use nvmem driver to read/write the specific OCOTP value

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6 - How to use nvmem driver to read/write the specific OCOTP value

Jump to solution
3,018 Views
petertseng
Contributor IV

Hello,

The fsl-community-bsp branch I am using on Yocto dunfell 3.1 is https://github.com/Freescale/linux-fslc/tree/dc9c8a20afa50de2da8773bbabb71464c4ee9a9d

The new kernel uses NVMEM driver instead of FSL_OTP driver, and we can use hexdump command to read OCOTP value.

$ hexdump /sys/bus/nvmem/devices/imx-ocotp0/nvmem
0000000 0002 2022 96b3 f220 09d4 0b1d 00ee a200
0000010 8706 0040 0000 0000 0000 0010 0000 0000
0000020 00c0 0000 0040 0000 002b 0000 0000 0000
0000030 0000 0000 0000 0000 0b7d 5bf5 0000 0000
0000040 bada bada bada bada bada bada bada bada
*
0000060 dc46 56b7 cc74 aaea 581c 0df4 9d3d 1f37
0000070 c906 01a8 1e2e 9bfe fa31 a44f 8c87 4dd2
0000080 0000 0000 0000 0000 4fe2 5d64 2cf0 0000
0000090 0000 0000 0000 0000 0000 0000 0000 0000
*
0000100 bada bada bada bada bada bada bada bada
*
0000200

How do I know which offset address OCOTP_MAC0, OCOTP_MAC1 and OCOTP_SRK0 ~ OCOTP_SRK7 are in?

 

In addition, how do I write to a specific address? (e.g., OCOTP_MAC0, OCOTP_MAC1)

 

Best regards
Peter Tseng

 

 

0 Kudos
1 Solution
3,014 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos
2 Replies
3,015 Views
igorpadykov
NXP Employee
NXP Employee

Hi Peter

 

for nvmem offset description one can look at

https://www.digi.com/resources/documentation/digidocs/embedded/dey/3.0/cc6/bsp_r_otp_cc6cc6qp

 

Best regards
igor

0 Kudos
2,999 Views
petertseng
Contributor IV

Hello, igor:

Thanks for your reply.

We will look into it.

Best regards
Peter Tseng

0 Kudos