Merge "fix(trp): Distinguish between cold and warm boot" into integration
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