Commit 2bc42067 authored by Sandrine Bailleux's avatar Sandrine Bailleux Committed by Achin Gupta
Browse files

CSS: Put secondary CPUs in a pen when booting an EL3 payload

By default, only the primary CPU is powered on by SCP on CSS
platforms. Secondary CPUs are then powered on later using PSCI
calls.

However, it is possible to power on more than one CPU at boot time
using platform specific settings. In this case, several CPUs will
enter the Trusted Firmware and execute the cold boot path code.
This is currently not supported and secondary CPUs will panic.

This patch preserves this behaviour in the normal boot flow.
However, when booting an EL3 payload, secondary CPUs are now held in
a pen until their mailbox is populated, at which point they jump to
this address. Note that, since all CPUs share the same mailbox, they
will all be released from their holding pen at the same time and the
EL3 payload is responsible to arbitrate execution between CPUs if
required.

Change-Id: I83737e0c9f15ca5e73afbed2e9c761bc580735b9
parent 4c117f6c
...@@ -37,19 +37,36 @@ ...@@ -37,19 +37,36 @@
.globl css_calc_core_pos_swap_cluster .globl css_calc_core_pos_swap_cluster
.weak plat_is_my_cpu_primary .weak plat_is_my_cpu_primary
/* ----------------------------------------------------- /* ---------------------------------------------------------------------
* void plat_secondary_cold_boot_setup (void); * void plat_secondary_cold_boot_setup(void);
* *
* This function performs any platform specific actions * In the normal boot flow, cold-booting secondary CPUs is not yet
* needed for a secondary cpu after a cold reset e.g * implemented and they panic.
* mark the cpu's presence, mechanism to place it in a *
* holding pen etc. * When booting an EL3 payload, secondary CPUs are placed in a holding
* ----------------------------------------------------- * pen, waiting for their mailbox to be populated. Note that all CPUs
* share the same mailbox ; therefore, populating it will release all
* CPUs from their holding pen. If finer-grained control is needed then
* this should be handled in the code that secondary CPUs jump to.
* ---------------------------------------------------------------------
*/ */
func plat_secondary_cold_boot_setup func plat_secondary_cold_boot_setup
/* todo: Implement secondary CPU cold boot setup on CSS platforms */ #ifndef EL3_PAYLOAD_BASE
/* TODO: Implement secondary CPU cold boot setup on CSS platforms */
cb_panic: cb_panic:
b cb_panic b cb_panic
#else
mov_imm x0, PLAT_ARM_TRUSTED_MAILBOX_BASE
/* Wait until the mailbox 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 endfunc plat_secondary_cold_boot_setup
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment