Hi Druvit,
thanks for reply,
Let me explain , how i am calculating and using the kernel image.
> hexdump -C vmlinuz-5.10.158-cip22+mel2 | tail -n 1
0x00932348
above is the size of my kernel and i have padded to this image(0x1000) and make it
hexdump -C vmlinuz-pad.bin | tail -n 1
0x00933348
below is my genIVT.pl
#! /usr/bin/perl -w
use strict;
open(my $out, '>:raw', 'ivt.bin') or die "Unable to open: $!";
print $out pack("V", 0x412000D1); # Signature
print $out pack("V", 0x12000000); # Load Address (*load_address)
print $out pack("V", 0x0); # Reserved
print $out pack("V", 0x0); # DCD pointer
print $out pack("V", 0x0); # Boot Data
print $out pack("V", 0x12933348); # Self Pointer (*ivt)
print $out pack("V", 0x12933368); # CSF Pointer (*csf)
print $out pack("V", 0x0); # Reserved
close($out);
ivt = load_address + size_of_padded_img (0x12000000 + 0x00933348)
CSF = ivt+offset (0x20) = (0x12933348 + 0x20)
appended the vmlinuz-pad.bin to ivt.bin.
below is the content of my vmlinuz-pad-ivt.bin .
> hexdump -C vmlinuz-pad-ivt..bin
00932340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00933340 00 00 00 00 00 00 00 00 d1 00 20 41 00 00 00 12 |.......... A....|
00933350 00 00 00 00 00 00 00 00 00 00 00 00 48 33 93 12 |............H3..|
00933360 68 33 93 12 00 00 00 00 |h3......|
00933368
As we can see the content contain the IVT structure at 0x00933348 and size of vmlinuz-pad-ivt.bin is 0x00933368.
SO in csf file i have mention Authentication Data as below.
[Authenticate Data]
# Key slot index used to authenticate the image data
Verification index = 2
# Authenticate Start Address, Offset, Length and file
Blocks = 0x12000000 0x0 0x00933368 "vmlinuz-pad-ivt.bin"
followed as below.
Block = <load_address> <offset> <size_of_img(size_of img+pad_ivt)>
and checking the hab_auth_img as below.
loaded the img like
u-boot>load mmc 3:1 0x12000000 /boot/vmlinuz-pad-ivt-signed.bin
U-Boot > hab_auth_img 0x12000000 009342a8 00933348
hab fuse not enabled
Authenticate image from DDR location 0x12000000...
Secure boot disabled
HAB Configuration: 0xf0, HAB State: 0x66
--------- HAB Event 1 -----------------
event data:
0xdb 0x00 0x24 0x42 0x69 0x30 0xe1 0x1d
0x00 0x04 0x00 0x02 0x40 0x00 0x36 0x06
0x55 0x55 0x00 0x03 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x01
STS = HAB_WARNING (0x69)
RSN = HAB_ENG_FAIL (0x30)
CTX = HAB_CTX_ENTRY (0xE1)
ENG = HAB_ENG_CAAM (0x1D)
No, error but just warning on checking the hab status of kernel img.
Please suggest, if i am wrong anywhere in my followings steps. After loading the kernel image when using
u-boot > boot
its again showing the same Invalid IVT structure. Is the kernel image is not loading correctly ot any issue .Please suggest on this .
1) Please point out any mistake here.
2) how to run RNG self test ?
Regards,
Rk