MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / arch / arm / mach-p2001 / head.S
blob21f36460a28d74714b707b43dcd89b5d62f95504
1 /*
2  *  linux/arch/arm/mach-p2001/head.S
3  *
4  *  Copyright (C) 2004-2005 Tobias Lorenz
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  *  Kernel startup code for P2001
11  */
12 #include <linux/linkage.h>
13 #include <linux/init.h>
15 #include <asm/assembler.h>
16 #include <asm/mach-types.h>
17 #include <asm/procinfo.h>
18 #include <asm/ptrace.h>
19 #include <asm/constants.h>
21 #define MACHINFO_TYPE           0
22 #define MACHINFO_PHYSRAM        4
23 #define MACHINFO_PHYSIO         8
24 #define MACHINFO_PGOFFIO        12
25 #define MACHINFO_NAME           16
28  * Kernel startup entry point.
29  * ---------------------------
30  *
31  * This is normally called from the decompressor code.  The requirements
32  * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
33  * r1 = machine nr.
34  *
35  * See linux/arch/arm/tools/mach-types for the complete list of machine
36  * numbers for r1.
37  *
38  */
39         __INIT
40         .type   stext, #function
41 ENTRY(stext)
42         mov     r0, #0
43         ldr     r1, P2001_MACH_TYPE
45         mov     r12, r0
46         mov     r0, #PSR_F_BIT | PSR_I_BIT | SVC_MODE   @ make sure svc mode
47         msr     cpsr_c, r0                      @ and all irqs disabled
48         ldr     r9, P2001_PROCESSOR_TYPE
51  * Set the Control Register and Read the process ID.
52  */
53         mov     r0, #0
56  *  r0  = processor control register
57  *  r1  = machine ID
58  *  r9  = processor ID
59  *  r12 = value of r0 when kernel was called (currently always zero)
60  */
61         adr     r5, LC0
62         ldmia   r5, {r5, r6, r7, r8, sp}                        @ Setup stack
64         /*  Clear BSS */
65         mov     r4, #0
66 1:      cmp     r5, r7                                  
67         strcc   r4, [r5],#4
68         bcc     1b
70         str     r9, [r6]                        @ Save processor ID
71         str     r1, [r8]                        @ Save machine type
73         b       start_kernel
75 LC0:    .long   __bss_start                     @ r5
76         .long   processor_id                    @ r6
77         .long   _end                            @ r7
78         .long   __machine_arch_type             @ r8
79         .long   init_thread_union+8192          @ sp
82  *      arm_id/PROCESSOR_TYPE:
83  *      31:24:  Implementer             (ARM Ltd)
84  *      23:20:  Variant                 (0)
85  *      19:16:  Architecture            (4T)
86  *      15:4:   Primary Part Number     (0)
87  *      3:0     Revision                (0)
88  */
89 P2001_PROCESSOR_TYPE:
90         .long   0x41029000
91 P2001_MACH_TYPE:
92         .long   MACH_TYPE_P2001
94 #include "../kernel/head-common.S"