arm/armv8-r: wfi secondary cores if SMP is disabled

Check cpu affinity in single core mode to avoid secondary cores bootup

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an 2024-01-11 11:09:50 +08:00 committed by Alin Jerpelea
parent 6e940b74f5
commit b7bd2e33b1
1 changed files with 14 additions and 2 deletions

View File

@ -132,12 +132,12 @@
.type __start, #function
__start:
#if defined(CONFIG_SMP) && CONFIG_SMP_NCPUS > 1
/* Get cpuindex, cpu0 continue boot, others wait event from cpu0 */
mrc CP15_MPIDR(r0)
and r0, r0, #0x3
cmp r0, #0
#if defined(CONFIG_SMP) && CONFIG_SMP_NCPUS > 1
beq __cpu0_start
wfe
cmp r0, #1
@ -155,9 +155,21 @@ __start:
beq __cpu4_start
# endif
__cpu0_start:
#else
beq __cpu0_start
__cpux_wfi:
/* Clear all pending data access */
dsb sy
wfi
b __cpux_wfi
#endif
__cpu0_start:
/* Make sure that IRQs and FIQs are disabled */
cpsid if