Access OCOTP by M4 on i.mx7d

cancel
Showing results for 
Search instead for 
Did you mean: 

Access OCOTP by M4 on i.mx7d

191 Views
marcuscw_liang
Contributor II

Hi all,

I am trying to get the CPU temperature by using the M4 on i.mx7d, so I need to access the OCOTP_ANA1(0x3035_04F0) to calculate the temperature.


However, I couldn't access the OCOTP_ANA1 value by M4. The reading of any register on OCOTP would cause the whole chip A7&m4 crash and reboot.

I thought it may be the access domain issue at first, so I tried to set the access domain of "rdcPdapOcotpCtrl" on M4 by using the API RDC_SetPdapAccess():

RDC_SetPdapAccess(RDC, rdcPdapOcotpCtrl, BOARD_RDC_PERMISSION_ALL_RW, false, false);
// BOARD_RDC_PERMISSION_ALL_RW is 0xFF

But the issue still remain, any advice?

Labels (1)
Tags (3)
0 Kudos
3 Replies

115 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 昶煒 梁 

are you using optee, if yes one can also check permissions

in imx_csu.c

optee_os/imx_csu.c at master · OP-TEE/optee_os · GitHub 

Use sect.3.2.1 Peripheral access policy

Security Reference Manual for i.MX 7Dual and 7Solo Applications Processors

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

0 Kudos

115 Views
marcuscw_liang
Contributor II

Hi Igor,

    Sorry for the late reply, I took some time to verify your suggestion.

(1) 

    Thanks for your information, I didin't use OPTEE and ARM trustzone function at all.

    Anyway, I still tried to check the CS_CSL register, tried to print it out in the M4. Based on the security reference manual you mentioned in your post, the R/W access permission of OCOTP_CTRL module is controlled by the CSU_CSL10 register. 

   The CSU_CSL10 value I read out in M4 is 0x00FF00FF, which means all R/W are allowed for all users(Non-secure supervisor, Non-secure user, Secure supervisor and Secure user).

    So, I think it may not be the problem of CSU_CSL10 setting.

 (2) 

    Another information, I tried to read the OCOTP register from the A7 in Linux. And it also make the system reset.

    Thanks.

0 Kudos

115 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 昶煒 梁

what bsp used in the case, one can try latest, please check rdc settings in :

soc.c\mx7\mach-imx\arm\arch - uboot-imx - i.MX U-Boot 

Best regards
igor

0 Kudos