diff options
Diffstat (limited to 'patches')
18 files changed, 655 insertions, 391 deletions
diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch deleted file mode 100644 index 164f199..0000000 --- a/patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 456257d346b295982761d33f4e24e07a9feee74d Mon Sep 17 00:00:00 2001 -From: Marco Felsch <mfe@pengutronix.de> -Date: Sat, 26 Nov 2022 08:00:39 +0100 -Subject: [PATCH 1/2] 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 <m.felsch@pengutronix.de> ---- - 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 b89d87ea6087..9f4f70dbe42f 100644 ---- a/make_helpers/build_macros.mk -+++ b/make_helpers/build_macros.mk -@@ -67,6 +67,12 @@ $(foreach d,$(0-9),$(eval __numeric := $(subst $(d),,$(__numeric)))) - $(if $(__numeric),$(error $(1) must be numeric)) - 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 -+ - # IMG_LINKERFILE defines the linker script corresponding to a BL stage - # $(1) = BL stage (2, 30, 31, 32, 33) - define IMG_LINKERFILE --- -2.30.2 - diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch deleted file mode 100644 index a433800..0000000 --- a/patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 710c027045df0d51e3d83bd26ec954b08108d836 Mon Sep 17 00:00:00 2001 -From: Robert Schwebel <r.schwebel@pengutronix.de> -Date: Sat, 26 Nov 2022 08:06:40 +0100 -Subject: [PATCH 2/2] build(makefile): avoid gcc warning that triggers with - -Werror=array-bounds - -With gcc 12, we get these warnings: - -make: Entering directory 'imx-atf-imx_5.4.24_2.1.0' - CC plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c -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:82:16, - inlined from 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:224: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:86:16, - inlined from 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:224: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 - -According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523#c9, this -is the right fix for TF-A, as it is a firmware that has memory at 0. - -Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> ---- - Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile b/Makefile -index 2ae12fda741a..555b46e7b361 100644 ---- a/Makefile -+++ b/Makefile -@@ -284,6 +284,7 @@ CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \ - ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \ - -ffreestanding -Wa,--fatal-warnings - TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \ -+ --param=min-pagesize=0 \ - -ffreestanding -fno-builtin -Wall -std=gnu99 \ - -Os -ffunction-sections -fdata-sections - --- -2.30.2 - diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch deleted file mode 100644 index 35b2be9..0000000 --- a/patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b102865225c8db6a4ef60f346aded5959acc4d1c Mon Sep 17 00:00:00 2001 -From: Marco Felsch <m.felsch@pengutronix.de> -Date: Wed, 9 Nov 2022 12:59:09 +0100 -Subject: [PATCH 3/4] feat(build): add support for new binutils versions - -The new ld.bfd linker version has added new warnings which are enabled by -default to secure elf binaries: - - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 - - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b4500c9277a8e9d0f07e6774 - -Since the tf-a handles every warning as error we need to tell the linker -to not warn about this. This is required to make the bl31 target -buildable with newer toolchain versions. - -Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> -Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617 ---- - Makefile | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/Makefile b/Makefile -index 3941f869800a..af7fd1535694 100644 ---- a/Makefile -+++ b/Makefile -@@ -444,6 +444,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) --- -2.30.2 - diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch deleted file mode 100644 index 727f8af..0000000 --- a/patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f77451f77ff01dda1a5239a65901ed0b666116b3 Mon Sep 17 00:00:00 2001 -From: Robert Schwebel <r.schwebel@pengutronix.de> -Date: Sat, 26 Nov 2022 08:24:50 +0100 -Subject: [PATCH 4/4] makefile: link with -z noexecstack - -Starting with binutils 2.39+, there is a new warning: - - ld: warning: vmlinux: missing .note.GNU-stack section implies executable stack - ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker - ld: warning: vmlinux has a LOAD segment with RWX permissions - -Fix it in a similar way to what the Linux kernel does, see: -https://lore.kernel.org/all/20220810222442.2296651-1-ndesaulniers@google.com/ - -Following the reasoning there, we set "-z noexecstack" for all linkers -(although LLVM's LLD defaults to it). - -Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> ---- - Makefile | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Makefile b/Makefile -index 54072a4543ce..86be2e68da3e 100644 ---- a/Makefile -+++ b/Makefile -@@ -298,6 +298,8 @@ endif - - GCC_V_OUTPUT := $(shell $(CC) -v 2>&1) - -+TF_LDFLAGS += -z noexecstack -+ - ifneq ($(findstring armlink,$(notdir $(LD))),) - TF_LDFLAGS += --diag_error=warning --lto_level=O1 - TF_LDFLAGS += --remove --info=unused,unusedsymbols --- -2.30.2 - diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/series b/patches/imx-atf-imx_5.4.24_2.1.0/series deleted file mode 100644 index c731f9c..0000000 --- a/patches/imx-atf-imx_5.4.24_2.1.0/series +++ /dev/null @@ -1,4 +0,0 @@ -0001-build-makefile-add-helper-to-detect-linker-options.patch -0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch -0003-feat-build-add-support-for-new-binutils-versions.patch -0004-makefile-link-with-z-noexecstack.patch diff --git a/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX8MQ.patch b/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX8MQ.patch new file mode 100644 index 0000000..cab995b --- /dev/null +++ b/patches/tf-a-v2.10/0001-fix-imx-disable-DRAM-retention-by-default-on-i.MX8MQ.patch @@ -0,0 +1,182 @@ +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +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 <a.fatoum@pengutronix.de> +--- + 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 0000000..745e171 --- /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 <a.fatoum@pengutronix.de> +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 <a.fatoum@pengutronix.de> +--- + 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-runti.patch b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch new file mode 100644 index 0000000..c488337 --- /dev/null +++ b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch @@ -0,0 +1,69 @@ +From aeb68be64c5c47142de3c95a8961749f7b33030a Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +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 <imx_aipstz.h> + #include <imx_uart.h> + #include <imx8m_caam.h> ++#include <imx8m_ccm.h> + #include <plat_imx8.h> + + #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 0000000..7d2b361 --- /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 <a.fatoum@pengutronix.de> +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-runti.patch b/patches/tf-a-v2.10/0101-feat-imx8mq-detect-console-base-address-during-runti.patch new file mode 100644 index 0000000..d375a45 --- /dev/null +++ b/patches/tf-a-v2.10/0101-feat-imx8mq-detect-console-base-address-during-runti.patch @@ -0,0 +1,72 @@ +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +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 <a.fatoum@pengutronix.de> +--- + 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 <imx_aipstz.h> + #include <imx_uart.h> + #include <imx8m_caam.h> ++#include <imx8m_ccm.h> + #include <plat_imx8.h> + + #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 0000000..60abc48 --- /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 <a.fatoum@pengutronix.de> +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 <a.fatoum@pengutronix.de> +--- + 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-2024031.patch b/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit-2024031.patch new file mode 100644 index 0000000..58cbc06 --- /dev/null +++ b/patches/tf-a-v2.10/0301-Release-2.10-customers-pengutronix-distrokit-2024031.patch @@ -0,0 +1,21 @@ +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +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 0000000..4dd620f --- /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..6c0660bf6047f288628c282e44b9b1b06bd1d33a +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..ec9b46be3c0c561ed61f113dc3c15085dbce5bf7 +0101-feat-imx8mq-detect-console-base-address-during-runti.patch +# umpf-topic: v2.10/topic/stm32mp1 +# umpf-hashinfo: 44f35b67ee4f89b05408ecfe7b4b2c1ae5366b72 +# umpf-topic-range: ec9b46be3c0c561ed61f113dc3c15085dbce5bf7..10dfac53fdfff2f98d8140863f583df472483f1d +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..288664026c3117bda3f8f2275e76bb97be116b89 +0301-Release-2.10-customers-pengutronix-distrokit-2024031.patch +# umpf-end diff --git a/patches/tf-a-v2.7/0001-fix-stm32mp1-fdts-stm32mp1-align-DDR-regulators-with.patch b/patches/tf-a-v2.7/0001-fix-stm32mp1-fdts-stm32mp1-align-DDR-regulators-with.patch deleted file mode 100644 index 3ee7268..0000000 --- a/patches/tf-a-v2.7/0001-fix-stm32mp1-fdts-stm32mp1-align-DDR-regulators-with.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 02e0e6ae14a747031c6ba67517c9eee744f4d51d Mon Sep 17 00:00:00 2001 -From: Ahmad Fatoum <a.fatoum@pengutronix.de> -Date: Thu, 2 Jun 2022 06:28:31 +0200 -Subject: [PATCH 1/4] fix(stm32mp1): fdts: stm32mp1: align DDR regulators with - new driver - -With recent changes, TF-A now panics on LXA MC1, Avernger96 and Odyssey: - - NOTICE: CPU: STM32MP157C?? Rev.B - NOTICE: Model: Linux Automation MC-1 board - ERROR: regul ldo3: max value 750 is invalid - PANIC at PC : 0x2ffeebb7 - -as the driver takes great offense at the content of the device -tree. The parts in question were copy-pasted from ST DTs, but those -ST DTs were fixed by commit 67d95409baae -("refactor(stm32mp1-fdts): update regulator description"). - -Fix the breakage by transplanting the same changes into all STM32MP1 DTs. - -Fixes: bba9fdee589f ("feat(stm32mp1): add regulator framework compilation") -Change-Id: I143d0091625f62c313b3b71449c9ad99583d01c8 -Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> -Origin: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/15370 ---- - fdts/stm32mp157a-avenger96.dts | 4 +--- - fdts/stm32mp157c-odyssey-som.dtsi | 4 +--- - fdts/stm32mp15xx-osd32.dtsi | 4 +--- - 3 files changed, 3 insertions(+), 9 deletions(-) - -diff --git a/fdts/stm32mp157a-avenger96.dts b/fdts/stm32mp157a-avenger96.dts -index b967736e4786..6ae97c7581d1 100644 ---- a/fdts/stm32mp157a-avenger96.dts -+++ b/fdts/stm32mp157a-avenger96.dts -@@ -115,10 +115,9 @@ - - vtt_ddr: ldo3 { - regulator-name = "vtt_ddr"; -- regulator-min-microvolt = <500000>; -- regulator-max-microvolt = <750000>; - regulator-always-on; - regulator-over-current-protection; -+ st,regulator-sink-source; - }; - - vdd_usb: ldo4 { -@@ -143,7 +142,6 @@ - vref_ddr: vref_ddr { - regulator-name = "vref_ddr"; - regulator-always-on; -- regulator-over-current-protection; - }; - - bst_out: boost { -diff --git a/fdts/stm32mp157c-odyssey-som.dtsi b/fdts/stm32mp157c-odyssey-som.dtsi -index 6bed33968f73..c4e13985a3f7 100644 ---- a/fdts/stm32mp157c-odyssey-som.dtsi -+++ b/fdts/stm32mp157c-odyssey-som.dtsi -@@ -140,10 +140,9 @@ - - vtt_ddr: ldo3 { - regulator-name = "vtt_ddr"; -- regulator-min-microvolt = <500000>; -- regulator-max-microvolt = <750000>; - regulator-always-on; - regulator-over-current-protection; -+ st,regulator-sink-source; - }; - - vdd_usb: ldo4 { -@@ -170,7 +169,6 @@ - vref_ddr: vref_ddr { - regulator-name = "vref_ddr"; - regulator-always-on; -- regulator-over-current-protection; - }; - - bst_out: boost { -diff --git a/fdts/stm32mp15xx-osd32.dtsi b/fdts/stm32mp15xx-osd32.dtsi -index 76a25613a14d..ca672356293c 100644 ---- a/fdts/stm32mp15xx-osd32.dtsi -+++ b/fdts/stm32mp15xx-osd32.dtsi -@@ -81,10 +81,9 @@ - - vtt_ddr: ldo3 { - regulator-name = "vtt_ddr"; -- regulator-min-microvolt = <500000>; -- regulator-max-microvolt = <750000>; - regulator-always-on; - regulator-over-current-protection; -+ st,regulator-sink-source; - }; - - vdd_usb: ldo4 { -@@ -110,7 +109,6 @@ - vref_ddr: vref_ddr { - regulator-name = "vref_ddr"; - regulator-always-on; -- regulator-over-current-protection; - }; - - bst_out: boost { --- -2.30.2 - diff --git a/patches/tf-a-v2.7/0002-build-makefile-add-helper-to-detect-linker-options.patch b/patches/tf-a-v2.7/0002-build-makefile-add-helper-to-detect-linker-options.patch deleted file mode 100644 index d391112..0000000 --- a/patches/tf-a-v2.7/0002-build-makefile-add-helper-to-detect-linker-options.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e4e456405177add4df5e21528caa3d873847056a Mon Sep 17 00:00:00 2001 -From: Marco Felsch <m.felsch@pengutronix.de> -Date: Thu, 24 Nov 2022 11:02:05 +0100 -Subject: [PATCH 2/4] 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 <m.felsch@pengutronix.de> -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 a58caf565163..06caeea19787 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 --- -2.30.2 - diff --git a/patches/tf-a-v2.7/0003-feat-build-add-support-for-new-binutils-versions.patch b/patches/tf-a-v2.7/0003-feat-build-add-support-for-new-binutils-versions.patch deleted file mode 100644 index 35b2be9..0000000 --- a/patches/tf-a-v2.7/0003-feat-build-add-support-for-new-binutils-versions.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b102865225c8db6a4ef60f346aded5959acc4d1c Mon Sep 17 00:00:00 2001 -From: Marco Felsch <m.felsch@pengutronix.de> -Date: Wed, 9 Nov 2022 12:59:09 +0100 -Subject: [PATCH 3/4] feat(build): add support for new binutils versions - -The new ld.bfd linker version has added new warnings which are enabled by -default to secure elf binaries: - - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 - - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b4500c9277a8e9d0f07e6774 - -Since the tf-a handles every warning as error we need to tell the linker -to not warn about this. This is required to make the bl31 target -buildable with newer toolchain versions. - -Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> -Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617 ---- - Makefile | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/Makefile b/Makefile -index 3941f869800a..af7fd1535694 100644 ---- a/Makefile -+++ b/Makefile -@@ -444,6 +444,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) --- -2.30.2 - diff --git a/patches/tf-a-v2.7/0004-makefile-link-with-z-noexecstack.patch b/patches/tf-a-v2.7/0004-makefile-link-with-z-noexecstack.patch deleted file mode 100644 index 5c66e97..0000000 --- a/patches/tf-a-v2.7/0004-makefile-link-with-z-noexecstack.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 943df16d58ec8e31cb3e1726998ac6e4cd195284 Mon Sep 17 00:00:00 2001 -From: Robert Schwebel <r.schwebel@pengutronix.de> -Date: Wed, 23 Nov 2022 09:02:59 +0100 -Subject: [PATCH 4/4] makefile: link with -z noexecstack - -Starting with binutils 2.39+, there is a new warning: - - ld: warning: vmlinux: missing .note.GNU-stack section implies executable stack - ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker - ld: warning: vmlinux has a LOAD segment with RWX permissions - -Fix it in a similar way to what the Linux kernel does, see: -https://lore.kernel.org/all/20220810222442.2296651-1-ndesaulniers@google.com/ - -Following the reasoning there, we set "-z noexecstack" for all linkers -(although LLVM's LLD defaults to it). - -Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> ---- - Makefile | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/Makefile b/Makefile -index af7fd1535694..e4cc77cd41ca 100644 ---- a/Makefile -+++ b/Makefile -@@ -409,6 +409,9 @@ 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 --- -2.30.2 - diff --git a/patches/tf-a-v2.7/series b/patches/tf-a-v2.7/series deleted file mode 100644 index 4097cf1..0000000 --- a/patches/tf-a-v2.7/series +++ /dev/null @@ -1,4 +0,0 @@ -0001-fix-stm32mp1-fdts-stm32mp1-align-DDR-regulators-with.patch -0002-build-makefile-add-helper-to-detect-linker-options.patch -0003-feat-build-add-support-for-new-binutils-versions.patch -0004-makefile-link-with-z-noexecstack.patch |