PSCI: Use a single mailbox for warm reset for FVP and Juno
Since there is a unique warm reset entry point, the FVP and Juno
port can use a single mailbox instead of maintaining one per core.
The mailbox gets programmed only once when plat_setup_psci_ops()
is invoked during PSCI initialization. This means mailbox is not
zeroed out during wakeup.
Change-Id: Ieba032a90b43650f970f197340ebb0ce5548d432
diff --git a/plat/arm/css/common/aarch64/css_helpers.S b/plat/arm/css/common/aarch64/css_helpers.S
index a8c558b..478d5cf 100644
--- a/plat/arm/css/common/aarch64/css_helpers.S
+++ b/plat/arm/css/common/aarch64/css_helpers.S
@@ -53,28 +53,24 @@
b cb_panic
endfunc plat_secondary_cold_boot_setup
- /* -----------------------------------------------------
+ /* ---------------------------------------------------------------------
* unsigned long plat_get_my_entrypoint (void);
*
- * Main job of this routine is to distinguish between
- * a cold and warm boot on the current CPU.
- * On a cold boot the secondaries first wait for the
- * platform to be initialized after which they are
- * hotplugged in. The primary proceeds to perform the
- * platform initialization.
- * On a warm boot, each cpu jumps to the address in its
- * mailbox.
+ * Main job of this routine is to distinguish between a cold and a warm
+ * boot. On CSS platforms, this distinction is based on the contents of
+ * the Trusted Mailbox. It is initialised to zero by the SCP before the
+ * AP cores are released from reset. Therefore, a zero mailbox means
+ * it's a cold reset.
*
- * TODO: Not a good idea to save lr in a temp reg
- * -----------------------------------------------------
+ * This functions returns the contents of the mailbox, i.e.:
+ * - 0 for a cold boot;
+ * - the warm boot entrypoint for a warm boot.
+ * ---------------------------------------------------------------------
*/
func plat_get_my_entrypoint
- mov x9, x30 // lr
- bl plat_my_core_pos
- ldr x1, =TRUSTED_MAILBOXES_BASE
- lsl x0, x0, #TRUSTED_MAILBOX_SHIFT
- ldr x0, [x1, x0]
- ret x9
+ mov_imm x0, TRUSTED_MAILBOX_BASE
+ ldr x0, [x0]
+ ret
endfunc plat_get_my_entrypoint
/* -----------------------------------------------------------