blob: 96ea631fed5af99b91a09c929836d8bad92cb669 [file] [log] [blame]
/*
* Copyright (c) 2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
{{utilities.donotedit_warning}}
#ifndef __CONFIG_IMPL_H__
#define __CONFIG_IMPL_H__
{% if ipc_partition_num > 0 and sfn_partition_num == 0 %}
#define {{"%-56s"|format("CONFIG_TFM_SPM_BACKEND_IPC")}} 1
#if TFM_LVL > 1
#define {{"%-56s"|format("CONFIG_TFM_PSA_API_SUPERVISOR_CALL")}} 1
#else
#define {{"%-56s"|format("CONFIG_TFM_PSA_API_THREAD_CALL")}} 1
#define {{"%-56s"|format("CONFIG_TFM_SPM_THREAD_STACK_SIZE")}} 1024
#endif
{% elif sfn_partition_num > 0 and ipc_partition_num == 0 %}
#define {{"%-56s"|format("CONFIG_TFM_SPM_BACKEND_SFN")}} 1
#if TFM_LVL > 1
#error "High isolation level SFN model is not supported."
#endif
{% set total_stk = namespace(size=0) %}
{% for partition in partitions %}
{% if "0x" in partition.manifest.stack_size or "0X" in partition.manifest.stack_size %}
{% set total_stk.size = total_stk.size + partition.manifest.stack_size|int(base=16) %}
{% else %}
{% set total_stk.size = total_stk.size + partition.manifest.stack_size|int(base=10) %}
{% endif %}
{% endfor %}
#define {{"%-36s"|format("SUM_OF_PARTITION_STACK_SIZES")}} ((({{"0x%x"|format(total_stk.size)}} >> 1) + 0x7) & (~0x7))
{% elif sfn_partition_num > 0 and ipc_partition_num > 0 %}
#error "IPC and SFN co-work not supported yet."
{% else %}
#error "Invalid partition number input, check configurations."
{% endif %}
#include "psa_interface_redirect.h"
#endif /* __CONFIG_IMPL_H__ */