ubuntu-buildroot/package/imx-mkimage/0004-Add-support-for-overri...

62 lines
1.7 KiB
Diff
Raw Normal View History

2024-04-01 15:19:46 +00:00
From b1e77d8ccabc6a3910ede2441ff567326291a355 Mon Sep 17 00:00:00 2001
From: Thomas Perrot <thomas.perrot@bootlin.com>
Date: Tue, 26 Apr 2022 15:10:04 +0200
Subject: [PATCH] Add support for overriding BL31, BL32 and BL33
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
---
iMX8M/print_fit_hab.sh | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/iMX8M/print_fit_hab.sh b/iMX8M/print_fit_hab.sh
index b915115..dbc28f2 100755
--- a/iMX8M/print_fit_hab.sh
+++ b/iMX8M/print_fit_hab.sh
@@ -1,12 +1,16 @@
#!/bin/bash
-BL32="tee.bin"
-
let fit_off=$1
# keep backward compatibility
[ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000"
+[ -z "$BL31" ] && BL31="bl31.bin"
+
+[ -z "$BL32" ] && BL32="tee.bin"
+
+[ -z "$BL33" ] && BL33="u-boot-nodtb.bin"
+
if [ -z "$ATF_LOAD_ADDR" ]; then
echo "ERROR: BL31 load address is not set" >&2
exit 0
@@ -26,7 +30,7 @@ else
let uboot_sign_off=$((fit_off - 0x8000 - ivt_off + 0x3000))
fi
-let uboot_size=$(ls -lct u-boot-nodtb.bin | awk '{print $5}')
+let uboot_size=$(ls -lct $BL33 | awk '{print $5}')
let uboot_load_addr=0x40200000
let last_sign_off=$(((uboot_sign_off + uboot_size + 3) & ~3))
@@ -64,13 +68,13 @@ done
let atf_sign_off=$((last_sign_off))
let atf_load_addr=$ATF_LOAD_ADDR
-let atf_size=$(ls -lct bl31.bin | awk '{print $5}')
+let atf_size=$(ls -lct $BL31 | awk '{print $5}')
if [ ! -f $BL32 ]; then
let tee_size=0x0
let tee_sign_off=$((atf_sign_off + atf_size))
else
- let tee_size=$(ls -lct tee.bin | awk '{print $5}')
+ let tee_size=$(ls -lct $BL32 | awk '{print $5}')
let tee_sign_off=$(((atf_sign_off + atf_size + 3) & ~3))
let tee_load_addr=$TEE_LOAD_ADDR
--
2.31.1