Help regarding booting FIT image on RPi4
Ritwik Mandal
ritwik.mandal at in.abb.com
Sun Feb 7 12:56:30 CET 2021
Warm greetings to the community,
Need some serious help regarding booting FIT images on RPi4.
I am working with a custom kernel and rootfs image for RPi4.
Have cloned this repo - git clone https://gitlab.denx.de/u-boot/u-boot.git
And generated u-boot.bin with the rpi_4_defconfig, and copied it onto my SDCard.
My sdcard's config.txt is pointing to u-boot.bin as kernel=u-boot.bin
Now all this works fine as
RPi Bootloader => u-boot.bin => Image (Custom Linux) => Mounts FS and stuff
Basically now I want to use signs and hashes here. Hence, changing from legacy Image to FIT Image using mkimage as :
mkimage -f ritman.its -K bcm2711-rpi-4-b-pubkey.dtb -k keys -r image.fit
I am stuck at some error while booting up this image.fit
---------------------------------------------------------------------------------------------------------------------------------
My its file looks like -
/dts-v1/;
/ {
description = "RPi FIT Image";
#address-cells = <2>;
images {
kernel-1 {
description = "default kernel";
data = /incbin/("Image");
type = "kernel";
arch = "arm64";
os = "linux";
compression = "none";
load = <0x00080000>;
entry = <0x00080000>;
hash at 1 {
algo = "sha1";
};
};
fdt-1 {
description = "device tree";
data = /incbin/("bcm2711-rpi-4-b.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
hash at 1 {
algo = "sha1";
};
};
};
configurations {
default = "config-1";
config-1 {
description = "default configuration";
kernel = "kernel-1";
fdt = "fdt-1";
signature-1 {
algo = "sha1,rsa2048";
key-name-hint = "dev";
sign-images = "fdt", "kernel";
};
};
};
};
---------------------------------------------------------------------------------------------------------------------------------
Now, copied the image.fit onto SDCard boot dir. and passed the following commands as boot.scr.uimg :
setenv bootargs console=tty0 console=ttyAMA0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
fatload mmc 0:1 0x1F000000 image.fit
bootm 0x1F000000
---------------------------------------------------------------------------------------------------------------------------------
On boot-up U - Boot throws error as:
0 is current device
Running mmc 0:1...
U-Boot script /boot.scr.uimg
Bytes read in 7 ms (24.4 KiB/s)
Executing script at 02400000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
fdt_check_header(): FDT_ERR_BADMAGIC
running disk emmc2 at 7e340000.blk<mailto:emmc2 at 7e340000.blk>...
did not respond to voltage select!: -110
running disk mmcnr at 7e300000.blk<mailto:mmcnr at 7e300000.blk> ...
mmcnr at 7e300000.blk<mailto:mmcnr at 7e300000.blk> not ready
3 disks
EFI system partition
BootOrder not defined
Boot manager : Cannot load any image
did not respond to voltage select!: -110
Starting USB ...
Networking controllers found
Please issue 'usb start' first
Waiting for PHY auto negotiation to complete...
---------------------------------------------------------------------------------------------------------------------------------
Sorry for not attaching the console output here, basically don't have access to the board via console at this moment.
Basically, the boot gets stuck at the PHY auto negotiation and after a few moments, U-Boot shell comes up. As far as I understand I am being dropped into the shell only because boot.scr couldn't get the kernel from the FIT image.
Any inputs on how to mitigate this issue and boot up the FIT correctly is highly required and appreciated. Really am not sure what am I getting wrong here. Any help would be great. Thanks in advance.
Regards,
Ritwik Mandal
More information about the U-Boot
mailing list