Access OCOTP registers in IMX8MQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Access OCOTP registers in IMX8MQ

935 Views
jignesh1
Contributor I

We are going to make product based on IMX8MQ (MIMX8MQ6DVAJZAA) processor.  Currently we are doing POC on IMX8MQ processor EVK.

  • We need unique ID of the board for our use case. As per Technical Reference  Manual we have two registers (0x30350410 and 0x30350420) in OCOTP controller for this purpose.
  • The issue is that we are not able to access it from user space. (using devmem utility).
  • Whenever we try to access these registers board got hang for few seconds and reboot.
  • This issue is same if we try to access any registers of OCOTP controller. (base : 0x30350000)
  • Is there any specific method to access these registers? Are we missing anything?
  • We also find the in kernel there is already driver exist for this purpose (drivers/soc/imx/soc-imx8.c) which provides unique ID via sysfs interface as ( cat /sys/devices/soc0/soc_uid). We see that this driver reads these registers at early stage of kernel booting.
  • We want to access same unique ID in our custom driver to access soc_uid via proc entry due to code modularity with older products(based on IMX6Q). But it is not accessible via custom driver. It shows same behavior as devmem.
  • In IMX6Q we didn't face such issue while accessing OCOTP registers via devmem or custom driver.

Please provide your suggestion if we are missing anything.

Thanks,

Jignesh

Labels (1)
0 Kudos
3 Replies

274 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Jignesh

for registers access one can try to use memtool:

memtool\test - imx-test - i.MX Driver Test Application Software 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

274 Views
jignesh1
Contributor I

Hi Igor,

My question  is I am able to access all the other physical registers using "devmem"  utility without any issue.

But we are not able to access OCOTP controller registers using same utility.

We are also able to access same registers at u-boot level.

Question: why we are not able to access OCOTP controller registers at later stage (after kernel  booting)? Is there any driver or configuration which doesn't allow us to access OCOTP controller registers after booting.  Because at earlier stage driver (drivers/soc/imx/soc-imx8.c) is accessing OCOTP controller registers successfully.

Thanks,

Jignesh

0 Kudos

274 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Jignesh

devmem is not supported by nxp, one can post issues related to devmem on

kernel mail list or check linux forums, like

memory - How to access physical addresses from user space in Linux? - Stack Overflow 

Best regards
igor

0 Kudos