S32G Linux_BSP:HSE Security Support,manualy building u-boot do not work

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32G Linux_BSP:HSE Security Support,manualy building u-boot do not work

1,349 次查看
seeu
Contributor III

Follow the  Linux BSP 33.0 User Manual for S32G2 platforms chapter 10 HSE Security Support to manually building U-boot and kernel,but after building U-BOOT I use command to copy binaries onto the SD Card, and repower the board, it have nothing to print, it look like the U-BOOT are broken. Which step was wrong. This are my step.

 

vmuser@ubuntu:~/u-boot$ make
CHK include/config/uboot.release
CHK include/generated/version_autogenerated.h
UPD include/generated/version_autogenerated.h
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CC lib/asm-offsets.s
CHK include/generated/generic-asm-offsets.h
CHK include/generated/asm-offsets.h
HOSTCC tools/mkenvimage.o
HOSTLD tools/mkenvimage
HOSTCC tools/fit_image.o
HOSTCC tools/image-host.o
HOSTCC tools/dumpimage.o
HOSTLD tools/dumpimage
HOSTCC tools/mkimage.o
HOSTLD tools/mkimage
CC arch/arm/cpu/armv8/fwcall.o
LD arch/arm/cpu/armv8/built-in.o
CC cmd/version.o
LD cmd/built-in.o
CC common/main.o
LD common/built-in.o
CC lib/efi_loader/helloworld.o
AS lib/efi_loader/efi_crt0.o
CC lib/efi_loader/efi_reloc.o
CC lib/efi_loader/efi_freestanding.o
LD lib/efi_loader/helloworld_efi.so
OBJCOPY lib/efi_loader/helloworld.efi
CC lib/smbios.o
CC lib/display_options.o
LD lib/built-in.o
LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
start=$(/home/vmuser/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(/home/vmuser/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0xffaa0000 $start $end
CAT u-boot-dtb.bin
COPY u-boot.bin
SYM u-boot.sym
CFGS u-boot-s32.cfgout
CFGCHK u-boot.cfg
vmuser@ubuntu:~/u-boot$ cd ../arm-trusted-firmware/

vmuser@ubuntu:~/arm-trusted-firmware$ make CROSS_COMPILE=/home/vmuser/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- ARCH=aarch64 PLAT=s32g274ardb2 BL33=/home/vmuser/u-boot/u-boot-nodtb.bin HSE_SECBOOT=1
make[1]: Nothing to be done for 'all'.
FIP /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/dummy_fip
MKIMAGE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/dummy_fip.s32
MKIMAGE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/ivt_location
MKIMAGE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_offset
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_mmc_offset_flag
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_qspi_offset_flag
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_mem_offset_flag
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_hdr_size
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/dtb_size
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM/bl31SSRAM.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM.bin successfully

XXD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM.bin
CC plat/nxp/s32/s32g/bl31_ssram/bl31_ssram.c
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM/bl31SRAM.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM.bin successfully

XXD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM.bin
CC plat/nxp/s32/s32g/bl31_sram/bl31_sram.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2/bl2.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2.bin successfully

OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2/bl2.dump
167890+0 records in
167890+0 records out
167890 bytes (168 kB, 164 KiB) copied, 0.153456 s, 1.1 MB/s
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
CC plat/nxp/s32/s32g/bl31_sram/bl31_sram.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31/bl31.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31.bin successfully

EL3 Runtime Firmware BL31: offset=0x90, size=0x16F51, cmdline="--soc-fw"
Non-Trusted Firmware BL33: offset=0x16FF0, size=0xA49A8, cmdline="--nt-fw"

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.bin successfully

256+0 records in
256+0 records out
256 bytes copied, 0.00162368 s, 158 kB/s
Added BL2 and DTB to /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.bin successfully
Trusted Boot Firmware BL2: offset=0x100, size=0x57904, cmdline="--tb-fw"
EL3 Runtime Firmware BL31: offset=0x57A10, size=0x16F51, cmdline="--soc-fw"
Non-Trusted Firmware BL33: offset=0x6E970, size=0xA49A8, cmdline="--nt-fw"
SOC_FW_CONFIG: offset=0x113320, size=0x595A, cmdline="--soc-fw-config"
Trusted Boot Firmware BL2 certificate: offset=0x118C80, size=0x100, cmdline="--tb-fw-cert"
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2_w_dtb_size
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.cfgout
MKIMAGE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.s32

Image Layout
DCD: Offset: 0x200 Size: 0x1c
IVT: Offset: 0x1000 Size: 0x100
HSE Firmware: Offset: 0x1200
HSE SYS Image: Offset: 0x52400 Size: 0xc000
AppBootCode Header: Offset: 0x5e400 Size: 0x40
Application: Offset: 0x5e440 Size: 0x118e00

IVT Location: SD/eMMC
Load address: 0x3407a5a0
Entry point: 0x34080000

Generated /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.s32 successfully
OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM/bl31SRAM.dump
OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM/bl31SSRAM.dump
Building s32g274ardb2
OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31/bl31.dump
vmuser@ubuntu:~/arm-trusted-firmware$ make CROSS_COMPILE=/home/vmuser/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- ARCH=aarch64 PLAT=s32g274ardb2 BL33=/home/vmuser/u-boot/u-boot-nodtb.bin FIP_MEMORY_OFFSET=0x3407a5a0 HSE_SECBOOT=1
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_mmc_offset_flag
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_qspi_offset_flag
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_mem_offset_flag
make[1]: Nothing to be done for 'all'.
FIP /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/dummy_fip
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip_hdr_size
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/dtb_size
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM/bl31SSRAM.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM.bin successfully

XXD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM.bin
CC plat/nxp/s32/s32g/bl31_ssram/bl31_ssram.c
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM/bl31SRAM.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM.bin successfully

XXD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM.bin
CC plat/nxp/s32/s32g/bl31_sram/bl31_sram.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2/bl2.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2.bin successfully

OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2/bl2.dump
167890+0 records in
167890+0 records out
167890 bytes (168 kB, 164 KiB) copied, 0.157969 s, 1.1 MB/s
CC /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/boot_info.c
CC plat/nxp/s32/s32g/bl31_sram/bl31_sram.c
LD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31/bl31.elf
BIN /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31.bin

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31.bin successfully

EL3 Runtime Firmware BL31: offset=0x90, size=0x16F51, cmdline="--soc-fw"
Non-Trusted Firmware BL33: offset=0x16FF0, size=0xA49A8, cmdline="--nt-fw"

Built /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.bin successfully

256+0 records in
256+0 records out
256 bytes copied, 0.00196321 s, 130 kB/s
Added BL2 and DTB to /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.bin successfully
Trusted Boot Firmware BL2: offset=0x100, size=0x57904, cmdline="--tb-fw"
EL3 Runtime Firmware BL31: offset=0x57A10, size=0x16F51, cmdline="--soc-fw"
Non-Trusted Firmware BL33: offset=0x6E970, size=0xA49A8, cmdline="--nt-fw"
SOC_FW_CONFIG: offset=0x113320, size=0x595A, cmdline="--soc-fw-config"
Trusted Boot Firmware BL2 certificate: offset=0x118C80, size=0x100, cmdline="--tb-fw-cert"
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl2_w_dtb_size
CREATE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.cfgout
MKIMAGE /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.s32

Image Layout
DCD: Offset: 0x200 Size: 0x1c
IVT: Offset: 0x1000 Size: 0x100
HSE Firmware: Offset: 0x1200
HSE SYS Image: Offset: 0x52400 Size: 0xc000
AppBootCode Header: Offset: 0x5e400 Size: 0x40
Application: Offset: 0x5e440 Size: 0x118e00

IVT Location: SD/eMMC
Load address: 0x3407a5a0
Entry point: 0x34080000

Generated /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/fip.s32 successfully
OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SRAM/bl31SRAM.dump
OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31SSRAM/bl31SSRAM.dump
Building s32g274ardb2
OD /home/vmuser/arm-trusted-firmware/build/s32g274ardb2/release/bl31/bl31.dump

vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ openssl genrsa -out rsa2048_private.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
...........+++++
.....................................+++++
e is 65537 (0x010001)
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ openssl rsa -in rsa2048_private.pem -outform DER -pubout -out rsa2048_public.der
writing RSA key

vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ ../../../tools/fiptool/fiptool info fip.bin
Trusted Boot Firmware BL2: offset=0x100, size=0x57904, cmdline="--tb-fw"
EL3 Runtime Firmware BL31: offset=0x57A10, size=0x16F51, cmdline="--soc-fw"
Non-Trusted Firmware BL33: offset=0x6E970, size=0xA49A8, cmdline="--nt-fw"
SOC_FW_CONFIG: offset=0x113320, size=0x595A, cmdline="--soc-fw-config"
Trusted Boot Firmware BL2 certificate: offset=0x118C80, size=0x100, cmdline="--tb-fw-cert"
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ dd if=fip.bin of=tosign-fip.bin bs=1 count=`printf "%d" 0x118C80` conv=notrunc
dd: failed to open 'tosign-fip.bin': Permission denied
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ sudo dd if=fip.bin of=tosign-fip.bin bs=1 count=`printf "%d" 0x118C80` conv=notrunc
[sudo] password for vmuser:
1150080+0 records in
1150080+0 records out
1150080 bytes (1.2 MB, 1.1 MiB) copied, 0.887758 s, 1.3 MB/s
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ openssl dgst -sha1 -sign rsa2048_private.pem -out fip-signature.bin tosign-fip.bin
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ ../../../tools/fiptool/fiptool update --align 16 --tb-fw-cert fip-signature.bin fip.bin
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ sudo dd if=fip.s32 seek=512 skip=512 iflag=skip_bytes oflag=seek_bytes conv=notrunc,fsync
^C0+0 records in
0+0 records out
0 bytes copied, 43.5562 s, 0.0 kB/s

vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ export DEVSD=/dev/sdb
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ sudo dd if=fip.s32 of=${DEVSD} seek=512 skip=512 iflag=skip_bytes oflag=seek_bytes conv=notrunc,fsync
2999+1 records in
2999+1 records out
1535936 bytes (1.5 MB, 1.5 MiB) copied, 1.36734 s, 1.1 MB/s
vmuser@ubuntu:~/arm-trusted-firmware/build/s32g274ardb2/release$ sudo dd if=fip.bin of=${DEVSD} seek=`printf "%d" 0x5e440` conv=notrunc,fsync
2246+1 records in
2246+1 records out
1150336 bytes (1.2 MB, 1.1 MiB) copied, 1.05017 s, 1.1 MB/s

 

THANKS!


 

0 项奖励
回复
2 回复数

1,306 次查看
seeu
Contributor III

help me please

0 项奖励
回复

1,193 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @seeu,

Hope you are doing well.

The steps you have provided are correct as per my knowledge but I have one doubt while building u-boot, have you enabled secure boot by following mentioned steps:

CONFIG_HSE_SECBOOT=y
CONFIG_HSE_FW_FILE=<path>/<to>/<HSE>/<directory>/<hse_fw_file>.bin.pink

Please let us know so that we can move forward to support you.

 

Thanks,

Mayank s Patel

0 项奖励
回复