aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm26/kernel/head.S
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm26/kernel/head.S
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/arm26/kernel/head.S')
-rw-r--r--arch/arm26/kernel/head.S113
1 files changed, 113 insertions, 0 deletions
diff --git a/arch/arm26/kernel/head.S b/arch/arm26/kernel/head.S
new file mode 100644
index 000000000000..8bfc62539ba6
--- /dev/null
+++ b/arch/arm26/kernel/head.S
@@ -0,0 +1,113 @@
1/*
2 * linux/arch/arm26/kernel/head.S
3 *
4 * Copyright (C) 1994-2000 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * 26-bit kernel startup code
12 */
13#include <linux/config.h>
14#include <linux/linkage.h>
15#include <asm/mach-types.h>
16
17 .globl swapper_pg_dir
18 .equ swapper_pg_dir, 0x0207d000
19
20/*
21 * Entry point.
22 */
23 .section ".init.text",#alloc,#execinstr
24ENTRY(stext)
25
26__entry:
27 cmp pc, #0x02000000
28 ldrlt pc, LC0 @ if 0x01800000, call at 0x02080000
29 teq r0, #0 @ Check for old calling method
30 blne oldparams @ Move page if old
31
32 adr r0, LC0
33 ldmib r0, {r2-r5, sp} @ Setup stack (and fetch other values)
34
35 mov r0, #0 @ Clear BSS
361: cmp r2, r3
37 strcc r0, [r2], #4
38 bcc 1b
39
40 bl detect_proc_type
41 str r0, [r4]
42 bl detect_arch_type
43 str r0, [r5]
44
45#ifdef CONFIG_XIP_KERNEL
46 ldr r3, ETEXT @ data section copy
47 ldr r4, SDATA
48 ldr r5, EDATA
491:
50 ldr r6, [r3], #4
51 str r6, [r4], #4
52 cmp r4, r5
53 blt 1b
54#endif
55 mov fp, #0
56 b start_kernel
57
58LC0: .word _stext
59 .word __bss_start @ r2
60 .word _end @ r3
61 .word processor_id @ r4
62 .word __machine_arch_type @ r5
63 .word init_thread_union+8192 @ sp
64#ifdef CONFIG_XIP_KERNEL
65ETEXT: .word _endtext
66SDATA: .word _sdata
67EDATA: .word __bss_start
68#endif
69
70arm2_id: .long 0x41560200 @ ARM2 and 250 dont have a CPUID
71arm250_id: .long 0x41560250 @ So we create some after probing for them
72 .align
73
74oldparams: mov r4, #0x02000000
75 add r3, r4, #0x00080000
76 add r4, r4, #0x0007c000
771: ldmia r0!, {r5 - r12}
78 stmia r4!, {r5 - r12}
79 cmp r4, r3
80 blt 1b
81 mov pc, lr
82
83/*
84 * We need some way to automatically detect the difference between
85 * these two machines. Unfortunately, it is not possible to detect
86 * the presence of the SuperIO chip, because that will hang the old
87 * Archimedes machines solid.
88 */
89/* DAG: Outdated, these have been combined !!!!!!! */
90detect_arch_type:
91#if defined(CONFIG_ARCH_ARC)
92 mov r0, #MACH_TYPE_ARCHIMEDES
93#elif defined(CONFIG_ARCH_A5K)
94 mov r0, #MACH_TYPE_A5K
95#endif
96 mov pc, lr
97
98detect_proc_type:
99 mov ip, lr
100 mov r2, #0xea000000 @ Point undef instr to continuation
101 adr r0, continue - 12
102 orr r0, r2, r0, lsr #2
103 mov r1, #0
104 str r0, [r1, #4]
105 ldr r0, arm2_id
106 swp r2, r2, [r1] @ check for swp (ARM2 cant)
107 ldr r0, arm250_id
108 mrc 15, 0, r3, c0, c0 @ check for CP#15 (ARM250 cant)
109 mov r0, r3
110continue: mov r2, #0xeb000000 @ Make undef vector loop
111 sub r2, r2, #2
112 str r2, [r1, #4]
113 mov pc, ip