Build: Introduce TFM_CONFIG_USE_TRUSTZONE
Both CMake variable and C define.
Default to ON, set to OFF in appropriate platform configs.
Used to control inclusion of veneers, etc.
Change-Id: Ic1abb17fc6c5b8ac23b5dff09b52aef4946b6f94
Signed-off-by: Chris Brand <chris.brand@cypress.com>
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index c039929..8aff0d5 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -1,6 +1,8 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
-# Copyright (c) 2021, Cypress Semiconductor Corporation. All rights reserved.
+# Copyright (c) 2021-2022 Cypress Semiconductor Corporation (an Infineon
+# company) or an affiliate of Cypress Semiconductor Corporation. All rights
+# reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -97,7 +99,7 @@
############################# Secure veneers ###################################
-if(NOT (TFM_PSA_API AND TFM_MULTI_CORE_TOPOLOGY))
+if(TFM_CONFIG_USE_TRUSTZONE)
add_library(tfm_s_veneers STATIC)
target_sources(tfm_s_veneers
diff --git a/secure_fw/partitions/ns_agent_tz/CMakeLists.txt b/secure_fw/partitions/ns_agent_tz/CMakeLists.txt
index 31d0a18..3813a6a 100644
--- a/secure_fw/partitions/ns_agent_tz/CMakeLists.txt
+++ b/secure_fw/partitions/ns_agent_tz/CMakeLists.txt
@@ -7,7 +7,7 @@
#
#-------------------------------------------------------------------------------
-if (TFM_MULTI_CORE_TOPOLOGY)
+if (NOT TFM_CONFIG_USE_TRUSTZONE)
return()
endif()
diff --git a/secure_fw/spm/CMakeLists.txt b/secure_fw/spm/CMakeLists.txt
index d88fb63..78e437a 100755
--- a/secure_fw/spm/CMakeLists.txt
+++ b/secure_fw/spm/CMakeLists.txt
@@ -1,6 +1,8 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
-# Copyright (c) 2021-2022, Cypress Semiconductor Corporation. All rights reserved.
+# Copyright (c) 2021-2022 Cypress Semiconductor Corporation (an Infineon
+# company) or an affiliate of Cypress Semiconductor Corporation. All rights
+# reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -156,7 +158,7 @@
############################# Secure veneers ###################################
-if(NOT TFM_MULTI_CORE_TOPOLOGY)
+if(TFM_CONFIG_USE_TRUSTZONE)
# If this is added to the spm, it is discarded as it is not used. Since the
# spm is a static library it can't generate veneers under all compilers so
# instead this single file is added to the tfm_s target.
diff --git a/secure_fw/spm/include/tfm_nspm.h b/secure_fw/spm/include/tfm_nspm.h
index 7906f80..fe1069d 100644
--- a/secure_fw/spm/include/tfm_nspm.h
+++ b/secure_fw/spm/include/tfm_nspm.h
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2018-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
+ * or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -12,7 +14,7 @@
#define TFM_NS_CLIENT_INVALID_ID ((int32_t)0)
-#if !defined(TFM_MULTI_CORE_TOPOLOGY)
+#ifdef TFM_CONFIG_USE_TRUSTZONE
/*
* The macro cmse_nsfptr_create defined in the gcc library uses the non-standard
* gcc C lanuage extension 'typeof'. TF-M is built with '-std=c99' so typeof
@@ -38,7 +40,7 @@
#define __tfm_nspm_secure_gateway_attributes__ \
__attribute__((cmse_nonsecure_entry))
#endif /* !__ARMCC_VERSION */
-#endif /* __GNUC__ && !TFM_MULTI_CORE_TOPOLOGY */
+#endif /* TFM_CONFIG_USE_TRUSTZONE */
/**
* \brief initialise the NS context database
diff --git a/secure_fw/spm/include/tfm_secure_api.h b/secure_fw/spm/include/tfm_secure_api.h
index 36d1be0..4b5e453 100644
--- a/secure_fw/spm/include/tfm_secure_api.h
+++ b/secure_fw/spm/include/tfm_secure_api.h
@@ -10,7 +10,7 @@
#ifndef __TFM_SECURE_API_H__
#define __TFM_SECURE_API_H__
-#ifndef TFM_MULTI_CORE_TOPOLOGY
+#ifdef TFM_CONFIG_USE_TRUSTZONE
#include <arm_cmse.h>
#endif
#include "tfm_arch.h"