Query regarding hab_auth_img and system.itb signing from u-boot in IMX7D

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

Query regarding hab_auth_img and system.itb signing from u-boot in IMX7D

Jump to solution
511 Views
nraghu12003
Contributor II

Hi NXP team,

 

I am trying to authenticate a signed system.itb from u-boot.

Als

I have 2 questions:

1. When I follow the procedure available to sign, I see that:

I get the following error:

 

HAB Configuration: 0xf0, HAB State: 0x66

--------- HAB Event 1 -----------------
event data:
0xdb 0x00 0x08 0x42 0x33 0x05 0x0a 0x00

STS = HAB_FAILURE (0x33)
RSN = HAB_INV_IVT (0x05)
CTX = HAB_CTX_AUTHENTICATE (0x0A)
ENG = HAB_ENG_ANY (0x00)

 

I use the following:

 

hab_auth_img 0x86000000 0x1483730 0x1484000

Where 0x86000000 is the DDR_Address

0x1483730 is the size of the system.itb before signing and

0x1484000 is the IVT_Offset.

 

I see that my second parameter for the size is wrong which leads to the above error.

I also tried 0x14840000 which is the size rounding to the next 0x1000, 0x1486020 which is the total size of the system.itb after signing and 0x1487000 which is the total size rounded to the nearest 0x1000.

Also, because of this issue, the load_addr comes as 0 even though hab_rvt_exit() is HAB_SUCCESS and authentication fails.

Below is my image layout I think:


Image Layout
------------------------------------
U-Boot
+-------------------+ DDR_START
| |
| U-Boot Image | Including the IVT at the beginning
| |
+-------------------+ DDR_START + UBOOT_SIZE
| PADDING |
+-------------------+ align to 0x1000
| CSF Data | \
+-------------------+ +-- CSF + Pad, Size : 0x2000
| PADDING | /
+-------------------+

system.itb

+-------------------+ DDR_START
| |
| boot.img |
| |
+-------------------+ DDR_START + size of system.itb
| PADDING |
+-------------------+ align to 0x1000
| IVT | ---- Size : 0x20
+-------------------+
| CSF Data | \
+-------------------+ +-- CSF + Pad, Size : 0x2000
| PADDING | /
+-------------------+

Please provide your solution to resolve this issue.

 

2. Also, currently when using hab_auth_img, I see that u-boot uses ivt->csf from the code which is not taken from the input parameters but stored prior in u-boot.  How is this value getting populated? Is there any prerequisite before running hab_auth_img to make sure that ivt->csf and other parameters that it is checking from system.itb are populated? Currently I hardcoded ivt->csf to 0x87484000 and did my test. I also commented out csf_is_valid check as it was not succeeding.

 

Please provide the solution for both the above issues.  Currently I am using IMX7D. Thank you.

 

With Regards,

N.Raghu Raman.

0 Kudos
1 Solution
503 Views
nraghu12003
Contributor II

This issue is resolved as the problem was with the hardware. When using a different hardware, the problem is not seen.

View solution in original post

0 Kudos
1 Reply
504 Views
nraghu12003
Contributor II

This issue is resolved as the problem was with the hardware. When using a different hardware, the problem is not seen.

0 Kudos