diff mbox series

[4/4] configs/avenger96_defconfig: downgrade to TF-A v2.5

Message ID 20231105183719.3811015-4-peter@korsgaard.com
State Accepted
Headers show
Series [1/4] configs/stm32mp157a_dk1_defconfig: unbreak TF-A build with GCC >= 12 | expand

Commit Message

Peter Korsgaard Nov. 5, 2023, 6:37 p.m. UTC
Commit 27bf08e4addb78 (configs/avenger96_defconfig: bump ATF version to 2.9
for binutils 2.39+ support) bumped TF-A, but it unfortunately does not boot
and instead dies with a panic:

NOTICE:  CPU: STM32MP157AAC Rev.B
NOTICE:  Model: Arrow Electronics STM32MP157A Avenger96 board
ERROR:   nvmem node board_id not found
INFO:    PMIC version = 0x10
ERROR:   Product_below_2v5=1:
ERROR:          HSLVEN update is destructive,
ERROR:          no update as VDD > 2.7V
PANIC at PC : 0x2fff086f

Exception mode=0x00000016 at: 0x2fff086f

Instead use v2.5 to match the other stm32mp1 boards and use the same E=0
-Werror workaround.  The avenger95 support is unfortunately broken since
v2.3 with the introduction of authentication support, so add a patch to the
DTS to fix that.

Notice that the authentication support was reworked in v2.7 so it is skipped
for the mp157a variant used on the avenger96, so the patch is not upstreamable.

While we're at it, also drop the debug option for consistency with the other
boards.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...ger96.dts-enable-hash-device-to-unbr.patch | 51 +++++++++++++++++++
 configs/avenger96_defconfig                   |  6 +--
 2 files changed, 54 insertions(+), 3 deletions(-)
 create mode 100644 board/arrow/avenger96/patches/arm-trusted-firmware/0001-stm32mp157a-avenger96.dts-enable-hash-device-to-unbr.patch

Comments

Peter Korsgaard Nov. 10, 2023, 12:26 p.m. UTC | #1
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 > Commit 27bf08e4addb78 (configs/avenger96_defconfig: bump ATF version to 2.9
 > for binutils 2.39+ support) bumped TF-A, but it unfortunately does not boot
 > and instead dies with a panic:

 > NOTICE:  CPU: STM32MP157AAC Rev.B
 > NOTICE:  Model: Arrow Electronics STM32MP157A Avenger96 board
 > ERROR:   nvmem node board_id not found
 > INFO:    PMIC version = 0x10
 > ERROR:   Product_below_2v5=1:
 > ERROR:          HSLVEN update is destructive,
 > ERROR:          no update as VDD > 2.7V
 > PANIC at PC : 0x2fff086f

 > Exception mode=0x00000016 at: 0x2fff086f

 > Instead use v2.5 to match the other stm32mp1 boards and use the same E=0
 > -Werror workaround.  The avenger95 support is unfortunately broken since
 > v2.3 with the introduction of authentication support, so add a patch to the
 > DTS to fix that.

 > Notice that the authentication support was reworked in v2.7 so it is skipped
 > for the mp157a variant used on the avenger96, so the patch is not upstreamable.

 > While we're at it, also drop the debug option for consistency with the other
 > boards.

 > Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Committed to 2023.08.x, thanks.
diff mbox series

Patch

diff --git a/board/arrow/avenger96/patches/arm-trusted-firmware/0001-stm32mp157a-avenger96.dts-enable-hash-device-to-unbr.patch b/board/arrow/avenger96/patches/arm-trusted-firmware/0001-stm32mp157a-avenger96.dts-enable-hash-device-to-unbr.patch
new file mode 100644
index 0000000000..8cec0af3b1
--- /dev/null
+++ b/board/arrow/avenger96/patches/arm-trusted-firmware/0001-stm32mp157a-avenger96.dts-enable-hash-device-to-unbr.patch
@@ -0,0 +1,51 @@ 
+From 336dc301e02d64507447f82020ce7a349797bef3 Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <peter@korsgaard.com>
+Date: Sun, 5 Nov 2023 14:59:16 +0100
+Subject: [PATCH] stm32mp157a-avenger96.dts: enable hash device to unbreak boot
+ issue
+
+The avenger96 board was forgotten when authentication support was added with
+commit 4bdb1a7a6a1325343 (stm32mp1: add authentication support for
+stm32image), causing a panic when stm32mp_init_auth() is called, so fix it
+similar to how it was done for the STM32MP157C-ED1 board with:
+
+commit b37b52ef8bc05bfd8dcca992d4ba84cd7c5d23bb
+Author: Yann Gautier <yann.gautier@st.com>
+Date:   Tue Oct 13 18:05:06 2020 +0200
+
+    fdts: add missing hash node in STM32MP157C-ED1 board DT
+
+    Without this node, the board fails to boot and panics in the function
+    stm32mp_init_auth().
+
+    Change-Id: Ia54924410dac2a8c94dd6e45d7e93977fe7d87e2
+    Signed-off-by: Yann Gautier <yann.gautier@st.com>
+
+Upstream: N/A - Upstream reworked authentication to skip it for MP157A
+ variant since v2.7, see "feat(st): disable authentication based on
+ part_number"
+ (https://github.com/ARM-software/arm-trusted-firmware/commit/49abdfd8cececb91a4bc7e7b29a30c09dce461c7)
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ fdts/stm32mp157a-avenger96.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/fdts/stm32mp157a-avenger96.dts b/fdts/stm32mp157a-avenger96.dts
+index b967736e4..76edecb83 100644
+--- a/fdts/stm32mp157a-avenger96.dts
++++ b/fdts/stm32mp157a-avenger96.dts
+@@ -271,6 +271,10 @@
+ 	};
+ };
+ 
++&hash1 {
++	status = "okay";
++};
++
+ &rng1 {
+ 	status = "okay";
+ };
+-- 
+2.39.2
+
diff --git a/configs/avenger96_defconfig b/configs/avenger96_defconfig
index adfd7585c4..142f6dd8c9 100644
--- a/configs/avenger96_defconfig
+++ b/configs/avenger96_defconfig
@@ -1,6 +1,7 @@ 
 BR2_arm=y
 BR2_cortex_a7=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
+BR2_GLOBAL_PATCH_DIR="board/arrow/avenger96/patches"
 BR2_ROOTFS_OVERLAY="board/arrow/avenger96/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
 BR2_LINUX_KERNEL=y
@@ -17,10 +18,9 @@  BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
-BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.9"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.5"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="stm32mp1"
-BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157a-avenger96.dtb"
-BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157a-avenger96.dtb E=0"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
 BR2_TARGET_UBOOT=y