提交 b27f4854 编写于 作者: M Michael Walle 提交者: Priyanka Jain

armv8: layerscape: fix spin-table support

Spin tables are broken with bootefi. This is because - in contrast to
the booti call chain - there is no call to smp_kick_all_cpus(). Due to
this missing call the secondary CPUs are never released from their "wait
for interrupt state", see secondary_boot_func() in lowlevel.S.

Originally, this "wait for interrupt" is there to make sure, the spin
table is cleared before the secondary cores read it for the first time.
But the boot flow for the layerscape architecture is different from
that. The CPUs are release from their BootROM _after_ U-Boot's
spin-table is cleared, see fsl_layerscape_wake_seconday_cores() in mp.c.
Thus, there is no need to wait for this interrupt and no need for
kicking all cores on cpu_release. An atomic 64bit write to the
spin-table and a "sev" is sufficient.
Signed-off-by: NMichael Walle <michael@walle.cc>
Reviewed-by: NPriyanka Jain <priyanka.jain@nxp.com>
上级 e0152dbe
...@@ -474,13 +474,6 @@ ENTRY(secondary_boot_func) ...@@ -474,13 +474,6 @@ ENTRY(secondary_boot_func)
mov x4, #1 mov x4, #1
str x4, [x11, #8] /* STATUS */ str x4, [x11, #8] /* STATUS */
dsb sy dsb sy
#if defined(CONFIG_GICV3)
gic_wait_for_interrupt_m x0
#elif defined(CONFIG_GICV2)
bl get_gic_offset
mov x0, x1
gic_wait_for_interrupt_m x0, w1
#endif
slave_cpu: slave_cpu:
wfe wfe
......
...@@ -277,11 +277,12 @@ int cpu_release(u32 nr, int argc, char *const argv[]) ...@@ -277,11 +277,12 @@ int cpu_release(u32 nr, int argc, char *const argv[])
flush_dcache_range((unsigned long)table, flush_dcache_range((unsigned long)table,
(unsigned long)table + SPIN_TABLE_ELEM_SIZE); (unsigned long)table + SPIN_TABLE_ELEM_SIZE);
asm volatile("dsb st"); asm volatile("dsb st");
smp_kick_all_cpus(); /* only those with entry addr set will run */
/* /*
* When the first release command runs, all cores are set to go. Those * The secondary CPUs polling the spin-table above for a non-zero
* without a valid entry address will be trapped by "wfe". "sev" kicks * value. To save power "wfe" is called. Thus call "sev" here to
* them off to check the address again. When set, they continue to run. * wake the CPUs and let them check the spin-table again (see
* slave_cpu loop in lowlevel.S)
*/ */
asm volatile("sev"); asm volatile("sev");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册