diff options
author | Herman Rimm <herman@rimm.ee> | 2024-12-19 23:10:35 +0100 |
---|---|---|
committer | Vagrant Cascadian <vagrant@debian.org> | 2024-12-19 16:06:26 -0800 |
commit | 91f50366e5bc54951851e99f5600f9abb628b6ec (patch) | |
tree | 0026dc271035a78fdb9b7b3836d9d28e2019f130 /gnu/packages/patches | |
parent | 29ff4a6ca836c0ee8fe052eda3ad9a5d2bb8d2af (diff) |
gnu: arm-trusted-firmware-imx8mq: Fix build.
* gnu/local.mk (dist_patch_DATA): Register patches.
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Add make-flags
argument. [source]: Use patches.
(arm-trusted-firmware-imx8mq): Refactor.
* gnu/packages/patches/8mq-enable-imx_hab_handler.patch: Add file.
* gnu/packages/patches/8mq-move-stack-to-ocram_s.patch: Add file.
Change-Id: I8a72c1ceb5e00e113ae91a7c2f5b733d981185d6
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/8mq-enable-imx_hab_handler.patch | 36 | ||||
-rw-r--r-- | gnu/packages/patches/8mq-move-stack-to-ocram_s.patch | 88 |
2 files changed, 124 insertions, 0 deletions
diff --git a/gnu/packages/patches/8mq-enable-imx_hab_handler.patch b/gnu/packages/patches/8mq-enable-imx_hab_handler.patch new file mode 100644 index 0000000000..0ead773e4e --- /dev/null +++ b/gnu/packages/patches/8mq-enable-imx_hab_handler.patch @@ -0,0 +1,36 @@ +From: Herman Rimm <herman@rimm.ee> +Date: Sun, 8 Dec 2024 01:13:59 +0100 +Subject: [PATCH] fix(imx8m): 8mq: enable imx_hab_handler + +This completes af799814e2639a03b3453744f06a73e77cb66e86. + +Signed-off-by: Herman Rimm <herman@rimm.ee> +--- +To submit to review.trustedfirmware.org, sign in with a GitHub account. + +diff --git a/plat/imx/common/include/imx_sip_svc.h b/plat/imx/common/include/imx_sip_svc.h +index 404a82959..1948bc2eb 100644 +--- a/plat/imx/common/include/imx_sip_svc.h ++++ b/plat/imx/common/include/imx_sip_svc.h +@@ -88,7 +88,8 @@ int imx_src_handler(uint32_t smc_fid, u_register_t x1, + u_register_t x2, u_register_t x3, void *handle); + #endif + +-#if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp) ++#if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp) || \ ++ defined(PLAT_imx8mq) + int imx_hab_handler(uint32_t smc_fid, u_register_t x1, + u_register_t x2, u_register_t x3, u_register_t x4); + #endif +diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk +index 73179dd0c..b1b954f1d 100644 +--- a/plat/imx/imx8m/imx8mq/platform.mk ++++ b/plat/imx/imx8m/imx8mq/platform.mk +@@ -30,6 +30,7 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \ + plat/imx/imx8m/imx8mq/imx8mq_psci.c \ + plat/imx/imx8m/gpc_common.c \ + plat/imx/imx8m/imx_aipstz.c \ ++ plat/imx/imx8m/imx_hab.c \ + plat/imx/imx8m/imx8m_caam.c \ + plat/imx/imx8m/imx8m_ccm.c \ + plat/imx/imx8m/imx8m_psci_common.c \ diff --git a/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch b/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch new file mode 100644 index 0000000000..1174881181 --- /dev/null +++ b/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch @@ -0,0 +1,88 @@ +From: Jacky Bai <ping.bai@nxp.com> +Date: Tue, 7 Jan 2020 15:48:36 +0800 +Subject: [PATCH] plat: imx8mq: move the stack & xlat table into ocram_s + +Move the stack & xlat table into ocram_s due to the +ocram is not enough. + +Signed-off-by: Jacky Bai <ping.bai@nxp.com> +Change-Id: I40a8e6c91f707598a38e420ff9f4be0c0a5dbf6c +--- +Commit ae90cc5773abf5656e0e49f2ce746aa54f712b7b of: +https://github.com/nxp-imx/imx-atf.git + +diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S +index 867dedb99..8be52bc7c 100644 +--- a/bl31/bl31.ld.S ++++ b/bl31/bl31.ld.S +@@ -25,6 +25,10 @@ MEMORY { + #else /* SEPARATE_RWDATA_REGION */ + #define RAM_RW RAM + #endif /* SEPARATE_RWDATA_REGION */ ++ ++#if XLAT_TABLE_IN_OCRAM_S ++ RAM_S (rwx): ORIGIN = 0x180000, LENGTH = 0x8000 ++#endif + } + + #ifdef PLAT_EXTRA_LD_SCRIPT +@@ -198,9 +202,13 @@ SECTIONS { + __NOBITS_START__ = .; + #endif /* SEPARATE_NOBITS_REGION */ + ++#if !STACK_IN_OCRAM_S + STACK_SECTION >NOBITS ++#endif + BSS_SECTION >NOBITS ++#if !XLAT_TABLE_IN_OCRAM_S + XLAT_TABLE_SECTION >NOBITS ++#endif + + #if USE_COHERENT_MEM + /* +@@ -253,4 +261,15 @@ SECTIONS { + /DISCARD/ : { + *(.dynsym .dynstr .hash .gnu.hash) + } ++ ++#if XLAT_TABLE_IN_OCRAM_S ++ . = 0x180000; ++ XLAT_TABLE_SECTION >RAM_S ++ ++#if STACK_IN_OCRAM_S ++ STACK_SECTION >RAM_S ++#endif ++ ++ASSERT(. <= OCRAM_S_LIMIT, "OCRAM_S limit has been exceeded.") ++#endif + } +diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +index 70c2def7d..ddff0925c 100644 +--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c ++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +@@ -48,6 +48,7 @@ static uint8_t mmio_read_8_ldrb(uintptr_t address) + static const mmap_region_t imx_mmap[] = { + MAP_REGION_FLAT(GPV_BASE, GPV_SIZE, MT_DEVICE | MT_RW), /* GPV map */ + MAP_REGION_FLAT(IMX_ROM_BASE, IMX_ROM_SIZE, MT_MEMORY | MT_RO), /* ROM map */ ++ MAP_REGION_FLAT(OCRAM_S_BASE, OCRAM_S_SIZE, MT_MEMORY | MT_RW), /* ROM map */ + MAP_REGION_FLAT(IMX_AIPS_BASE, IMX_AIPS_SIZE, MT_DEVICE | MT_RW), /* AIPS map */ + MAP_REGION_FLAT(IMX_GIC_BASE, IMX_GIC_SIZE, MT_DEVICE | MT_RW), /* GIC map */ + MAP_REGION_FLAT(IMX_DDRPHY_BASE, IMX_DDR_IPS_SIZE, MT_DEVICE | MT_RW), /* DDRMIX map */ +diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk +index 73179dd0c..20a73d691 100644 +--- a/plat/imx/imx8m/imx8mq/platform.mk ++++ b/plat/imx/imx8m/imx8mq/platform.mk +@@ -45,7 +45,12 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \ + ${XLAT_TABLES_LIB_SRCS} \ + ${IMX_GIC_SOURCES} + +-ENABLE_PIE := 1 ++XLAT_TABLE_IN_OCRAM_S := 1 ++STACK_IN_OCRAM_S := 1 ++ ++$(eval $(call add_define,XLAT_TABLE_IN_OCRAM_S)) ++$(eval $(call add_define,STACK_IN_OCRAM_S)) ++ + USE_COHERENT_MEM := 1 + RESET_TO_BL31 := 1 + A53_DISABLE_NON_TEMPORAL_HINT := 0 |