aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/head.S
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2015-10-09 01:56:12 -0400
committerVineet Gupta <vgupta@synopsys.com>2015-10-28 06:38:17 -0400
commit3971cdc202f638f252e39316d42492ace04cc1b1 (patch)
tree74838b53918c8705eda28460a24591ae77cbbf45 /arch/arc/kernel/head.S
parentf33e9c434b8ce833bd3dd39436bd0799c3e1d1c5 (diff)
ARC: boot: Support Halt-on-reset and Run-on-reset SMP booting modes
For Run-on-reset, non masters need to spin wait. For Halt-on-reset they can jump to entry point directly. Also while at it, made reset vector handler as "the" entry point for kernel including host debugger based boot (which uses the ELF header entry point) Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/head.S')
-rw-r--r--arch/arc/kernel/head.S47
1 files changed, 27 insertions, 20 deletions
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 812f95e6ae69..e7fa703c8d5e 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -50,28 +50,37 @@
50.endm 50.endm
51 51
52 .section .init.text, "ax",@progbits 52 .section .init.text, "ax",@progbits
53 .type stext, @function 53
54 .globl stext 54;----------------------------------------------------------------
55stext: 55; Default Reset Handler (jumped into from Reset vector)
56 ;------------------------------------------------------------------- 56; - Don't clobber r0,r1,r2 as they might have u-boot provided args
57 ; Don't clobber r0-r2 yet. It might have bootloader provided info 57; - Platforms can override this weak version if needed
58 ;------------------------------------------------------------------- 58;----------------------------------------------------------------
59WEAK(res_service)
60 j stext
61END(res_service)
62
63;----------------------------------------------------------------
64; Kernel Entry point
65;----------------------------------------------------------------
66ENTRY(stext)
59 67
60 CPU_EARLY_SETUP 68 CPU_EARLY_SETUP
61 69
62#ifdef CONFIG_SMP 70#ifdef CONFIG_SMP
63 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way
64 ; IDENTITY Reg [ 3 2 1 0 ]
65 ; (cpu-id) ^^^ => Zero for UP ARC700
66 ; => #Core-ID if SMP (Master 0)
67 ; Note that non-boot CPUs might not land here if halt-on-reset and
68 ; instead breath life from @first_lines_of_secondary, but we still
69 ; need to make sure only boot cpu takes this path.
70 GET_CPU_ID r5 71 GET_CPU_ID r5
71 cmp r5, 0 72 cmp r5, 0
72 mov.ne r0, r5 73 mov.nz r0, r5
73 jne arc_platform_smp_wait_to_boot 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
78 ; 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
74#endif 82#endif
83
75 ; Clear BSS before updating any globals 84 ; Clear BSS before updating any globals
76 ; XXX: use ZOL here 85 ; XXX: use ZOL here
77 mov r5, __bss_start 86 mov r5, __bss_start
@@ -102,16 +111,14 @@ stext:
102 GET_TSK_STACK_BASE r9, sp ; r9 = tsk, sp = stack base(output) 111 GET_TSK_STACK_BASE r9, sp ; r9 = tsk, sp = stack base(output)
103 112
104 j start_kernel ; "C" entry point 113 j start_kernel ; "C" entry point
114END(stext)
105 115
106#ifdef CONFIG_SMP 116#ifdef CONFIG_SMP
107;---------------------------------------------------------------- 117;----------------------------------------------------------------
108; First lines of code run by secondary before jumping to 'C' 118; First lines of code run by secondary before jumping to 'C'
109;---------------------------------------------------------------- 119;----------------------------------------------------------------
110 .section .text, "ax",@progbits 120 .section .text, "ax",@progbits
111 .type first_lines_of_secondary, @function 121ENTRY(first_lines_of_secondary)
112 .globl first_lines_of_secondary
113
114first_lines_of_secondary:
115 122
116 CPU_EARLY_SETUP 123 CPU_EARLY_SETUP
117 124
@@ -126,5 +133,5 @@ first_lines_of_secondary:
126 GET_TSK_STACK_BASE r0, sp 133 GET_TSK_STACK_BASE r0, sp
127 134
128 j start_kernel_secondary 135 j start_kernel_secondary
129 136END(first_lines_of_secondary)
130#endif 137#endif