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 / kernel / head-nommu.S
blobeb61ac6412327db59d575ed5e4e33e0c542a09d7
1 /*
2  *  linux/arch/arm/kernel/head-nommu.S
3  *
4  *  Copyright (C) 1994-2002 Russell King
5  *  Copyright (C) 2003-2006 Hyok S. Choi
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  *  Common kernel startup code (non-paged MM)
12  *
13  */
14 #include <linux/linkage.h>
15 #include <linux/init.h>
17 #include <asm/assembler.h>
18 #include <asm/mach-types.h>
19 #include <asm/procinfo.h>
20 #include <asm/ptrace.h>
21 #include <asm/asm-offsets.h>
22 #include <asm/thread_info.h>
23 #include <asm/system.h>
24 #include <asm/arch/hardware.h>
27  * Kernel startup entry point.
28  * ---------------------------
29  *
30  * This is normally called from the decompressor code.  The requirements
31  * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
32  * r1 = machine nr.
33  *
34  * See linux/arch/arm/tools/mach-types for the complete list of machine
35  * numbers for r1.
36  *
37  */
38 #if 0   /* add by Victor Yu. 02-08-2007 for debug */
39         .macro  victor_led value
40         ldr     r2, =0x98700000
41         ldr     r3, [r2]
42         and     r3, r3, #0xfffffff0
43         orr     r3, r3, \value
44         str     r3, [r2]
45         .endm
47         .macro  victor_uart value
48         ldr     r7, =0x98200000
49         mov     r8, \value
50         strb    r8, [r7]
51         .endm
52 #endif
53         __INIT
54         .type   stext, %function
55 ENTRY(stext)
56 #if 1   /* add by Victor Yu. 02-08-2007 */
57         mov     r1, #MACH_TYPE_MOXART
58 #else
59         ldr     r1, =machine_arch_type          @ find the machine type
60 #endif
61         msr     cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
62                                                 @ and irqs disabled
63 #ifndef CONFIG_CPU_CP15
64         ldr     r9, =CONFIG_PROCESSOR_ID
65 #else
66         mrc     p15, 0, r9, c0, c0              @ get processor id
67 #endif
68         bl      __lookup_processor_type         @ r5=procinfo r9=cpuid
69         movs    r10, r5                         @ invalid processor (r5=0)?
70         beq     __error_p                       @ yes, error 'p'
71         bl      __lookup_machine_type           @ r5=machinfo
72         movs    r8, r5                          @ invalid machine (r5=0)?
73         beq     __error_a                       @ yes, error 'a'
75         ldr     r13, __switch_data              @ address to jump to after
76                                                 @ the initialization is done
77         adr     lr, __after_proc_init           @ return (PIC) address
78         add     pc, r10, #PROCINFO_INITFUNC
81  * Set the Control Register and Read the process ID.
82  */
83         .type   __after_proc_init, %function
84 __after_proc_init:
85 #ifdef CONFIG_CPU_CP15
86         mrc     p15, 0, r0, c1, c0, 0           @ read control reg
87 #ifdef CONFIG_ALIGNMENT_TRAP
88         orr     r0, r0, #CR_A
89 #else
90         bic     r0, r0, #CR_A
91 #endif
92 #ifdef CONFIG_CPU_DCACHE_DISABLE
93         bic     r0, r0, #CR_C
94 #else   /* add by Victor Yu. 02-09-2007 */
95         orr     r0, r0, #CR_C
96 #endif
97 #ifdef CONFIG_CPU_BPREDICT_DISABLE
98         bic     r0, r0, #CR_Z
99 #endif
100 #ifdef CONFIG_CPU_ICACHE_DISABLE
101         bic     r0, r0, #CR_I
102 #else   /* add by Victor Yu. 02-09-2007 */
103         orr     r0, r0, #CR_I
104 #endif
105 #ifdef CONFIG_CPU_HIGH_VECTOR
106         orr     r0, r0, #CR_V
107 #else
108         bic     r0, r0, #CR_V
109 #endif
110         mcr     p15, 0, r0, c1, c0, 0           @ write control reg
111 #if 0   /* add by Victor Yu. 02-08-2007 */
112         mov     ip, #0
113         mcr     p15, 0, ip, c7, c5, 4           @ flush prefetch instruction
114 #endif
115 #endif /* CONFIG_CPU_CP15 */
117         mov     pc, r13                         @ clear the BSS and jump
118                                                 @ to start_kernel
119         .ltorg
121 #include "head-common.S"