blob: 211fb9e669d386757a262e3f835c88fcf13404ab [file] [log] [blame]
Patrick Williams2390b1b2022-11-03 13:47:49 -05001From f3686dfb8fb97cb42c3d4f8ee2d7aa736d5cb760 Mon Sep 17 00:00:00 2001
2From: Satish Kumar <satish.kumar01@arm.com>
3Date: Wed, 3 Aug 2022 15:50:27 +0100
4Subject: [PATCH 4/6] Platform Partition: Allow configuration of input and
5 output buffer
6
7The change makes input and output buffer size macros used by
8the platform partition to be configured by cmake. This will
9allow platforms to set the buffer size accordingly.
10
11Change-Id: Ia492ce02f8744b0157228d9be51a9ec5b7c88ef6
12Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
13Upstream-Status: Accepted [TF-Mv1.7.0]
14---
15 config/config_default.cmake | 2 ++
16 secure_fw/partitions/platform/CMakeLists.txt | 6 ++++++
17 secure_fw/partitions/platform/platform_sp.c | 9 +++++++--
18 3 files changed, 15 insertions(+), 2 deletions(-)
19
20diff --git a/config/config_default.cmake b/config/config_default.cmake
21index 3112b707bc..497c972dc9 100755
22--- a/config/config_default.cmake
23+++ b/config/config_default.cmake
24@@ -141,6 +141,8 @@ set(ATTEST_INCLUDE_OPTIONAL_CLAIMS ON CACHE BOOL "Include opt
25 set(ATTEST_INCLUDE_COSE_KEY_ID OFF CACHE BOOL "Include COSE key-id in initial attestation token")
26
27 set(TFM_PARTITION_PLATFORM ON CACHE BOOL "Enable Platform partition")
28+set(PLATFORM_SERVICE_INPUT_BUFFER_SIZE 64 CACHE STRING "Size of input buffer in platform service.")
29+set(PLATFORM_SERVICE_OUTPUT_BUFFER_SIZE 64 CACHE STRING "Size of output buffer in platform service.")
30
31 set(TFM_PARTITION_AUDIT_LOG OFF CACHE BOOL "Enable Audit Log partition")
32
33diff --git a/secure_fw/partitions/platform/CMakeLists.txt b/secure_fw/partitions/platform/CMakeLists.txt
34index 4b37cd780c..3070f89d6d 100644
35--- a/secure_fw/partitions/platform/CMakeLists.txt
36+++ b/secure_fw/partitions/platform/CMakeLists.txt
37@@ -47,6 +47,12 @@ target_link_libraries(tfm_psa_rot_partition_platform
38 tfm_spm
39 )
40
41+target_compile_definitions(tfm_psa_rot_partition_platform
42+ PRIVATE
43+ INPUT_BUFFER_SIZE=${PLATFORM_SERVICE_INPUT_BUFFER_SIZE}
44+ OUTPUT_BUFFER_SIZE=${PLATFORM_SERVICE_OUTPUT_BUFFER_SIZE}
45+)
46+
47 ############################ Secure API ########################################
48
49 target_sources(tfm_sprt
50diff --git a/secure_fw/partitions/platform/platform_sp.c b/secure_fw/partitions/platform/platform_sp.c
51index 673cb0ee06..87bd434720 100644
52--- a/secure_fw/partitions/platform/platform_sp.c
53+++ b/secure_fw/partitions/platform/platform_sp.c
54@@ -38,8 +38,13 @@ static const int32_t nv_counter_access_map[NV_COUNTER_MAP_SIZE] = {
55 #include "psa/service.h"
56 #include "region_defs.h"
57
58-#define INPUT_BUFFER_SIZE 64
59-#define OUTPUT_BUFFER_SIZE 64
60+#ifndef INPUT_BUFFER_SIZE
61+#define INPUT_BUFFER_SIZE 64
62+#endif
63+
64+#ifndef OUTPUT_BUFFER_SIZE
65+#define OUTPUT_BUFFER_SIZE 64
66+#endif
67
68 typedef enum tfm_platform_err_t (*plat_func_t)(const psa_msg_t *msg);
69 #endif /* TFM_PSA_API */
70--
712.25.1
72