aboutsummaryrefslogtreecommitdiff
path: root/platform/ext
diff options
context:
space:
mode:
authorMingyang Sun <mingyang.sun@arm.com>2021-06-04 17:49:56 +0800
committerKen Liu <ken.liu@arm.com>2021-06-08 08:47:39 +0200
commit61f8fbc280ebb103ac48ecda84dd2ef77852dc69 (patch)
treea5528bd664e95cee7175a6673ee9e09dfb2751fd /platform/ext
parent327bc844621fe6d6702c55479e35348c6c8bfa11 (diff)
downloadtrusted-firmware-m-61f8fbc280ebb103ac48ecda84dd2ef77852dc69.tar.gz
HAL: Replace the 'idx' input param with 'privileged'
In tfm_spm_hal_configure_default_isolation(), a partition index is passed in to query the partition privilege. Change to pass in privilege directly instead of the partition index. Change-Id: Id046431cc8e224a94e83a71564ba2843fabf8ed7 Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'platform/ext')
-rw-r--r--platform/ext/target/arm/mps2/an519/spm_hal.c6
-rw-r--r--platform/ext/target/arm/mps2/an521/spm_hal.c7
-rw-r--r--platform/ext/target/arm/mps2/fvp_sse300/spm_hal.c5
-rw-r--r--platform/ext/target/arm/mps3/an524/spm_hal.c6
-rw-r--r--platform/ext/target/arm/mps3/an547/spm_hal.c5
-rw-r--r--platform/ext/target/arm/musca_b1/secure_enclave/spm_hal.c6
-rw-r--r--platform/ext/target/arm/musca_b1/sse_200/spm_hal.c5
-rw-r--r--platform/ext/target/arm/musca_s1/spm_hal.c6
-rw-r--r--platform/ext/target/cypress/psoc64/spm_hal.c6
-rw-r--r--platform/ext/target/nordic_nrf/common/core/spm_hal.c6
-rw-r--r--platform/ext/target/nuvoton/common/spm_hal.c6
-rw-r--r--platform/ext/target/nxp/common/spm_hal.c5
-rw-r--r--platform/ext/target/stm/common/stm32l5xx/secure/spm_hal.c4
13 files changed, 30 insertions, 43 deletions
diff --git a/platform/ext/target/arm/mps2/an519/spm_hal.c b/platform/ext/target/arm/mps2/an519/spm_hal.c
index 02cd47a97b..c192152c76 100644
--- a/platform/ext/target/arm/mps2/an519/spm_hal.c
+++ b/platform/ext/target/arm/mps2/an519/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -22,11 +22,9 @@ extern ARM_DRIVER_MPC Driver_SRAM1_MPC;
extern const struct memory_region_limits memory_regions;
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- bool privileged = tfm_is_partition_privileged(partition_idx);
-
if (!platform_data) {
return TFM_PLAT_ERR_INVALID_INPUT;
}
diff --git a/platform/ext/target/arm/mps2/an521/spm_hal.c b/platform/ext/target/arm/mps2/an521/spm_hal.c
index 58dee4d888..9390b46fef 100644
--- a/platform/ext/target/arm/mps2/an521/spm_hal.c
+++ b/platform/ext/target/arm/mps2/an521/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -33,16 +33,15 @@ uint32_t periph_num_count = 0;
#ifdef TFM_FIH_PROFILE_ON
fih_int tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
#else /* TFM_FIH_PROFILE_ON */
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
#endif /* TFM_FIH_PROFILE_ON */
{
fih_int fih_rc = FIH_FAILURE;
- bool privileged = tfm_is_partition_privileged(partition_idx);
#if defined(CONFIG_TFM_ENABLE_MEMORY_PROTECT) && (TFM_LVL != 1)
struct mpu_armv8m_region_cfg_t region_cfg;
#endif
diff --git a/platform/ext/target/arm/mps2/fvp_sse300/spm_hal.c b/platform/ext/target/arm/mps2/fvp_sse300/spm_hal.c
index 6b2d8a6d4e..ff26d6fc75 100644
--- a/platform/ext/target/arm/mps2/fvp_sse300/spm_hal.c
+++ b/platform/ext/target/arm/mps2/fvp_sse300/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -27,11 +27,10 @@ uint32_t periph_num_count = 0;
#endif /* CONFIG_TFM_ENABLE_MEMORY_PROTECT */
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
#if defined(CONFIG_TFM_ENABLE_MEMORY_PROTECT) && (TFM_LVL != 1)
- bool privileged = tfm_is_partition_privileged(partition_idx);
struct mpu_armv8m_region_cfg_t region_cfg;
#endif
diff --git a/platform/ext/target/arm/mps3/an524/spm_hal.c b/platform/ext/target/arm/mps3/an524/spm_hal.c
index 8abe9d8a50..30907b20db 100644
--- a/platform/ext/target/arm/mps3/an524/spm_hal.c
+++ b/platform/ext/target/arm/mps3/an524/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -33,11 +33,9 @@
extern const struct memory_region_limits memory_regions;
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- bool privileged = tfm_is_partition_privileged(partition_idx);
-
if (!platform_data) {
return TFM_PLAT_ERR_INVALID_INPUT;
}
diff --git a/platform/ext/target/arm/mps3/an547/spm_hal.c b/platform/ext/target/arm/mps3/an547/spm_hal.c
index 840deac1ba..e8c8c8d684 100644
--- a/platform/ext/target/arm/mps3/an547/spm_hal.c
+++ b/platform/ext/target/arm/mps3/an547/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -29,11 +29,10 @@ uint32_t periph_num_count = 0;
#endif /* CONFIG_TFM_ENABLE_MEMORY_PROTECT */
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
#if defined(CONFIG_TFM_ENABLE_MEMORY_PROTECT) && (TFM_LVL != 1)
- bool privileged = tfm_is_partition_privileged(partition_idx);
struct mpu_armv8m_region_cfg_t region_cfg;
#endif
diff --git a/platform/ext/target/arm/musca_b1/secure_enclave/spm_hal.c b/platform/ext/target/arm/musca_b1/secure_enclave/spm_hal.c
index b80007853c..207db15c15 100644
--- a/platform/ext/target/arm/musca_b1/secure_enclave/spm_hal.c
+++ b/platform/ext/target/arm/musca_b1/secure_enclave/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
* Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -21,12 +21,12 @@
extern const struct memory_region_limits memory_regions;
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
/* Nothing to do, there is no isolation HW in this platform to be
* configured by Secure Enclave */
- (void) partition_idx;
+ (void) privileged;
(void) platform_data;
return TFM_PLAT_ERR_SUCCESS;
}
diff --git a/platform/ext/target/arm/musca_b1/sse_200/spm_hal.c b/platform/ext/target/arm/musca_b1/sse_200/spm_hal.c
index 42c10cffe2..58ac546039 100644
--- a/platform/ext/target/arm/musca_b1/sse_200/spm_hal.c
+++ b/platform/ext/target/arm/musca_b1/sse_200/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -33,10 +33,9 @@ uint32_t periph_num_count = 0;
#endif /* CONFIG_TFM_ENABLE_MEMORY_PROTECT */
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- bool privileged = tfm_is_partition_privileged(partition_idx);
#if defined(CONFIG_TFM_ENABLE_MEMORY_PROTECT) && (TFM_LVL != 1)
struct mpu_armv8m_region_cfg_t region_cfg;
#endif
diff --git a/platform/ext/target/arm/musca_s1/spm_hal.c b/platform/ext/target/arm/musca_s1/spm_hal.c
index dba21775c6..46f0de0d24 100644
--- a/platform/ext/target/arm/musca_s1/spm_hal.c
+++ b/platform/ext/target/arm/musca_s1/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -25,11 +25,9 @@ extern const struct memory_region_limits memory_regions;
struct mpu_armv8m_dev_t dev_mpu_s = { MPU_BASE };
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- bool privileged = tfm_is_partition_privileged(partition_idx);
-
if (!platform_data) {
return TFM_PLAT_ERR_INVALID_INPUT;
}
diff --git a/platform/ext/target/cypress/psoc64/spm_hal.c b/platform/ext/target/cypress/psoc64/spm_hal.c
index 7b4e2fed8e..b996368fcc 100644
--- a/platform/ext/target/cypress/psoc64/spm_hal.c
+++ b/platform/ext/target/cypress/psoc64/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
* Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -35,10 +35,10 @@
extern const struct memory_region_limits memory_regions;
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- (void) partition_idx; /* Unused parameter */
+ (void) privileged; /* Unused parameter */
if (!platform_data) {
return TFM_PLAT_ERR_INVALID_INPUT;
}
diff --git a/platform/ext/target/nordic_nrf/common/core/spm_hal.c b/platform/ext/target/nordic_nrf/common/core/spm_hal.c
index d38100d31d..5b9aa9c11e 100644
--- a/platform/ext/target/nordic_nrf/common/core/spm_hal.c
+++ b/platform/ext/target/nordic_nrf/common/core/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
* Copyright (c) 2020, Nordic Semiconductor ASA. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -29,7 +29,7 @@ static uint32_t periph_num_count = 0;
#endif /* CONFIG_TFM_ENABLE_MEMORY_PROTECT */
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
if (!platform_data) {
@@ -38,7 +38,7 @@ enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
#if defined(CONFIG_TFM_ENABLE_MEMORY_PROTECT) && (TFM_LVL != 1)
- if (!tfm_is_partition_privileged(partition_idx)) {
+ if (!privileged) {
struct mpu_armv8m_region_cfg_t region_cfg;
region_cfg.region_nr = PARTITION_REGION_PERIPH_START + periph_num_count;
diff --git a/platform/ext/target/nuvoton/common/spm_hal.c b/platform/ext/target/nuvoton/common/spm_hal.c
index 500593bbf2..9772399d3d 100644
--- a/platform/ext/target/nuvoton/common/spm_hal.c
+++ b/platform/ext/target/nuvoton/common/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -22,11 +22,9 @@ extern ARM_DRIVER_MPC Driver_SRAM1_MPC;
extern const struct memory_region_limits memory_regions;
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- bool privileged = tfm_is_partition_privileged(partition_idx);
-
if (!platform_data) {
return TFM_PLAT_ERR_INVALID_INPUT;
}
diff --git a/platform/ext/target/nxp/common/spm_hal.c b/platform/ext/target/nxp/common/spm_hal.c
index b9a6e98912..fee91a905b 100644
--- a/platform/ext/target/nxp/common/spm_hal.c
+++ b/platform/ext/target/nxp/common/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
* Copyright 2019-2020 NXP. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -30,10 +30,9 @@ uint32_t periph_num_count = 0;
#endif /* CONFIG_TFM_ENABLE_MEMORY_PROTECT */
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
- bool privileged = tfm_is_partition_privileged(partition_idx);
#if defined(CONFIG_TFM_ENABLE_MEMORY_PROTECT) && (TFM_LVL != 1)
struct mpu_armv8m_region_cfg_t region_cfg;
#endif
diff --git a/platform/ext/target/stm/common/stm32l5xx/secure/spm_hal.c b/platform/ext/target/stm/common/stm32l5xx/secure/spm_hal.c
index 94cab01c93..638d0cfdfc 100644
--- a/platform/ext/target/stm/common/stm32l5xx/secure/spm_hal.c
+++ b/platform/ext/target/stm/common/stm32l5xx/secure/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -19,7 +19,7 @@
extern const struct memory_region_limits memory_regions;
enum tfm_plat_err_t tfm_spm_hal_configure_default_isolation(
- uint32_t partition_idx,
+ bool privileged,
const struct platform_data_t *platform_data)
{
/* plat data are ignored */