aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaykumar Pitambarbhai Patel <jaykumar.pitambarbhaipatel@arm.com>2020-01-06 12:42:42 +0530
committerEdison Ai <edison.ai@arm.com>2020-01-10 09:50:47 +0800
commit98e6ce4967a3a2c81aee3bddc55579bda1fa6789 (patch)
tree37b622608cef7f4102734817177c164bee83ea6c
parentcba90782908626f955fe361f803558181a85c6fc (diff)
downloadtrusted-firmware-m-98e6ce4967a3a2c81aee3bddc55579bda1fa6789.tar.gz
Core: Initialize UART after programming the PPC/SAU
When the PSA API reset test was run, the test failed at reboot as FVP AN521 has some problem with PPC setting over reset. It doesn't reset the PPC setting over reset which causes the hard fault when TFM programs the UART at reboot. Ideally, the access to any device should be done after programming the necessary security components such as PPC/SAU. The test passes when the patch was applied. Change-Id: I98ffd2bf53580bb87cb27f4f542d2466f2bf4426 Signed-off-by: Jaykumar Pitambarbhai Patel <jaykumar.pitambarbhaipatel@arm.com>
-rw-r--r--secure_fw/core/tfm_core.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/secure_fw/core/tfm_core.c b/secure_fw/core/tfm_core.c
index 548609e81..33a18de7b 100644
--- a/secure_fw/core/tfm_core.c
+++ b/secure_fw/core/tfm_core.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -75,6 +75,15 @@ int32_t tfm_core_init(void)
return TFM_ERROR_GENERIC;
}
+ /*
+ * Access to any peripheral should be performed after programming
+ * the necessary security components such as PPC/SAU.
+ */
+ plat_err = tfm_spm_hal_init_isolation_hw();
+ if (plat_err != TFM_PLAT_ERR_SUCCESS) {
+ return TFM_ERROR_GENERIC;
+ }
+
/* Performs platform specific initialization */
plat_err = tfm_spm_hal_post_init();
if (plat_err != TFM_PLAT_ERR_SUCCESS) {
@@ -89,11 +98,6 @@ int32_t tfm_core_init(void)
tfm_core_validate_boot_data();
- plat_err = tfm_spm_hal_init_isolation_hw();
- if (plat_err != TFM_PLAT_ERR_SUCCESS) {
- return TFM_ERROR_GENERIC;
- }
-
configure_ns_code();
/* Configures all interrupts to retarget NS state, except for