feat(smmu): separate out smmuv3_security_init from smmuv3_init
Split the smmuv3_init() to separate smmuv3_security_init() from it in
order to allow skipping the default deny policy on reset for certain
SMMUv3 implementations.
Additionally, fix a couple of MISRA warnings.
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Signed-off-by: Vivek Gautam <vivek.gautam@arm.com>
Change-Id: I2127943e709dd1ded34145bd022c930e351bbb4a
diff --git a/plat/arm/board/fvp/fvp_bl31_setup.c b/plat/arm/board/fvp/fvp_bl31_setup.c
index e46dbc9..93289b6 100644
--- a/plat/arm/board/fvp/fvp_bl31_setup.c
+++ b/plat/arm/board/fvp/fvp_bl31_setup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -73,8 +73,19 @@
fvp_timer_init();
/* On FVP RevC, initialize SMMUv3 */
- if ((arm_config.flags & ARM_CONFIG_FVP_HAS_SMMUV3) != 0U)
- smmuv3_init(PLAT_FVP_SMMUV3_BASE);
+ if ((arm_config.flags & ARM_CONFIG_FVP_HAS_SMMUV3) != 0U) {
+ if (smmuv3_security_init(PLAT_FVP_SMMUV3_BASE) != 0) {
+ /*
+ * Don't proceed for smmuv3 initialization if the
+ * security init failed.
+ */
+ return;
+ }
+ /* SMMUv3 initialization failure is not fatal */
+ if (smmuv3_init(PLAT_FVP_SMMUV3_BASE) != 0) {
+ WARN("Failed initializing SMMU.\n");
+ }
+ }
}
void __init bl31_plat_arch_setup(void)