Commit 8cb6045e authored by Vineet Gupta's avatar Vineet Gupta Committed by Greg Kroah-Hartman

ARC: smp-boot: Decouple Non masters waiting API from jump to entry point


[ Upstream commit bf02454a ]

For run-on-reset SMP configs, non master cores call a routine which
waits until Master gives it a "go" signal (currently using a shared
mem flag). The same routine then jumps off the well known entry point of
all non Master cores i.e. @first_lines_of_secondary

This patch moves out the last part into one single place in early boot
code.

This is better in terms of absraction (the wait API only waits) and
returns, leaving out the "jump off to" part.

In actual implementation this requires some restructuring of the early
boot code as well as Master now jumps to BSS setup explicitly,
vs. falling thru into it before.

Technically this patch doesn't cause any functional change, it just
moves the ugly #ifdef'ry from assembly code to "C"
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae36f6a6
...@@ -71,14 +71,14 @@ ENTRY(stext) ...@@ -71,14 +71,14 @@ ENTRY(stext)
GET_CPU_ID r5 GET_CPU_ID r5
cmp r5, 0 cmp r5, 0
mov.nz r0, r5 mov.nz r0, r5
#ifdef CONFIG_ARC_SMP_HALT_ON_RESET bz .Lmaster_proceed
; Non-Master can proceed as system would be booted sufficiently
jnz first_lines_of_secondary
#else
; Non-Masters wait for Master to boot enough and bring them up ; Non-Masters wait for Master to boot enough and bring them up
jnz arc_platform_smp_wait_to_boot ; when they resume, tail-call to entry point
#endif mov blink, @first_lines_of_secondary
; Master falls thru j arc_platform_smp_wait_to_boot
.Lmaster_proceed:
#endif #endif
; Clear BSS before updating any globals ; Clear BSS before updating any globals
......
...@@ -98,14 +98,16 @@ static void arc_default_smp_cpu_kick(int cpu, unsigned long pc) ...@@ -98,14 +98,16 @@ static void arc_default_smp_cpu_kick(int cpu, unsigned long pc)
void arc_platform_smp_wait_to_boot(int cpu) void arc_platform_smp_wait_to_boot(int cpu)
{ {
/* for halt-on-reset, we've waited already */
if (IS_ENABLED(CONFIG_ARC_SMP_HALT_ON_RESET))
return;
while (wake_flag != cpu) while (wake_flag != cpu)
; ;
wake_flag = 0; wake_flag = 0;
__asm__ __volatile__("j @first_lines_of_secondary \n");
} }
const char *arc_platform_smp_cpuinfo(void) const char *arc_platform_smp_cpuinfo(void)
{ {
return plat_smp_ops.info ? : ""; return plat_smp_ops.info ? : "";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment