diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-07-14 05:42:32 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:31:52 -0400 |
commit | 7e35952baa9d7424dfb95ca8aff7239a1f6ec011 (patch) | |
tree | 6412561c7dddfcc903491be1d6bb784646e2e3a6 | |
parent | a0c3a5b5a84df11cf6a44fc04cb6f7c0525123a8 (diff) |
Move Origin crapola into a machine-specific header file.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/head.S | 43 | ||||
-rw-r--r-- | include/asm-mips/mach-generic/kernel-entry-init.h | 25 | ||||
-rw-r--r-- | include/asm-mips/mach-ip27/kernel-entry-init.h | 52 |
3 files changed, 83 insertions, 37 deletions
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index d7d7de7cdb40..d2de5d025dbf 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 | */ |
@@ -142,13 +127,10 @@ EXPORT(_stext) | |||
142 | __INIT | 127 | __INIT |
143 | 128 | ||
144 | NESTED(kernel_entry, 16, sp) # kernel entry point | 129 | NESTED(kernel_entry, 16, sp) # kernel entry point |
145 | setup_c0_status_pri | ||
146 | 130 | ||
147 | #ifdef CONFIG_SGI_IP27 | 131 | kernel_entry_setup # cpu specific setup |
148 | GET_NASID_ASM t1 | 132 | |
149 | move t2, t1 # text and data are here | 133 | setup_c0_status_pri |
150 | MAPPED_KERNEL_SETUP_TLB | ||
151 | #endif /* IP27 */ | ||
152 | 134 | ||
153 | ARC64_TWIDDLE_PC | 135 | ARC64_TWIDDLE_PC |
154 | 136 | ||
@@ -185,20 +167,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point | |||
185 | */ | 167 | */ |
186 | NESTED(smp_bootstrap, 16, sp) | 168 | NESTED(smp_bootstrap, 16, sp) |
187 | setup_c0_status_sec | 169 | setup_c0_status_sec |
188 | 170 | smp_slave_setup | |
189 | #ifdef CONFIG_SGI_IP27 | ||
190 | GET_NASID_ASM t1 | ||
191 | dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ | ||
192 | KLDIR_OFF_POINTER + CAC_BASE | ||
193 | dsll t1, NASID_SHFT | ||
194 | or t0, t0, t1 | ||
195 | ld t0, 0(t0) # t0 points to kern_vars struct | ||
196 | lh t1, KV_RO_NASID_OFFSET(t0) | ||
197 | lh t2, KV_RW_NASID_OFFSET(t0) | ||
198 | MAPPED_KERNEL_SETUP_TLB | ||
199 | ARC64_TWIDDLE_PC | ||
200 | #endif /* CONFIG_SGI_IP27 */ | ||
201 | |||
202 | j start_secondary | 171 | j start_secondary |
203 | END(smp_bootstrap) | 172 | END(smp_bootstrap) |
204 | #endif /* CONFIG_SMP */ | 173 | #endif /* CONFIG_SMP */ |
diff --git a/include/asm-mips/mach-generic/kernel-entry-init.h b/include/asm-mips/mach-generic/kernel-entry-init.h new file mode 100644 index 000000000000..7e66505fa574 --- /dev/null +++ b/include/asm-mips/mach-generic/kernel-entry-init.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2005 Embedded Alley Solutions, Inc | ||
7 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_GENERIC_KERNEL_ENTRY_H | ||
10 | #define __ASM_MACH_GENERIC_KERNEL_ENTRY_H | ||
11 | |||
12 | /* Intentionally empty macro, used in head.S. Override in | ||
13 | * arch/mips/mach-xxx/kernel-entry-init.h when necessary. | ||
14 | */ | ||
15 | .macro kernel_entry_setup | ||
16 | .endm | ||
17 | |||
18 | /* | ||
19 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
20 | */ | ||
21 | .macro smp_slave_setup | ||
22 | .endm | ||
23 | |||
24 | |||
25 | #endif /* __ASM_MACH_GENERIC_KERNEL_ENTRY_H */ | ||
diff --git a/include/asm-mips/mach-ip27/kernel-entry-init.h b/include/asm-mips/mach-ip27/kernel-entry-init.h new file mode 100644 index 000000000000..c1a10314b317 --- /dev/null +++ b/include/asm-mips/mach-ip27/kernel-entry-init.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2000 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org> | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H | ||
10 | #define __ASM_MACH_IP27_KERNEL_ENTRY_H | ||
11 | |||
12 | #include <asm/sn/addrs.h> | ||
13 | #include <asm/sn/sn0/hubni.h> | ||
14 | #include <asm/sn/klkernvars.h> | ||
15 | |||
16 | /* | ||
17 | * Returns the local nasid into res. | ||
18 | */ | ||
19 | .macro GET_NASID_ASM res | ||
20 | dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID) | ||
21 | ld \res, (\res) | ||
22 | and \res, NSRI_NODEID_MASK | ||
23 | dsrl \res, NSRI_NODEID_SHFT | ||
24 | .endm | ||
25 | |||
26 | /* | ||
27 | * Intentionally empty macro, used in head.S. Override in | ||
28 | * arch/mips/mach-xxx/kernel-entry-init.h when necessary. | ||
29 | */ | ||
30 | .macro kernel_entry_setup | ||
31 | GET_NASID_ASM t1 | ||
32 | move t2, t1 # text and data are here | ||
33 | MAPPED_KERNEL_SETUP_TLB | ||
34 | .endm | ||
35 | |||
36 | /* | ||
37 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
38 | */ | ||
39 | .macro smp_slave_setup | ||
40 | GET_NASID_ASM t1 | ||
41 | dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ | ||
42 | KLDIR_OFF_POINTER + CAC_BASE | ||
43 | dsll t1, NASID_SHFT | ||
44 | or t0, t0, t1 | ||
45 | ld t0, 0(t0) # t0 points to kern_vars struct | ||
46 | lh t1, KV_RO_NASID_OFFSET(t0) | ||
47 | lh t2, KV_RW_NASID_OFFSET(t0) | ||
48 | MAPPED_KERNEL_SETUP_TLB | ||
49 | ARC64_TWIDDLE_PC | ||
50 | .endm | ||
51 | |||
52 | #endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */ | ||