aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL31-BL32-and-BL33.patch
blob: 4e0d954a30f010620664fde8a6c495e875629bd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 8fc8fc3dfce7533b9c965185277d34e27055cc8f 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

Upstream-Status: Pending

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 b915115d1ecc..dbc28f2d9af5 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.35.1