From cdf1408856d980c0f6dd40b33138a9d6c46598c0 Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux <sandrine.bailleux@arm.com> Date: Fri, 2 Oct 2015 14:35:25 +0100 Subject: [PATCH] FVP: Do not power off secondary CPUs when booting an EL3 payload Normally, in the FVP port, secondary CPUs are immediately powered down if they are powered on at reset. However, when booting an EL3 payload, we need to keep them powered on as the requirement is for all CPUs to enter the EL3 payload image. This patch puts them in a holding pen instead of powering them off. Change-Id: I6526a88b907a0ddb820bead72f1d350a99b1692c --- docs/porting-guide.md | 8 +++++--- plat/arm/board/fvp/aarch64/fvp_helpers.S | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/porting-guide.md b/docs/porting-guide.md index 5e823e815..82bed6b04 100644 --- a/docs/porting-guide.md +++ b/docs/porting-guide.md @@ -468,9 +468,11 @@ for placing the executing secondary CPU in a platform-specific state until the primary CPU performs the necessary actions to bring it out of that state and allow entry into the OS. This function must not return. -In the ARM FVP port, each secondary CPU powers itself off. The primary CPU is -responsible for powering up the secondary CPU when normal world software -requires them. +In the ARM FVP port, when using the normal boot flow, each secondary CPU powers +itself off. The primary CPU is responsible for powering up the secondary CPUs +when normal world software requires them. When booting an EL3 payload instead, +they stay powered on and are put in a holding pen until their mailbox gets +populated. This function fulfills requirement 2 above. diff --git a/plat/arm/board/fvp/aarch64/fvp_helpers.S b/plat/arm/board/fvp/aarch64/fvp_helpers.S index 865c615a3..2c24e61f9 100644 --- a/plat/arm/board/fvp/aarch64/fvp_helpers.S +++ b/plat/arm/board/fvp/aarch64/fvp_helpers.S @@ -60,6 +60,7 @@ * ----------------------------------------------------- */ func plat_secondary_cold_boot_setup +#ifndef EL3_PAYLOAD_BASE /* --------------------------------------------- * Power down this cpu. * TODO: Do we need to worry about powering the @@ -93,6 +94,18 @@ func plat_secondary_cold_boot_setup wfi cb_panic: b cb_panic +#else + mov_imm x0, PLAT_ARM_TRUSTED_MAILBOX_BASE + + /* Wait until the entrypoint gets populated */ +poll_mailbox: + ldr x1, [x0] + cbz x1, 1f + br x1 +1: + wfe + b poll_mailbox +#endif /* EL3_PAYLOAD_BASE */ endfunc plat_secondary_cold_boot_setup /* --------------------------------------------------------------------- -- GitLab