fix(trp): Distinguish between cold and warm boot
The original design prevented the primary CPU from doing a
warm boot sequence. This patch allows the primary to do warm
boot as well.
Signed-off-by: Mark Dykes <mark.dykes@arm.com>
Change-Id: I6baa50c3dff3051ff8b3e5a922d340634f651867
diff --git a/services/std_svc/rmmd/trp/trp_entry.S b/services/std_svc/rmmd/trp/trp_entry.S
index 23b48fb..5826d75 100644
--- a/services/std_svc/rmmd/trp/trp_entry.S
+++ b/services/std_svc/rmmd/trp/trp_entry.S
@@ -33,8 +33,19 @@
*/
trp_head:
bl plat_set_my_stack
- bl plat_is_my_cpu_primary
- cbz x0, trp_secondary_cpu_entry
+
+ /*
+ * Find out whether this is a cold or warm boot
+ */
+ ldr x1, cold_boot_flag
+ cbz x1, warm_boot
+
+ /*
+ * Update cold boot flag to indicate cold boot is done
+ */
+ adr x2, cold_boot_flag
+ str xzr, [x2]
+
/* ---------------------------------------------
* Zero out BSS section
@@ -47,12 +58,20 @@
bl trp_setup
bl trp_main
-trp_secondary_cpu_entry:
+warm_boot:
mov_imm x0, RMI_RMM_REQ_COMPLETE
mov x1, xzr
smc #0
b trp_handler
+ /*
+ * Flag to mark if it is a cold boot.
+ * 1: cold boot, 0: warmboot.
+ */
+.align 3
+cold_boot_flag:
+ .dword 1
+
/* ---------------------------------------------
* Direct SMC call to BL31 service provided by
* RMM Dispatcher