From ac0a9a90643f2df29433e10c1124c2cb362833c6 Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sat, 2 Sep 2017 19:20:11 +0000 Subject: [PATCH] The latest RPi firmware leaves secondary cores in a wait-for-event (WFE) state to save power, so after writing the entry point address for a core to the mailbox, use a dsb() to synchronize the execution pipeline to the data written, then use an sev() to wake up the core. Submitted by: Sylvain Garrigues --- sys/arm/broadcom/bcm2835/bcm2836_mp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2836_mp.c b/sys/arm/broadcom/bcm2835/bcm2836_mp.c index 6caaa504fbb..14177d6a893 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836_mp.c +++ b/sys/arm/broadcom/bcm2835/bcm2836_mp.c @@ -117,7 +117,9 @@ bcm2836_mp_start_ap(platform_t plat) /* set entry point to mailbox 3 */ BSWR4(MBOX3SET_CORE(i), (uint32_t)pmap_kextract((vm_offset_t)mpentry)); - wmb(); + /* Firmware put cores in WFE state, need SEV to wake up. */ + dsb(); + sev(); /* wait for bootup */ retry = 1000;