aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/head.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/head.S')
-rw-r--r--arch/mips/kernel/head.S70
1 files changed, 23 insertions, 47 deletions
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 2a1b45d66f04..2e9122a4213a 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -22,11 +22,8 @@
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/mipsregs.h> 23#include <asm/mipsregs.h>
24#include <asm/stackframe.h> 24#include <asm/stackframe.h>
25#ifdef CONFIG_SGI_IP27 25
26#include <asm/sn/addrs.h> 26#include <kernel-entry-init.h>
27#include <asm/sn/sn0/hubni.h>
28#include <asm/sn/klkernvars.h>
29#endif
30 27
31 .macro ARC64_TWIDDLE_PC 28 .macro ARC64_TWIDDLE_PC
32#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL) 29#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
@@ -38,18 +35,6 @@
38#endif 35#endif
39 .endm 36 .endm
40 37
41#ifdef CONFIG_SGI_IP27
42 /*
43 * outputs the local nasid into res. IP27 stuff.
44 */
45 .macro GET_NASID_ASM res
46 dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
47 ld \res, (\res)
48 and \res, NSRI_NODEID_MASK
49 dsrl \res, NSRI_NODEID_SHFT
50 .endm
51#endif /* CONFIG_SGI_IP27 */
52
53 /* 38 /*
54 * inputs are the text nasid in t1, data nasid in t2. 39 * inputs are the text nasid in t1, data nasid in t2.
55 */ 40 */
@@ -131,16 +116,21 @@
131EXPORT(stext) # used for profiling 116EXPORT(stext) # used for profiling
132EXPORT(_stext) 117EXPORT(_stext)
133 118
119#if defined(CONFIG_QEMU) || defined(CONFIG_MIPS_SIM)
120 /*
121 * Give us a fighting chance of running if execution beings at the
122 * kernel load address. This is needed because this platform does
123 * not have a ELF loader yet.
124 */
125 j kernel_entry
126#endif
134 __INIT 127 __INIT
135 128
136NESTED(kernel_entry, 16, sp) # kernel entry point 129NESTED(kernel_entry, 16, sp) # kernel entry point
137 setup_c0_status_pri
138 130
139#ifdef CONFIG_SGI_IP27 131 kernel_entry_setup # cpu specific setup
140 GET_NASID_ASM t1 132
141 move t2, t1 # text and data are here 133 setup_c0_status_pri
142 MAPPED_KERNEL_SETUP_TLB
143#endif /* IP27 */
144 134
145 ARC64_TWIDDLE_PC 135 ARC64_TWIDDLE_PC
146 136
@@ -157,6 +147,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
157 LONG_S a2, fw_arg2 147 LONG_S a2, fw_arg2
158 LONG_S a3, fw_arg3 148 LONG_S a3, fw_arg3
159 149
150 MTC0 zero, CP0_CONTEXT # clear context register
160 PTR_LA $28, init_thread_union 151 PTR_LA $28, init_thread_union
161 PTR_ADDIU sp, $28, _THREAD_SIZE - 32 152 PTR_ADDIU sp, $28, _THREAD_SIZE - 32
162 set_saved_sp sp, t0, t1 153 set_saved_sp sp, t0, t1
@@ -165,6 +156,10 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
165 j start_kernel 156 j start_kernel
166 END(kernel_entry) 157 END(kernel_entry)
167 158
159#ifdef CONFIG_QEMU
160 __INIT
161#endif
162
168#ifdef CONFIG_SMP 163#ifdef CONFIG_SMP
169/* 164/*
170 * SMP slave cpus entry point. Board specific code for bootstrap calls this 165 * SMP slave cpus entry point. Board specific code for bootstrap calls this
@@ -172,20 +167,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
172 */ 167 */
173NESTED(smp_bootstrap, 16, sp) 168NESTED(smp_bootstrap, 16, sp)
174 setup_c0_status_sec 169 setup_c0_status_sec
175 170 smp_slave_setup
176#ifdef CONFIG_SGI_IP27
177 GET_NASID_ASM t1
178 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
179 KLDIR_OFF_POINTER + CAC_BASE
180 dsll t1, NASID_SHFT
181 or t0, t0, t1
182 ld t0, 0(t0) # t0 points to kern_vars struct
183 lh t1, KV_RO_NASID_OFFSET(t0)
184 lh t2, KV_RW_NASID_OFFSET(t0)
185 MAPPED_KERNEL_SETUP_TLB
186 ARC64_TWIDDLE_PC
187#endif /* CONFIG_SGI_IP27 */
188
189 j start_secondary 171 j start_secondary
190 END(smp_bootstrap) 172 END(smp_bootstrap)
191#endif /* CONFIG_SMP */ 173#endif /* CONFIG_SMP */
@@ -200,19 +182,13 @@ NESTED(smp_bootstrap, 16, sp)
200 .comm fw_arg2, SZREG, SZREG 182 .comm fw_arg2, SZREG, SZREG
201 .comm fw_arg3, SZREG, SZREG 183 .comm fw_arg3, SZREG, SZREG
202 184
203 .macro page name, order=0 185 .macro page name, order
204 .globl \name 186 .comm \name, (_PAGE_SIZE << \order), (_PAGE_SIZE << \order)
205\name: .size \name, (_PAGE_SIZE << \order)
206 .org . + (_PAGE_SIZE << \order)
207 .type \name, @object
208 .endm 187 .endm
209 188
210 .data
211 .align PAGE_SHIFT
212
213 /* 189 /*
214 * ... but on 64-bit we've got three-level pagetables with a 190 * On 64-bit we've got three-level pagetables with a slightly
215 * slightly different layout ... 191 * different layout ...
216 */ 192 */
217 page swapper_pg_dir, _PGD_ORDER 193 page swapper_pg_dir, _PGD_ORDER
218#ifdef CONFIG_64BIT 194#ifdef CONFIG_64BIT