Linux kernel 无法使用Rasbperry Pi 4上的FIT映像引导到内核
我正在使用树莓皮4,试图在其上添加验证引导。我使用Buildroot构建了基本的SD卡映像,并用mkimage对映像进行了签名。 我首先在u-boot控制台中使用两个选项进行测试: 测试1: 我使用了“bootm0x01000000”,让u-boot在FIT映像中计算出设备树Linux kernel 无法使用Rasbperry Pi 4上的FIT映像引导到内核,linux-kernel,raspberry-pi,u-boot,Linux Kernel,Raspberry Pi,U Boot,我正在使用树莓皮4,试图在其上添加验证引导。我使用Buildroot构建了基本的SD卡映像,并用mkimage对映像进行了签名。 我首先在u-boot控制台中使用两个选项进行测试: 测试1: 我使用了“bootm0x01000000”,让u-boot在FIT映像中计算出设备树 In: serial Out: vidconsole Err: vidconsole Net: eth0: ethernet@7d580000 Hit any key to stop autoboot:
In: serial
Out: vidconsole
Err: vidconsole
Net: eth0: ethernet@7d580000
Hit any key to stop autoboot: 0
U-Boot> setenv bootargs console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootwait
U-Boot> printenv bootargs
bootargs=console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootwait
U-Boot> fatload mmc 0:1 0x01000000 Image
15731478 bytes read in 700 ms (21.4 MiB/s)
U-Boot> bootm 0x01000000
## Loading kernel from FIT Image at 01000000 ...
Using 'config-1' configuration
Verifying Hash Integrity ... OK
Trying 'kernel-1' kernel subimage
Description: default kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x010000dc
Data Size: 15682048 Bytes = 15 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x00080000
Entry Point: 0x00080000
Hash algo: sha1
Hash value: 1f7b5be7099568611cbc76c0b83202ae5829073a
Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 01000000 ...
Using 'config-1' configuration
Verifying Hash Integrity ... OK
Trying 'fdt-1' fdt subimage
Description: device tree
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x01ef4bc4
Data Size: 47437 Bytes = 46.3 KiB
Architecture: AArch64
Hash algo: sha1
Hash value: b0ba4b289dbcb0c1571103ca5a013aaddaebb03e
Verifying Hash Integrity ... sha1+ OK
Booting using the fdt blob at 0x1ef4bc4
Loading Kernel Image
Using Device Tree in place at 0000000001ef4bc4, end 0000000001f03510
Starting kernel ...
引导进程在“启动内核…”消息处卡住
测试2:
我使用“bootm0x01000000-0x2eff4000”并使用${fdt_addr}在u-boot的位置指定设备树
In: serial
Out: vidconsole
Err: vidconsole
Net: eth0: ethernet@7d580000
Hit any key to stop autoboot: 2 0
U-Boot> setenv bootargs console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootwait
U-Boot> fatload mmc 0:1 0x01000000 Image
15731478 bytes read in 700 ms (21.4 MiB/s)
U-Boot> bootm 0x01000000 - 0x2eff4000
## Loading kernel from FIT Image at 01000000 ...
Using 'config-1' configuration
Verifying Hash Integrity ... OK
Trying 'kernel-1' kernel subimage
Description: default kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x010000dc
Data Size: 15682048 Bytes = 15 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x00080000
Entry Point: 0x00080000
Hash algo: sha1
Hash value: 1f7b5be7099568611cbc76c0b83202ae5829073a
Verifying Hash Integrity ... sha1+ OK
## Flattened Device Tree blob at 2eff4000
Booting using the fdt blob at 0x2eff4000
Loading Kernel Image
Using Device Tree in place at 000000002eff4000, end 000000002f002f79
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[ 0.000000] Linux version 5.4.51-v8 (xiangrong.li@ubuntu) (gcc version 9.3.0 (Buildroot 2020.08)) #1 SMP PREEMPT Tue Nov 3 10:06:41 EST 2020
[ 0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.2
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
u-boot可以正常引导到内核
评论:
/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-1 {
algo = "sha1";
};
};
fdt-1 {
description = "device tree";
data = /incbin/("bcm2711-rpi-4-b.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
hash-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";
};
};
};
};
- 我从“Image”文件中提取设备树,并与bcm2711-rpi-4-b.dtb进行比较。他们完全一样
- 似乎从FIT“映像”中提取的设备树无法将引导过程引导到内核
/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-1 {
algo = "sha1";
};
};
fdt-1 {
description = "device tree";
data = /incbin/("bcm2711-rpi-4-b.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
hash-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";
};
};
};
};
知道我哪里出错了吗?谢谢