Cannot read IMX7D fuses using the NVMEM and imx_ocotp drivers.

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot read IMX7D fuses using the NVMEM and imx_ocotp drivers.

138 Views
Contributor I

we have an existing product based on the IMX7D architecture which we are updating from linux V4.14 to V5..4.40.

On the V4.14 build the product used the fsl_otp driver to read and write the fuses. As this is no longer supported, we are moving to use the NVMEM driver and imx_otp driver.Screenshot from 2020-10-14 11-39-21.png

Checking the device tree include files, there is the following ocotp entry in imx7s.dtsi

Screenshot from 2020-10-14 11-47-49.png

Following the solution posted by NXP here https://community.nxp.com/t5/i-MX-Processors/OCOTP-write-support-on-i-mx8m/m-p/825028 (Note: I have checked that the contents of the patch provided in the answer is present in the driver version I am using).

I should now be able to read the content of the nvmem file using hexdump. However I cant.

I have two devices appearing in the /sys/bus/devices/ directory. one is a real time clock included in our top level device tree, the other is the imx_ocotp node.

Capture.PNG

I can read the content of the ds1307 device

Capture3.PNG

However I cant read the nvmem of the ocotp device.

Capture2.PNG

Because we can read the other device I think it is safe to assume that the NVMEM functionality is working. Which leads me to suspect that the imx_ocotp driver is not working?

I've tried using different versions of the driver and different entries in the device tree files to no avail. Am I missing any steps here or is the driver not working on this build of linux?

 

0 Kudos
5 Replies

109 Views
NXP TechSupport
NXP TechSupport

Hello,

Unfortunately I don't have an i.MX7D board to test, but I tested this in an i.MX6UL with pre-built image L5.4.47 and it is working correctly, could you try with 5.4.47 version?

Also, could you share the changes you have made to the dts?
 

Regards,
Aldo.

0 Kudos

83 Views
Contributor I

Hi there,

Thanks for your response. I have rebuilt my image with linux kernel 5.4.47 and retried reading the imx-ocotp NVMEM file. I get the same behaviour.

Note: whilst we are using a  custom top level device tree ( based on the imx7-sabre device tree), there are no entries related to the ocotp. We are relying on the device tree include files to configure the ocotp. Our top level device tree includes the imx7d.dtsi which subsequently includes the imx7s.dtsi. These include files are in the linux source files.

i.e. linux-5.4.47/arch/arm/boot/dts/imx7s.dtsi  (I've attached a screenshot showing how this file configures the ocotp peripheral)

I have also tried to get this working on the imx7d sabre board using buildroot's imx7d sabre board default config. This config uses an old version of the freescale linux repository (rel_imx_4.9.x_1.0.0_ga) which doesnt support the imx_ocotp driver. I then manually added this driver to no avail.

Is there a build for the imx7d sabre board where this is working?. I'm consious that the imx6ulp is a not a very good comparison to make, as it is a different chipset.

Kind regards

 

 

 

 

 

 

 

 

0 Kudos

77 Views
NXP TechSupport
NXP TechSupport

Hello,

Could you try with demo image for imx7d sabre board and try again the NVMEM driver?
you may download it from here:
https://www.nxp.com/webapp/Download?colCode=L5.4.47_2.2.0_MX7D&appType=license

Also, could you try reading the fuses from uboot?

fuse read <bank> <word>

Thank you,
Regards,
Aldo.

0 Kudos

69 Views
Contributor I

Hi there,

Thanks again for your response. I booted the imx7d-sdb.dtb and zImage files given (on the imx7d-sabre board) and using this I could successfully read the nvmem.

temp.png

Could you tell me how I could get the source files for this build? I would like to compare the device trees and kernel options to my environment.

Kind regards

Rob

0 Kudos

48 Views
NXP TechSupport
NXP TechSupport

Hello,

You may clone from the following repository which contains all the NXP releases.

https://source.codeaurora.org/external/imx/linux-imx

Regards,
Aldo.

0 Kudos