From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 24 Apr 2024 13:59:01 +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 1rzbHB-00Ene9-1k for lore@lore.pengutronix.de; Wed, 24 Apr 2024 13:59:01 +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 1rzbHB-0005sM-0f; Wed, 24 Apr 2024 13:59:01 +0200 Received: from mail.thorsis.com ([2003:a:e28:26e4::10]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rzbH4-0005oM-CA; Wed, 24 Apr 2024 13:58:58 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9724D1487377; Wed, 24 Apr 2024 13:58:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1713959932; h=from:subject:date:message-id:to:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=UDowak07ymIT9yewCBfpsbgibmV0sA/EMBI7MJUcAV0=; b=rt+1Ym0H018UVWSQR5DLnXkN+GYF4eTOhRdP3MyCy0Z1mnZVVJqQsQhvj1+fexddzftdy+ 1bf+kl6jZGrQgfJpgbPu2hzhruN4O2ER/yADPCIFgB4I8BctSPMB1vU0qyFGAQEUHOsSTr i7VCvROK4Rl/Di/6tNsK83W8qA9UEMNL2y5EyOWiX6kJqOoJ0PCOQivbnHc6OM2/7wqg6g Dk2E7iRejFXDSFWbmmVWewkrWIsP2n2ebI5YsJWRBRe8zfxXIB9L15aERH87/JvBgMKNvI ac32f2lwcFjjFyvgtv1Fpz2qFr0vmLfmaf73gz6gEfp7CMl/pySzkd43LTty5w== From: Alexander Dahl To: distrokit@pengutronix.de, Ahmad Fatoum Date: Wed, 24 Apr 2024 13:58:52 +0200 Message-ID: <4888454.GXAFRqVoOG@ada-pc> In-Reply-To: References: <20240315211240.3016716-1-a.fatoum@pengutronix.de> <12425358.O9o76ZdvQC@ada-pc> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Clacks-Overhead: GNU Terry Pratchett X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.4 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 Hello, Am Mittwoch, 24. April 2024, 13:48:10 CEST schrieb Ahmad Fatoum: > Hi, >=20 > On 24.04.24 13:15, Alexander Dahl wrote: > > Hello Ahmad, > >=20 > > Am Freitag, 15. M=E4rz 2024, 22:12:30 CEST schrieb Ahmad Fatoum: > > Download fails like this: > >=20 > >=20 > > ------------------------- > > target: tf-a-v2.10.tar.gz > > ------------------------- > >=20 > > --2024-04-24 13:09:40--=20 > > https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/v2= =2E1 > > 0.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 >=20 > 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=3Dhttps >=20 > What do you think? I'm no big fan of the way ptxdist handles those git sources. =20 Played around with URLs like this instead: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/+archive/ v2.10.tar.gz However the generated tarball is not stable. buildroot uses the archive tarballs from the github mirror, e.g. from here: https://github.com/ARM-software/arm-trusted-firmware/releases/tag/v2.10 We already have quite some tarballs downloaded in the same way. None of those two options are good, especially because that code screams=20 "trusted" but they don't offer trustworthy, reproducible, signed tarballs. = =20 But I'm not in the mood today to complain at their door. Oh and I discovered the problem is not in DistroKit itself, but in ptxdist.= =20 There's no rules/tf-a.make in DistroKit, the generic rule is used. Sorry f= or=20 using the wrong list here. Greets Alex >=20 > Cheers, > Ahmad >=20 > > Username/Password Authentication Failed. > > --2024-04-24 13:09:40--=20 > > http://www.pengutronix.de/software/ptxdist/temporary-src/tf-a-v2.10.tar= =2Eg > > z 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.ta= r. > > gz [following] --2024-04-24 13:09:40--=20 > > 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. > >=20 > >=20 > > Could not download package > > URL: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapsh= ot/ > > v2.10.tar.gz > >=20 > > 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 > >=20 > >=20 > > Greets > > Alex > >=20 > >> PTXCONF_TF_A_ARCH_STRING=3D"aarch64" > >> PTXCONF_TF_A_ARM_ARCH_MAJOR_8=3Dy > >> PTXCONF_TF_A_ARM_ARCH_MAJOR=3D8 > >>=20 > >> diff --git > >> a/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on= =2Di. > >> MX > >> 8MQ.patch > >> b/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on= =2Di. > >> 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= =2Di. > >> 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.MX8= MQ > >> + > >> +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 DR= AM > >> +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 current= ly > >> +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..5015eb6a1= f11 > >> 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=20 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> + ${XLAT_TABLES_LIB_SRCS} > >>=20 > > \ > >>=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >> + > >> + ifeq (${NEED_BL2},yes) > >> +@@ -153,6 +152,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 1 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/arm/tzc/tzc380.c > >>=20 > > \ > > =09 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >>=20 > > \ > > =09 > >> + ${XLAT_TABLES_LIB_SRCS} > >> + > >> +@@ -59,6 +58,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 1 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/arm/tzc/tzc380.c > >>=20 > > \ > > =09 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >>=20 > > \ > > =09 > >> + ${XLAT_TABLES_LIB_SRCS} > >> + > >> +@@ -150,6 +149,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 1 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> + ${XLAT_TABLES_LIB_SRCS} > >>=20 > > \ > >>=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >> + > >> + ENABLE_PIE :=3D 1 > >> +@@ -55,6 +54,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 0 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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_m= in- > >> as > >> -BL.patch > >> b/patches/tf-a-v2.10/0001-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_m= in- > >> 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_m= in- > >> 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 folde= r") > >> +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 > >=20 > > Secure > >=20 > >> +- * state execution. This does not affect lower NS ELs. > >> +- */ > >> +- pmuv3_init_el3(); > >> ++ if (read_feat_pmuv3_id_field() >=3D 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..456a48efb0= fb > >> 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 =3D read_sdcr(); > >> +-- > >> +2.39.2 > >> + > >> diff --git > >> a/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-duri= ng- > >> ru > >> nti.patch > >> b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-duri= ng- > >> 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-duri= ng- > >> 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 =3D 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 arg= 0, > >> u_register_t arg1, + > >> + imx_aipstz_init(aipstz); > >> + > >> +- console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> ++ if (console_base =3D=3D 0U) { > >> ++ console_base =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + plat/imx/imx8m/gpc_common.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx_aipstz.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx8m_caam.c > >>=20 > > \ > > =09 > >> ++ plat/imx/imx8m/imx8m_ccm.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx8m_psci_common.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx8mq/gpc.c > >>=20 > > \ > > =09 > >> + plat/imx/common/imx8_topology.c > >>=20 > > \ > > =09 > >> +@@ -62,6 +63,9 @@ BL32_SIZE ?=3D 0x2000000 > >> + $(eval $(call add_define,BL32_SIZE)) > >> + > >> + IMX_BOOT_UART_BASE ?=3D 0x30860000 > >> ++ifeq (${IMX_BOOT_UART_BASE},auto) > >> ++ override IMX_BOOT_UART_BASE :=3D 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.pa= tch > >> @@ -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..5015eb6a1= f11 > >> 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=20 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> + ${XLAT_TABLES_LIB_SRCS} > >>=20 > > \ > >>=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >> + > >> + ifeq (${NEED_BL2},yes) > >> +@@ -153,6 +152,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 1 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/arm/tzc/tzc380.c > >>=20 > > \ > > =09 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >>=20 > > \ > > =09 > >> + ${XLAT_TABLES_LIB_SRCS} > >> + > >> +@@ -59,6 +58,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 1 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/arm/tzc/tzc380.c > >>=20 > > \ > > =09 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >>=20 > > \ > > =09 > >> + ${XLAT_TABLES_LIB_SRCS} > >> + > >> +@@ -150,6 +149,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 1 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + drivers/delay_timer/delay_timer.c > >=20 > > \ > >=20 > >> + drivers/delay_timer/ > >=20 > > generic_delay_timer.c \ > >=20 > >> + ${XLAT_TABLES_LIB_SRCS} > >>=20 > > \ > >>=20 > >> +- ${IMX_DRAM_SOURCES} > >>=20 > > \ > > =09 > >> + ${IMX_GIC_SOURCES} > >> + > >> + ENABLE_PIE :=3D 1 > >> +@@ -56,6 +55,14 @@ ERRATA_A53_835769 :=3D 1 > >> + ERRATA_A53_843419 :=3D 1 > >> + ERRATA_A53_855873 :=3D 1 > >> + > >> ++IMX_DRAM_RETENTION ?=3D 0 > >> ++$(eval $(call assert_boolean,IMX_DRAM_RETENTION)) > >> ++$(eval $(call add_define,IMX_DRAM_RETENTION)) > >> ++ > >> ++ifeq (${IMX_DRAM_RETENTION},1) > >> ++BL31_SOURCES +=3D ${IMX_DRAM_SOURCES} > >> ++endif > >> ++ > >> + BL32_BASE ?=3D 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-duri= ng- > >> ru > >> nti.patch > >> b/patches/tf-a-v2.10/0101-feat-imx8mq-detect-console-base-address-duri= ng- > >> 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-duri= ng- > >> 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 depe= nds > >> +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 =3D 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 arg= 0, > >> u_register_t arg1, + > >> + imx_aipstz_init(aipstz); > >> + > >> +- console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> ++ if (console_base =3D=3D 0U) { > >> ++ console_base =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> + plat/imx/imx8m/gpc_common.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx_aipstz.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx8m_caam.c > >>=20 > > \ > > =09 > >> ++ plat/imx/imx8m/imx8m_ccm.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx8m_psci_common.c > >>=20 > > \ > > =09 > >> + plat/imx/imx8m/imx8mq/gpc.c > >>=20 > > \ > > =09 > >> + plat/imx/common/imx8_topology.c > >>=20 > > \ > > =09 > >> +@@ -69,6 +70,9 @@ BL32_SIZE ?=3D 0x2000000 > >> + $(eval $(call add_define,BL32_SIZE)) > >> + > >> + IMX_BOOT_UART_BASE ?=3D 0x30860000 > >> ++ifeq (${IMX_BOOT_UART_BASE},auto) > >> ++ override IMX_BOOT_UART_BASE :=3D 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_m= in- > >> as > >> -BL.patch > >> b/patches/tf-a-v2.10/0201-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_m= in- > >> 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_m= in- > >> 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 folde= r") > >> +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 > >=20 > > Secure > >=20 > >> +- * state execution. This does not affect lower NS ELs. > >> +- */ > >> +- pmuv3_init_el3(); > >> ++ if (read_feat_pmuv3_id_field() >=3D 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..456a48efb0= fb > >> 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 =3D read_sdcr(); > >> diff --git > >> a/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit= =2D20 > >> 24 > >> 031.patch > >> b/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit= =2D20 > >> 24 > >> 031.patch new file mode 100644 > >> index 000000000000..58cbc06803cb > >> --- /dev/null > >> +++ > >> b/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit= =2D20 > >> 24 > >> 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/2024031= 5-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 :=3D $(shell git describe --always --dirty --tags 2> > >> /dev/null) + endif > >> +-VERSION_STRING :=3D v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} > >> ++VERSION_STRING :=3D > >> v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}-20240315-1 + > >> + ifeq (${AARCH32_INSTRUCTION_SET},A32) > >> + TF_CFLAGS_aarch32 +=3D -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..6c0660bf6047f288628c282e44b9= b1b > >> 06 > >> bd1d33a +0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX8MQ.pat= ch > >> +# umpf-topic: v2.10/topic/imx8mq-console > >> +# umpf-hashinfo: 252b1100fb3c424e0fe1043e60414c3d7e0fa675 > >> +# umpf-topic-range: > >> 6c0660bf6047f288628c282e44b9b1b06bd1d33a..ec9b46be3c0c561ed61f113dc3c1= 508 > >> 5d > >> bce5bf7 +0101-feat-imx8mq-detect-console-base-address-during-runti.pat= ch > >> +# umpf-topic: v2.10/topic/stm32mp1 > >> +# umpf-hashinfo: 44f35b67ee4f89b05408ecfe7b4b2c1ae5366b72 > >> +# umpf-topic-range: > >> ec9b46be3c0c561ed61f113dc3c15085dbce5bf7..10dfac53fdfff2f98d8140863f58= 3df > >> 47 > >> 2483f1d +0201-fix-pmu-fix-breakage-on-ARMv7-CPUs-with-SP_min-as-BL.pat= ch > >> +# umpf-release: 2.10/customers/pengutronix/distrokit/20240315-1 > >> +# umpf-topic-range: > >> 10dfac53fdfff2f98d8140863f583df472483f1d..288664026c3117bda3f8f2275e76= bb9 > >> 7b > >> e116b89 +0301-Release-2.10-customers-pengutronix-distrokit-2024031.pat= ch > >> +# umpf-end > >> diff --git > >> a/patches/tf-a-v2.8/0001-build-makefile-add-helper-to-detect-linker-op= tio > >> ns > >> .patch > >> b/patches/tf-a-v2.8/0001-build-makefile-add-helper-to-detect-linker-op= tio > >> ns > >> .patch deleted file mode 100644 > >> index e86f31b8858a..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0001-build-makefile-add-helper-to-detect-linker-op= tio > >> ns > >> .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 +=3D $(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= =2Emk > >> -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 t= he > >> 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 f= rom > >> 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-versi= ons > >> .p > >> atch > >> b/patches/tf-a-v2.8/0002-feat-build-add-support-for-new-binutils-versi= ons > >> .p > >> atch deleted file mode 100644 > >> index b254a578d7d4..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0002-feat-build-add-support-for-new-binutils-versi= ons > >> .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 insta= ces > >> -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=3Dbinutils-gdb.git;a=3Dcommit;h=3Dba951a= fb99912da > >> 01 > >> a6e8434126b8fac7aa75107 - - > >> https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dcommit;h=3D0d3857= 6a34ec64a > >> 1b > >> 4500c9277a8e9d0f07e6774 - > >> -Fix it in a similar way to what the Linux kernel does, see: > >> -https://lore.kernel.org/all/20220810222442.2296651-1-ndesaulniers@goo= gle > >> .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 :=3D $(shell $(CC) -v 2>&1) > >> - > >> -+TF_LDFLAGS +=3D -z noexecstack > >> -+ > >> - # LD =3D armlink > >> - ifneq ($(findstring armlink,$(notdir $(LD))),) > >> - TF_LDFLAGS +=3D --diag_error=3Dwarning -- > >=20 > > lto_level=3DO1 > >=20 > >> -@@ -451,6 +453,10 @@ TF_LDFLAGS +=3D $ > >=20 > > (TF_LDFLAGS_$(ARCH)) > >=20 > >> - endif > >> - endif > >> - > >> -+# With ld.bfd version 2.29 and newer new warnings are added. Skip th= ose > >> since we -+# are not loaded by a elf loader. > >> -+TF_LDFLAGS +=3D $(call ld_option, --no-warn-rwx- > >=20 > > segments) > >=20 > >> -+ > >> - DTC_FLAGS +=3D -I dts -O dtb > >> - DTC_CPPFLAGS +=3D -P -nostdinc -Iinclude -Ifdts - > >=20 > > undef \ > >=20 > >> - -x assembler-with-cpp $(DEFINES) > >> diff --git > >> a/patches/tf-a-v2.8/0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configura= ble > >> -v > >> ia.patch > >> b/patches/tf-a-v2.8/0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configura= ble > >> -v > >> ia.patch deleted file mode 100644 > >> index 958b7fda325a..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configura= ble > >> -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 v= ia > >> 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) /* > >=20 > > HAB_RVT for i.MX8MQ */ > >=20 > >> - > >> --#define IMX_BOOT_UART_BASE U(0x30860000) > >> - #define IMX_BOOT_UART_CLK_IN_HZ 25000000 /* Select > >=20 > > 25Mhz oscillator */ > >=20 > >> - #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 ?=3D 0x2000000 > >> - $(eval $(call add_define,BL32_SIZE)) > >> - > >> -+IMX_BOOT_UART_BASE ?=3D 0x30860000 > >> -+$(eval $(call add_define,IMX_BOOT_UART_BASE)) > >> -+ > >> - ifeq (${SPD},trusty) > >> - BL31_CFLAGS +=3D -DPLAT_XLAT_TABLES_DYNAMIC=3D1 > >> - endif > >> diff --git > >> a/patches/tf-a-v2.8/0102-feat-imx8mq-remove-empty-bl31_plat_runtime_se= tup > >> .p > >> atch > >> b/patches/tf-a-v2.8/0102-feat-imx8mq-remove-empty-bl31_plat_runtime_se= tup > >> .p > >> atch deleted file mode 100644 > >> index 0b1bc7e8c82b..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0102-feat-imx8mq-remove-empty-bl31_plat_runtime_se= tup > >> .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 delet= ed > >> 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 =3D 0; i < 64; i++) { > >> -@@ -132,12 +133,10 @@ void bl31_early_platform_setup2(u_register_t ar= g0, > >> u_register_t arg1, - > >> - imx_aipstz_init(aipstz); > >> - > >> --#if DEBUG_CONSOLE > >> -- static console_t console; > >> -- > >> - console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> - 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= =2Epa > >> tc > >> h > >> b/patches/tf-a-v2.8/0104-refactor-imx8mq-make-use-of-setup_page_tables= =2Epa > >> tc > >> h deleted file mode 100644 > >> index 6cf2dc18deb2..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0104-refactor-imx8mq-make-use-of-setup_page_tables= =2Epa > >> tc > >> 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 ar= g0, > >> 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 - > >=20 > > BL_CODE_BASE), > >=20 > >> -- MT_MEMORY | MT_RO | MT_SECURE); > >> -- > >> -- /* Map TEE memory */ > >> -- mmap_add_region(BL32_BASE, BL32_BASE, BL32_SIZE, MT_MEMORY | > >=20 > > MT_RW); > >=20 > >> -- > >> -- mmap_add(imx_mmap); > >> -- > >> -+ const mmap_region_t bl_regions[] =3D { > >> -+ MAP_REGION_FLAT(BL31_BASE, BL31_LIMIT - BL31_BASE, > >> -+ MT_MEMORY | MT_RW | MT_SECURE), > >> -+ MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - > >=20 > > BL_CODE_BASE, > >=20 > >> -+ 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 - > >=20 > > BL_COHERENT_RAM_BASE, > >=20 > >> -+ MT_DEVICE | MT_RW | MT_SECURE), > >> - #endif > >> -- /* setup xlat table */ > >> -- init_xlat_tables(); > >> -+ MAP_REGION_FLAT(BL32_BASE, BL32_SIZE, MT_MEMORY | > >=20 > > MT_RW), > >=20 > >> -+ {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[] =3D { > >> -- 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 - > >=20 > > BL_CODE_BASE, > >=20 > >> - 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 :=3D 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[] =3D { > >> -- 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 - > >=20 > > BL_CODE_BASE, > >=20 > >> - 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_sta= te, > >> - > >> - void imx_domain_suspend(const psci_power_state_t *target_state) > >> - { > >> -- uint64_t base_addr =3D BL31_BASE; > >> -+ uint64_t base_addr =3D BL31_START; > >> - uint64_t mpidr =3D read_mpidr_el1(); > >> - unsigned int core_id =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> - ${XLAT_TABLES_LIB_SRCS} > >>=20 > > \ > >>=20 > >> - ${IMX_GIC_SOURCES} > >> - > >> -+ENABLE_PIE :=3D 1 > >> - USE_COHERENT_MEM :=3D 1 > >> - RESET_TO_BL31 :=3D 1 > >> - A53_DISABLE_NON_TEMPORAL_HINT :=3D 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 >=3D 12.x > >> - > >> -Starting with GCC >=3D 12.x the -Wall option includes -Werror=3Darray= =2Dbounds > >> -checks. Per default GCC threads all memory accesses below 4096 as NUL= L, > >> -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=3Darray-bounds] - 19 | return *(volatile uint8_t*)a= ddr; > >> - | ^~~~~~~~~~~~~~~~~~~~~~~~ > >> -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=3Darray-bounds] - 19 | return *(volatile uint8_t*)a= ddr; > >> - | ^~~~~~~~~~~~~~~~~~~~~~~~ > >> -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 +=3D -DPLAT_XLAT_TABLES_DYNAMIC=3D1 > >> - endif > >> -+ > >> -+# Required with gcc version >=3D 12 > >> -+$(BUILD_PLAT)/bl31/imx8mq_bl31_setup.o: CFLAGS +=3D > >> --param=3Dmin-pagesize=3D0 > >> diff --git > >> a/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during= =2Dru > >> nt > >> im.patch > >> b/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during= =2Dru > >> nt > >> im.patch deleted file mode 100644 > >> index 68f36aca7aa1..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during= =2Dru > >> nt > >> 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 runt= ime > >> - > >> -Provide a helper to detect the enabled UART device during runtime. Th= is > >> -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=3D0 to ke= ep > >> -the backward compatibility. For more advanced use-cases (multiple UAR= Ts > >> -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 > >>=20 > >> | 11 +++++- > >>=20 > >> - 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) !=3D 0) > >> -+ > >> -+static struct imx_uart { > >> -+ unsigned int ccm_reg; > >> -+ unsigned int uart_base; > >> -+} imx8m_uart_info[] =3D { > >> -+ { /* UART 1 */ > >> -+ .ccm_reg =3D 0x4490, > >> -+ .uart_base =3D 0x30860000, > >> -+ }, { /* UART 2 */ > >> -+ .ccm_reg =3D 0x44a0, > >> -+ .uart_base =3D 0x30890000, > >> -+ }, { /* UART 3 */ > >> -+ .ccm_reg =3D 0x44b0, > >> -+ .uart_base =3D 0x30880000, > >> -+ }, { /* UART 4 */ > >> -+ .ccm_reg =3D 0x44c0, > >> -+ .uart_base =3D 0x30a60000, > >> -+ } > >> -+}; > >> -+ > >> -+unsigned int imx8m_uart_get_base(void) > >> -+{ > >> -+ unsigned int i; > >> -+ > >> -+ for (i =3D 0; i < ARRAY_SIZE(imx8m_uart_info); i++) { > >> -+ uint32_t val; > >> -+ > >> -+ /* > >> -+ * At least check that the clock-gate is ungated before > >=20 > > we > >=20 > >> -+ * access the UART register. > >> -+ */ > >> -+ val =3D mmio_read_32(IMX_CCM_BASE + > >=20 > > imx8m_uart_info[i].ccm_reg); > >=20 > >> -+ if (DOMAIN0_RUNNING(val)) { > >> -+ val =3D > >=20 > > mmio_read_32(imx8m_uart_info[i].uart_base + UCR1); > >=20 > >> -+ if (val & UCR1_UARTEN) { > >> -+ return > >=20 > > imx8m_uart_info[i].uart_base; > >=20 > >> -+ } > >> -+ } > >> -+ } > >> -+ > >> -+ /* > >> -+ * 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 =3D 0U; > >> - static console_t console; > >> - int i; > >> - > >> -@@ -144,7 +146,14 @@ void bl31_early_platform_setup2(u_register_t arg= 0, > >> u_register_t arg1, - > >> - imx_csu_init(csu_cfg); > >> - > >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> -+#if IMX_BOOT_UART_BASE > >> -+ console_base =3D IMX_BOOT_UART_BASE; > >> -+#endif > >> -+ if (console_base =3D=3D 0U) { > >> -+ console_base =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> - plat/imx/imx8m/imx_rdc.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_csu.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_caam.c > >>=20 > > \ > > =09 > >> -+ plat/imx/imx8m/imx8m_ccm.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_psci_common.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8mm/ > >=20 > > imx8mm_bl31_setup.c \ > >=20 > >> - plat/imx/imx8m/imx8mm/ > >=20 > > imx8mm_psci.c \ > >=20 > >> -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 =3D 0U; > >> - static console_t console; > >> - unsigned int val; > >> - int i; > >> -@@ -141,7 +143,14 @@ void bl31_early_platform_setup2(u_register_t arg= 0, > >> u_register_t arg1, - val =3D mmio_read_32(IMX_IOMUX_GPR_BASE + > >=20 > > 0x2c); > >=20 > >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); > >> - > >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> -+#if IMX_BOOT_UART_BASE > >> -+ console_base =3D IMX_BOOT_UART_BASE; > >> -+#endif > >> -+ if (console_base =3D=3D 0U) { > >> -+ console_base =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> - plat/imx/imx8m/imx_aipstz.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx_rdc.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_caam.c > >>=20 > > \ > > =09 > >> -+ plat/imx/imx8m/imx8m_ccm.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_csu.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_psci_common.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8mn/ > >=20 > > imx8mn_bl31_setup.c \ > >=20 > >> -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 =3D 0U; > >> - static console_t console; > >> - unsigned int val; > >> - unsigned int i; > >> -@@ -137,7 +139,14 @@ void bl31_early_platform_setup2(u_register_t arg= 0, > >> u_register_t arg1, - val =3D mmio_read_32(IMX_IOMUX_GPR_BASE + > >=20 > > 0x2c); > >=20 > >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); > >> - > >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> -+#if IMX_BOOT_UART_BASE > >> -+ console_base =3D IMX_BOOT_UART_BASE; > >> -+#endif > >> -+ if (console_base =3D=3D 0U) { > >> -+ console_base =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> - plat/imx/imx8m/imx_aipstz.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx_rdc.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_caam.c > >>=20 > > \ > > =09 > >> -+ plat/imx/imx8m/imx8m_ccm.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_csu.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_psci_common.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8mp/ > >=20 > > imx8mp_bl31_setup.c \ > >=20 > >> -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 =3D 0U; > >> - static console_t console; > >> - int i; > >> - /* enable CSU NS access permission */ > >> -@@ -133,7 +135,14 @@ void bl31_early_platform_setup2(u_register_t arg= 0, > >> u_register_t arg1, - > >> - imx_aipstz_init(aipstz); > >> - > >> -- console_imx_uart_register(IMX_BOOT_UART_BASE, > >=20 > > IMX_BOOT_UART_CLK_IN_HZ, > >=20 > >> -+#if IMX_BOOT_UART_BASE > >> -+ console_base =3D IMX_BOOT_UART_BASE; > >> -+#endif > >> -+ if (console_base =3D=3D 0U) { > >> -+ console_base =3D 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 +=3D plat/imx/ common/ > >=20 > > imx8_helpers.S \ > >=20 > >> - plat/imx/imx8m/gpc_common.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx_aipstz.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_caam.c > >>=20 > > \ > > =09 > >> -+ plat/imx/imx8m/imx8m_ccm.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8m_psci_common.c > >>=20 > > \ > > =09 > >> - plat/imx/imx8m/imx8mq/gpc.c > >>=20 > > \ > > =09 > >> - plat/imx/common/imx8_topology.c > >>=20 > > \ > > =09 > >> -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-autodetecti= on- > >> op > >> ti.patch > >> b/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetecti= on- > >> op > >> ti.patch deleted file mode 100644 > >> index 9fae10905edd..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetecti= on- > >> 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=3D0 to IMX_BOOT_UART_BASE=3Dauto to ma= ke 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 =3D 0U; > >> -+ unsigned int console_base =3D 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 =3D IMX_BOOT_UART_BASE; > >> --#endif > >> - if (console_base =3D=3D 0U) { > >> - console_base =3D 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 ?=3D 0x2000000 > >> - $(eval $(call add_define,BL32_SIZE)) > >> - > >> - IMX_BOOT_UART_BASE ?=3D 0x30890000 > >> -+ifeq (${IMX_BOOT_UART_BASE},auto) > >> -+ override IMX_BOOT_UART_BASE :=3D 0 > >> -+endif > >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) > >> - > >> - EL3_EXCEPTION_HANDLING :=3D $(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 =3D 0U; > >> -+ unsigned int console_base =3D 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 =3D mmio_read_32(IMX_IOMUX_GPR_BASE + > >=20 > > 0x2c); > >=20 > >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); > >> - > >> --#if IMX_BOOT_UART_BASE > >> -- console_base =3D IMX_BOOT_UART_BASE; > >> --#endif > >> - if (console_base =3D=3D 0U) { > >> - console_base =3D 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 ?=3D 0x2000000 > >> - $(eval $(call add_define,BL32_SIZE)) > >> - > >> - IMX_BOOT_UART_BASE ?=3D 0x30890000 > >> -+ifeq (${IMX_BOOT_UART_BASE},auto) > >> -+ override IMX_BOOT_UART_BASE :=3D 0 > >> -+endif > >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) > >> - > >> - EL3_EXCEPTION_HANDLING :=3D $(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 =3D 0U; > >> -+ unsigned int console_base =3D 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 =3D mmio_read_32(IMX_IOMUX_GPR_BASE + > >=20 > > 0x2c); > >=20 > >> - mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); > >> - > >> --#if IMX_BOOT_UART_BASE > >> -- console_base =3D IMX_BOOT_UART_BASE; > >> --#endif > >> - if (console_base =3D=3D 0U) { > >> - console_base =3D 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 ?=3D 0x2000000 > >> - $(eval $(call add_define,BL32_SIZE)) > >> - > >> - IMX_BOOT_UART_BASE ?=3D 0x30890000 > >> -+ifeq (${IMX_BOOT_UART_BASE},auto) > >> -+ override IMX_BOOT_UART_BASE :=3D 0 > >> -+endif > >> - $(eval $(call add_define,IMX_BOOT_UART_BASE)) > >> - > >> - EL3_EXCEPTION_HANDLING :=3D $(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 =3D 0U; > >> -+ unsigned int console_base =3D 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 =3D IMX_BOOT_UART_BASE; > >> --#endif > >> - if (console_base =3D=3D 0U) { > >> - console_base =3D 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 ?=3D 0x2000000 > >> - $(eval $(call add_define,BL32_SIZE)) > >> - > >> - IMX_BOOT_UART_BASE ?=3D 0x30860000 > >> -+ifeq (${IMX_BOOT_UART_BASE},auto) > >> -+ override IMX_BOOT_UART_BASE :=3D 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-2= 024 > >> 01 > >> 17.patch > >> b/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-2= 024 > >> 01 > >> 17.patch deleted file mode 100644 > >> index 1d1a9b9471bb..000000000000 > >> --- > >> a/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-2= 024 > >> 01 > >> 17.patch +++ /dev/null > >> @@ -1,21 +0,0 @@ > >> -From: =3D?UTF-8?q?Leonard=3D20G=3DC3=3DB6hrs?=3D > >> -Date: Wed, 17 Jan 2024 11:13:01 +0100 > >> -Subject: [PATCH] Release 2.8/customers/pengutronix/distrokit/20240117= =2D1 > >> - > >> ---- > >> - 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 :=3D $(shell git describe --always --dirty --= tags > >> 2> > >> /dev/null) - endif > >> --VERSION_STRING :=3D v${VERSION}(${BUILD_TYPE}):${BUILD_STRING} > >> -+VERSION_STRING :=3D > >> v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}-20240117-1 - > >> - ifeq (${AARCH32_INSTRUCTION_SET},A32) > >> - TF_CFLAGS_aarch32 +=3D -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..da1b5e74dc7c2b3e7a2d9a1adb7e= 23b > >> ee > >> 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..be7bcbebf5b22958e8b88564ca08= 65b > >> 45 > >> 91263e7 -0101-feat-imx8mq-make-IMX_BOOT_UART_BASE-configurable-via.pat= ch > >> -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..015b0b19a839d0d4beb01babbe1a= f81 > >> 91 > >> 7fcfb57 -0201-feat-imx8m-detect-console-base-address-during-runtim.pat= ch > >> -0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch > >> -# umpf-release: 2.8/customers/pengutronix/distrokit/20240117-1 > >> -# umpf-topic-range: > >> 015b0b19a839d0d4beb01babbe1af81917fcfb57..070499680453a1c6a358828e4bd7= cf6 > >> c9 > >> 629ef6b -0301-Release-2.8-customers-pengutronix-distrokit-20240117.pat= ch > >> -# umpf-end