[PATCH 1/2] arm-bsp/trusted-services: Corstone-1000: Move the MM communication buffer configs to TS CMake

Michael Safwat <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arm
Message-ID <[email protected]>
Two variables are moved from the meta-arm-bsp layer to the Trusted-Services
Corstone-1000 platform CMake file so the MM communication buffer address and
page count can be configured from the CMake layer.

Signed-off-by: Michael Safwat <[email protected]>
---
 ...he-com-buffer-address-and-page-count.patch | 41 +++++++++++++++++++
 .../trusted-services/ts-arm-platforms.inc     |  1 +
 .../ts-sp-se-proxy_%.bbappend                 |  4 +-
 .../ts-sp-smm-gateway_%.bbappend              |  4 +-
 4 files changed, 44 insertions(+), 6 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-security/trusted-services/corstone1000/0016-Add-the-com-buffer-address-and-page-count.patch

diff --git a/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0016-Add-the-com-buffer-address-and-page-count.patch b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0016-Add-the-com-buffer-address-and-page-count.patch
new file mode 100644
index 00000000..5b138943
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0016-Add-the-com-buffer-address-and-page-count.patch
@@ -0,0 +1,41 @@
+From 0423349ec142bd1c4a6cc452eed9a0f5e43c8539 Mon Sep 17 00:00:00 2001
+From: Michael Safwat <[email protected]>
+Date: Mon, 23 Jun 2025 13:06:10 +0000
+Subject: [PATCH] Plat: Corstone-1000: Add MM communication buffer configs to
+ CMake
+Upstream-Status: Pending
+
+Two variables are added into the Corstone-1000 platform
+CMake file so the MM communication buffer address and
+the page count can be configured.
+
+Change-Id: I6bbdc90231b0417d4318d6709568113ab1f2c8ce
+Signed-off-by: Michael Safwat <[email protected]>
+---
+ platform/providers/arm/corstone1000/platform.cmake | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/platform/providers/arm/corstone1000/platform.cmake b/platform/providers/arm/corstone1000/platform.cmake
+index 2afcdea8..37c6accf 100644
+--- a/platform/providers/arm/corstone1000/platform.cmake
++++ b/platform/providers/arm/corstone1000/platform.cmake
+@@ -1,5 +1,5 @@
+ #-------------------------------------------------------------------------------
+-# Copyright (c) 2021-2024, Arm Limited and Contributors. All rights reserved.
++# Copyright (c) 2021-2025, Arm Limited and Contributors. All rights reserved.
+ #
+ # SPDX-License-Identifier: BSD-3-Clause
+ #
+@@ -11,6 +11,9 @@ set(SMM_RPC_CALLER_SESSION_SHARED_MEMORY_SIZE 4*4096 CACHE STRING "RPC caller bu
+ set(SMM_SP_HEAP_SIZE 80*1024 CACHE STRING "SMM gateway SP heap size")
+ set(PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE 0x43C0 CACHE STRING "Size of the RSE_COMMS_PAYLOAD buffer")
+ set(COMMS_MHU_MSG_SIZE 0x4500 CACHE STRING "Max message size that can be transfered via MHU")
++set(MM_COMM_BUFFER_ADDRESS "0x00000000 0x81FFF000" CACHE STRING "MM Communication buffer start address")
++set(MM_COMM_BUFFER_PAGE_COUNT 0x1 CACHE STRING "MM Communication buffer page count")
++
+ 
+ target_compile_definitions(${TGT} PRIVATE
+ 	SMM_VARIABLE_INDEX_STORAGE_UID=0x787
+-- 
+2.43.0
+
diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
index 6d44a5c7..543413ea 100644
--- a/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
+++ b/meta-arm-bsp/recipes-security/trusted-services/ts-arm-platforms.inc
@@ -18,6 +18,7 @@ SRC_URI:append:corstone1000  = " \
     file://0014-Revert-Make-constraints-of-NV-UEFI-variables-persist.patch \
     file://0015-se-proxy-protobuf-change.patch \
     file://0021-Align-PSA-Crypto-structs-with-TF-Mv2.1.1.patch \
+    file://0016-Add-the-com-buffer-address-and-page-count.patch \
     "
 # The patches above introduce errors with GCC 14.1, silence them for now
 CFLAGS:append:corstone1000 = " -Wno-int-conversion -Wno-implicit-function-declaration"
diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend b/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend
index 64ab5bea..d7a0f777 100644
--- a/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend
+++ b/meta-arm-bsp/recipes-security/trusted-services/ts-sp-se-proxy_%.bbappend
@@ -1,8 +1,6 @@
 require ts-arm-platforms.inc
 
-EXTRA_OECMAKE:append:corstone1000 = " -DMM_COMM_BUFFER_ADDRESS="0x00000000 0x81FFF000" \
-    -DMM_COMM_BUFFER_PAGE_COUNT="1" \
-    -DSP_HEAP_SIZE=70*1024 \
+EXTRA_OECMAKE:append:corstone1000 = " -DSP_HEAP_SIZE=70*1024 \
     "
 
 # Proxy is pointless on fvp-base as there is no dedicated security subsystem. It could be
diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend b/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend
index 3d8f0d25..b4de3725 100644
--- a/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend
+++ b/meta-arm-bsp/recipes-security/trusted-services/ts-sp-smm-gateway_%.bbappend
@@ -1,8 +1,6 @@
 require ts-arm-platforms.inc
 
-EXTRA_OECMAKE:append:corstone1000 = " -DMM_COMM_BUFFER_ADDRESS="0x00000000 0x81FFF000" \
-    -DMM_COMM_BUFFER_PAGE_COUNT="1" \
-    -DSMM_GATEWAY_MAX_UEFI_VARIABLES=60 \
+EXTRA_OECMAKE:append:corstone1000 = " -DSMM_GATEWAY_MAX_UEFI_VARIABLES=60 \
     "
 
 EXTRA_OECMAKE:append:fvp-base = " -DMM_COMM_BUFFER_ADDRESS="0x00000000 0x81000000" \
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.