IMX6UL: /sys/fsl_otp/HW_OCOTP_LOCK is not found in 5.4 kernel

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

IMX6UL: /sys/fsl_otp/HW_OCOTP_LOCK is not found in 5.4 kernel

4,688 Views
sikumar3
Contributor III

Hi,

I am migrating from 4.1.x (Jethro) kernel to 5.4 (Zeus) and noticed that CONFIG_FSL_OTP has been removed.

Is there any way to read these OCOTP registers to find out whether it is fused or not?

Labels (1)
Tags (1)
5 Replies

4,625 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

 

Unfortunately OTP driver is not supported anymore, it was moved to NVMEM framework.

imx-ocotp.c\nvmem\drivers - linux-imx - i.MX Linux kernel 

 

Hope this helps,

Best regards,

Aldo.

0 Kudos

4,454 Views
emptyfridge
Contributor III

Hi all,

I was working with i.MX6 and kernel 4.9. There we implemented during the flashing process for new u-boot and kernel we write the public key into OTP_SRK*. So next time the device boots it is secured.

Now I want to do the same for i.MX8MM kernel 5.4... But what I have to read here is really disappointing...

Is that still the case? No change to reactivate the FSL driver? An easy way to program eFuses from the userspace.

Now I have to do it in the u-boot. In my case, it means the device needs at least 2 reboots to be in the secure mode. makes no sense to me ...

It just not the same security level...

Dear NXP,

Please give us back the FSL driver?!

Or at least a patch or a workaround that it is possible to use it again. 

Any chance for this?

0 Kudos

4,625 Views
sikumar3
Contributor III

Hi Aldo,

Thanks for the information!

I am able to read the OCOTP registers through the nvmem interface.

$ hexdump ./sys/bus/platform/drivers/imx_ocotp/21bc000.oco

l/imx-ocotp0/nvmem

0000000 c04f 0032 6f41 ea9b 81d4 4732 0000 7032

0000010 0002 0241 0000 0000 004a 0018 0000 0000

0000020 0080 0000 0000 0000 00ba 0000 0000 0000

0000030 0000 0000 0000 0000 0069 5845 0000 0000

0000040 bada bada bada bada bada bada bada bada

*

0000060 687c 4869 8c6d da7e e74a 08f5 782f 0319

0000070 2e6d bab3 c759 050f 6f6c 2fd2 911f 4b7a

0000080 bada bada bada bada 0000 0000 0000 0000

0000090 0000 0000 bada bada 0000 0000 0000 0000

00000a0 0000 0000 0000 0000 0000 0000 0000 0000

00000b0 0000 0000 0040 0000 0000 0000 0000 0000

00000c0 0000 0000 0000 0000 0000 0000 0000 0000

*

0000200

$

4,058 Views
GeoffBenn
Contributor I

@sikumar3,

Glad to see you have it working.

Just wondering if you could share the corresponding part of the Device Tree which allows reading of the i.MXD7 NVRAM MAC address?

Regards,

Geoff

0 Kudos

4,054 Views
sikumar3
Contributor III

Hi Geoff,

 

I didn't make any additional changes to get it working as the nvmem entry was provided by the parent device tree file imx6ul.dtsi

 

ocotp: ocotp-ctrl@21bc000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,imx6ul-ocotp", "syscon";
reg = <0x021bc000 0x4000>;
clocks = <&clks IMX6UL_CLK_OCOTP>;

tempmon_calib: calib@38 {
reg = <0x38 4>;
};

tempmon_temp_grade: temp-grade@20 {
reg = <0x20 4>;
};

cpu_speed_grade: speed-grade@10 {
reg = <0x10 4>;
};
};