diff options
Diffstat (limited to 'secure_fw/partitions/ns_proxy_partition')
-rw-r--r-- | secure_fw/partitions/ns_proxy_partition/CMakeLists.txt | 14 | ||||
-rw-r--r-- | secure_fw/partitions/ns_proxy_partition/static_info_ns_proxy.c | 65 |
2 files changed, 79 insertions, 0 deletions
diff --git a/secure_fw/partitions/ns_proxy_partition/CMakeLists.txt b/secure_fw/partitions/ns_proxy_partition/CMakeLists.txt new file mode 100644 index 0000000000..e08525ebe3 --- /dev/null +++ b/secure_fw/partitions/ns_proxy_partition/CMakeLists.txt @@ -0,0 +1,14 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2021, Arm Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +#------------------------------------------------------------------------------- + +cmake_minimum_required(VERSION 3.15) +cmake_policy(SET CMP0079 NEW) + +target_sources(tfm_partitions + INTERFACE + $<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/static_info_ns_proxy.c> +) diff --git a/secure_fw/partitions/ns_proxy_partition/static_info_ns_proxy.c b/secure_fw/partitions/ns_proxy_partition/static_info_ns_proxy.c new file mode 100644 index 0000000000..700a86ba15 --- /dev/null +++ b/secure_fw/partitions/ns_proxy_partition/static_info_ns_proxy.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021, Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + */ + +/***** WARNING: This file SHOULD BE CHANGED according to storage template *****/ + +#include <stdint.h> +#include <stddef.h> +#include "region.h" +#include "region_defs.h" +#include "spm_partition_defs.h" +#include "load/partition_static_load.h" +#include "load/partition_defs.h" +#include "load/service_defs.h" +#include "psa_manifest/pid.h" +#include "psa_manifest/sid.h" + +#define TFM_SP_NS_PROXY_NDEPS (0) +#define TFM_SP_NS_PROXY_NSERVS (0) + +/* Memory region declaration */ +REGION_DECLARE(Image$$, ARM_LIB_STACK, $$ZI$$Base); +REGION_DECLARE(Image$$, ARM_LIB_STACK, $$ZI$$Limit); + +/* Entrypoint function declaration */ +extern void tfm_nspm_thread_entry(void); + +struct partition_tfm_sp_ns_proxy_static_info_t { + /* common length data */ + struct partition_static_info_t cmn_info; + /* per-partition variable length data */ + uintptr_t stack_pos; + uintptr_t heap_pos; +} __attribute__((aligned(4))); + +/* Partition static, deps, service static data. Put to a dedicated section. */ +const struct partition_tfm_sp_ns_proxy_static_info_t + tfm_sp_ns_proxy_static __attribute__((used, section(".partition_info"))) = { + .cmn_info = { + .psa_ff_ver = 0x0100 | PARTITION_INFO_MAGIC, + .pid = TFM_SP_NON_SECURE_ID, + .flags = PARTITION_PRI_LOWEST | SPM_PART_FLAG_IPC +#if TFM_MULTI_CORE_TOPOLOGY + | SPM_PART_FLAG_PSA_ROT +#endif + , + .entry = ENTRY_TO_POSITION(tfm_nspm_thread_entry), + .stack_size = S_PSP_STACK_SIZE, + .heap_size = 0, + .ndeps = TFM_SP_NS_PROXY_NDEPS, + .nservices = TFM_SP_NS_PROXY_NSERVS, + .plat_cookie = 0, +#if TFM_LVL == 3 + .mems = { + .start = PART_REGION_ADDR(ARM_LIB_STACK, $$ZI$$Base), + .limit = PART_REGION_ADDR(ARM_LIB_STACK, $$ZI$$Limit), + }, +#endif + }, + .stack_pos = PART_REGION_ADDR(ARM_LIB_STACK, $$ZI$$Base), + .heap_pos = 0, +}; |