aboutsummaryrefslogtreecommitdiff
path: root/platform/ext/target/mps2/an519/spm_hal.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ext/target/mps2/an519/spm_hal.c')
-rw-r--r--platform/ext/target/mps2/an519/spm_hal.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/ext/target/mps2/an519/spm_hal.c b/platform/ext/target/mps2/an519/spm_hal.c
index c85d8d0094..19a52c292a 100644
--- a/platform/ext/target/mps2/an519/spm_hal.c
+++ b/platform/ext/target/mps2/an519/spm_hal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -41,12 +41,21 @@ enum tfm_plat_err_t tfm_spm_hal_init_isolation_hw(void)
}
void tfm_spm_hal_configure_default_isolation(
- const struct tfm_spm_partition_platform_data_t *platform_data)
+ uint32_t partition_idx,
+ const struct tfm_spm_partition_platform_data_t *platform_data)
{
+ bool privileged = tfm_is_partition_privileged(partition_idx);
if (platform_data) {
if (platform_data->periph_ppc_bank != PPC_SP_DO_NOT_CONFIGURE) {
ppc_configure_to_secure(platform_data->periph_ppc_bank,
platform_data->periph_ppc_loc);
+ if (privileged) {
+ ppc_clr_secure_unpriv(platform_data->periph_ppc_bank,
+ platform_data->periph_ppc_loc);
+ } else {
+ ppc_en_secure_unpriv(platform_data->periph_ppc_bank,
+ platform_data->periph_ppc_loc);
+ }
}
}
}