From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [DistroKit] [PATCH 1/8] v8a: tf-a: update v2.10 -> v2.12
Date: Mon, 9 Dec 2024 18:53:58 +0100 [thread overview]
Message-ID: <20241209175405.2217481-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241209175405.2217481-1-a.fatoum@pengutronix.de>
Let's update to the TF-A v2.12, the most recent release, which was tagged
three weeks ago.
Unfortunately, this release broke i.MX8MQ build, but there's already
patches to address this breakage, which are imported here from:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/33413
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
...mq-fix-imx8mq-build-break-due-to-hab.patch | 83 +++++++++++++++++
...002-fix-imx8m-fix-imx8mq-build-break.patch | 93 +++++++++++++++++++
.../platform-v8a/patches/tf-a-v2.12/series | 2 +
configs/platform-v8a/platformconfig | 4 +-
4 files changed, 180 insertions(+), 2 deletions(-)
create mode 100644 configs/platform-v8a/patches/tf-a-v2.12/0001-fix-imx8mq-fix-imx8mq-build-break-due-to-hab.patch
create mode 100644 configs/platform-v8a/patches/tf-a-v2.12/0002-fix-imx8m-fix-imx8mq-build-break.patch
create mode 100644 configs/platform-v8a/patches/tf-a-v2.12/series
diff --git a/configs/platform-v8a/patches/tf-a-v2.12/0001-fix-imx8mq-fix-imx8mq-build-break-due-to-hab.patch b/configs/platform-v8a/patches/tf-a-v2.12/0001-fix-imx8mq-fix-imx8mq-build-break-due-to-hab.patch
new file mode 100644
index 000000000000..1c538180f8b2
--- /dev/null
+++ b/configs/platform-v8a/patches/tf-a-v2.12/0001-fix-imx8mq-fix-imx8mq-build-break-due-to-hab.patch
@@ -0,0 +1,83 @@
+From 3a36f70ba02e88ed20083c1278a739c6c870aae0 Mon Sep 17 00:00:00 2001
+From: Jacky Bai <ping.bai@nxp.com>
+Date: Tue, 14 Jan 2020 16:05:59 +0800
+Subject: [PATCH 1/2] fix(imx8mq): fix imx8mq build break due to hab
+
+Add the HAB secure boot support for the i.MX8MQ to
+fix the build break.
+
+Signed-off-by: Jacky Bai <ping.bai@nxp.com>
+Change-Id: I806de2dc42806e008355cc185065e774570362f0
+---
+ plat/imx/common/include/imx_sip_svc.h | 2 ++
+ plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 2 ++
+ plat/imx/imx8m/imx8mq/include/platform_def.h | 7 +++++--
+ plat/imx/imx8m/imx8mq/platform.mk | 1 +
+ 4 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/plat/imx/common/include/imx_sip_svc.h b/plat/imx/common/include/imx_sip_svc.h
+index 404a8295938e..ecb43c3673c5 100644
+--- a/plat/imx/common/include/imx_sip_svc.h
++++ b/plat/imx/common/include/imx_sip_svc.h
+@@ -72,6 +72,8 @@ static inline int dram_dvfs_handler(uint32_t smc_fid, void *handle,
+ SMC_RET1(handle, SMC_UNK);
+ }
+ #endif
++int imx_hab_handler(uint32_t smc_fid, u_register_t x1,
++ u_register_t x2, u_register_t x3, u_register_t x4);
+ #endif
+ #if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp)
+ int dram_dvfs_handler(uint32_t smc_fid, void *handle,
+diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+index 70c2def7d18b..735f5dba4fac 100644
+--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+@@ -52,6 +52,8 @@ static const mmap_region_t imx_mmap[] = {
+ MAP_REGION_FLAT(IMX_GIC_BASE, IMX_GIC_SIZE, MT_DEVICE | MT_RW), /* GIC map */
+ MAP_REGION_FLAT(IMX_DDRPHY_BASE, IMX_DDR_IPS_SIZE, MT_DEVICE | MT_RW), /* DDRMIX map */
+ MAP_REGION_FLAT(IMX_DRAM_BASE, IMX_DRAM_SIZE, MT_MEMORY | MT_RW | MT_NS),
++ MAP_REGION_FLAT(IMX_CAAM_RAM_BASE, IMX_CAAM_RAM_SIZE, MT_MEMORY | MT_RW), /* CAMM RAM */
++ MAP_REGION_FLAT(IMX_NS_OCRAM_BASE, IMX_NS_OCRAM_SIZE, MT_MEMORY | MT_RW), /* NS OCRAM */
+ {0},
+ };
+
+diff --git a/plat/imx/imx8m/imx8mq/include/platform_def.h b/plat/imx/imx8m/imx8mq/include/platform_def.h
+index 61c0e8e46e5e..c8289894b804 100644
+--- a/plat/imx/imx8m/imx8mq/include/platform_def.h
++++ b/plat/imx/imx8m/imx8mq/include/platform_def.h
+@@ -10,7 +10,7 @@
+ #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
+ #define PLATFORM_LINKER_ARCH aarch64
+
+-#define PLATFORM_STACK_SIZE 0x800
++#define PLATFORM_STACK_SIZE 0xb00
+ #define CACHE_WRITEBACK_GRANULE 64
+
+ #define PLAT_PRIMARY_CPU U(0x0)
+@@ -93,7 +93,10 @@
+ #define IMX_DDR_IPS_SIZE U(0x1800000)
+ #define IMX_DRAM_BASE U(0x40000000)
+ #define IMX_DRAM_SIZE U(0xc0000000)
+-
++#define IMX_NS_OCRAM_BASE U(0x900000)
++#define IMX_NS_OCRAM_SIZE U(0x20000)
++#define IMX_CAAM_RAM_BASE U(0x100000)
++#define IMX_CAAM_RAM_SIZE U(0x10000)
+ #define IMX_ROM_BASE U(0x00000000)
+ #define IMX_ROM_SIZE U(0x20000)
+
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index 73179dd0c13e..d3d213268ce1 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -29,6 +29,7 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \
+ plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c \
+ plat/imx/imx8m/imx8mq/imx8mq_psci.c \
+ plat/imx/imx8m/gpc_common.c \
++ plat/imx/imx8m/imx_hab.c \
+ plat/imx/imx8m/imx_aipstz.c \
+ plat/imx/imx8m/imx8m_caam.c \
+ plat/imx/imx8m/imx8m_ccm.c \
+--
+2.39.5
+
diff --git a/configs/platform-v8a/patches/tf-a-v2.12/0002-fix-imx8m-fix-imx8mq-build-break.patch b/configs/platform-v8a/patches/tf-a-v2.12/0002-fix-imx8m-fix-imx8mq-build-break.patch
new file mode 100644
index 000000000000..8cf78cd2e17d
--- /dev/null
+++ b/configs/platform-v8a/patches/tf-a-v2.12/0002-fix-imx8m-fix-imx8mq-build-break.patch
@@ -0,0 +1,93 @@
+From 1b65be5943fc4f6a0382d03a4ed7393b383e56a4 Mon Sep 17 00:00:00 2001
+From: Jacky Bai <ping.bai@nxp.com>
+Date: Thu, 17 Oct 2024 17:56:41 +0800
+Subject: [PATCH 2/2] fix(imx8m): fix imx8mq build break
+
+Fix the build break for i.MX8MQ to make it boot
+with basic function enabled.
+
+Signed-off-by: Jacky Bai <ping.bai@nxp.com>
+Change-Id: I2ff7976e3fb7960d6876d26fe0b4a78e51219ae2
+---
+ plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 6 ++++++
+ plat/imx/imx8m/imx8mq/include/platform_def.h | 12 +++++++-----
+ plat/imx/imx8m/imx8mq/platform.mk | 2 ++
+ 3 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+index 735f5dba4fac..fdaf9fd22e88 100644
+--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+@@ -209,13 +209,19 @@ void bl31_plat_arch_setup(void)
+ MT_MEMORY | MT_RW | MT_SECURE),
+ MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - BL_CODE_BASE,
+ MT_MEMORY | MT_RO | MT_SECURE),
++#if SEPARATE_NOBITS_REGION
++ MAP_REGION_FLAT(BL_NOBITS_BASE, BL_NOBITS_END - BL_NOBITS_BASE,
++ MT_RW_DATA | MT_SECURE),
++#endif
+ #if USE_COHERENT_MEM
+ MAP_REGION_FLAT(BL_COHERENT_RAM_BASE,
+ BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE,
+ MT_DEVICE | MT_RW | MT_SECURE),
+ #endif
++#if defined(SPD_opteed) || defined(SPD_trusty)
+ /* Map TEE memory */
+ MAP_REGION_FLAT(BL32_BASE, BL32_SIZE, MT_MEMORY | MT_RW),
++#endif
+ {0},
+ };
+
+diff --git a/plat/imx/imx8m/imx8mq/include/platform_def.h b/plat/imx/imx8m/imx8mq/include/platform_def.h
+index c8289894b804..34bd77e87e60 100644
+--- a/plat/imx/imx8m/imx8mq/include/platform_def.h
++++ b/plat/imx/imx8m/imx8mq/include/platform_def.h
+@@ -37,6 +37,12 @@
+ #define BL31_SIZE SZ_64K
+ #define BL31_LIMIT (BL31_BASE + BL31_SIZE)
+
++#define OCRAM_S_BASE U(0x180000)
++#define OCRAM_S_SIZE SZ_32K
++#define OCRAM_S_LIMIT (OCRAM_S_BASE + OCRAM_S_SIZE)
++#define BL31_NOBITS_BASE OCRAM_S_BASE
++#define BL31_NOBITS_LIMIT (BL31_NOBITS_BASE + SZ_32K)
++
+ /* non-secure uboot base */
+ #ifndef PLAT_NS_IMAGE_OFFSET
+ #define PLAT_NS_IMAGE_OFFSET U(0x40200000)
+@@ -54,7 +60,7 @@
+ #define MAX_XLAT_TABLES 5
+ #define MAX_MMAP_REGIONS 15
+ #else
+-#define MAX_XLAT_TABLES 4
++#define MAX_XLAT_TABLES 3
+ #define MAX_MMAP_REGIONS 14
+ #endif
+
+@@ -144,10 +150,6 @@
+ #define GPR_TZASC_EN BIT(0)
+ #define GPR_TZASC_EN_LOCK BIT(16)
+
+-#define OCRAM_S_BASE U(0x00180000)
+-#define OCRAM_S_SIZE U(0x8000)
+-#define OCRAM_S_LIMIT (OCRAM_S_BASE + OCRAM_S_SIZE)
+-
+ #define COUNTER_FREQUENCY 8333333 /* 25MHz / 3 */
+
+ #define IMX_WDOG_B_RESET
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index d3d213268ce1..76fc07107057 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -64,6 +64,8 @@ ifeq (${IMX_DRAM_RETENTION},1)
+ BL31_SOURCES += ${IMX_DRAM_SOURCES}
+ endif
+
++SEPARATE_NOBITS_REGION := 1
++
+ ifneq (${PRELOADED_BL33_BASE},)
+ $(eval $(call add_define_val,PLAT_NS_IMAGE_OFFSET,${PRELOADED_BL33_BASE}))
+ endif
+--
+2.39.5
+
diff --git a/configs/platform-v8a/patches/tf-a-v2.12/series b/configs/platform-v8a/patches/tf-a-v2.12/series
new file mode 100644
index 000000000000..e9a737739bc2
--- /dev/null
+++ b/configs/platform-v8a/patches/tf-a-v2.12/series
@@ -0,0 +1,2 @@
+0001-fix-imx8mq-fix-imx8mq-build-break-due-to-hab.patch
+0002-fix-imx8m-fix-imx8mq-build-break.patch
diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index ee395b075eac..44750400790b 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -206,8 +206,8 @@ PTXCONF_BOOTLOADER=y
# PTXCONF_HOST_MXS_UTILS is not set
PTXCONF_TF_A=y
PTXCONF_TF_A_URL="https://github.com/ARM-software/arm-trusted-firmware/archive/refs/tags"
-PTXCONF_TF_A_VERSION="v2.10"
-PTXCONF_TF_A_MD5="641f42080967e05d687ef2fa9f8f3bc3 179042745d57dc03cb44063d43dc5301"
+PTXCONF_TF_A_VERSION="v2.12"
+PTXCONF_TF_A_MD5="dea016f3707117c7935a8a26433a1e46"
PTXCONF_TF_A_ARCH_STRING="aarch64"
PTXCONF_TF_A_ARM_ARCH_MAJOR_8=y
PTXCONF_TF_A_ARM_ARCH_MAJOR=8
--
2.39.5
next prev parent reply other threads:[~2024-12-09 17:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 17:53 [DistroKit] [PATCH 0/8] v7a/v8a: update firmware, bootloader and kernel Ahmad Fatoum
2024-12-09 17:53 ` Ahmad Fatoum [this message]
2024-12-09 17:53 ` [DistroKit] [PATCH 2/8] v8a: barebox: update v2024.07.0 -> v2024.12.0 Ahmad Fatoum
2024-12-09 17:54 ` [DistroKit] [PATCH 3/8] v8a: kernel: update 6.11 -> v6.13-rc2 Ahmad Fatoum
2024-12-09 17:54 ` [DistroKit] [PATCH 4/8] v7a: barebox: am335x-mlo: disable LZO decompress Ahmad Fatoum
2024-12-09 17:54 ` [DistroKit] [PATCH 5/8] v7a: barebox: update v2024.07.0 -> v2024.12.0 Ahmad Fatoum
2024-12-09 17:54 ` [DistroKit] [PATCH 6/8] v7a: kernel: update 6.11 -> v6.13-rc2 Ahmad Fatoum
2024-12-09 17:54 ` [DistroKit] [PATCH 7/8] v7a: tf-a: update v2.10 -> v2.12 Ahmad Fatoum
2024-12-09 17:54 ` [DistroKit] [PATCH 8/8] v7a/v8a: barebox: enable some more useful commands Ahmad Fatoum
2024-12-09 18:05 ` [DistroKit] [PATCH 0/8] v7a/v8a: update firmware, bootloader and kernel Robert Schwebel
2024-12-09 19:10 ` Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241209175405.2217481-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=distrokit@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox