Reading and writing OCOTP registers

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading and writing OCOTP registers

5,496 Views
PeterChan
NXP Employee
NXP Employee

Some of you may know that the BSP has a On-Chip OTP Memory driver to facilitate the OCOTP registers access. Here are the steps to enable it.

 

In LTIB, enable this configuration

Device Drivers

---> Character devices

     ---> Freescale On-Chip OTP Memory Support

Or

define “CONFIG_FSL_OTP” in your configuration file.

Compile the new kernel and after boot up, all OCOTP registers will be exposed at the "/sys/fsl_otp" directory. You can run the 'cat' command to read these registers and even echo a new value to these registers. BEWARE that they are One Time Programming only, meaning once written, these values can never be re-written again.

 

Cheers : )

Labels (1)
3 Replies

979 Views
PeterChan
NXP Employee
NXP Employee

The OCOTP write operation hangs because the HCLK frequency is not set correctly. This bug is fixed and the write operation is now working after applying the attached patch.

It is mandatory to input hex value ahead by "0x" when issuing the echo command, i.e. "echo 0xXXXXXXXX > HW_OCOTP_XXXX" because the value is always parsed in hexadecimal.

Please understand that this patch is only limitedly tested. Besides the VDDIO needs to be 2.8V and HCLK must be lower to 24MHz during OCOTP write, it is not desirable when the system has other peripherals which cannot operate at 2.8V or during high bus utilization. So, the IMX_OTP_TOOLS is still the first approach you should consider.

979 Views
StevenBytnar
Contributor I

My Freescale FAE said that CONFIG_FSL_OTP is not verified as functional on the i.MX28.

The stand-alone tools for managing OTP bits are on the MX28 page in “IMX_OTP_TOOLS” under “Programmers (Flash, etc.)". http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX287&nodeId=018rH3ZrDRA24A&fpsp=1&...

0 Kudos

979 Views
StevenBytnar
Contributor I

When I try to execute "echo 0x00000001 > HW_OCOTP_CUST3", it hangs. Writes to any of the CUST0 through CUST3 all hang. Has anyone had success writing to HW_OCOTP_CUST* on an i.MX28 EVK and a custom board we've created? Is there some magic /sys/ flag that has to be tickled to allow writes?

0 Kudos