From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 24 Apr 2024 13:48:16 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rzb6m-00En0E-28 for lore@lore.pengutronix.de; Wed, 24 Apr 2024 13:48:16 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rzb6l-0006y6-Tq; Wed, 24 Apr 2024 13:48:15 +0200 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rzb6h-0006xp-01; Wed, 24 Apr 2024 13:48:11 +0200 Message-ID: Date: Wed, 24 Apr 2024 13:48:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Alexander Dahl , distrokit@pengutronix.de References: <20240315211240.3016716-1-a.fatoum@pengutronix.de> <20240315211240.3016716-3-a.fatoum@pengutronix.de> <12425358.O9o76ZdvQC@ada-pc> From: Ahmad Fatoum In-Reply-To: <12425358.O9o76ZdvQC@ada-pc> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [DistroKit] =?utf-8?q?=5BPATCH_02/12=5D_tf-a=3A_update_from_v2?= =?utf-8?b?Ljgg4oaSIHYyLjEw?= X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Hi, On 24.04.24 13:15, Alexander Dahl wrote: > Hello Ahmad, > > Am Freitag, 15. März 2024, 22:12:30 CEST schrieb Ahmad Fatoum: > Download fails like this: > > > ------------------------- > target: tf-a-v2.10.tar.gz > ------------------------- > > --2024-04-24 13:09:40-- https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/v2.10.tar.gz > Resolving git.trustedfirmware.org (git.trustedfirmware.org)... 51.159.18.17 > Connecting to git.trustedfirmware.org (git.trustedfirmware.org)|51.159.18.17|: > 443... connected. > HTTP request sent, awaiting response... 401 Unauthorized Meh. I guess we should do like meta-arm does and use a git checkout: git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https What do you think? Cheers, Ahmad > > Username/Password Authentication Failed. > --2024-04-24 13:09:40-- http://www.pengutronix.de/software/ptxdist/temporary-src/tf-a-v2.10.tar.gz > Resolving www.pengutronix.de (www.pengutronix.de)... 2a01:4f9:2a: > 2c17:5054:ff:fe65:8c93, 95.216.103.100 > Connecting to www.pengutronix.de (www.pengutronix.de)|2a01:4f9:2a: > 2c17:5054:ff:fe65:8c93|:80... connected. > HTTP request sent, awaiting response... 307 Temporary Redirect > Location: https://www.pengutronix.de/software/ptxdist/temporary-src/tf-a-v2.10.tar.gz [following] > --2024-04-24 13:09:40-- https://www.pengutronix.de/software/ptxdist/ > temporary-src/tf-a-v2.10.tar.gz > Connecting to www.pengutronix.de (www.pengutronix.de)|2a01:4f9:2a: > 2c17:5054:ff:fe65:8c93|:443... connected. > HTTP request sent, awaiting response... 307 Temporary Redirect > Location: https://public.pengutronix.de/mirror/software/ptxdist/temporary-src/ > tf-a-v2.10.tar.gz [following] > --2024-04-24 13:09:41-- https://public.pengutronix.de/mirror/software/ > ptxdist/temporary-src/tf-a-v2.10.tar.gz > Resolving public.pengutronix.de (public.pengutronix.de)... 2a01:4f9:2a: > 2c17:5054:ff:fe65:8c93, 95.216.103.100 > Connecting to public.pengutronix.de (public.pengutronix.de)|2a01:4f9:2a: > 2c17:5054:ff:fe65:8c93|:443... connected. > HTTP request sent, awaiting response... 404 Not Found > 2024-04-24 13:09:41 ERROR 404: Not Found. > > > Could not download package > URL: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/ > v2.10.tar.gz > > make: *** [/usr/local/lib/ptxdist-2024.03.0/rules/post/ > ptxd_make_world_get.make:16: /home/adahl/mnt/bagend-src_archive/tf-a- > v2.10.tar.gz] Error 1 > > > Greets > Alex > >> PTXCONF_TF_A_ARCH_STRING="aarch64" >> PTXCONF_TF_A_ARM_ARCH_MAJOR_8=y >> PTXCONF_TF_A_ARM_ARCH_MAJOR=8 >> diff --git >> a/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX >> 8MQ.patch >> b/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX >> 8MQ.patch new file mode 100644 >> index 000000000000..cab995bda37a >> --- /dev/null >> +++ >> b/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX >> 8MQ.patch @@ -0,0 +1,182 @@ >> +From: Ahmad Fatoum >> +Date: Wed, 13 Mar 2024 08:08:13 +0100 >> +Subject: [PATCH] fix(imx): disable DRAM retention by default on i.MX8MQ >> + >> +Building the default upstream configuration for the imx8mq-evk is no longer >> +possible: The linker will complain that the TF-A image would no longer >> +fit On-Chip SRAM. >> + >> +In order to make the i.MX8MQ Image buildable again, let's make the DRAM >> +retention feature optional: It was added in v2.9 and it's possible to >> +boot the systems without it. Users that make space elsewhere and wish to >> +enable it can use the newly introduced IMX_DRAM_RETENTION parameter to >> +configure it. The parameter is added to all i.MX8M variants, but only >> +for i.MX8MQ, we disable it by default, as that's the one that currently >> +has binary size problems. >> + >> +Change-Id: I714f8ea96f18154db02390ba500f4a2dc5329ee7 >> +Fixes: dd108c3c1fe3 ("feat(imx8mq): add the dram retention support for >> imx8mq") +Signed-off-by: Ahmad Fatoum >> +--- >> + plat/imx/common/include/imx_sip_svc.h | 8 ++++++++ >> + plat/imx/imx8m/imx8mm/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/imx8mn/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/imx8mp/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/imx8mq/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/include/dram.h | 8 +++++++- >> + 6 files changed, 47 insertions(+), 5 deletions(-) >> + >> +diff --git a/plat/imx/common/include/imx_sip_svc.h >> b/plat/imx/common/include/imx_sip_svc.h +index 0e91c7174a52..5015eb6a1f11 >> 100644 >> +--- a/plat/imx/common/include/imx_sip_svc.h >> ++++ b/plat/imx/common/include/imx_sip_svc.h >> +@@ -57,8 +57,16 @@ int imx_soc_info_handler(uint32_t smc_fid, u_register_t >> x1, + u_register_t x2, u_register_t x3); >> + int imx_gpc_handler(uint32_t smc_fid, u_register_t x1, >> + u_register_t x2, u_register_t x3); >> ++#if IMX_DRAM_RETENTION >> + int dram_dvfs_handler(uint32_t smc_fid, void *handle, >> + u_register_t x1, u_register_t x2, u_register_t x3); >> ++#else >> ++static inline int dram_dvfs_handler(uint32_t smc_fid, void *handle, >> ++ u_register_t x1, u_register_t x2, u_register_t x3) >> ++{ >> ++ SMC_RET1(handle, SMC_UNK); >> ++} >> ++#endif >> + #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/imx8mm/platform.mk >> b/plat/imx/imx8m/imx8mm/platform.mk +index 97f4f248824d..849ae5e4ca36 >> 100644 >> +--- a/plat/imx/imx8m/imx8mm/platform.mk >> ++++ b/plat/imx/imx8m/imx8mm/platform.mk >> +@@ -52,7 +52,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> + ${XLAT_TABLES_LIB_SRCS} > \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} >> + >> + ifeq (${NEED_BL2},yes) >> +@@ -153,6 +152,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 1 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0xbe000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/imx8mn/platform.mk >> b/plat/imx/imx8m/imx8mn/platform.mk +index e0826e29a88c..94d31a2681aa >> 100644 >> +--- a/plat/imx/imx8m/imx8mn/platform.mk >> ++++ b/plat/imx/imx8m/imx8mn/platform.mk >> +@@ -46,7 +46,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/arm/tzc/tzc380.c > \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} > \ >> + ${XLAT_TABLES_LIB_SRCS} >> + >> +@@ -59,6 +58,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 1 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0xbe000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/imx8mp/platform.mk >> b/plat/imx/imx8m/imx8mp/platform.mk +index ce6907195152..1f699c4f26f0 >> 100644 >> +--- a/plat/imx/imx8m/imx8mp/platform.mk >> ++++ b/plat/imx/imx8m/imx8mp/platform.mk >> +@@ -47,7 +47,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/arm/tzc/tzc380.c > \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} > \ >> + ${XLAT_TABLES_LIB_SRCS} >> + >> +@@ -150,6 +149,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 1 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0x56000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk +index b1c189fa09f5..b48449725791 >> 100644 >> +--- a/plat/imx/imx8m/imx8mq/platform.mk >> ++++ b/plat/imx/imx8m/imx8mq/platform.mk >> +@@ -42,7 +42,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> + ${XLAT_TABLES_LIB_SRCS} > \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} >> + >> + ENABLE_PIE := 1 >> +@@ -55,6 +54,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 0 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0xfe000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/include/dram.h b/plat/imx/imx8m/include/dram.h >> +index 719c39063778..1cf0666e9cad 100644 >> +--- a/plat/imx/imx8m/include/dram.h >> ++++ b/plat/imx/imx8m/include/dram.h >> +@@ -70,13 +70,19 @@ struct dram_info { >> + >> + extern struct dram_info dram_info; >> + >> +-void dram_info_init(unsigned long dram_timing_base); >> + void dram_umctl2_init(struct dram_timing_info *timing); >> + void dram_phy_init(struct dram_timing_info *timing); >> + >> + /* dram retention */ >> ++#if IMX_DRAM_RETENTION >> ++void dram_info_init(unsigned long dram_timing_base); >> + void dram_enter_retention(void); >> + void dram_exit_retention(void); >> ++#else >> ++static inline void dram_info_init(unsigned long dram_timing_base) {} >> ++static inline void dram_enter_retention(void) {} >> ++static inline void dram_exit_retention(void) {} >> ++#endif >> + >> + void dram_clock_switch(unsigned int target_drate, bool bypass_mode); >> + >> diff --git >> a/patches/tf-a-v2.10/0001-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as >> -BL.patch >> b/patches/tf-a-v2.10/0001-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as >> -BL.patch new file mode 100644 >> index 000000000000..745e171b40e3 >> --- /dev/null >> +++ >> b/patches/tf-a-v2.10/0001-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as >> -BL.patch @@ -0,0 +1,61 @@ >> +From 44f35b67ee4f89b05408ecfe7b4b2c1ae5366b72 Mon Sep 17 00:00:00 2001 >> +From: Ahmad Fatoum >> +Date: Tue, 12 Mar 2024 18:36:46 +0100 >> +Subject: [PATCH 1/3] fix(pmu): fix breakage on ARMv7 CPUs with SP_min as >> BL32 + >> +While comments introduced with the original commit claim that >> +pmuv3_disable_el3()/pmuv3_init_el3() are compatible with PMUv2 and >> +PMUv1, this is not true in practice: The function accesses the Secure >> +Debug Control Register (SDCR), which only available to ARMv8 CPUs. >> + >> +ARMv8 CPUs executing in AArch32 mode would thus be able to disable >> +their PMUv3, while ARMv7 CPUs would hang trying to access the SDCR. >> + >> +Fix this by only doing PMUv3 handling when we know a PMUv3 to be >> +available. This resolves boot hanging on all STM32MP15 platforms >> +that use SP_min as BL32 instead of OP-TEE. >> + >> +Change-Id: I40f7611cf46b89a30243cc55bf55a8d9c9de93c8 >> +Fixes: c73686a11cea ("feat(pmu): introduce pmuv3 lib/extensions folder") >> +Signed-off-by: Ahmad Fatoum >> +--- >> + lib/el3_runtime/aarch32/context_mgmt.c | 7 ++----- >> + lib/extensions/pmuv3/aarch32/pmuv3.c | 4 ---- >> + 2 files changed, 2 insertions(+), 9 deletions(-) >> + >> +diff --git a/lib/el3_runtime/aarch32/context_mgmt.c >> b/lib/el3_runtime/aarch32/context_mgmt.c +index b60b8e0f05d0..72af43d3dcb0 >> 100644 >> +--- a/lib/el3_runtime/aarch32/context_mgmt.c >> ++++ b/lib/el3_runtime/aarch32/context_mgmt.c >> +@@ -149,11 +149,8 @@ static void enable_extensions_nonsecure(bool >> el2_unused) + trf_init_el3(); >> + } >> + >> +- /* >> +- * Also applies to PMU < v3. The PMU is only disabled for EL3 and > Secure >> +- * state execution. This does not affect lower NS ELs. >> +- */ >> +- pmuv3_init_el3(); >> ++ if (read_feat_pmuv3_id_field() >= 3) >> ++ pmuv3_init_el3(); >> + #endif /* IMAGE_BL32 */ >> + } >> + >> +diff --git a/lib/extensions/pmuv3/aarch32/pmuv3.c >> b/lib/extensions/pmuv3/aarch32/pmuv3.c +index effb7e02dc29..456a48efb0fb >> 100644 >> +--- a/lib/extensions/pmuv3/aarch32/pmuv3.c >> ++++ b/lib/extensions/pmuv3/aarch32/pmuv3.c >> +@@ -25,10 +25,6 @@ static u_register_t mtpmu_disable_el3(u_register_t sdcr) >> + return sdcr; >> + } >> + >> +-/* >> +- * Applies to all PMU versions. Name is PMUv3 for compatibility with >> aarch64 and +- * to not clash with platforms which reuse the PMU name >> +- */ >> + void pmuv3_init_el3(void) >> + { >> + u_register_t sdcr = read_sdcr(); >> +-- >> +2.39.2 >> + >> diff --git >> a/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-ru >> nti.patch >> b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-ru >> nti.patch new file mode 100644 >> index 000000000000..c48833730753 >> --- /dev/null >> +++ >> b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-ru >> nti.patch @@ -0,0 +1,69 @@ >> +From aeb68be64c5c47142de3c95a8961749f7b33030a Mon Sep 17 00:00:00 2001 >> +From: Ahmad Fatoum >> +Date: Wed, 13 Mar 2024 02:08:54 +0100 >> +Subject: [PATCH 2/3] feat(imx8mq): detect console base address during >> runtime + >> +Change-Id: I9ba70f7068e762da979bd103390fa006c3a5d480 >> +--- >> + plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 8 +++++++- >> + plat/imx/imx8m/imx8mq/platform.mk | 4 ++++ >> + 2 files changed, 11 insertions(+), 1 deletion(-) >> + >> +diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +index >> 7065a658614f..70c2def7d18b 100644 >> +--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> ++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> +@@ -26,6 +26,7 @@ >> + #include >> + #include >> + #include >> ++#include >> + #include >> + >> + #define TRUSTY_PARAMS_LEN_BYTES (4096*2) >> +@@ -145,6 +146,7 @@ static void bl31_tz380_setup(void) >> + void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> + u_register_t arg2, u_register_t arg3) >> + { >> ++ unsigned int console_base = IMX_BOOT_UART_BASE; >> + static console_t console; >> + int i; >> + /* enable CSU NS access permission */ >> +@@ -154,7 +156,11 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, + >> + imx_aipstz_init(aipstz); >> + >> +- console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> ++ if (console_base == 0U) { >> ++ console_base = imx8m_uart_get_base(); >> ++ } >> ++ >> ++ console_imx_uart_register(console_base, IMX_BOOT_UART_CLK_IN_HZ, >> + IMX_CONSOLE_BAUDRATE, &console); >> + /* This console is only used for boot stage */ >> + console_set_scope(&console, CONSOLE_FLAG_BOOT); >> +diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk +index b1c189fa09f5..648159eb3d10 >> 100644 >> +--- a/plat/imx/imx8m/imx8mq/platform.mk >> ++++ b/plat/imx/imx8m/imx8mq/platform.mk >> +@@ -31,6 +31,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + plat/imx/imx8m/gpc_common.c > \ >> + plat/imx/imx8m/imx_aipstz.c > \ >> + plat/imx/imx8m/imx8m_caam.c > \ >> ++ plat/imx/imx8m/imx8m_ccm.c > \ >> + plat/imx/imx8m/imx8m_psci_common.c > \ >> + plat/imx/imx8m/imx8mq/gpc.c > \ >> + plat/imx/common/imx8_topology.c > \ >> +@@ -62,6 +63,9 @@ BL32_SIZE ?= 0x2000000 >> + $(eval $(call add_define,BL32_SIZE)) >> + >> + IMX_BOOT_UART_BASE ?= 0x30860000 >> ++ifeq (${IMX_BOOT_UART_BASE},auto) >> ++ override IMX_BOOT_UART_BASE := 0 >> ++endif >> + $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> + >> + ifeq (${SPD},trusty) >> +-- >> +2.39.2 >> + >> diff --git >> a/patches/tf-a-v2.10/0003-imx-disable-DRAM-retention-by-default.patch >> b/patches/tf-a-v2.10/0003-imx-disable-DRAM-retention-by-default.patch new >> file mode 100644 >> index 000000000000..7d2b36119599 >> --- /dev/null >> +++ b/patches/tf-a-v2.10/0003-imx-disable-DRAM-retention-by-default.patch >> @@ -0,0 +1,174 @@ >> +From 5d2f3f48a66a1f3f90d35679920832569100ed35 Mon Sep 17 00:00:00 2001 >> +From: Ahmad Fatoum >> +Date: Wed, 13 Mar 2024 08:08:13 +0100 >> +Subject: [PATCH 3/3] imx: disable DRAM retention by default >> + >> +Building the default upstream configuration is no longer possible >> + >> +Change-Id: I714f8ea96f18154db02390ba500f4a2dc5329ee7 >> +--- >> + plat/imx/common/include/imx_sip_svc.h | 8 ++++++++ >> + plat/imx/imx8m/imx8mm/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/imx8mn/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/imx8mp/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/imx8mq/platform.mk | 9 ++++++++- >> + plat/imx/imx8m/include/dram.h | 8 +++++++- >> + 6 files changed, 47 insertions(+), 5 deletions(-) >> + >> +diff --git a/plat/imx/common/include/imx_sip_svc.h >> b/plat/imx/common/include/imx_sip_svc.h +index 0e91c7174a52..5015eb6a1f11 >> 100644 >> +--- a/plat/imx/common/include/imx_sip_svc.h >> ++++ b/plat/imx/common/include/imx_sip_svc.h >> +@@ -57,8 +57,16 @@ int imx_soc_info_handler(uint32_t smc_fid, u_register_t >> x1, + u_register_t x2, u_register_t x3); >> + int imx_gpc_handler(uint32_t smc_fid, u_register_t x1, >> + u_register_t x2, u_register_t x3); >> ++#if IMX_DRAM_RETENTION >> + int dram_dvfs_handler(uint32_t smc_fid, void *handle, >> + u_register_t x1, u_register_t x2, u_register_t x3); >> ++#else >> ++static inline int dram_dvfs_handler(uint32_t smc_fid, void *handle, >> ++ u_register_t x1, u_register_t x2, u_register_t x3) >> ++{ >> ++ SMC_RET1(handle, SMC_UNK); >> ++} >> ++#endif >> + #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/imx8mm/platform.mk >> b/plat/imx/imx8m/imx8mm/platform.mk +index 97f4f248824d..849ae5e4ca36 >> 100644 >> +--- a/plat/imx/imx8m/imx8mm/platform.mk >> ++++ b/plat/imx/imx8m/imx8mm/platform.mk >> +@@ -52,7 +52,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> + ${XLAT_TABLES_LIB_SRCS} > \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} >> + >> + ifeq (${NEED_BL2},yes) >> +@@ -153,6 +152,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 1 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0xbe000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/imx8mn/platform.mk >> b/plat/imx/imx8m/imx8mn/platform.mk +index e0826e29a88c..94d31a2681aa >> 100644 >> +--- a/plat/imx/imx8m/imx8mn/platform.mk >> ++++ b/plat/imx/imx8m/imx8mn/platform.mk >> +@@ -46,7 +46,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/arm/tzc/tzc380.c > \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} > \ >> + ${XLAT_TABLES_LIB_SRCS} >> + >> +@@ -59,6 +58,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 1 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0xbe000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/imx8mp/platform.mk >> b/plat/imx/imx8m/imx8mp/platform.mk +index ce6907195152..1f699c4f26f0 >> 100644 >> +--- a/plat/imx/imx8m/imx8mp/platform.mk >> ++++ b/plat/imx/imx8m/imx8mp/platform.mk >> +@@ -47,7 +47,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/arm/tzc/tzc380.c > \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} > \ >> + ${XLAT_TABLES_LIB_SRCS} >> + >> +@@ -150,6 +149,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 1 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0x56000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk +index 648159eb3d10..f61620bd4224 >> 100644 >> +--- a/plat/imx/imx8m/imx8mq/platform.mk >> ++++ b/plat/imx/imx8m/imx8mq/platform.mk >> +@@ -43,7 +43,6 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + drivers/delay_timer/delay_timer.c > \ >> + drivers/delay_timer/ > generic_delay_timer.c \ >> + ${XLAT_TABLES_LIB_SRCS} > \ >> +- ${IMX_DRAM_SOURCES} > \ >> + ${IMX_GIC_SOURCES} >> + >> + ENABLE_PIE := 1 >> +@@ -56,6 +55,14 @@ ERRATA_A53_835769 := 1 >> + ERRATA_A53_843419 := 1 >> + ERRATA_A53_855873 := 1 >> + >> ++IMX_DRAM_RETENTION ?= 0 >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) >> ++ >> ++ifeq (${IMX_DRAM_RETENTION},1) >> ++BL31_SOURCES += ${IMX_DRAM_SOURCES} >> ++endif >> ++ >> + BL32_BASE ?= 0xfe000000 >> + $(eval $(call add_define,BL32_BASE)) >> + >> +diff --git a/plat/imx/imx8m/include/dram.h b/plat/imx/imx8m/include/dram.h >> +index 719c39063778..1cf0666e9cad 100644 >> +--- a/plat/imx/imx8m/include/dram.h >> ++++ b/plat/imx/imx8m/include/dram.h >> +@@ -70,13 +70,19 @@ struct dram_info { >> + >> + extern struct dram_info dram_info; >> + >> +-void dram_info_init(unsigned long dram_timing_base); >> + void dram_umctl2_init(struct dram_timing_info *timing); >> + void dram_phy_init(struct dram_timing_info *timing); >> + >> + /* dram retention */ >> ++#if IMX_DRAM_RETENTION >> ++void dram_info_init(unsigned long dram_timing_base); >> + void dram_enter_retention(void); >> + void dram_exit_retention(void); >> ++#else >> ++static inline void dram_info_init(unsigned long dram_timing_base) {} >> ++static inline void dram_enter_retention(void) {} >> ++static inline void dram_exit_retention(void) {} >> ++#endif >> + >> + void dram_clock_switch(unsigned int target_drate, bool bypass_mode); >> + >> +-- >> +2.39.2 >> + >> diff --git >> a/patches/tf-a-v2.10/0101-feat-imx8mq-detect-console-base-address-during-ru >> nti.patch >> b/patches/tf-a-v2.10/0101-feat-imx8mq-detect-console-base-address-during-ru >> nti.patch new file mode 100644 >> index 000000000000..d375a45c1598 >> --- /dev/null >> +++ >> b/patches/tf-a-v2.10/0101-feat-imx8mq-detect-console-base-address-during-ru >> nti.patch @@ -0,0 +1,72 @@ >> +From: Ahmad Fatoum >> +Date: Wed, 13 Mar 2024 02:08:54 +0100 >> +Subject: [PATCH] feat(imx8mq): detect console base address during runtime >> + >> +On the i.MX8M SoCs, TF-A doesn't itself initialize the UART, but depends >> +on BL2 to set it up beforehand. To allow using the same TF-A binary on >> +boards with different UART assignment, TF-A On i.MX8M M/N/P supports >> +dynamically determining the UART in use. The code is also applicable to >> +the i.MX8MQ, so enable it there too. >> + >> +Change-Id: I9ba70f7068e762da979bd103390fa006c3a5d480 >> +Signed-off-by: Ahmad Fatoum >> +--- >> + plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 8 +++++++- >> + plat/imx/imx8m/imx8mq/platform.mk | 4 ++++ >> + 2 files changed, 11 insertions(+), 1 deletion(-) >> + >> +diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +index >> 7065a658614f..70c2def7d18b 100644 >> +--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> ++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> +@@ -26,6 +26,7 @@ >> + #include >> + #include >> + #include >> ++#include >> + #include >> + >> + #define TRUSTY_PARAMS_LEN_BYTES (4096*2) >> +@@ -145,6 +146,7 @@ static void bl31_tz380_setup(void) >> + void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> + u_register_t arg2, u_register_t arg3) >> + { >> ++ unsigned int console_base = IMX_BOOT_UART_BASE; >> + static console_t console; >> + int i; >> + /* enable CSU NS access permission */ >> +@@ -154,7 +156,11 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, + >> + imx_aipstz_init(aipstz); >> + >> +- console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> ++ if (console_base == 0U) { >> ++ console_base = imx8m_uart_get_base(); >> ++ } >> ++ >> ++ console_imx_uart_register(console_base, IMX_BOOT_UART_CLK_IN_HZ, >> + IMX_CONSOLE_BAUDRATE, &console); >> + /* This console is only used for boot stage */ >> + console_set_scope(&console, CONSOLE_FLAG_BOOT); >> +diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk +index b48449725791..f61620bd4224 >> 100644 >> +--- a/plat/imx/imx8m/imx8mq/platform.mk >> ++++ b/plat/imx/imx8m/imx8mq/platform.mk >> +@@ -31,6 +31,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> + plat/imx/imx8m/gpc_common.c > \ >> + plat/imx/imx8m/imx_aipstz.c > \ >> + plat/imx/imx8m/imx8m_caam.c > \ >> ++ plat/imx/imx8m/imx8m_ccm.c > \ >> + plat/imx/imx8m/imx8m_psci_common.c > \ >> + plat/imx/imx8m/imx8mq/gpc.c > \ >> + plat/imx/common/imx8_topology.c > \ >> +@@ -69,6 +70,9 @@ BL32_SIZE ?= 0x2000000 >> + $(eval $(call add_define,BL32_SIZE)) >> + >> + IMX_BOOT_UART_BASE ?= 0x30860000 >> ++ifeq (${IMX_BOOT_UART_BASE},auto) >> ++ override IMX_BOOT_UART_BASE := 0 >> ++endif >> + $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> + >> + ifeq (${SPD},trusty) >> diff --git >> a/patches/tf-a-v2.10/0201-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as >> -BL.patch >> b/patches/tf-a-v2.10/0201-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as >> -BL.patch new file mode 100644 >> index 000000000000..60abc4862d7c >> --- /dev/null >> +++ >> b/patches/tf-a-v2.10/0201-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as >> -BL.patch @@ -0,0 +1,57 @@ >> +From: Ahmad Fatoum >> +Date: Tue, 12 Mar 2024 18:36:46 +0100 >> +Subject: [PATCH] fix(pmu): fix breakage on ARMv7 CPUs with SP_min as BL32 >> + >> +While comments introduced with the original commit claim that >> +pmuv3_disable_el3()/pmuv3_init_el3() are compatible with PMUv2 and >> +PMUv1, this is not true in practice: The function accesses the Secure >> +Debug Control Register (SDCR), which only available to ARMv8 CPUs. >> + >> +ARMv8 CPUs executing in AArch32 mode would thus be able to disable >> +their PMUv3, while ARMv7 CPUs would hang trying to access the SDCR. >> + >> +Fix this by only doing PMUv3 handling when we know a PMUv3 to be >> +available. This resolves boot hanging on all STM32MP15 platforms >> +that use SP_min as BL32 instead of OP-TEE. >> + >> +Change-Id: I40f7611cf46b89a30243cc55bf55a8d9c9de93c8 >> +Fixes: c73686a11cea ("feat(pmu): introduce pmuv3 lib/extensions folder") >> +Signed-off-by: Ahmad Fatoum >> +--- >> + lib/el3_runtime/aarch32/context_mgmt.c | 7 ++----- >> + lib/extensions/pmuv3/aarch32/pmuv3.c | 4 ---- >> + 2 files changed, 2 insertions(+), 9 deletions(-) >> + >> +diff --git a/lib/el3_runtime/aarch32/context_mgmt.c >> b/lib/el3_runtime/aarch32/context_mgmt.c +index b60b8e0f05d0..72af43d3dcb0 >> 100644 >> +--- a/lib/el3_runtime/aarch32/context_mgmt.c >> ++++ b/lib/el3_runtime/aarch32/context_mgmt.c >> +@@ -149,11 +149,8 @@ static void enable_extensions_nonsecure(bool >> el2_unused) + trf_init_el3(); >> + } >> + >> +- /* >> +- * Also applies to PMU < v3. The PMU is only disabled for EL3 and > Secure >> +- * state execution. This does not affect lower NS ELs. >> +- */ >> +- pmuv3_init_el3(); >> ++ if (read_feat_pmuv3_id_field() >= 3) >> ++ pmuv3_init_el3(); >> + #endif /* IMAGE_BL32 */ >> + } >> + >> +diff --git a/lib/extensions/pmuv3/aarch32/pmuv3.c >> b/lib/extensions/pmuv3/aarch32/pmuv3.c +index effb7e02dc29..456a48efb0fb >> 100644 >> +--- a/lib/extensions/pmuv3/aarch32/pmuv3.c >> ++++ b/lib/extensions/pmuv3/aarch32/pmuv3.c >> +@@ -25,10 +25,6 @@ static u_register_t mtpmu_disable_el3(u_register_t sdcr) >> + return sdcr; >> + } >> + >> +-/* >> +- * Applies to all PMU versions. Name is PMUv3 for compatibility with >> aarch64 and +- * to not clash with platforms which reuse the PMU name >> +- */ >> + void pmuv3_init_el3(void) >> + { >> + u_register_t sdcr = read_sdcr(); >> diff --git >> a/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit-2024 >> 031.patch >> b/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit-2024 >> 031.patch new file mode 100644 >> index 000000000000..58cbc06803cb >> --- /dev/null >> +++ >> b/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit-2024 >> 031.patch @@ -0,0 +1,21 @@ >> +From: Ahmad Fatoum >> +Date: Fri, 15 Mar 2024 21:18:29 +0100 >> +Subject: [PATCH] Release 2.10/customers/pengutronix/distrokit/20240315-1 >> + >> +--- >> + Makefile | 2 +- >> + 1 file changed, 1 insertion(+), 1 deletion(-) >> + >> +diff --git a/Makefile b/Makefile >> +index 97c3c1548a78..56556db0be78 100644 >> +--- a/Makefile >> ++++ b/Makefile >> +@@ -222,7 +222,7 @@ endif #(Debug) >> + ifeq (${BUILD_STRING},) >> + BUILD_STRING := $(shell git describe --always --dirty --tags 2> >> /dev/null) + endif >> +-VERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} >> ++VERSION_STRING := >> v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}-20240315-1 + >> + ifeq (${AARCH32_INSTRUCTION_SET},A32) >> + TF_CFLAGS_aarch32 += -marm >> diff --git a/patches/tf-a-v2.10/series b/patches/tf-a-v2.10/series >> new file mode 100644 >> index 000000000000..4dd620f0aa06 >> --- /dev/null >> +++ b/patches/tf-a-v2.10/series >> @@ -0,0 +1,19 @@ >> +# umpf-base: v2.10 >> +# umpf-name: 2.10/customers/pengutronix/distrokit >> +# umpf-version: 2.10/customers/pengutronix/distrokit/20240315-1 >> +# umpf-topic: v2.10/topic/imx8mq-size >> +# umpf-hashinfo: a972970be20be852b0d48576dfb1c233612efbdd >> +# umpf-topic-range: >> b6c0948400594e3cc4dbb5a4ef04b815d2675808..6c0660bf6047f288628c282e44b9b1b06 >> bd1d33a +0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX8MQ.patch >> +# umpf-topic: v2.10/topic/imx8mq-console >> +# umpf-hashinfo: 252b1100fb3c424e0fe1043e60414c3d7e0fa675 >> +# umpf-topic-range: >> 6c0660bf6047f288628c282e44b9b1b06bd1d33a..ec9b46be3c0c561ed61f113dc3c15085d >> bce5bf7 +0101-feat-imx8mq-detect-console-base-address-during-runti.patch >> +# umpf-topic: v2.10/topic/stm32mp1 >> +# umpf-hashinfo: 44f35b67ee4f89b05408ecfe7b4b2c1ae5366b72 >> +# umpf-topic-range: >> ec9b46be3c0c561ed61f113dc3c15085dbce5bf7..10dfac53fdfff2f98d8140863f583df47 >> 2483f1d +0201-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as-BL.patch >> +# umpf-release: 2.10/customers/pengutronix/distrokit/20240315-1 >> +# umpf-topic-range: >> 10dfac53fdfff2f98d8140863f583df472483f1d..288664026c3117bda3f8f2275e76bb97b >> e116b89 +0301-Release-2.10-customers-pengutronix-distrokit-2024031.patch >> +# umpf-end >> diff --git >> a/patches/tf-a-v2.8/0001-build-makefile-add-helper-to-detect-linker-options >> .patch >> b/patches/tf-a-v2.8/0001-build-makefile-add-helper-to-detect-linker-options >> .patch deleted file mode 100644 >> index e86f31b8858a..000000000000 >> --- >> a/patches/tf-a-v2.8/0001-build-makefile-add-helper-to-detect-linker-options >> .patch +++ /dev/null >> @@ -1,35 +0,0 @@ >> -From: Marco Felsch >> -Date: Thu, 24 Nov 2022 11:02:05 +0100 >> -Subject: [PATCH] build(makefile): add helper to detect linker options >> - >> -This is a small helper to check for possible linker options. If the >> -linker supports the requested option it is returned and if not nothing >> -will be returned, e.g.: >> - >> - TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments) >> - >> -can be called unconditional. >> - >> -Signed-off-by: Marco Felsch >> -Change-Id: I236800852ece49948ff53a0b91fddba53c8f0f95 >> ---- >> - make_helpers/build_macros.mk | 6 ++++++ >> - 1 file changed, 6 insertions(+) >> - >> -diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk >> -index 426e344941d9..7d0b0a511226 100644 >> ---- a/make_helpers/build_macros.mk >> -+++ b/make_helpers/build_macros.mk >> -@@ -86,6 +86,12 @@ define assert_numerics >> - $(foreach num,$1,$(eval $(call assert_numeric,$(num)))) >> - endef >> - >> -+# Convenience function to check for a given linker option. An call to >> -+# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the >> linker -+define ld_option >> -+ $(shell if $(LD) $(1) -v >/dev/null 2>&1; then echo $(1); fi ) >> -+endef >> -+ >> - # CREATE_SEQ is a recursive function to create sequence of numbers from 1 >> to - # $(2) and assign the sequence to $(1) >> - define CREATE_SEQ >> diff --git >> a/patches/tf-a-v2.8/0002-feat-build-add-support-for-new-binutils-versions.p >> atch >> b/patches/tf-a-v2.8/0002-feat-build-add-support-for-new-binutils-versions.p >> atch deleted file mode 100644 >> index b254a578d7d4..000000000000 >> --- >> a/patches/tf-a-v2.8/0002-feat-build-add-support-for-new-binutils-versions.p >> atch +++ /dev/null >> @@ -1,54 +0,0 @@ >> -From: Marco Felsch >> -Date: Wed, 9 Nov 2022 12:59:09 +0100 >> -Subject: [PATCH] feat(build): add support for new binutils versions >> - >> -Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces >> -of a new warning when linking the bl*.elf in the form: >> - >> - ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section >> implies executable stack - ld.bfd: NOTE: This behaviour is deprecated and >> will be removed in a future version of the linker - ld.bfd: warning: >> bl2.elf has a LOAD segment with RWX permissions - ld.bfd: warning: >> bl32.elf has a LOAD segment with RWX permissions - >> -These new warnings are enbaled by default to secure elf binaries: >> - - >> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01 >> a6e8434126b8fac7aa75107 - - >> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b >> 4500c9277a8e9d0f07e6774 - >> -Fix it in a similar way to what the Linux kernel does, see: >> -https://lore.kernel.org/all/20220810222442.2296651-1-ndesaulniers@google.co >> m/ - >> -Following the reasoning there, we set "-z noexecstack" for all linkers >> -(although LLVM's LLD defaults to it) and optional add >> ---no-warn-rwx-segments since this a ld.bfd related. >> - >> -Signed-off-by: Marco Felsch >> -Signed-off-by: Robert Schwebel >> -Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617 >> ---- >> - Makefile | 6 ++++++ >> - 1 file changed, 6 insertions(+) >> - >> -diff --git a/Makefile b/Makefile >> -index 1ddb7b84417d..1bfff716485a 100644 >> ---- a/Makefile >> -+++ b/Makefile >> -@@ -416,6 +416,8 @@ endif >> - >> - GCC_V_OUTPUT := $(shell $(CC) -v 2>&1) >> - >> -+TF_LDFLAGS += -z noexecstack >> -+ >> - # LD = armlink >> - ifneq ($(findstring armlink,$(notdir $(LD))),) >> - TF_LDFLAGS += --diag_error=warning -- > lto_level=O1 >> -@@ -451,6 +453,10 @@ TF_LDFLAGS += $ > (TF_LDFLAGS_$(ARCH)) >> - endif >> - endif >> - >> -+# With ld.bfd version 2.29 and newer new warnings are added. Skip those >> since we -+# are not loaded by a elf loader. >> -+TF_LDFLAGS += $(call ld_option, --no-warn-rwx- > segments) >> -+ >> - DTC_FLAGS += -I dts -O dtb >> - DTC_CPPFLAGS += -P -nostdinc -Iinclude -Ifdts - > undef \ >> - -x assembler-with-cpp $(DEFINES) >> diff --git >> a/patches/tf-a-v2.8/0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configurable-v >> ia.patch >> b/patches/tf-a-v2.8/0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configurable-v >> ia.patch deleted file mode 100644 >> index 958b7fda325a..000000000000 >> --- >> a/patches/tf-a-v2.8/0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configurable-v >> ia.patch +++ /dev/null >> @@ -1,41 +0,0 @@ >> -From: Lucas Stach >> -Date: Thu, 8 Dec 2022 15:54:26 +0100 >> -Subject: [PATCH] feat(imx8mq): make IMX_BOOT_UART_BASE configurable via >> build - parameter >> - >> -This aligns the i.MX8MQ build with the other i.MX8M platforms by allowing >> -to override the default IMX_BOOT_UART_BASE value via a make parameter. >> - >> -Signed-off-by: Lucas Stach >> -Change-Id: Iad9b844517209fc7d051c61767f71ac9fa2b55c7 >> ---- >> - plat/imx/imx8m/imx8mq/include/platform_def.h | 1 - >> - plat/imx/imx8m/imx8mq/platform.mk | 3 +++ >> - 2 files changed, 3 insertions(+), 1 deletion(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/include/platform_def.h >> b/plat/imx/imx8m/imx8mq/include/platform_def.h -index >> 1dd22d952305..4671cd3afa40 100644 >> ---- a/plat/imx/imx8m/imx8mq/include/platform_def.h >> -+++ b/plat/imx/imx8m/imx8mq/include/platform_def.h >> -@@ -54,7 +54,6 @@ >> - >> - #define HAB_RVT_BASE U(0x00000880) /* > HAB_RVT for i.MX8MQ */ >> - >> --#define IMX_BOOT_UART_BASE U(0x30860000) >> - #define IMX_BOOT_UART_CLK_IN_HZ 25000000 /* Select > 25Mhz oscillator */ >> - #define PLAT_CRASH_UART_BASE IMX_BOOT_UART_BASE >> - #define PLAT_CRASH_UART_CLK_IN_HZ 25000000 >> -diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk -index 7b6df920c924..f62d3aa5be15 >> 100644 >> ---- a/plat/imx/imx8m/imx8mq/platform.mk >> -+++ b/plat/imx/imx8m/imx8mq/platform.mk >> -@@ -52,6 +52,9 @@ $(eval $(call add_define,BL32_BASE)) >> - BL32_SIZE ?= 0x2000000 >> - $(eval $(call add_define,BL32_SIZE)) >> - >> -+IMX_BOOT_UART_BASE ?= 0x30860000 >> -+$(eval $(call add_define,IMX_BOOT_UART_BASE)) >> -+ >> - ifeq (${SPD},trusty) >> - BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1 >> - endif >> diff --git >> a/patches/tf-a-v2.8/0102-feat-imx8mq-remove-empty-bl31_plat_runtime_setup.p >> atch >> b/patches/tf-a-v2.8/0102-feat-imx8mq-remove-empty-bl31_plat_runtime_setup.p >> atch deleted file mode 100644 >> index 0b1bc7e8c82b..000000000000 >> --- >> a/patches/tf-a-v2.8/0102-feat-imx8mq-remove-empty-bl31_plat_runtime_setup.p >> atch +++ /dev/null >> @@ -1,30 +0,0 @@ >> -From: Lucas Stach >> -Date: Thu, 8 Dec 2022 17:51:17 +0100 >> -Subject: [PATCH] feat(imx8mq): remove empty bl31_plat_runtime_setup >> - >> -Having this empty definition is actively harmful, as it prevents the >> -default weak function to be used, which does a switch of the console >> -state. >> - >> -Signed-off-by: Lucas Stach >> -Change-Id: I3b78e0c524c4907714036dba573a44d8f9c48b09 >> ---- >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 5 ----- >> - 1 file changed, 5 deletions(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> 59c3779abb7f..0feb6d7fbad2 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -227,11 +227,6 @@ unsigned int plat_get_syscnt_freq2(void) >> - return COUNTER_FREQUENCY; >> - } >> - >> --void bl31_plat_runtime_setup(void) >> --{ >> -- return; >> --} >> -- >> - #ifdef SPD_trusty >> - void plat_trusty_set_boot_args(aapcs64_params_t *args) >> - { >> diff --git a/patches/tf-a-v2.8/0103-feat-imx8mq-always-set-up-console.patch >> b/patches/tf-a-v2.8/0103-feat-imx8mq-always-set-up-console.patch deleted >> file mode 100644 >> index 3a44ae3a149d..000000000000 >> --- a/patches/tf-a-v2.8/0103-feat-imx8mq-always-set-up-console.patch >> +++ /dev/null >> @@ -1,51 +0,0 @@ >> -From: Lucas Stach >> -Date: Thu, 8 Dec 2022 16:00:04 +0100 >> -Subject: [PATCH] feat(imx8mq): always set up console >> - >> -This aligns the i.MX8MQ platform behaviour with the other i.MX8M* >> -platforms by always setting up the console UART. >> - >> -Signed-off-by: Lucas Stach >> -Change-Id: I1279d9cb4feb6e789422b9844cab711b8daae74e >> ---- >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 7 +++---- >> - plat/imx/imx8m/imx8mq/include/platform_def.h | 1 - >> - 2 files changed, 3 insertions(+), 5 deletions(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> 0feb6d7fbad2..0972c35e9554 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -124,6 +124,7 @@ static void bl31_tz380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -+ static console_t console; >> - int i; >> - /* enable CSU NS access permission */ >> - for (i = 0; i < 64; i++) { >> -@@ -132,12 +133,10 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - >> - imx_aipstz_init(aipstz); >> - >> --#if DEBUG_CONSOLE >> -- static console_t console; >> -- >> - console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> - IMX_CONSOLE_BAUDRATE, &console); >> --#endif >> -+ /* This console is only used for boot stage */ >> -+ console_set_scope(&console, CONSOLE_FLAG_BOOT); >> - >> - imx8m_caam_init(); >> - >> -diff --git a/plat/imx/imx8m/imx8mq/include/platform_def.h >> b/plat/imx/imx8m/imx8mq/include/platform_def.h -index >> 4671cd3afa40..103f2e4087e2 100644 >> ---- a/plat/imx/imx8m/imx8mq/include/platform_def.h >> -+++ b/plat/imx/imx8m/imx8mq/include/platform_def.h >> -@@ -127,5 +127,4 @@ >> - >> - #define COUNTER_FREQUENCY 8333333 /* 25MHz / 3 */ >> - >> --#define DEBUG_CONSOLE 0 >> - #define IMX_WDOG_B_RESET >> diff --git >> a/patches/tf-a-v2.8/0104-refactor-imx8mq-make-use-of-setup_page_tables.patc >> h >> b/patches/tf-a-v2.8/0104-refactor-imx8mq-make-use-of-setup_page_tables.patc >> h deleted file mode 100644 >> index 6cf2dc18deb2..000000000000 >> --- >> a/patches/tf-a-v2.8/0104-refactor-imx8mq-make-use-of-setup_page_tables.patc >> h +++ /dev/null >> @@ -1,53 +0,0 @@ >> -From: Lucas Stach >> -Date: Thu, 8 Dec 2022 16:35:11 +0100 >> -Subject: [PATCH] refactor(imx8mq): make use of setup_page_tables() >> - >> -Improve code readability and align with other i.MX8M* platforms. >> - >> -Signed-off-by: Lucas Stach >> -Change-Id: Ifd29b74872e3a567288d208de4827403078164e9 >> ---- >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 28 >> +++++++++++++--------------- - 1 file changed, 13 insertions(+), 15 >> deletions(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> 0972c35e9554..c7eddf430197 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -175,23 +175,21 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - >> - void bl31_plat_arch_setup(void) >> - { >> -- mmap_add_region(BL31_BASE, BL31_BASE, (BL31_LIMIT - BL31_BASE), >> -- MT_MEMORY | MT_RW | MT_SECURE); >> -- mmap_add_region(BL_CODE_BASE, BL_CODE_BASE, (BL_CODE_END - > BL_CODE_BASE), >> -- MT_MEMORY | MT_RO | MT_SECURE); >> -- >> -- /* Map TEE memory */ >> -- mmap_add_region(BL32_BASE, BL32_BASE, BL32_SIZE, MT_MEMORY | > MT_RW); >> -- >> -- mmap_add(imx_mmap); >> -- >> -+ const mmap_region_t bl_regions[] = { >> -+ MAP_REGION_FLAT(BL31_BASE, BL31_LIMIT - BL31_BASE, >> -+ 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 USE_COHERENT_MEM >> -- mmap_add_region(BL_COHERENT_RAM_BASE, BL_COHERENT_RAM_BASE, >> -- BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE, >> -- MT_DEVICE | MT_RW | MT_SECURE); >> -+ MAP_REGION_FLAT(BL_COHERENT_RAM_BASE, >> -+ BL_COHERENT_RAM_END - > BL_COHERENT_RAM_BASE, >> -+ MT_DEVICE | MT_RW | MT_SECURE), >> - #endif >> -- /* setup xlat table */ >> -- init_xlat_tables(); >> -+ MAP_REGION_FLAT(BL32_BASE, BL32_SIZE, MT_MEMORY | > MT_RW), >> -+ {0}, >> -+ }; >> -+ >> -+ setup_page_tables(bl_regions, imx_mmap); >> - /* enable the MMU */ >> - enable_mmu_el3(0); >> - } >> diff --git >> a/patches/tf-a-v2.8/0105-refactor-imx8mq-introduce-BL31_SIZE.patch >> b/patches/tf-a-v2.8/0105-refactor-imx8mq-introduce-BL31_SIZE.patch deleted >> file mode 100644 >> index 960d7265cc08..000000000000 >> --- a/patches/tf-a-v2.8/0105-refactor-imx8mq-introduce-BL31_SIZE.patch >> +++ /dev/null >> @@ -1,54 +0,0 @@ >> -From: Lucas Stach >> -Date: Thu, 8 Dec 2022 16:37:44 +0100 >> -Subject: [PATCH] refactor(imx8mq): introduce BL31_SIZE >> - >> -No functional change. >> - >> -Introduce BL31_SIZE define and calculate the limits based on the >> -BL31_BASE and the BL31_SIZE define. Also make use of SZ_64K to make it >> -easier to read. This is required for later BL31 PIE support since it >> -drops the calculation based on the BL31_LIMIT and BL31_BASE. >> - >> -Signed-off-by: Lucas Stach >> -Change-Id: I517074b866b5bf11841b51777f87c926b304488d >> ---- >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 2 +- >> - plat/imx/imx8m/imx8mq/include/platform_def.h | 5 ++++- >> - 2 files changed, 5 insertions(+), 2 deletions(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> c7eddf430197..bbdb4d899a39 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -176,7 +176,7 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - void bl31_plat_arch_setup(void) >> - { >> - const mmap_region_t bl_regions[] = { >> -- MAP_REGION_FLAT(BL31_BASE, BL31_LIMIT - BL31_BASE, >> -+ MAP_REGION_FLAT(BL31_BASE, BL31_SIZE, >> - MT_MEMORY | MT_RW | MT_SECURE), >> - MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - > BL_CODE_BASE, >> - MT_MEMORY | MT_RO | MT_SECURE), >> -diff --git a/plat/imx/imx8m/imx8mq/include/platform_def.h >> b/plat/imx/imx8m/imx8mq/include/platform_def.h -index >> 103f2e4087e2..bb570748f573 100644 >> ---- a/plat/imx/imx8m/imx8mq/include/platform_def.h >> -+++ b/plat/imx/imx8m/imx8mq/include/platform_def.h >> -@@ -4,6 +4,8 @@ >> - * SPDX-License-Identifier: BSD-3-Clause >> - */ >> - >> -+#include >> -+ >> - #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" >> - #define PLATFORM_LINKER_ARCH aarch64 >> - >> -@@ -31,7 +33,8 @@ >> - #define PLAT_STOP_OFF_STATE U(3) >> - >> - #define BL31_BASE U(0x910000) >> --#define BL31_LIMIT U(0x920000) >> -+#define BL31_SIZE SZ_64K >> -+#define BL31_LIMIT (BL31_BASE + BL31_SIZE) >> - >> - /* non-secure uboot base */ >> - #define PLAT_NS_IMAGE_OFFSET U(0x40200000) >> diff --git a/patches/tf-a-v2.8/0106-feat-imx8mq-add-BL31-PIE-support.patch >> b/patches/tf-a-v2.8/0106-feat-imx8mq-add-BL31-PIE-support.patch deleted >> file mode 100644 >> index 25d2aaae70fd..000000000000 >> --- a/patches/tf-a-v2.8/0106-feat-imx8mq-add-BL31-PIE-support.patch >> +++ /dev/null >> @@ -1,55 +0,0 @@ >> -From: Lucas Stach >> -Date: Thu, 8 Dec 2022 16:44:00 +0100 >> -Subject: [PATCH] feat(imx8mq): add BL31 PIE support >> - >> -Enable PIE support so the BL31 firmware can be loaded from anywhere >> -within the OCRAM (SRAM). For the PIE support we only need to replace the >> -BL31_BASE define by the BL31_START symbol which is a relocatable and we >> -need to enable it by setting ENABLE_PIE := 1. >> - >> -Signed-off-by: Lucas Stach >> -Change-Id: Ie6a13e4ae0fdc6627a94798d7a86df7d5b310896 >> ---- >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 2 +- >> - plat/imx/imx8m/imx8mq/imx8mq_psci.c | 2 +- >> - plat/imx/imx8m/imx8mq/platform.mk | 1 + >> - 3 files changed, 3 insertions(+), 2 deletions(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> bbdb4d899a39..3c2d223fef21 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -176,7 +176,7 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - void bl31_plat_arch_setup(void) >> - { >> - const mmap_region_t bl_regions[] = { >> -- MAP_REGION_FLAT(BL31_BASE, BL31_SIZE, >> -+ MAP_REGION_FLAT(BL31_START, BL31_SIZE, >> - MT_MEMORY | MT_RW | MT_SECURE), >> - MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - > BL_CODE_BASE, >> - MT_MEMORY | MT_RO | MT_SECURE), >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_psci.c >> b/plat/imx/imx8m/imx8mq/imx8mq_psci.c -index 662017d6fe4a..01582afe490c >> 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_psci.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_psci.c >> -@@ -41,7 +41,7 @@ int imx_validate_power_state(unsigned int power_state, >> - >> - void imx_domain_suspend(const psci_power_state_t *target_state) >> - { >> -- uint64_t base_addr = BL31_BASE; >> -+ uint64_t base_addr = BL31_START; >> - uint64_t mpidr = read_mpidr_el1(); >> - unsigned int core_id = MPIDR_AFFLVL0_VAL(mpidr); >> - >> -diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk -index f62d3aa5be15..901a974a591e >> 100644 >> ---- a/plat/imx/imx8m/imx8mq/platform.mk >> -+++ b/plat/imx/imx8m/imx8mq/platform.mk >> -@@ -38,6 +38,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> - ${XLAT_TABLES_LIB_SRCS} > \ >> - ${IMX_GIC_SOURCES} >> - >> -+ENABLE_PIE := 1 >> - USE_COHERENT_MEM := 1 >> - RESET_TO_BL31 := 1 >> - A53_DISABLE_NON_TEMPORAL_HINT := 0 >> diff --git >> a/patches/tf-a-v2.8/0107-feat-imx8mq-add-support-for-gcc-12.x.patch >> b/patches/tf-a-v2.8/0107-feat-imx8mq-add-support-for-gcc-12.x.patch deleted >> file mode 100644 >> index 24a5b80ca473..000000000000 >> --- a/patches/tf-a-v2.8/0107-feat-imx8mq-add-support-for-gcc-12.x.patch >> +++ /dev/null >> @@ -1,45 +0,0 @@ >> -From: Marco Felsch >> -Date: Fri, 10 Feb 2023 12:14:26 +0100 >> -Subject: [PATCH] feat(imx8mq): add support for gcc >= 12.x >> - >> -Starting with GCC >= 12.x the -Wall option includes -Werror=array-bounds >> -checks. Per default GCC threads all memory accesses below 4096 as NULL, >> -so access to ROMAPI causes the following warning: >> - >> -In file included from plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:20: >> -In function 'mmio_read_8', >> - inlined from 'imx8mq_soc_info_init' at >> plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:70:16, - inlined from >> 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:206:2: >> -include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds >> of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} >> [-Werror=array-bounds] - 19 | return *(volatile uint8_t*)addr; >> - | ^~~~~~~~~~~~~~~~~~~~~~~~ >> -In function 'mmio_read_8', >> - inlined from 'imx8mq_soc_info_init' at >> plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:74:16, - inlined from >> 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:206:2: >> -include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds >> of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} >> [-Werror=array-bounds] - 19 | return *(volatile uint8_t*)addr; >> - | ^~~~~~~~~~~~~~~~~~~~~~~~ >> -cc1: all warnings being treated as errors >> - >> -Fix this by setting the default min-pagesize to 0 instead of 4096, so >> -the ROMAPI access will not trigger the warning. Don't set this option >> -for all files since it is unkown how it affects code >> -generation/optimizations. >> - >> -Signed-off-by: Marco Felsch >> -Change-Id: Ibcca65ca69750e1a1bca3d528c80e5b445d2f90f >> ---- >> - plat/imx/imx8m/imx8mq/platform.mk | 3 +++ >> - 1 file changed, 3 insertions(+) >> - >> -diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk -index 901a974a591e..985be71725f7 >> 100644 >> ---- a/plat/imx/imx8m/imx8mq/platform.mk >> -+++ b/plat/imx/imx8m/imx8mq/platform.mk >> -@@ -59,3 +59,6 @@ $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> - ifeq (${SPD},trusty) >> - BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1 >> - endif >> -+ >> -+# Required with gcc version >= 12 >> -+$(BUILD_PLAT)/bl31/imx8mq_bl31_setup.o: CFLAGS += --param=min-pagesize=0 >> diff --git >> a/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runt >> im.patch >> b/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runt >> im.patch deleted file mode 100644 >> index 68f36aca7aa1..000000000000 >> --- >> a/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runt >> im.patch +++ /dev/null >> @@ -1,304 +0,0 @@ >> -From: Marco Felsch >> -Date: Mon, 24 Jul 2023 15:05:58 +0200 >> -Subject: [PATCH] feat(imx8m): detect console base address during runtime >> - >> -Provide a helper to detect the enabled UART device during runtime. This >> -lower the integration effort and make it more straight forward for >> -'simple' use-cases with a single UART enabled. If multiple UARTs are >> -enabled the first enabled is returned. >> - >> -The auto-detection is enabled by setting IMX_BOOT_UART_BASE=0 to keep >> -the backward compatibility. For more advanced use-cases (multiple UARTs >> -are enabled) the user still has to provide the correct base address. >> - >> -Signed-off-by: Marco Felsch >> -Change-Id: I300a167e1a10f9aa991c8d1c3efe2c6b23f56c47 >> ---- >> - plat/imx/imx8m/imx8m_ccm.c | 58 >> +++++++++++++++++++++++++++++++ - plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> | 11 +++++- >> - plat/imx/imx8m/imx8mm/platform.mk | 1 + >> - plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 11 +++++- >> - plat/imx/imx8m/imx8mn/platform.mk | 1 + >> - plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 11 +++++- >> - plat/imx/imx8m/imx8mp/platform.mk | 1 + >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 11 +++++- >> - plat/imx/imx8m/imx8mq/platform.mk | 1 + >> - plat/imx/imx8m/include/imx8m_ccm.h | 12 +++++++ >> - 10 files changed, 114 insertions(+), 4 deletions(-) >> - create mode 100644 plat/imx/imx8m/imx8m_ccm.c >> - create mode 100644 plat/imx/imx8m/include/imx8m_ccm.h >> - >> -diff --git a/plat/imx/imx8m/imx8m_ccm.c b/plat/imx/imx8m/imx8m_ccm.c >> -new file mode 100644 >> -index 000000000000..10a00c990031 >> ---- /dev/null >> -+++ b/plat/imx/imx8m/imx8m_ccm.c >> -@@ -0,0 +1,58 @@ >> -+/* >> -+ * Copyright (c) 2023, Pengutronix. All rights reserved. >> -+ * >> -+ * SPDX-License-Identifier: BSD-3-Clause >> -+ */ >> -+ >> -+#include >> -+#include >> -+ >> -+#define UCR1 0x80 >> -+#define UCR1_UARTEN BIT(0) >> -+#define DOMAIN0_RUNNING(d) (((d) & 0x3) != 0) >> -+ >> -+static struct imx_uart { >> -+ unsigned int ccm_reg; >> -+ unsigned int uart_base; >> -+} imx8m_uart_info[] = { >> -+ { /* UART 1 */ >> -+ .ccm_reg = 0x4490, >> -+ .uart_base = 0x30860000, >> -+ }, { /* UART 2 */ >> -+ .ccm_reg = 0x44a0, >> -+ .uart_base = 0x30890000, >> -+ }, { /* UART 3 */ >> -+ .ccm_reg = 0x44b0, >> -+ .uart_base = 0x30880000, >> -+ }, { /* UART 4 */ >> -+ .ccm_reg = 0x44c0, >> -+ .uart_base = 0x30a60000, >> -+ } >> -+}; >> -+ >> -+unsigned int imx8m_uart_get_base(void) >> -+{ >> -+ unsigned int i; >> -+ >> -+ for (i = 0; i < ARRAY_SIZE(imx8m_uart_info); i++) { >> -+ uint32_t val; >> -+ >> -+ /* >> -+ * At least check that the clock-gate is ungated before > we >> -+ * access the UART register. >> -+ */ >> -+ val = mmio_read_32(IMX_CCM_BASE + > imx8m_uart_info[i].ccm_reg); >> -+ if (DOMAIN0_RUNNING(val)) { >> -+ val = > mmio_read_32(imx8m_uart_info[i].uart_base + UCR1); >> -+ if (val & UCR1_UARTEN) { >> -+ return > imx8m_uart_info[i].uart_base; >> -+ } >> -+ } >> -+ } >> -+ >> -+ /* >> -+ * We should return an error and inform the user but we can't do it >> -+ * this early. >> -+ */ >> -+ return 0; >> -+} >> -diff --git a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c -index >> 67bfd3651dfe..8e6636147438 100644 >> ---- a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> -@@ -27,6 +27,7 @@ >> - #include >> - #include >> - #include >> -+#include >> - #include >> - #include >> - >> -@@ -130,6 +131,7 @@ void bl31_tzc380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -+ unsigned int console_base = 0U; >> - static console_t console; >> - int i; >> - >> -@@ -144,7 +146,14 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - >> - imx_csu_init(csu_cfg); >> - >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> -+#if IMX_BOOT_UART_BASE >> -+ console_base = IMX_BOOT_UART_BASE; >> -+#endif >> -+ if (console_base == 0U) { >> -+ console_base = imx8m_uart_get_base(); >> -+ } >> -+ >> -+ console_imx_uart_register(console_base, IMX_BOOT_UART_CLK_IN_HZ, >> - IMX_CONSOLE_BAUDRATE, &console); >> - /* This console is only used for boot stage */ >> - console_set_scope(&console, CONSOLE_FLAG_BOOT); >> -diff --git a/plat/imx/imx8m/imx8mm/platform.mk >> b/plat/imx/imx8m/imx8mm/platform.mk -index 7a42554f5739..22791fda4c2c >> 100644 >> ---- a/plat/imx/imx8m/imx8mm/platform.mk >> -+++ b/plat/imx/imx8m/imx8mm/platform.mk >> -@@ -37,6 +37,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> - plat/imx/imx8m/imx_rdc.c > \ >> - plat/imx/imx8m/imx8m_csu.c > \ >> - plat/imx/imx8m/imx8m_caam.c > \ >> -+ plat/imx/imx8m/imx8m_ccm.c > \ >> - plat/imx/imx8m/imx8m_psci_common.c > \ >> - plat/imx/imx8m/imx8mm/ > imx8mm_bl31_setup.c \ >> - plat/imx/imx8m/imx8mm/ > imx8mm_psci.c \ >> -diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c >> b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c -index >> eff198dd741c..aeb1cbf2945f 100644 >> ---- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c >> -@@ -25,6 +25,7 @@ >> - #include >> - #include >> - #include >> -+#include >> - #include >> - #include >> - #include >> -@@ -121,6 +122,7 @@ static void bl31_tzc380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -+ unsigned int console_base = 0U; >> - static console_t console; >> - unsigned int val; >> - int i; >> -@@ -141,7 +143,14 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - val = mmio_read_32(IMX_IOMUX_GPR_BASE + > 0x2c); >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); >> - >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> -+#if IMX_BOOT_UART_BASE >> -+ console_base = IMX_BOOT_UART_BASE; >> -+#endif >> -+ if (console_base == 0U) { >> -+ console_base = imx8m_uart_get_base(); >> -+ } >> -+ >> -+ console_imx_uart_register(console_base, IMX_BOOT_UART_CLK_IN_HZ, >> - IMX_CONSOLE_BAUDRATE, &console); >> - /* This console is only used for boot stage */ >> - console_set_scope(&console, CONSOLE_FLAG_BOOT); >> -diff --git a/plat/imx/imx8m/imx8mn/platform.mk >> b/plat/imx/imx8m/imx8mn/platform.mk -index 1c0ad4f3bc23..46516104f16d >> 100644 >> ---- a/plat/imx/imx8m/imx8mn/platform.mk >> -+++ b/plat/imx/imx8m/imx8mn/platform.mk >> -@@ -31,6 +31,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> - plat/imx/imx8m/imx_aipstz.c > \ >> - plat/imx/imx8m/imx_rdc.c > \ >> - plat/imx/imx8m/imx8m_caam.c > \ >> -+ plat/imx/imx8m/imx8m_ccm.c > \ >> - plat/imx/imx8m/imx8m_csu.c > \ >> - plat/imx/imx8m/imx8m_psci_common.c > \ >> - plat/imx/imx8m/imx8mn/ > imx8mn_bl31_setup.c \ >> -diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c >> b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c -index >> 4c31fa28dab7..e25668b879b3 100644 >> ---- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c >> -@@ -25,6 +25,7 @@ >> - #include >> - #include >> - #include >> -+#include >> - #include >> - #include >> - #include >> -@@ -117,6 +118,7 @@ static void bl31_tzc380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -+ unsigned int console_base = 0U; >> - static console_t console; >> - unsigned int val; >> - unsigned int i; >> -@@ -137,7 +139,14 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - val = mmio_read_32(IMX_IOMUX_GPR_BASE + > 0x2c); >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); >> - >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> -+#if IMX_BOOT_UART_BASE >> -+ console_base = IMX_BOOT_UART_BASE; >> -+#endif >> -+ if (console_base == 0U) { >> -+ console_base = imx8m_uart_get_base(); >> -+ } >> -+ >> -+ console_imx_uart_register(console_base, IMX_BOOT_UART_CLK_IN_HZ, >> - IMX_CONSOLE_BAUDRATE, &console); >> - /* This console is only used for boot stage */ >> - console_set_scope(&console, CONSOLE_FLAG_BOOT); >> -diff --git a/plat/imx/imx8m/imx8mp/platform.mk >> b/plat/imx/imx8m/imx8mp/platform.mk -index 5414c0a5732d..cdb504de0f3d >> 100644 >> ---- a/plat/imx/imx8m/imx8mp/platform.mk >> -+++ b/plat/imx/imx8m/imx8mp/platform.mk >> -@@ -32,6 +32,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> - plat/imx/imx8m/imx_aipstz.c > \ >> - plat/imx/imx8m/imx_rdc.c > \ >> - plat/imx/imx8m/imx8m_caam.c > \ >> -+ plat/imx/imx8m/imx8m_ccm.c > \ >> - plat/imx/imx8m/imx8m_csu.c > \ >> - plat/imx/imx8m/imx8m_psci_common.c > \ >> - plat/imx/imx8m/imx8mp/ > imx8mp_bl31_setup.c \ >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> 3c2d223fef21..1cb2d2a25b54 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -25,6 +25,7 @@ >> - #include >> - #include >> - #include >> -+#include >> - #include >> - >> - #define TRUSTY_PARAMS_LEN_BYTES (4096*2) >> -@@ -124,6 +125,7 @@ static void bl31_tz380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -+ unsigned int console_base = 0U; >> - static console_t console; >> - int i; >> - /* enable CSU NS access permission */ >> -@@ -133,7 +135,14 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - >> - imx_aipstz_init(aipstz); >> - >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > IMX_BOOT_UART_CLK_IN_HZ, >> -+#if IMX_BOOT_UART_BASE >> -+ console_base = IMX_BOOT_UART_BASE; >> -+#endif >> -+ if (console_base == 0U) { >> -+ console_base = imx8m_uart_get_base(); >> -+ } >> -+ >> -+ console_imx_uart_register(console_base, IMX_BOOT_UART_CLK_IN_HZ, >> - IMX_CONSOLE_BAUDRATE, &console); >> - /* This console is only used for boot stage */ >> - console_set_scope(&console, CONSOLE_FLAG_BOOT); >> -diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk -index 985be71725f7..0c34c10bdcb4 >> 100644 >> ---- a/plat/imx/imx8m/imx8mq/platform.mk >> -+++ b/plat/imx/imx8m/imx8mq/platform.mk >> -@@ -25,6 +25,7 @@ BL31_SOURCES += plat/imx/common/ > imx8_helpers.S \ >> - plat/imx/imx8m/gpc_common.c > \ >> - plat/imx/imx8m/imx_aipstz.c > \ >> - plat/imx/imx8m/imx8m_caam.c > \ >> -+ plat/imx/imx8m/imx8m_ccm.c > \ >> - plat/imx/imx8m/imx8m_psci_common.c > \ >> - plat/imx/imx8m/imx8mq/gpc.c > \ >> - plat/imx/common/imx8_topology.c > \ >> -diff --git a/plat/imx/imx8m/include/imx8m_ccm.h >> b/plat/imx/imx8m/include/imx8m_ccm.h -new file mode 100644 >> -index 000000000000..acbd135cb314 >> ---- /dev/null >> -+++ b/plat/imx/imx8m/include/imx8m_ccm.h >> -@@ -0,0 +1,12 @@ >> -+/* >> -+ * Copyright (c) 2023, Pengutronix. All rights reserved. >> -+ * >> -+ * SPDX-License-Identifier: BSD-3-Clause >> -+ */ >> -+ >> -+#ifndef IMX8M_CCM_H >> -+#define IMX8M_CCM_H >> -+ >> -+unsigned int imx8m_uart_get_base(void); >> -+ >> -+#endif /* IMX8M_CCM_H */ >> diff --git >> a/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-op >> ti.patch >> b/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-op >> ti.patch deleted file mode 100644 >> index 9fae10905edd..000000000000 >> --- >> a/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-op >> ti.patch +++ /dev/null >> @@ -1,172 +0,0 @@ >> -From: Marco Felsch >> -Date: Wed, 2 Aug 2023 08:11:35 +0200 >> -Subject: [PATCH] fix(imx8m): make IMX_BOOT_UART_BASE autodetection option >> more - obvious >> - >> -Switch from IMX_BOOT_UART_BASE=0 to IMX_BOOT_UART_BASE=auto to make it >> -more obvious that the detection is based on the runtime autodetection. >> - >> -In addition this moves the evaluation of IMX_BOOT_UART_BASE into the >> -makefile which removes the ugly conditional compilation as well. >> - >> -Signed-off-by: Marco Felsch >> -Change-Id: I92c13607bf81c6267f4b6aee829d74902b7f72d2 >> ---- >> - plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c | 5 +---- >> - plat/imx/imx8m/imx8mm/platform.mk | 3 +++ >> - plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 5 +---- >> - plat/imx/imx8m/imx8mn/platform.mk | 3 +++ >> - plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 5 +---- >> - plat/imx/imx8m/imx8mp/platform.mk | 3 +++ >> - plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 5 +---- >> - plat/imx/imx8m/imx8mq/platform.mk | 3 +++ >> - 8 files changed, 16 insertions(+), 16 deletions(-) >> - >> -diff --git a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c -index >> 8e6636147438..c8a3adf8f333 100644 >> ---- a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c >> -@@ -131,7 +131,7 @@ void bl31_tzc380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -- unsigned int console_base = 0U; >> -+ unsigned int console_base = IMX_BOOT_UART_BASE; >> - static console_t console; >> - int i; >> - >> -@@ -146,9 +146,6 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - >> - imx_csu_init(csu_cfg); >> - >> --#if IMX_BOOT_UART_BASE >> -- console_base = IMX_BOOT_UART_BASE; >> --#endif >> - if (console_base == 0U) { >> - console_base = imx8m_uart_get_base(); >> - } >> -diff --git a/plat/imx/imx8m/imx8mm/platform.mk >> b/plat/imx/imx8m/imx8mm/platform.mk -index 22791fda4c2c..1b4a1f2f37c7 >> 100644 >> ---- a/plat/imx/imx8m/imx8mm/platform.mk >> -+++ b/plat/imx/imx8m/imx8mm/platform.mk >> -@@ -159,6 +159,9 @@ BL32_SIZE ?= 0x2000000 >> - $(eval $(call add_define,BL32_SIZE)) >> - >> - IMX_BOOT_UART_BASE ?= 0x30890000 >> -+ifeq (${IMX_BOOT_UART_BASE},auto) >> -+ override IMX_BOOT_UART_BASE := 0 >> -+endif >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> - >> - EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT) >> -diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c >> b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c -index >> aeb1cbf2945f..147249ee5e56 100644 >> ---- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c >> -@@ -122,7 +122,7 @@ static void bl31_tzc380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -- unsigned int console_base = 0U; >> -+ unsigned int console_base = IMX_BOOT_UART_BASE; >> - static console_t console; >> - unsigned int val; >> - int i; >> -@@ -143,9 +143,6 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - val = mmio_read_32(IMX_IOMUX_GPR_BASE + > 0x2c); >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); >> - >> --#if IMX_BOOT_UART_BASE >> -- console_base = IMX_BOOT_UART_BASE; >> --#endif >> - if (console_base == 0U) { >> - console_base = imx8m_uart_get_base(); >> - } >> -diff --git a/plat/imx/imx8m/imx8mn/platform.mk >> b/plat/imx/imx8m/imx8mn/platform.mk -index 46516104f16d..a6b43f213506 >> 100644 >> ---- a/plat/imx/imx8m/imx8mn/platform.mk >> -+++ b/plat/imx/imx8m/imx8mn/platform.mk >> -@@ -65,6 +65,9 @@ BL32_SIZE ?= 0x2000000 >> - $(eval $(call add_define,BL32_SIZE)) >> - >> - IMX_BOOT_UART_BASE ?= 0x30890000 >> -+ifeq (${IMX_BOOT_UART_BASE},auto) >> -+ override IMX_BOOT_UART_BASE := 0 >> -+endif >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> - >> - EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT) >> -diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c >> b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c -index >> e25668b879b3..b0a41c741c17 100644 >> ---- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c >> -@@ -118,7 +118,7 @@ static void bl31_tzc380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -- unsigned int console_base = 0U; >> -+ unsigned int console_base = IMX_BOOT_UART_BASE; >> - static console_t console; >> - unsigned int val; >> - unsigned int i; >> -@@ -139,9 +139,6 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - val = mmio_read_32(IMX_IOMUX_GPR_BASE + > 0x2c); >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); >> - >> --#if IMX_BOOT_UART_BASE >> -- console_base = IMX_BOOT_UART_BASE; >> --#endif >> - if (console_base == 0U) { >> - console_base = imx8m_uart_get_base(); >> - } >> -diff --git a/plat/imx/imx8m/imx8mp/platform.mk >> b/plat/imx/imx8m/imx8mp/platform.mk -index cdb504de0f3d..0169144f4a1a >> 100644 >> ---- a/plat/imx/imx8m/imx8mp/platform.mk >> -+++ b/plat/imx/imx8m/imx8mp/platform.mk >> -@@ -156,6 +156,9 @@ BL32_SIZE ?= 0x2000000 >> - $(eval $(call add_define,BL32_SIZE)) >> - >> - IMX_BOOT_UART_BASE ?= 0x30890000 >> -+ifeq (${IMX_BOOT_UART_BASE},auto) >> -+ override IMX_BOOT_UART_BASE := 0 >> -+endif >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> - >> - EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT) >> -diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -index >> 1cb2d2a25b54..a2c81610b353 100644 >> ---- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -+++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c >> -@@ -125,7 +125,7 @@ static void bl31_tz380_setup(void) >> - void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, >> - u_register_t arg2, u_register_t arg3) >> - { >> -- unsigned int console_base = 0U; >> -+ unsigned int console_base = IMX_BOOT_UART_BASE; >> - static console_t console; >> - int i; >> - /* enable CSU NS access permission */ >> -@@ -135,9 +135,6 @@ void bl31_early_platform_setup2(u_register_t arg0, >> u_register_t arg1, - >> - imx_aipstz_init(aipstz); >> - >> --#if IMX_BOOT_UART_BASE >> -- console_base = IMX_BOOT_UART_BASE; >> --#endif >> - if (console_base == 0U) { >> - console_base = imx8m_uart_get_base(); >> - } >> -diff --git a/plat/imx/imx8m/imx8mq/platform.mk >> b/plat/imx/imx8m/imx8mq/platform.mk -index 0c34c10bdcb4..6ee7d23d4882 >> 100644 >> ---- a/plat/imx/imx8m/imx8mq/platform.mk >> -+++ b/plat/imx/imx8m/imx8mq/platform.mk >> -@@ -55,6 +55,9 @@ BL32_SIZE ?= 0x2000000 >> - $(eval $(call add_define,BL32_SIZE)) >> - >> - IMX_BOOT_UART_BASE ?= 0x30860000 >> -+ifeq (${IMX_BOOT_UART_BASE},auto) >> -+ override IMX_BOOT_UART_BASE := 0 >> -+endif >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) >> - >> - ifeq (${SPD},trusty) >> diff --git >> a/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-202401 >> 17.patch >> b/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-202401 >> 17.patch deleted file mode 100644 >> index 1d1a9b9471bb..000000000000 >> --- >> a/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-202401 >> 17.patch +++ /dev/null >> @@ -1,21 +0,0 @@ >> -From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= >> -Date: Wed, 17 Jan 2024 11:13:01 +0100 >> -Subject: [PATCH] Release 2.8/customers/pengutronix/distrokit/20240117-1 >> - >> ---- >> - Makefile | 2 +- >> - 1 file changed, 1 insertion(+), 1 deletion(-) >> - >> -diff --git a/Makefile b/Makefile >> -index 1bfff716485a..f39eb940a024 100644 >> ---- a/Makefile >> -+++ b/Makefile >> -@@ -327,7 +327,7 @@ endif >> - ifeq (${BUILD_STRING},) >> - BUILD_STRING := $(shell git describe --always --dirty --tags 2> >> /dev/null) - endif >> --VERSION_STRING := v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} >> -+VERSION_STRING := >> v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}-20240117-1 - >> - ifeq (${AARCH32_INSTRUCTION_SET},A32) >> - TF_CFLAGS_aarch32 += -marm >> diff --git a/patches/tf-a-v2.8/series b/patches/tf-a-v2.8/series >> deleted file mode 100644 >> index 7a73fce4ff94..000000000000 >> --- a/patches/tf-a-v2.8/series >> +++ /dev/null >> @@ -1,27 +0,0 @@ >> -# umpf-base: v2.8 >> -# umpf-name: 2.8/customers/pengutronix/distrokit >> -# umpf-version: 2.8/customers/pengutronix/distrokit/20240117-1 >> -# umpf-topic: v2.8/topic/fix-build-warnings >> -# umpf-hashinfo: 4730b4b80206cf2fc27787f43cefd3169a6f8a2f >> -# umpf-topic-range: >> 9881bb93a3bc0a3ea37e9f093e09ab4b360a9e48..da1b5e74dc7c2b3e7a2d9a1adb7e23bee >> ba079e3 -0001-build-makefile-add-helper-to-detect-linker-options.patch >> -0002-feat-build-add-support-for-new-binutils-versions.patch >> -# umpf-topic: v2.8/topic/imx8mq >> -# umpf-hashinfo: 651310b67fd269e8118285e9ed44e8ad6cc52941 >> -# umpf-topic-range: >> da1b5e74dc7c2b3e7a2d9a1adb7e23beeba079e3..be7bcbebf5b22958e8b88564ca0865b45 >> 91263e7 -0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configurable-via.patch >> -0102-feat-imx8mq-remove-empty-bl31_plat_runtime_setup.patch >> -0103-feat-imx8mq-always-set-up-console.patch >> -0104-refactor-imx8mq-make-use-of-setup_page_tables.patch >> -0105-refactor-imx8mq-introduce-BL31_SIZE.patch >> -0106-feat-imx8mq-add-BL31-PIE-support.patch >> -0107-feat-imx8mq-add-support-for-gcc-12.x.patch >> -# umpf-topic: v2.8/topic/uart-runtime-detection >> -# umpf-hashinfo: b59093eaea88fddf1c893eb8f45a3eadf1f570cc >> -# umpf-topic-range: >> be7bcbebf5b22958e8b88564ca0865b4591263e7..015b0b19a839d0d4beb01babbe1af8191 >> 7fcfb57 -0201-feat-imx8m-detect-console-base-address-during-runtim.patch >> -0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch >> -# umpf-release: 2.8/customers/pengutronix/distrokit/20240117-1 >> -# umpf-topic-range: >> 015b0b19a839d0d4beb01babbe1af81917fcfb57..070499680453a1c6a358828e4bd7cf6c9 >> 629ef6b -0301-Release-2.8-customers-pengutronix-distrokit-20240117.patch >> -# umpf-end > > > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |