- pre3:
[davej-history.git] / arch / arm / kernel / head-armo.S
blob86211a9236e58a49dad378691f0c4f879898ff7e
1 /*
2  * linux/arch/arm/kernel/head-armo.S
3  *
4  * Copyright (C) 1994-2000 Russell King
5  *
6  * 26-bit kernel startup code
7  */
8 #include <linux/config.h>
9 #include <linux/linkage.h>
10 #include <asm/mach-types.h>
12                 .globl  SYMBOL_NAME(swapper_pg_dir)
13                 .equ    SYMBOL_NAME(swapper_pg_dir),    0x0207d000
16  * Entry point.
17  */
18                 .section ".text.init",#alloc,#execinstr
19 ENTRY(stext)
20 ENTRY(_stext)
21 __entry:        cmp     pc, #0x02000000
22                 ldrlt   pc, LC0                 @ if 0x01800000, call at 0x02080000
23                 teq     r0, #0                  @ Check for old calling method
24                 blne    oldparams               @ Move page if old
25                 adr     r0, LC0
26                 ldmib   r0, {r2-r5, sp}         @ Setup stack
27                 mov     r0, #0
28 1:              cmp     r2, r3                  @ Clear BSS
29                 strcc   r0, [r2], #4
30                 bcc     1b
32                 bl      detect_proc_type
33                 str     r0, [r4]
34                 bl      detect_arch_type
35                 str     r0, [r5]
37                 mov     fp, #0
38                 b       SYMBOL_NAME(start_kernel)
40 LC0:            .word   SYMBOL_NAME(_stext)
41                 .word   SYMBOL_NAME(__bss_start)                @ r2
42                 .word   SYMBOL_NAME(_end)                       @ r3
43                 .word   SYMBOL_NAME(processor_id)               @ r4
44                 .word   SYMBOL_NAME(__machine_arch_type)        @ r5
45                 .word   SYMBOL_NAME(init_task_union)+8192       @ sp
46 arm2_id:        .long   0x41560200
47 arm250_id:      .long   0x41560250
48                 .align
50 oldparams:      mov     r4, #0x02000000
51                 add     r3, r4, #0x00080000
52                 add     r4, r4, #0x0007c000
53 1:              ldmia   r0!, {r5 - r12}
54                 stmia   r4!, {r5 - r12}
55                 cmp     r4, r3
56                 blt     1b
57                 mov     pc, lr
60  * We need some way to automatically detect the difference between
61  * these two machines.  Unfortunately, it is not possible to detect
62  * the presence of the SuperIO chip, because that will hang the old
63  * Archimedes machines solid.
64  */
65 /* DAG: Outdated, these have been combined !!!!!!! */
66 detect_arch_type:
67 #if defined(CONFIG_ARCH_ARC)
68                 mov     r0, #MACH_TYPE_ARCHIMEDES
69 #elif defined(CONFIG_ARCH_A5K)
70                 mov     r0, #MACH_TYPE_A5K
71 #endif
72                 mov     pc, lr
74 detect_proc_type:
75                 mov     ip, lr
76                 mov     r2, #0xea000000         @ Point undef instr to continuation
77                 adr     r0, continue - 12
78                 orr     r0, r2, r0, lsr #2
79                 mov     r1, #0
80                 str     r0, [r1, #4]
81                 ldr     r0, arm2_id
82                 swp     r2, r2, [r1]            @ check for swp (ARM2 can't)
83                 ldr     r0, arm250_id
84                 mrc     15, 0, r3, c0, c0       @ check for CP#15 (ARM250 can't)
85                 mov     r0, r3
86 continue:       mov     r2, #0xeb000000         @ Make undef vector loop
87                 sub     r2, r2, #2
88                 str     r2, [r1, #4]
89                 mov     pc, ip