How to read/write OTP fuse register in imx8mp

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

How to read/write OTP fuse register in imx8mp

3,148 Views
shivani__p
Contributor II

Hi,

We want to read and write the OTP fuse register e.g MAC address in iMX8MP.

We saw there for iMX6 and iMX7, there is fsl_otp driver is available by which we can read/write the OTP register through sysfs (/sys/fsl_otp/) interface. But for iMX8, there is no such driver available.

So, how can the otp registers read/write in iMX8MP through sysfs?

 

Thanks,

Shivani

0 Kudos
Reply
3 Replies

3,127 Views
joanxie
NXP TechSupport
NXP TechSupport

you can search you can search OCOTP in the dts file, you can find the detailed information, the simple way is that you can use fuse prog command in uboot to fuse the mac address, for example, fuse prog -y 9 0 xxxxx, for read mac address you can use "fuse read" command , but let me remind, this is one time program,

"https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mp.dtsi?...

ocotp: efuse@30350000 {
				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp", "syscon", "simple-mfd";
				reg = <0x30350000 0x10000>;
				clocks = <&clk IMX8MP_CLK_OCOTP_ROOT>;
				/* For nvmem subnodes */
				#address-cells = <1>;
				#size-cells = <1>;

				imx8mp_uid: unique-id@420 {
					reg = <0x8 0x8>;
				};

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

				eth_mac1: mac-address@90 {
					reg = <0x90 6>;
				};

				eth_mac2: mac-address@650 {
					reg = <0x96 6>;
				};

				imx8mp_soc: imx8mp-soc {
					compatible = "fsl,imx8mp-soc";
					nvmem-cells = <&imx8mp_uid>;
					nvmem-cell-names = "soc_unique_id";
				};
			};

 

 

0 Kudos
Reply

3,110 Views
shivani__p
Contributor II

Hi @joanxie ,

 

Thanks for your response.

Actually we need to write to OTP register at user level. Like e.g. we write for i.MX6 & 7 processor through "echo {value} > /sys/fsl_otp/HW_OCOTP_CFG5".

Is there any way we have for i.MX8 processor?

 

Regards,

Shivani

0 Kudos
Reply