[PATCH 03/13] arm-bsp/trusted-firmware-m: corstone-1000: Increase PS_MAX_ASSET_SIZE and CRYPTO_IOVEC_BUFFER_SIZE for EFI variable support

Harsimran Singh Tungal <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arm
Message-ID <[email protected]>
Increase `PS_MAX_ASSET_SIZE` and `CRYPTO_IOVEC_BUFFER_SIZE` for the
Corstone-1000 platform to support large EFI variable storage required
by the UEFI firmware update flow and to pass Arm Architecture Compliance
Suite (ACS) tests.

Signed-off-by: Harsimran Singh Tungal <[email protected]>
---
 ...m-Corstone1000-Increase-buffer-sizes.patch | 40 +++++++++++++++++++
 .../trusted-firmware-m-corstone1000.inc       |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0028-Platform-Corstone1000-Increase-buffer-sizes.patch

diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0028-Platform-Corstone1000-Increase-buffer-sizes.patch b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0028-Platform-Corstone1000-Increase-buffer-sizes.patch
new file mode 100644
index 00000000..2aaa4fcd
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/files/corstone1000/0028-Platform-Corstone1000-Increase-buffer-sizes.patch
@@ -0,0 +1,40 @@
+From e3d94988f14b3004606c247b39bda5ade119545f Mon Sep 17 00:00:00 2001
+From: Harsimran Singh Tungal <[email protected]>
+Date: Wed, 12 Mar 2025 13:10:47 +0000
+Subject: [PATCH 2/2] Platform: Corstone1000: Increase buffer sizes
+
+Increase PSA_MAX_ASSET_SIZE and CRYPTO_IOVEC_BUFFER_SIZE
+to accommodate large size EFI variables set by new U-Boot version.
+
+This change is required to pass ACS tests related to Set/Get
+EFI variables. These ACS tests started failing after introducing new
+version of U-Boot, Trusted-Services and Trusted-Firmware-M while
+implementing PSA FWU support.
+
+Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/39517/1]
+Signed-off-by: Harsimran Singh Tungal <[email protected]>
+---
+ platform/ext/target/arm/corstone1000/config_tfm_target.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/platform/ext/target/arm/corstone1000/config_tfm_target.h b/platform/ext/target/arm/corstone1000/config_tfm_target.h
+index 0b410dfd4..a65305bd4 100644
+--- a/platform/ext/target/arm/corstone1000/config_tfm_target.h
++++ b/platform/ext/target/arm/corstone1000/config_tfm_target.h
+@@ -24,11 +24,11 @@
+ #define ITS_MAX_ASSET_SIZE   2048
+ 
+ /* The maximum asset size to be stored in the Protected Storage */
+-#define PS_MAX_ASSET_SIZE   2592
++#define PS_MAX_ASSET_SIZE   3500
+ 
+ /* This is needed to be able to process the EFI variables during PS writes. */
+ #define CRYPTO_ENGINE_BUF_SIZE 0x5000
+ 
+ /* This is also has to be increased to fit the EFI variables into the iovecs. */
+-#define CRYPTO_IOVEC_BUFFER_SIZE    6000
++#define CRYPTO_IOVEC_BUFFER_SIZE    7200
+ #endif /* __CONFIG_TFM_TARGET_H__ */
+-- 
+2.25.1
+
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc
index 87302069..562abb7c 100644
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m-corstone1000.inc
@@ -46,6 +46,7 @@ SRC_URI:append:corstone1000 = " \
     file://0025-FWU-Make-platform-specific-TFM_FWU_BOOTLOADER_LIB-se.patch \
     file://0026-Platform-CS1000-Enable-FWU-partition.patch \
     file://0027-Platform-Corstone1000-Implement-Bootloader-Abstracti.patch \
+    file://0028-Platform-Corstone1000-Increase-buffer-sizes.patch \
     "
 
 FILESEXTRAPATHS:prepend:corstone1000-mps3 := "${THISDIR}/files/corstone1000/psa-adac:"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.