[libcpu] [cortex-a] Revert RT_SMP_AUTO_BOOT. (#7549)
Co-authored-by: Wayne Lin <wclin@nuvoton.com>
This commit is contained in:
parent
0cbb665a1c
commit
ed4b4ca9e6
|
@ -157,6 +157,38 @@ after_enable_mmu:
|
||||||
#endif /* RT_USING_SMART */
|
#endif /* RT_USING_SMART */
|
||||||
mcr p15, 0, r1, c1, c0, 0
|
mcr p15, 0, r1, c1, c0, 0
|
||||||
|
|
||||||
|
#ifndef RT_USING_SMART
|
||||||
|
#ifdef RT_USING_SMP
|
||||||
|
/* Use spin-table to start secondary cores */
|
||||||
|
@ get cpu id, and subtract the offset from the stacks base address
|
||||||
|
bl rt_hw_cpu_id
|
||||||
|
mov r5, r0
|
||||||
|
|
||||||
|
cmp r5, #0 @ cpu id == 0
|
||||||
|
beq normal_setup
|
||||||
|
|
||||||
|
@ cpu id > 0, stop or wait
|
||||||
|
#ifdef RT_SMP_AUTO_BOOT
|
||||||
|
ldr r0, =secondary_cpu_entry
|
||||||
|
mov r1, #0
|
||||||
|
str r1, [r0] /* clean secondary_cpu_entry */
|
||||||
|
#endif /* RT_SMP_AUTO_BOOT */
|
||||||
|
|
||||||
|
secondary_loop:
|
||||||
|
@ cpu core 1 goes into sleep until core 0 wakeup it
|
||||||
|
wfe
|
||||||
|
#ifdef RT_SMP_AUTO_BOOT
|
||||||
|
ldr r1, =secondary_cpu_entry
|
||||||
|
ldr r0, [r1]
|
||||||
|
cmp r0, #0
|
||||||
|
blxne r0 /* if(secondary_cpu_entry) secondary_cpu_entry(); */
|
||||||
|
#endif /* RT_SMP_AUTO_BOOT */
|
||||||
|
b secondary_loop
|
||||||
|
|
||||||
|
normal_setup:
|
||||||
|
#endif /* RT_USING_SMP */
|
||||||
|
#endif /* RT_USING_SMART */
|
||||||
|
|
||||||
/* enable I cache + branch prediction */
|
/* enable I cache + branch prediction */
|
||||||
mrc p15, 0, r0, c1, c0, 0
|
mrc p15, 0, r0, c1, c0, 0
|
||||||
orr r0, r0, #(1<<12)
|
orr r0, r0, #(1<<12)
|
||||||
|
|
Loading…
Reference in New Issue