imx91 MAC fuse programming in linux shell

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

imx91 MAC fuse programming in linux shell

3,208 Views
Robbi
Contributor III

Hi Team,

I'm able to burn MAC OTP using fuse prog -y command in u-boot terminal. But I need to run a bash script in Linux shell post booting and during that script execution it will ask for user to enter MAC address in command line interface so I had checked OCOTP, which is not available in /sys/bus/nvmem/devices/ (I had enabled NVMEM configurations and OCOTP node in kernel device tree) but I need some guidance or commands to proceed. 

Tags (1)
0 Kudos
Reply
12 Replies

3,168 Views
joanxie
NXP TechSupport
NXP TechSupport
0 Kudos
Reply

3,166 Views
Robbi
Contributor III

I'm getting access denied please provide me access.

 
 

 

0 Kudos
Reply

3,156 Views
joanxie
NXP TechSupport
NXP TechSupport

I sent mail to you, pls check

0 Kudos
Reply

3,151 Views
Robbi
Contributor III
Thank for support
0 Kudos
Reply

3,113 Views
Robbi
Contributor III

Hi Team,

As MAC OTP is irreversible process, please verify below command which I'm using to perform MAC OTP.
Note: Our custom board has one ethernet port(i.e. eth1)

Write commands in Uboot terminal:

Consider MAC as 0xAABBCCDDEEFF(6Bytes)

fuse prog -y 39 3 0xCCDDEEFF

fuse prog -y 39 4 0x0000AABB

Read commands in Uboot terminal:

fuse read  39 3

fuse read  39 4

I had referred "i.MX91_Fusemap_RM.xlsx" excel sheet attached to reference manual.
And is there any other source like Reference Manual  to confirm the register other than this excel sheet. Waiting for response.

Thank you 

Manikanta Robbi

 

0 Kudos
Reply

2,941 Views
joanxie
NXP TechSupport
NXP TechSupport

the fusemap you refer to is correct, we don't have other fusemap, you can refer to this xlsx files

0 Kudos
Reply

2,853 Views
Robbi
Contributor III

Hi @joanxie 

Thanks for the quick response.

I have reviewed the shared "fuse_read_write_test.c" and associated references. However, enabled OCOTP node in kernel device tree and required configuration and modified register bank address and offset in the code but unable to successfully program the MAC address fuse from Linux using the provided source file. Using the above code, I was able to read but not able to the fuse does not update the MAC value in the NVMEM region. Kindly find the attached image for reference.
  1. Is it possible to perform OTP via linux shell(not using u-boot)
  2. if yes, what are the necessary configurations that need to be done to enable write operation.
  3. Share if any references.

 

 

0 Kudos
Reply

2,514 Views
joanxie
NXP TechSupport
NXP TechSupport

reading and writing via nvmem is what you need, did you apply the patches I sent to you? do you mean you can read the nvmem correctly, but write failed? any error message?

0 Kudos
Reply

2,508 Views
Robbi
Contributor III
yes joanxie, Thanks for the support I'm using older kernel version (6.6.52) earlier and upgraded to (6.12.46) now the commands are executing successfully.
Thanks for the support
0 Kudos
Reply

2,382 Views
joanxie
NXP TechSupport
NXP TechSupport

great, glad to hear this!

0 Kudos
Reply

2,239 Views
Robbi
Contributor III

Hi @joanxie 
I has successfully performed  MAC OTP (00:50:F9:27:72:1B) using below commands in  linux kernel version-6.12.48 

  1. echo -n -e "\x1B\x72\x27\xF9" > /tmp/fuse.bin
  2. dd if=/tmp/fuse.bin of=/sys/bus/nvmem/devices/fsb_s400_fuse1/nvmem bs=4 seek=315 conv=notrunc
  3. echo -n -e "\x50\x00\x00\x00" > /tmp/fuse.bin
  4. dd if=/tmp/fuse.bin of=/sys/bus/nvmem/devices/fsb_s400_fuse1/nvmem bs=4 seek=316 conv=notrunc

    verified with reading register using hexdump and fuse read commands.
    root@imx:~# hexdump -Cv -s 0x4ec -n 6 /sys/bus/nvmem/devices/fsb_s400_fuse1/nvmem
    000004ec 1b 72 27 f9 50 00 |.r'.P.|
    000004f2

    But I'm not getting fused MAC address while I'm using "ifconfig" command, it is displaying random MAC address.(During boot time also). Please find the attached ZIP file contains  ETH kernel device tree node and all relevant images. Guide me to resolve this issue, if I miss enabling any configurations or did I fused correctly registers(Based on Bank and word).
0 Kudos
Reply

1,937 Views
joanxie
NXP TechSupport
NXP TechSupport

sorry there are some issues with community, I missed your message before, do you mind sharing your fuse command result by fuse prog and nvmem dump result? 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2326434%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Eimx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326434%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Team%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EI'm%20able%20to%20burn%20MAC%20OTP%20using%20fuse%20prog%20-y%20command%20in%20u-boot%20terminal.%20But%20I%20need%20to%20run%20a%20bash%20script%20in%20Linux%20shell%20post%20booting%20and%20during%20that%20script%20execution%20it%20will%20ask%20for%20user%20to%20enter%20MAC%20address%20in%20command%20line%20interface%20so%20I%20had%20checked%20OCOTP%2C%20which%20is%20not%20available%20in%20%2Fsys%2Fbus%2Fnvmem%2Fdevices%2F%20(I%20had%20enabled%20NVMEM%20configurations%20and%20OCOTP%20node%20in%20kernel%20device%20tree)%20but%20I%20need%20some%20guidance%20or%20commands%20to%20proceed.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20sent%20mail%20to%20you%2C%20pls%20check%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326763%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326763%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20getting%20access%20denied%20please%20provide%20me%20access.%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326760%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326760%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eyou%20can%20refer%20to%20this%20link%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FSecurity-Blog-NXP-Internal%2FHow-to-fuse-key-through-nvmem-on-i-MX93%2Fta-p%2F165727%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FSecurity-Blog-NXP-Internal%2FHow-to-fuse-key-through-nvmem-on-i-MX93%2Fta-p%2F165727%3C%2FA%3E8%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326939%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326939%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThank%20for%20support%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2327505%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2327505%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Team%2C%3C%2FP%3E%3CP%3EAs%20MAC%20OTP%20is%20irreversible%20process%2C%20please%20verify%20below%20command%20which%20I'm%20using%20to%20perform%20MAC%20OTP.%3CBR%20%2F%3ENote%3A%20Our%20custom%20board%20has%20one%20ethernet%20port(i.e.%20eth1)%3C%2FP%3E%3CP%3EWrite%20commands%20in%20Uboot%20terminal%3A%3C%2FP%3E%3CP%3EConsider%20MAC%20as%200xAABBCCDDEEFF(6Bytes)%3C%2FP%3E%3CP%3E%3CSTRONG%3Efuse%20prog%20-y%2039%203%200xCCDDEEFF%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3Efuse%20prog%20-y%2039%204%200x0000AABB%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ERead%20commands%20in%20Uboot%20terminal%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3Efuse%20read%26nbsp%3B%2039%203%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3Efuse%20read%26nbsp%3B%2039%204%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20had%20referred%20%22i.MX91_Fusemap_RM.xlsx%22%20excel%20sheet%20attached%20to%20reference%20manual.%3CBR%20%2F%3EAnd%20is%20there%20any%20other%20source%20like%20Reference%20Manual%26nbsp%3B%20to%20confirm%20the%20register%20other%20than%20this%20excel%20sheet.%20Waiting%20for%20response.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EThank%20you%26nbsp%3B%3C%2FP%3E%3CP%3EManikanta%20Robbi%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2328362%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2328362%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ethe%20fusemap%20you%20refer%20to%20is%20correct%2C%20we%20don't%20have%20other%20fusemap%2C%20you%20can%20refer%20to%20this%20xlsx%20files%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2328862%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2328862%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39586%22%20target%3D%22_blank%22%3E%40joanxie%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20quick%20response.%3C%2FP%3E%3CDIV%20class%3D%22%22%3EI%20have%20reviewed%20the%20shared%20%22fuse_read_write_test.c%22%26nbsp%3Band%20associated%20references.%20However%2C%20enabled%20OCOTP%20node%20in%20kernel%20device%20tree%20and%20required%20configuration%20and%20modified%20register%20bank%20address%20and%20offset%20in%20the%20code%20but%20unable%20to%20successfully%20program%20the%20MAC%20address%20fuse%20from%20Linux%20using%20the%20provided%20source%20file.%20Using%20the%20above%20code%2C%20I%20was%20able%20to%20read%20but%20not%20able%20to%20the%20fuse%20does%20not%20update%20the%20MAC%20value%20in%20the%20NVMEM%20region.%20Kindly%20find%20the%20attached%20image%20for%20reference.%3C%2FDIV%3E%3COL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EIs%20it%20possible%20to%20perform%20OTP%20via%20linux%20shell(not%20using%20u-boot)%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3Eif%20yes%2C%20what%20are%20the%20necessary%20configurations%20that%20need%20to%20be%20done%20to%20enable%20write%20operation.%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EShare%20if%20any%20references.%3C%2FDIV%3E%3C%2FLI%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2332551%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2332551%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ereading%20and%20writing%20via%20nvmem%20is%20what%20you%20need%2C%20did%20you%20apply%20the%20patches%20I%20sent%20to%20you%3F%20do%20you%20mean%20you%20can%20read%20the%20nvmem%20correctly%2C%20but%20write%20failed%3F%20any%20error%20message%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2332558%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2332558%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Eyes%20joanxie%2C%20Thanks%20for%20the%20support%20I'm%20using%20older%20kernel%20version%20(6.6.52)%20earlier%20and%20upgraded%20to%20(6.12.46)%20now%20the%20commands%20are%20executing%20successfully.%3CBR%20%2F%3EThanks%20for%20the%20support%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2332909%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2332909%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Egreat%2C%20glad%20to%20hear%20this!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2333135%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2333135%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39586%22%20target%3D%22_blank%22%3E%40joanxie%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EI%20has%20successfully%20performed%26nbsp%3B%20MAC%20OTP%20(%3CSTRONG%3E00%3A50%3AF9%3A27%3A72%3A1B%3C%2FSTRONG%3E)%20using%20below%20commands%20in%26nbsp%3B%20linux%20kernel%20version-6.12.48%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3Eecho%20-n%20-e%20%22%5Cx1B%5Cx72%5Cx27%5CxF9%22%20%26gt%3B%20%2Ftmp%2Ffuse.bin%3C%2FLI%3E%3CLI%3Edd%20if%3D%2Ftmp%2Ffuse.bin%20of%3D%2Fsys%2Fbus%2Fnvmem%2Fdevices%2Ffsb_s400_fuse1%2Fnvmem%20bs%3D4%20seek%3D315%20conv%3Dnotrunc%3C%2FLI%3E%3CLI%3Eecho%20-n%20-e%20%22%5Cx50%5Cx00%5Cx00%5Cx00%22%20%26gt%3B%20%2Ftmp%2Ffuse.bin%3C%2FLI%3E%3CLI%3Edd%20if%3D%2Ftmp%2Ffuse.bin%20of%3D%2Fsys%2Fbus%2Fnvmem%2Fdevices%2Ffsb_s400_fuse1%2Fnvmem%20bs%3D4%20seek%3D316%20conv%3Dnotrunc%3CBR%20%2F%3E%3CBR%20%2F%3Everified%20with%20reading%20register%20using%20hexdump%20and%20fuse%20read%20commands.%3CBR%20%2F%3Eroot%40imx%3A~%23%20hexdump%20-Cv%20-s%200x4ec%20-n%206%20%2Fsys%2Fbus%2Fnvmem%2Fdevices%2Ffsb_s400_fuse1%2Fnvmem%3CBR%20%2F%3E000004ec%201b%2072%2027%20f9%2050%2000%20%7C.r'.P.%7C%3CBR%20%2F%3E000004f2%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20I'm%20not%20getting%20fused%20MAC%20address%20while%20I'm%20using%20%22%3CSTRONG%3Eifconfig%3C%2FSTRONG%3E%22%20command%2C%20it%20is%20displaying%20random%20MAC%20address.(During%20boot%20time%20also).%20Please%20find%20the%20attached%20ZIP%20file%20contains%26nbsp%3B%20ETH%20kernel%20device%20tree%20node%20and%20all%20relevant%20images.%20Guide%20me%20to%20resolve%20this%20issue%2C%20if%20I%20miss%20enabling%20any%20configurations%20or%20did%20I%20fused%20correctly%20registers(Based%20on%20Bank%20and%20word).%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2335217%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20imx91%20MAC%20fuse%20programming%20in%20linux%20shell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2335217%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Esorry%20there%20are%20some%20issues%20with%20community%2C%20I%20missed%20your%20message%20before%2C%20do%20you%20mind%20sharing%20your%20fuse%20command%20result%20by%20fuse%20prog%20and%20nvmem%20dump%20result%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E