aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/arc/Kconfig10
-rw-r--r--arch/arc/kernel/entry-arcv2.S2
-rw-r--r--arch/arc/kernel/entry-compact.S10
-rw-r--r--arch/arc/kernel/head.S47
-rw-r--r--arch/arc/kernel/vmlinux.lds.S2
5 files changed, 42 insertions, 29 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index f50ff986ed60..cc938967282b 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -194,6 +194,16 @@ config NR_CPUS
194 range 2 4096 194 range 2 4096
195 default "4" 195 default "4"
196 196
197config ARC_SMP_HALT_ON_RESET
198 bool "Enable Halt-on-reset boot mode"
199 default y if ARC_UBOOT_SUPPORT
200 help
201 In SMP configuration cores can be configured as Halt-on-reset
202 or they could all start at same time. For Halt-on-reset, non
203 masters are parked until Master kicks them so they can start of
204 at designated entry point. For other case, all jump to common
205 entry point and spin wait for Master's signal.
206
197endif #SMP 207endif #SMP
198 208
199menuconfig ARC_CACHE 209menuconfig ARC_CACHE
diff --git a/arch/arc/kernel/entry-arcv2.S b/arch/arc/kernel/entry-arcv2.S
index 8fa76567e402..445e63a10754 100644
--- a/arch/arc/kernel/entry-arcv2.S
+++ b/arch/arc/kernel/entry-arcv2.S
@@ -24,7 +24,7 @@
24 .align 4 24 .align 4
25 25
26# Initial 16 slots are Exception Vectors 26# Initial 16 slots are Exception Vectors
27VECTOR stext ; Restart Vector (jump to entry point) 27VECTOR res_service ; Reset Vector
28VECTOR mem_service ; Mem exception 28VECTOR mem_service ; Mem exception
29VECTOR instr_service ; Instrn Error 29VECTOR instr_service ; Instrn Error
30VECTOR EV_MachineCheck ; Fatal Machine check 30VECTOR EV_MachineCheck ; Fatal Machine check
diff --git a/arch/arc/kernel/entry-compact.S b/arch/arc/kernel/entry-compact.S
index 5221f194602b..59f52035b4ea 100644
--- a/arch/arc/kernel/entry-compact.S
+++ b/arch/arc/kernel/entry-compact.S
@@ -86,7 +86,7 @@
86 */ 86 */
87 87
88; ********* Critical System Events ********************** 88; ********* Critical System Events **********************
89VECTOR res_service ; 0x0, Restart Vector (0x0) 89VECTOR res_service ; 0x0, Reset Vector (0x0)
90VECTOR mem_service ; 0x8, Mem exception (0x1) 90VECTOR mem_service ; 0x8, Mem exception (0x1)
91VECTOR instr_service ; 0x10, Instrn Error (0x2) 91VECTOR instr_service ; 0x10, Instrn Error (0x2)
92 92
@@ -155,13 +155,9 @@ int2_saved_reg:
155; --------------------------------------------- 155; ---------------------------------------------
156 .section .text, "ax",@progbits 156 .section .text, "ax",@progbits
157 157
158res_service: ; processor restart
159 flag 0x1 ; not implemented
160 nop
161 nop
162 158
163reserved: ; processor restart 159reserved:
164 rtie ; jump to processor initializations 160 flag 1 ; Unexpected event, halt
165 161
166;##################### Interrupt Handling ############################## 162;##################### Interrupt Handling ##############################
167 163
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
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
index dd35bde39f69..894e696bddaa 100644
--- a/arch/arc/kernel/vmlinux.lds.S
+++ b/arch/arc/kernel/vmlinux.lds.S
@@ -12,7 +12,7 @@
12#include <asm/thread_info.h> 12#include <asm/thread_info.h>
13 13
14OUTPUT_ARCH(arc) 14OUTPUT_ARCH(arc)
15ENTRY(_stext) 15ENTRY(res_service)
16 16
17#ifdef CONFIG_CPU_BIG_ENDIAN 17#ifdef CONFIG_CPU_BIG_ENDIAN
18jiffies = jiffies_64 + 4; 18jiffies = jiffies_64 + 4;