Dear Support Team,
We have successfully printed HAB log from Preloader.
As we have understood error as below. But we are unable to identify the exact reason for this failure.
It will be helpful if you share some information opinion on this.
HAB Event 1 = 3311cf00 = HAB_INV_CSF
HAB Event 2 = 330ca000 = HAB_INV_ASSERTION
HAB Event 3 = 330ca000 = HAB_INV_ASSERTION
HAB Event 4 = 330ca000 = HAB_INV_ASSERTION
HAB Event 5 = 330ca000 = HAB_INV_ASSERTION
Please find below details
u-boot.bin size = 0x20CB4
objcopy -I binary -O binary --pad-to 0x21000 --gap-fill=0x5A u-boot.bin u-boot-pad.bin
u-boot-pad.bin size = 0x21000
genIVT_uboot
#! /usr/bin/perl -w
use strict;
open(my $out, '>:raw', 'ivt.bin') or die "Unable to open: $!";
print $out pack("V", 0x402000D1); # Signature
print $out pack("V", 0x17800000); # Jump Location
print $out pack("V", 0x0); # Reserved
print $out pack("V", 0x0); # DCD pointer
print $out pack("V", 0x0); # Boot Data
print $out pack("V", 0x17821000); # Self Pointer
print $out pack("V", 0x17821020); # CSF Pointer
print $out pack("V", 0x0); # Reserved
close($out);
u-boot.csf
[Header]
Version = 4.0
Security Configuration = Open
Hash Algorithm = sha256
Engine Configuration = 0
Certificate Format = X509
Signature Format = CMS
[Install SRK]
File = "../crts/SRK_1_2_3_4_table.bin"
Source index = 0
[Install CSFK]
File = "../crts/CSF1_1_sha256_2048_65537_v3_usr_crt.pem"
[Authenticate CSF]
[Unlock]
Engine = CAAM
Features = RNG
[Install Key]
Verification index = 0
Target index = 2
File = "../crts/IMG1_1_sha256_2048_65537_v3_usr_crt.pem"
# Sign padded uImage start at address 0x10800000
# length = 0x3FE0000
# This covers the essential parts: original uImage and the attached IVT
# Blocks have the following definition:
# Image block start address on i.MX, Offset from start of image file,
# Length of block in bytes, image data file
[Authenticate Data]
Verification index = 2
Blocks = 0x17800000 0x0 0x21020 "u-boot-pad-ivt.bin"
Preloader main.c use below for authentication uboot
#define DDR_UBOOT_LOAD 0x17800000
// hab
#define IVT_SIZE 0x20
#define ALIGN_SIZE 0x1000
#define CSF_PAD_SIZE 0x2000
#define UBOOT_SIZE_PAD 0x21000
#define UBOOT_COPY 0x23000
#define UBOOT_IVT_OFFSET UBOOT_SIZE_PAD
#define UBOOT_AUTH_SIZE (UBOOT_SIZE_PAD + IVT_SIZE + CSF_PAD_SIZE)
Then use below function for authentication in main.c (Preloader)
authenticate_image(UBOOT_IVT_OFFSET, DDR_UBOOT_LOAD, UBOOT_AUTH_SIZE);
habApiIf.c
hab_rvt_authenticate_image(1, ivt_offset, (void **)&start,(size_t *)&bytes, NULL);