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

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: Vineet Gupta <vgupta@synopsys.com>

+11 -9
+7 -7
arch/arc/kernel/head.S
··· 71 71 GET_CPU_ID r5 72 72 cmp r5, 0 73 73 mov.nz r0, r5 74 - #ifdef CONFIG_ARC_SMP_HALT_ON_RESET 75 - ; Non-Master can proceed as system would be booted sufficiently 76 - jnz first_lines_of_secondary 77 - #else 74 + bz .Lmaster_proceed 75 + 78 76 ; Non-Masters wait for Master to boot enough and bring them up 79 - jnz arc_platform_smp_wait_to_boot 80 - #endif 81 - ; Master falls thru 77 + ; when they resume, tail-call to entry point 78 + mov blink, @first_lines_of_secondary 79 + j arc_platform_smp_wait_to_boot 80 + 81 + .Lmaster_proceed: 82 82 #endif 83 83 84 84 ; Clear BSS before updating any globals
+4 -2
arch/arc/kernel/smp.c
··· 98 98 99 99 void arc_platform_smp_wait_to_boot(int cpu) 100 100 { 101 + /* for halt-on-reset, we've waited already */ 102 + if (IS_ENABLED(CONFIG_ARC_SMP_HALT_ON_RESET)) 103 + return; 104 + 101 105 while (wake_flag != cpu) 102 106 ; 103 107 104 108 wake_flag = 0; 105 - __asm__ __volatile__("j @first_lines_of_secondary \n"); 106 109 } 107 - 108 110 109 111 const char *arc_platform_smp_cpuinfo(void) 110 112 {