NXP IMX6DP FUSE DATA VERIFICATION

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

NXP IMX6DP FUSE DATA VERIFICATION

1,580 Views
sezergin
Contributor I

I am working on a project where I need to burn MAC addresses and HAB Keys for secure boot to various IMX6 and IMX8 boards using a python script. Fuse burn process works. I want to automate Fuse data verification. But for unknown reason my manual attempt to verify the fuse using uuu utility below does not work.

Load U-Boot Image over OTG port via of the PCBA with NXP IMX6DP using uuu commands below to verify MAC Address.

uuu SDPS: boot -f u-boot-dtb.imx
uuu FB: ucmd bdinfo
uuu FB: ucmd printenv
uuu FB: ucmd setenv fastboot_buffer 0x12000000
uuu FB: download -f system.itb
uuu FB: ucmd iminfo 0x12000000
uuu FB: ucmd fuse read 4 2


Here is the response I receive which does not include the fuse read back mete data that I can parse :

cp-user@system76-pc:~/Downloads/Images/uuu-flash-provision-2021.02.41-pbc$ uuu FB: acmd fuse read 4 2
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.77-0-g66bf3cc

Success 0 Failure 0


1:34 1/ 1 [ ] FB: acmd fuse read 4 2
Okay



cp-user@system76-pc:~/Downloads/Images/uuu-flash-provision-2021.02.41-pbc$ uuu FB: ucmd fuse read 4 2
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.77-0-g66bf3cc

Success 0 Failure 1


1:34 1/ 1 [ ] FB: ucmd fuse read 4 2

Error:

 

However fuse read command works fine if I interrupt the Linux boot process and execute the command below IN u-boot shell:

=> version
U-Boot 2018.03 (Jun 30 2021 - 21:57:32 +0000)

arm-none-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16)) 10.2.1 20201103
GNU ld (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16)) 2.35.1.20201028
=> fuse read 4 2
Reading bank 4:

Word 0x00000002: b1ff0007


There should be workaround way to do this using uuu utility with one liner U-BOOT script that I am currently searching for, but want to check if anyone has any input? 

Thanks

0 Kudos
3 Replies

1,571 Views
sezergin
Contributor I

There needs to be a way to do this with the approach below but still no luck:
I need to figure out on how to call a function and parse the output and set it to a variable.
Need a one liner that would read the MAC fuses with the command below and set the MAC readback to a environment variable and test it against expected MAC and returns Success or Failure.

 

=> fuse read 4 2 2
Reading bank 4:

Word 0x00000002: b1ff0007 00000021
=> setenv a true
=> setenv b true
=> echo $b
true
=> printenv b
b=true
=> if test "${a}" = "${b}"; then echo "same"; else 
echo Error; fi
same
=> setenv mac_fuse fuse read 4 2 2
=> run mac_fuse
Reading bank 4:

Word 0x00000002: b1ff0007 00000024

The question is how to parse and set the MAC metadata to a variable?

 

 

Any idea on the syntax and format of such one liner u-boot script?

0 Kudos

1,543 Views
sezergin
Contributor I

It seems like U-boot really doesn't support i/O redirection after so many trial.
So, the command we would need to execute from the user space and parse that has all the e-fuse info instead is as follows.
After including the package below into the Linux kernel which should have already been enabled by default:

CONFIG_NVMEM_IMX_OCOTP=y

The following command would give all the fuse information:

# hexdump /sys/bus/platform/drivers/imx_ocotp/21bc000.ocotp/imx-ocotp0/nvmem 
0000000 0003 2023 7b9a d1e0 39d4 1312 007c 0020
0000010 0302 0040 0000 0000 0000 0000 0000 0000
0000020 0080 0000 0040 0000 00da 0000 0000 0000
0000030 0000 0000 0000 8000 6669 5ec5 0000 0000
0000040 bada bada bada bada bada bada bada bada
*
0000060 0000 0000 0000 0000 0000 0000 0000 0000
*
0000080 0000 0000 0000 0000 0007 b1ff 0024 0000
0000090 0000 0000 0000 0000 0000 0000 0000 0000
*
0000100 bada bada bada bada bada bada bada bada
*
0000200

One can also check the mac from the same Linux user space with the command:

# cat /sys/class/net/eth0/address
00:24:b1:ff:00:07

 

0 Kudos

1,522 Views
Juan-Rodarte
NXP Employee
NXP Employee

Thanks for sharing your solution.

0 Kudos