AnsweredAssumed Answered

i.mx6 burning OCOTP_OTPMK[0-7]

Question asked by ZC Tee on Dec 27, 2015
Latest reply on Dec 30, 2015 by ZC Tee

Dear all,

I am trying to write a bash script to burn the OCOTP_OTPMK[0-7] registers.

However, i find out that I am only able to write one OTPMK at a time. Writing the 2nd OTPMK will result in endless loop in the ssh window. Machine is still operateable at this time. After i reboot, i can then write the 2nd OTPMK register.

I need to reboot everytime on writing one OTPMK register. Is it the norm behaviour? If not, may i know is there anything wrong with my procedure?

Below is my script on writing the SRK and OTPMK register

 

#!/bin/bash

echo "YOU ARE GOING TO BURN THE E-FUSE!"

echo -n "THIS ACTION IS NOT REVERSIBLE! PLEASE CONFIRM [y/n]:"

read confirm

 

if [ "$confirm" = "y" ]; then

  echo Burning SRK...

  cd /sys/fsl_otp

  echo 0xxxxxxxxx > HW_OCOTP_SRK0

  echo 0xxxxxxxxx > HW_OCOTP_SRK1

  echo 0xxxxxxxxx > HW_OCOTP_SRK2

  echo 0xxxxxxxxx > HW_OCOTP_SRK3

  echo 0xxxxxxxxx > HW_OCOTP_SRK4

  echo 0xxxxxxxxx > HW_OCOTP_SRK5

  echo 0xxxxxxxxx > HW_OCOTP_SRK6

  echo 0xxxxxxxxx > HW_OCOTP_SRK7

 

  echo Burning OTP Fuse 1...

  echo 0x975b69a7 > HW_OCOTP_OTPMK0

  sleep 1

  echo Burning OTP fuse 2...

  echo 0xafae0b5d > HW_OCOTP_OTPMK1

  sleep 1

  echo Burning OTP fuse 3...

  echo 0x6f780499 > HW_OCOTP_OTPMK2

  sleep 1

  echo Burning OTP fuse 4...

  echo 0x3dda7a47 > HW_OCOTP_OTPMK3

  sleep 1

  echo Burning OTP fuse 5...

  echo 0x76fcba3c > HW_OCOTP_OTPMK4

  sleep 1

  echo Burning OTP fuse 6

  echo 0x6d5c9ef6 > HW_OCOTP_OTPMK5

  sleep 1

  echo Burning OTP fuse 7...

  echo 0xb166b40a > HW_OCOTP_OTPMK6

  sleep 1

  echo Burning OTP fuse 8...

  echo 0x8f449c5d > HW_OCOTP_OTPMK7

  sleep 1

 

  echo Enabling HAB...

  echo 0x00040000 > HW_OCOTP_MEM0

  echo 0x02 > HW_OCOTP_CFG5

  echo -n "Done. Press [enter] to reboot"

  read systemReboot

  echo system reboot

  reboot

else

  echo Aborted.

fi

 

Thank you.

 

Regards,

Tee

Outcomes