Imx28 secure boot with custom key

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

Imx28 secure boot with custom key

1,551 Views
pjiangplus
Contributor I

hi all, I am working on a secure boot for imx28.

I got couple of questions:

1) may I know what is the different of elftosb -z -f imx28 -c arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd -o u-boot.sb.new and elftosb -k "./my.key" -f imx28 -c arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd -o u-boot.sb.new. if the my.key is all zero like 00000000000000000000000000000000.

the problem I face is I try to work on a board which is OTP virgin, and if I set the key as key file then it does not boot up, while option -z works (uboot default way).

2) I used bitbunner.exe program to program one CRYPTO0 register as 0x12345678, all other 3 untouched, but I cannot read it out anymore, reading will result in reset, does this expected? if yes, may I know how to read the key I program?

3) same as question 2, if I prepare a key file as 123456780000000000000000000000000, and in step 1, and it cannot boot up. any particular steps required?

my bd file looks like

cat arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd
options
{
flags = 0x4; // 0x8 encrypted + signed, 0x4 encrypted
buildNumber = 0x1;
productVersion = "1.00.00";
componentVersion = "1.00.00";
secureBinaryVersion = "2.0";
}

sources {
u_boot_spl="spl/u-boot-spl.bin";
u_boot="u-boot.bin";
}

section (0) {
load u_boot_spl > 0x1000;
load ivt (entry = 0x1000) > 0x8000;
hab call 0x8000;

load u_boot > 0x40002000;
load ivt (entry = 0x40002000) > 0x8000;
hab call 0x8000;
}

 

thanks a lot

Peng

0 Kudos
Reply
2 Replies

1,452 Views
hector_delgado
NXP TechSupport
NXP TechSupport

Hi @pjiangplus ,

Hope you're doing well!

Have you followed https://www.nxp.com/webapp/Download?colCode=AN4555?

Best regards,
Hector.

0 Kudos
Reply

758 Views
6FArumugam
Contributor I

Hi @hector_delgado 

Tried the link for downloading it ended with "Page not found" error.

 

 

Regards

Arumugam JS

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1822032%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EImx28%20secure%20boot%20with%20custom%20key%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1822032%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehi%20all%2C%20I%20am%20working%20on%20a%20secure%20boot%20for%20imx28.%3C%2FP%3E%3CP%3EI%20got%20couple%20of%20questions%3A%3C%2FP%3E%3CP%3E1)%20may%20I%20know%20what%20is%20the%20different%20of%20%3CFONT%20color%3D%22%23FF0000%22%3Eelftosb%20-z%20-f%20imx28%20-c%20arch%2Farm%2Fcpu%2Farm926ejs%2Fmxs%2Fu-boot-imx28.bd%20-o%20u-boot.sb.new%20%3CFONT%20color%3D%22%23000000%22%3Eand%3C%2FFONT%3E%20elftosb%20-k%20%22.%2Fmy.key%22%20-f%20imx28%20-c%20arch%2Farm%2Fcpu%2Farm926ejs%2Fmxs%2Fu-boot-imx28.bd%20-o%20u-boot.sb.new.%20%3CFONT%20color%3D%22%23000000%22%3Eif%20the%20my.key%20is%20all%20zero%20like%2000000000000000000000000000000000.%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CFONT%20color%3D%22%23000000%22%3Ethe%20problem%20I%20face%20is%20I%20try%20to%20work%20on%20a%20board%20which%20is%20OTP%20virgin%2C%20and%20if%20I%20set%20the%20key%20as%20key%20file%20then%20it%20does%20not%20boot%20up%2C%20while%20option%20-z%20works%20(uboot%20default%20way).%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CFONT%20color%3D%22%23000000%22%3E2)%20I%20used%20bitbunner.exe%20program%20to%20program%20one%20CRYPTO0%20register%20as%200x12345678%2C%20all%20other%203%20untouched%2C%20but%20I%20cannot%20read%20it%20out%20anymore%2C%20reading%20will%20result%20in%20reset%2C%20does%20this%20expected%3F%20if%20yes%2C%20may%20I%20know%20how%20to%20read%20the%20key%20I%20program%3F%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CFONT%20color%3D%22%23000000%22%3E3)%20same%20as%20question%202%2C%20if%20I%20prepare%20a%20key%20file%20as%20123456780000000000000000000000000%2C%20and%20in%20step%201%2C%20and%20it%20cannot%20boot%20up.%20any%20particular%20steps%20required%3F%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3Emy%20bd%20file%20looks%20like%3C%2FP%3E%3CP%3Ecat%20arch%2Farm%2Fcpu%2Farm926ejs%2Fmxs%2Fu-boot-imx28.bd%3CBR%20%2F%3Eoptions%3CBR%20%2F%3E%7B%3CBR%20%2F%3Eflags%20%3D%200x4%3B%20%2F%2F%200x8%20encrypted%20%2B%20signed%2C%200x4%20encrypted%3CBR%20%2F%3EbuildNumber%20%3D%200x1%3B%3CBR%20%2F%3EproductVersion%20%3D%20%221.00.00%22%3B%3CBR%20%2F%3EcomponentVersion%20%3D%20%221.00.00%22%3B%3CBR%20%2F%3EsecureBinaryVersion%20%3D%20%222.0%22%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Esources%20%7B%3CBR%20%2F%3Eu_boot_spl%3D%22spl%2Fu-boot-spl.bin%22%3B%3CBR%20%2F%3Eu_boot%3D%22u-boot.bin%22%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Esection%20(0)%20%7B%3CBR%20%2F%3Eload%20u_boot_spl%20%26gt%3B%200x1000%3B%3CBR%20%2F%3Eload%20ivt%20(entry%20%3D%200x1000)%20%26gt%3B%200x8000%3B%3CBR%20%2F%3Ehab%20call%200x8000%3B%3C%2FP%3E%3CP%3Eload%20u_boot%20%26gt%3B%200x40002000%3B%3CBR%20%2F%3Eload%20ivt%20(entry%20%3D%200x40002000)%20%26gt%3B%200x8000%3B%3CBR%20%2F%3Ehab%20call%200x8000%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3Ethanks%20a%20lot%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3EPeng%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2255716%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Imx28%20secure%20boot%20with%20custom%20key%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2255716%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%2F207913%22%20target%3D%22_blank%22%3E%40hector_delgado%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETried%20the%20link%20for%20downloading%20it%20ended%20with%20%22Page%20not%20found%22%20error.%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3ERegards%3C%2FP%3E%3CP%3EArumugam%20JS%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1836599%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Imx28%20secure%20boot%20with%20custom%20key%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1836599%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%2F230514%22%20target%3D%22_blank%22%3E%40pjiangplus%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EHope%20you're%20doing%20well!%3C%2FP%3E%0A%3CP%3EHave%20you%20followed%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DAN4555%3F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DAN4555%3F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EHector.%3C%2FP%3E%3C%2FLINGO-BODY%3E