summaryrefslogtreecommitdiff
path: root/fwu/ns_bl1u/ns_bl1u_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'fwu/ns_bl1u/ns_bl1u_main.c')
-rw-r--r--fwu/ns_bl1u/ns_bl1u_main.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/fwu/ns_bl1u/ns_bl1u_main.c b/fwu/ns_bl1u/ns_bl1u_main.c
index c6e6582..f55a79e 100644
--- a/fwu/ns_bl1u/ns_bl1u_main.c
+++ b/fwu/ns_bl1u/ns_bl1u_main.c
@@ -210,22 +210,28 @@ void ns_bl1u_main(void)
ns_bl1u_fwu_smc_call(FWU_SMC_IMAGE_EXECUTE, image_desc->image_id,
0, 0, 0);
CHECK_SMC_RESULT(0);
- }
+
#if FWU_BL_TEST
- if (image_desc->execute == FWU_EXEC) {
/* Check if executing again the same image returns error. */
INFO("NS_BL1U: TEST Calling SMC to execute again\n");
ns_bl1u_fwu_smc_call(FWU_SMC_IMAGE_EXECUTE,
ns_bl1u_desc[index].image_id, 0, 0, 0);
CHECK_SMC_RESULT(-EPERM);
- } else if (image_desc->image_id != SCP_BL2U_IMAGE_ID) {
- /* The SCP_BL2U shouldn't be reset as it is needed by BL2U */
- INFO("NS_BL1U: TEST Calling SMC to RESET\n");
- ns_bl1u_fwu_smc_call(FWU_SMC_IMAGE_RESET, image_desc->image_id,
- 0, 0, 0);
- CHECK_SMC_RESULT(0);
- }
#endif
+ } else {
+ /*
+ * If the image is not executable, its internal state
+ * needs to be reset, unless it is for later consumption
+ * by another CPU (like for the SCP_BL2U firmware).
+ */
+ if (image_desc->image_id != SCP_BL2U_IMAGE_ID) {
+ INFO("NS_BL1U: Calling RESET SMC\n");
+ ns_bl1u_fwu_smc_call(FWU_SMC_IMAGE_RESET,
+ image_desc->image_id,
+ 0, 0, 0);
+ CHECK_SMC_RESULT(0);
+ }
+ }
}
/*