diff options
author | Thomas Perrot <thomas.perrot@bootlin.com> | 2022-04-26 17:16:02 +0200 |
---|---|---|
committer | Thomas Perrot <thomas.perrot@bootlin.com> | 2022-04-27 10:41:47 +0200 |
commit | daf1f29014920538b0e7472ac14bd6f454429970 (patch) | |
tree | 8195171a31b3165c8ed36b64a55bea68dbdcc56f /recipes-bsp/imx-mkimage | |
parent | 1f4577542cd2246b4a1f1bf0e331f82ff2d7da8b (diff) | |
download | meta-freescale-daf1f29014920538b0e7472ac14bd6f454429970.tar.gz |
imx-imkimage: install print_fit_hab.sh
This script gives the address, the offset and the size of binaries have been
stored into U-Boot FIT image that contains TF-A, U-Boot and OP-TEE.
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Diffstat (limited to 'recipes-bsp/imx-mkimage')
5 files changed, 164 insertions, 0 deletions
diff --git a/recipes-bsp/imx-mkimage/files/0001-Add-LDFLAGS-to-link-step.patch b/recipes-bsp/imx-mkimage/files/0001-Add-LDFLAGS-to-link-step.patch new file mode 100644 index 00000000..4de0155d --- /dev/null +++ b/recipes-bsp/imx-mkimage/files/0001-Add-LDFLAGS-to-link-step.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 2a6e2d40a4af78d4a0824e384c3aec55db758fee Mon Sep 17 00:00:00 2001 | ||
2 | From: Erik Larsson <erik.larsson@combitech.se> | ||
3 | Date: Tue, 6 Mar 2018 12:28:39 +0100 | ||
4 | Subject: [PATCH] Add LDFLAGS to link step | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com> | ||
9 | --- | ||
10 | iMX8M/soc.mak | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak | ||
14 | index 03b05f7aafeb..4d5df0777704 100644 | ||
15 | --- a/iMX8M/soc.mak | ||
16 | +++ b/iMX8M/soc.mak | ||
17 | @@ -84,7 +84,7 @@ FW_DIR = imx-boot/imx-boot-tools/$(PLAT) | ||
18 | $(MKIMG): mkimage_imx8.c | ||
19 | @echo "PLAT="$(PLAT) "HDMI="$(HDMI) | ||
20 | @echo "Compiling mkimage_imx8" | ||
21 | - $(CC) $(CFLAGS) mkimage_imx8.c -o $(MKIMG) -lz | ||
22 | + $(CC) $(CFLAGS) mkimage_imx8.c -o $(MKIMG) $(LDFLAGS) -lz | ||
23 | |||
24 | lpddr4_imem_1d = lpddr4_pmu_train_1d_imem$(LPDDR_FW_VERSION).bin | ||
25 | lpddr4_dmem_1d = lpddr4_pmu_train_1d_dmem$(LPDDR_FW_VERSION).bin | ||
26 | -- | ||
27 | 2.35.1 | ||
28 | |||
diff --git a/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL31-BL32-and-BL33.patch b/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL31-BL32-and-BL33.patch new file mode 100644 index 00000000..eadba937 --- /dev/null +++ b/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL31-BL32-and-BL33.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From ff3204addcf737b7285a0c44eb0a34c9ca82be4e Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Perrot <thomas.perrot@bootlin.com> | ||
3 | Date: Tue, 26 Apr 2022 15:10:04 +0200 | ||
4 | Subject: [PATCH] Add support for overriding BL31, BL32 and BL33 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> | ||
9 | --- | ||
10 | iMX8M/print_fit_hab.sh | 14 +++++++++----- | ||
11 | 1 file changed, 9 insertions(+), 5 deletions(-) | ||
12 | |||
13 | diff --git a/iMX8M/print_fit_hab.sh b/iMX8M/print_fit_hab.sh | ||
14 | index b915115d1ecc..9e025b78c04d 100755 | ||
15 | --- a/iMX8M/print_fit_hab.sh | ||
16 | +++ b/iMX8M/print_fit_hab.sh | ||
17 | @@ -1,12 +1,16 @@ | ||
18 | #!/bin/bash | ||
19 | |||
20 | -BL32="tee.bin" | ||
21 | - | ||
22 | let fit_off=$1 | ||
23 | |||
24 | # keep backward compatibility | ||
25 | [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000" | ||
26 | |||
27 | +[ -z "$BL31" ] && BL33="bl31.bin" | ||
28 | + | ||
29 | +[ -z "$BL32" ] && BL32="tee.bin" | ||
30 | + | ||
31 | +[ -z "$BL33" ] && BL33="u-boot-nodtb.bin" | ||
32 | + | ||
33 | if [ -z "$ATF_LOAD_ADDR" ]; then | ||
34 | echo "ERROR: BL31 load address is not set" >&2 | ||
35 | exit 0 | ||
36 | @@ -26,7 +30,7 @@ else | ||
37 | let uboot_sign_off=$((fit_off - 0x8000 - ivt_off + 0x3000)) | ||
38 | fi | ||
39 | |||
40 | -let uboot_size=$(ls -lct u-boot-nodtb.bin | awk '{print $5}') | ||
41 | +let uboot_size=$(ls -lct $BL33 | awk '{print $5}') | ||
42 | let uboot_load_addr=0x40200000 | ||
43 | |||
44 | let last_sign_off=$(((uboot_sign_off + uboot_size + 3) & ~3)) | ||
45 | @@ -64,13 +68,13 @@ done | ||
46 | |||
47 | let atf_sign_off=$((last_sign_off)) | ||
48 | let atf_load_addr=$ATF_LOAD_ADDR | ||
49 | -let atf_size=$(ls -lct bl31.bin | awk '{print $5}') | ||
50 | +let atf_size=$(ls -lct $BL31 | awk '{print $5}') | ||
51 | |||
52 | if [ ! -f $BL32 ]; then | ||
53 | let tee_size=0x0 | ||
54 | let tee_sign_off=$((atf_sign_off + atf_size)) | ||
55 | else | ||
56 | - let tee_size=$(ls -lct tee.bin | awk '{print $5}') | ||
57 | + let tee_size=$(ls -lct $BL32 | awk '{print $5}') | ||
58 | |||
59 | let tee_sign_off=$(((atf_sign_off + atf_size + 3) & ~3)) | ||
60 | let tee_load_addr=$TEE_LOAD_ADDR | ||
61 | -- | ||
62 | 2.35.1 | ||
diff --git a/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL32-and-BL33-not-only-BL.patch b/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL32-and-BL33-not-only-BL.patch new file mode 100644 index 00000000..9e8360b5 --- /dev/null +++ b/recipes-bsp/imx-mkimage/files/0001-Add-support-for-overriding-BL32-and-BL33-not-only-BL.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From 4e4e06602f594b335b4c264a3b062bc7af961078 Mon Sep 17 00:00:00 2001 | ||
2 | From: Erik Larsson <erik.larsson@combitech.se> | ||
3 | Date: Thu, 8 Mar 2018 19:04:37 +0100 | ||
4 | Subject: [PATCH] Add support for overriding BL32 and BL33 not only BL31 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com> | ||
9 | Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com> | ||
10 | Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> | ||
11 | Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> | ||
12 | --- | ||
13 | iMX8M/mkimage_fit_atf.sh | 15 ++++++++------- | ||
14 | 1 file changed, 8 insertions(+), 7 deletions(-) | ||
15 | |||
16 | diff --git a/iMX8M/mkimage_fit_atf.sh b/iMX8M/mkimage_fit_atf.sh | ||
17 | index 10903ea3bbf5..85ea6ffcc71d 100755 | ||
18 | --- a/iMX8M/mkimage_fit_atf.sh | ||
19 | +++ b/iMX8M/mkimage_fit_atf.sh | ||
20 | @@ -6,6 +6,7 @@ | ||
21 | # usage: $0 <dt_name> [<dt_name> [<dt_name] ...] | ||
22 | |||
23 | [ -z "$BL31" ] && BL31="bl31.bin" | ||
24 | + | ||
25 | # keep backward compatibility | ||
26 | [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000" | ||
27 | |||
28 | @@ -18,23 +19,23 @@ if [ ! -f $BL31 ]; then | ||
29 | echo "ERROR: BL31 file $BL31 NOT found" >&2 | ||
30 | exit 0 | ||
31 | else | ||
32 | - echo "bl31.bin size: " >&2 | ||
33 | - ls -lct bl31.bin | awk '{print $5}' >&2 | ||
34 | + echo "$BL31 size: " >&2 | ||
35 | + ls -lct $BL31 | awk '{print $5}' >&2 | ||
36 | fi | ||
37 | |||
38 | -BL32="tee.bin" | ||
39 | +[ -z "$BL32" ] && BL32="tee.bin" | ||
40 | LOADABLES="\"atf-1\"" | ||
41 | |||
42 | if [ ! -f $BL32 ]; then | ||
43 | BL32=/dev/null | ||
44 | else | ||
45 | echo "Building with TEE support, make sure your bl31 is compiled with spd. If you do not want tee, please delete tee.bin" >&2 | ||
46 | - echo "tee.bin size: " >&2 | ||
47 | + echo "$BL32 size: " >&2 | ||
48 | ls -lct tee.bin | awk '{print $5}' >&2 | ||
49 | LOADABLES="$LOADABLES, \"tee-1\"" | ||
50 | fi | ||
51 | |||
52 | -BL33="u-boot-nodtb.bin" | ||
53 | +[ -z "$BL33" ] && BL33="u-boot-nodtb.bin" | ||
54 | DEK_BLOB="dek_blob_fit_dummy.bin" | ||
55 | |||
56 | if [ ! -f $DEK_BLOB ]; then | ||
57 | @@ -49,8 +50,8 @@ if [ ! -f $BL33 ]; then | ||
58 | exit 0 | ||
59 | else | ||
60 | |||
61 | - echo "u-boot-nodtb.bin size: " >&2 | ||
62 | - ls -lct u-boot-nodtb.bin | awk '{print $5}' >&2 | ||
63 | + echo "$BL33 size: " >&2 | ||
64 | + ls -lct $BL33 | awk '{print $5}' >&2 | ||
65 | fi | ||
66 | |||
67 | for dtname in $* | ||
68 | -- | ||
69 | 2.35.1 | ||
diff --git a/recipes-bsp/imx-mkimage/imx-mkimage_git.bb b/recipes-bsp/imx-mkimage/imx-mkimage_git.bb index 24ed76e2..4906121f 100644 --- a/recipes-bsp/imx-mkimage/imx-mkimage_git.bb +++ b/recipes-bsp/imx-mkimage/imx-mkimage_git.bb | |||
@@ -23,5 +23,7 @@ do_install () { | |||
23 | cd ${S} | 23 | cd ${S} |
24 | install -d ${D}${bindir} | 24 | install -d ${D}${bindir} |
25 | install -m 0755 iMX8M/mkimage_imx8 ${D}${bindir}/mkimage_imx8m | 25 | install -m 0755 iMX8M/mkimage_imx8 ${D}${bindir}/mkimage_imx8m |
26 | install -m 0755 iMX8M/mkimage_fit_atf.sh ${D}${bindir}/mkimage_fit_atf.sh | ||
27 | install -m 0755 iMX8M/print_fit_hab.sh ${D}${bindir}/print_fit_hab.sh | ||
26 | install -m 0755 mkimage_imx8 ${D}${bindir}/mkimage_imx8 | 28 | install -m 0755 mkimage_imx8 ${D}${bindir}/mkimage_imx8 |
27 | } | 29 | } |
diff --git a/recipes-bsp/imx-mkimage/imx-mkimage_git.inc b/recipes-bsp/imx-mkimage/imx-mkimage_git.inc index b4d32a54..5f44fe2b 100644 --- a/recipes-bsp/imx-mkimage/imx-mkimage_git.inc +++ b/recipes-bsp/imx-mkimage/imx-mkimage_git.inc | |||
@@ -6,6 +6,9 @@ SRCBRANCH = "lf-5.10.72_2.2.0" | |||
6 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH} \ | 6 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH} \ |
7 | file://0001-mkimage_fit_atf-fix-fit-generator-node-naming.patch \ | 7 | file://0001-mkimage_fit_atf-fix-fit-generator-node-naming.patch \ |
8 | file://0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch \ | 8 | file://0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch \ |
9 | file://0001-Add-support-for-overriding-BL32-and-BL33-not-only-BL.patch \ | ||
10 | file://0001-Add-LDFLAGS-to-link-step.patch \ | ||
11 | file://0001-Add-support-for-overriding-BL31-BL32-and-BL33.patch \ | ||
9 | " | 12 | " |
10 | SRCREV = "7a277c8a1a21ff921d217889dde6a9f84e6d2168" | 13 | SRCREV = "7a277c8a1a21ff921d217889dde6a9f84e6d2168" |
11 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |