On 10.07.23 09:50, Neha Malcom Francis wrote: > Hi Jan > > On 07/07/23 19:08, Jan Kiszka wrote: >> On 07.07.23 14:34, Neha Malcom Francis wrote: >>> Move to using binman to generate tispl.bin which is used to generate the >>> final flash.bin bootloader for iot2050 boards. >>> >>> Signed-off-by: Neha Malcom Francis <n-fran...@ti.com> >>> Cc: Jan Kiszka <jan.kis...@siemens.com> >>> --- >>> arch/arm/dts/k3-am65-iot2050-boot-image.dtsi | 76 +++++++++++++++++++- >>> 1 file changed, 74 insertions(+), 2 deletions(-) >>> >>> diff --git a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi >>> b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi >>> index 03ccc54329..9d83898d33 100644 >>> --- a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi >>> +++ b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi >>> @@ -26,9 +26,81 @@ >>> missing-msg = "iot2050-seboot"; >>> }; >>> - blob@0x180000 { >>> + fit@0x180000 { >>> offset = <0x180000>; >>> - filename = "tispl.bin"; >>> + pad-byte = <0xff>; >>> + description = "Configuration to load ATF and SPL"; >>> + >>> + images { >>> + atf { >>> + description = "ARM Trusted Firmware"; >>> + type = "firmware"; >>> + arch = "arm64"; >>> + compression = "none"; >>> + os = "arm-trusted-firmware"; >>> + load = <CONFIG_K3_ATF_LOAD_ADDR>; >>> + entry = <CONFIG_K3_ATF_LOAD_ADDR>; >>> + atf: atf-bl31 { >>> + }; >>> + }; >>> + >>> + tee { >>> + description = "OPTEE"; >>> + type = "tee"; >>> + arch = "arm64"; >>> + compression = "none"; >>> + os = "tee"; >>> + load = <0x9e800000>; >>> + entry = <0x9e800000>; >>> + tee: tee-os { >>> + }; >>> + }; >>> + >>> + dm { >>> + description = "DM binary"; >>> + type = "firmware"; >>> + arch = "arm32"; >>> + compression = "none"; >>> + os = "DM"; >>> + load = <0x89000000>; >>> + entry = <0x89000000>; >>> + blob-ext { >>> + filename = "/dev/null"; >>> + }; >>> + }; >>> + >>> + spl { >>> + description = "SPL (64-bit)"; >>> + type = "standalone"; >>> + os = "U-Boot"; >>> + arch = "arm64"; >>> + compression = "none"; >>> + load = <CONFIG_SPL_TEXT_BASE>; >>> + entry = <CONFIG_SPL_TEXT_BASE>; >>> + u_boot_spl_nodtb: blob-ext { >>> + filename = "spl/u-boot-spl-nodtb.bin"; >>> + }; >>> + }; >>> + >>> + fdt-0 { >>> + description = "k3-am65-iot2050-spl.dtb"; >>> + type = "flat_dt"; >>> + arch = "arm"; >>> + compression = "none"; >>> + spl_am65x_evm_dtb: blob-ext { >>> + filename = "spl/dts/k3-am65-iot2050-spl.dtb"; >>> + }; >>> + }; >>> + }; >>> + >>> + configurations { >>> + default = "spl"; >>> + spl { >>> + fdt = "fdt-0"; >>> + firmware = "atf"; >>> + loadables = "tee", "dm", "spl"; >>> + }; >>> + }; >>> }; >>> fit@0x380000 { >> >> Looks ok (will have to test), but this lacks adjustment of >> tools/iot2050-sign-fw.sh, probably something around >> s/tispl.bin/fit@0x180000/g. >> > > Okay, let us know once tested. >
Done successfully, using this diff: diff --git a/tools/iot2050-sign-fw.sh b/tools/iot2050-sign-fw.sh index 4d1d79498c2..598482311ca 100755 --- a/tools/iot2050-sign-fw.sh +++ b/tools/iot2050-sign-fw.sh @@ -8,8 +8,8 @@ fi TEMP_X509=$(mktemp XXXXXXXX.temp) REVISION=${2:-0} -SHA_VAL=$(openssl dgst -sha512 -hex tispl.bin | sed -e "s/^.*= //g") -BIN_SIZE=$(stat -c %s tispl.bin) +SHA_VAL=$(openssl dgst -sha512 -hex f...@0x180000.fit | sed -e "s/^.*= //g") +BIN_SIZE=$(stat -c %s f...@0x180000.fit) cat <<EOF >$TEMP_X509 [ req ] @@ -38,10 +38,10 @@ EOF CERT_X509=$(mktemp XXXXXXXX.crt) openssl req -new -x509 -key $1 -nodes -outform DER -out $CERT_X509 -config $TEMP_X509 -sha512 -cat $CERT_X509 tispl.bin > tispl.bin_signed +cat $CERT_X509 f...@0x180000.fit > fit@0x180000.fit_signed # currently broken in upstream #source/tools/binman/binman replace -i flash.bin -f tispl.bin_signed blob@0x180000 -dd if=tispl.bin_signed of=flash.bin bs=$((0x1000)) seek=$((0x180000/0x1000)) conv=notrunc +dd if=fit@0x180000.fit_signed of=flash.bin bs=$((0x1000)) seek=$((0x180000/0x1000)) conv=notrunc rm $TEMP_X509 $CERT_X509 > Regarding the naming used in tools/iot2050-sign-fw.sh; would you like me > to preserve tispl.bin naming in the dts? > I don't mind, the naming is internal (thanks to the script). Jan -- Siemens AG, Technology Competence Center Embedded Linux