[arch][arm] conditionalize the code to boot the secondary cpus in arch_init()

On some platforms, the secondary cpus have been booted and trapped by the arch/arm code
and need to be brought up lockstep to make sure the temporary page mappings are
still in place as they are booted. For these platforms, set
ARM_ARCH_BOOTS_SECONDARIES=1 to have arch_init() try to release and start the cpus.

For other platforms, after arch_init() they can simply arrange for the secondary cpus
to start themselves.

Change-Id: I7619ac66d84bd26060ddd949ae6641c1ef6e2b1d
This commit is contained in:
Travis Geiselbrecht
2015-06-01 18:35:25 -07:00
parent 22704a793c
commit 2362022970
4 changed files with 19 additions and 3 deletions

View File

@@ -128,6 +128,11 @@ void arch_init(void)
lk_init_secondary_cpus(secondaries_to_init);
#if ARM_ARCH_BOOTS_SECONDARIES
/* in platforms where the cpus have already been started, go ahead and wake up all the
* secondary cpus here.
* TODO: find a cleaner way to do this than this #define
*/
dprintf(SPEW, "releasing %d secondary cpu%c\n", secondaries_to_init, secondaries_to_init > 1 ? 's' : ' ');
/* release the secondary cpus */
@@ -135,7 +140,15 @@ void arch_init(void)
/* flush the release of the lock, since the secondary cpus are running without cache on */
arch_clean_cache_range((addr_t)&arm_boot_cpu_lock, sizeof(arm_boot_cpu_lock));
/* wait for secondary cpus to boot before arm_mmu_init below, which will remove
* temporary boot mappings
*/
while (secondaries_to_init > 0) {
__asm__ volatile("wfe");
}
#endif
#endif // WITH_SMP
//spinlock_test();

View File

@@ -37,7 +37,8 @@ KERNEL_BASE = 0x80000000
GLOBAL_DEFINES += \
MEMBASE=$(MEMBASE) \
MEMSIZE=$(MEMSIZE)
MEMSIZE=$(MEMSIZE) \
ARM_ARCH_BOOTS_SECONDARIES=1
LINKER_SCRIPT += \
$(BUILDDIR)/system-onesegment.ld

View File

@@ -26,7 +26,8 @@ MODULE_DEPS += \
GLOBAL_DEFINES += \
MEMBASE=$(MEMBASE) \
MEMSIZE=$(MEMSIZE)
MEMSIZE=$(MEMSIZE) \
ARM_ARCH_BOOTS_SECONDARIES=1
LINKER_SCRIPT += \
$(BUILDDIR)/system-onesegment.ld

View File

@@ -42,7 +42,8 @@ MODULE_SRCS += \
$(LOCAL_DIR)/gem.c \
GLOBAL_DEFINES += \
ZYNQ_WITH_GEM_ETH=1
ZYNQ_WITH_GEM_ETH=1 \
ARM_ARCH_BOOTS_SECONDARIES=1
# gem driver depends on minip interface
MODULE_DEPS += \