summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2022-07-13 19:05:27 +0200
committerPhilippe Schenker <philippe.schenker@toradex.com>2022-07-13 19:57:42 +0200
commit4a69733c8358bada99e86eb455cd637fff8e0ba9 (patch)
tree0383544310a0d133988e0413922b0abc08ff05cc /recipes-bsp
parent3a4ea6511b12c4f68f9479bf83651fbc086d0885 (diff)
imx-atf: bbappend: forward port to v2.6
Add the two patches from our imx-atf fork that are not yet upstreamed and are not upstreamable. Related-to: ELB-4586 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/imx-atf/files/0001-Revert-Add-NXP-s-SoCs-partition-reboot-support.patch41
-rw-r--r--recipes-bsp/imx-atf/files/0002-imx8m-hab.c-work-around-gcc-12.1-false-positives.patch46
-rw-r--r--recipes-bsp/imx-atf/imx-atf_%.bbappend10
3 files changed, 92 insertions, 5 deletions
diff --git a/recipes-bsp/imx-atf/files/0001-Revert-Add-NXP-s-SoCs-partition-reboot-support.patch b/recipes-bsp/imx-atf/files/0001-Revert-Add-NXP-s-SoCs-partition-reboot-support.patch
new file mode 100644
index 0000000..e0150ba
--- /dev/null
+++ b/recipes-bsp/imx-atf/files/0001-Revert-Add-NXP-s-SoCs-partition-reboot-support.patch
@@ -0,0 +1,41 @@
+From bef717b8edd1458bcff576e79ba536390d40deb2 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Tue, 19 May 2020 20:32:59 +0200
+Subject: [PATCH 1/2] Revert "Add NXP's SoCs partition reboot support."
+
+This reverts commit 13a5c7ece5a13c636e52f22b45f592b72b6453d1.
+With commit 13a5c7ece5a1 the SCFW will execute a reboot of the AP
+partition as a reaction to a psci_system_reboot, e.g. because of
+a Linux reboot.
+
+This does only reset the SoC partly, i.e. only IP which will not affect
+other partitions. As a result on Apalis iMX8 USB HSIC comes up in a
+state were it does not recognize our USB3503 hub correctly.
+
+Refer to the SCFW doc file sc_fw_port.pdf for more info on the various
+sc_reboot*, sc_reset* functionalities.
+
+Upstream-Status: Inappropriate [configuration]
+
+Related-to: ELB-2702
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ plat/imx/common/imx8_psci.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plat/imx/common/imx8_psci.c b/plat/imx/common/imx8_psci.c
+index 5b53e62f3..d4f6723ec 100644
+--- a/plat/imx/common/imx8_psci.c
++++ b/plat/imx/common/imx8_psci.c
+@@ -23,7 +23,7 @@ void __dead2 imx_system_off(void)
+
+ void __dead2 imx_system_reset(void)
+ {
+- sc_pm_reboot(ipc_handle, SC_PM_RESET_TYPE_COLD);
++ sc_pm_reset(ipc_handle, SC_PM_RESET_TYPE_BOARD);
+ wfi();
+ ERROR("system reset failed.\n");
+ panic();
+--
+2.37.0
+
diff --git a/recipes-bsp/imx-atf/files/0002-imx8m-hab.c-work-around-gcc-12.1-false-positives.patch b/recipes-bsp/imx-atf/files/0002-imx8m-hab.c-work-around-gcc-12.1-false-positives.patch
new file mode 100644
index 0000000..810914c
--- /dev/null
+++ b/recipes-bsp/imx-atf/files/0002-imx8m-hab.c-work-around-gcc-12.1-false-positives.patch
@@ -0,0 +1,46 @@
+From d1dccc8d9e4ff70a742340eb11ea48ae2b88f035 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Mon, 16 May 2022 17:41:23 +0000
+Subject: [PATCH 2/2] imx8m/hab.c: work around gcc 12.1 false positives
+
+| plat/imx/imx8m/hab.c: In function 'imx_hab_handler':
+| plat/imx/imx8m/hab.c:64:57: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
+| 64 | #define HAB_RVT_CHECK_TARGET_ARM64 ((unsigned long)*(uint32_t *)(HAB_RVT_BASE + 0x18))
+| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ plat/imx/imx8m/hab.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/plat/imx/imx8m/hab.c b/plat/imx/imx8m/hab.c
+index 2e5154367..658e14bb4 100644
+--- a/plat/imx/imx8m/hab.c
++++ b/plat/imx/imx8m/hab.c
+@@ -89,6 +89,15 @@ int imx_hab_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2,
+ hab_rvt_failsafe_t *hab_rvt_failsafe;
+ hab_rvt_check_target_t *hab_rvt_check_target;
+
++/* work around gcc 12.1 false positives */
++/*
++| plat/imx/imx8m/hab.c: In function 'imx_hab_handler':
++| plat/imx/imx8m/hab.c:64:57: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
++| 64 | #define HAB_RVT_CHECK_TARGET_ARM64 ((unsigned long)*(uint32_t *)(HAB_RVT_BASE + 0x18))
++| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++*/
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Warray-bounds"
+ switch(x1) {
+ case IMX_SIP_HAB_AUTHENTICATE:
+ hab_rvt_authenticate_image = hab_rvt_authenticate_image_p;
+@@ -116,6 +125,7 @@ int imx_hab_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2,
+ return SMC_UNK;
+
+ };
++#pragma GCC diagnostic pop
+
+ return 0;
+ }
+--
+2.37.0
+
diff --git a/recipes-bsp/imx-atf/imx-atf_%.bbappend b/recipes-bsp/imx-atf/imx-atf_%.bbappend
index 2ea5722..1f204a2 100644
--- a/recipes-bsp/imx-atf/imx-atf_%.bbappend
+++ b/recipes-bsp/imx-atf/imx-atf_%.bbappend
@@ -1,8 +1,8 @@
-PV:tdx = "2.2+git${SRCPV}"
-SRCBRANCH:tdx = "toradex_imx_5.4.70_2.3.0"
-SRCREV:tdx = "2fa8c6349e9a1d965757d44f05a6c72687850b77"
-SRCREV:use-head-next:tdx = "${AUTOREV}"
-SRC_URI:tdx = "git://git.toradex.com/imx-atf.git;protocol=https;branch=${SRCBRANCH}"
+FILESEXTRAPATHS:prepend := "${THISDIR}/files/:"
+SRC_URI:append:tdx = " \
+ file://0001-Revert-Add-NXP-s-SoCs-partition-reboot-support.patch \
+ file://0002-imx8m-hab.c-work-around-gcc-12.1-false-positives.patch \
+"
EXTRA_OEMAKE:append:tdx = " \
BUILD_STRING="${SRCBRANCH}-g${@'${SRCPV}'.replace('AUTOINC+', '')}" \