2 * linux/arch/arm/kernel/head-nommu.S
4 * Copyright (C) 1994-2002 Russell King
5 * Copyright (C) 2003-2006 Hyok S. Choi
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.
11 * Common kernel startup code (non-paged MM)
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 * ---------------------------
30 * This is normally called from the decompressor code. The requirements
31 * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
34 * See linux/arch/arm/tools/mach-types for the complete list of machine
38 #if 0 /* add by Victor Yu. 02-08-2007 for debug */
39 .macro victor_led value
42 and r3, r3, #0xfffffff0
47 .macro victor_uart value
54 .type stext, %function
56 #if 1 /* add by Victor Yu. 02-08-2007 */
57 mov r1, #MACH_TYPE_MOXART
59 ldr r1, =machine_arch_type @ find the machine type
61 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
63 #ifndef CONFIG_CPU_CP15
64 ldr r9, =CONFIG_PROCESSOR_ID
66 mrc p15, 0, r9, c0, c0 @ get processor id
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.
83 .type __after_proc_init, %function
85 #ifdef CONFIG_CPU_CP15
86 mrc p15, 0, r0, c1, c0, 0 @ read control reg
87 #ifdef CONFIG_ALIGNMENT_TRAP
92 #ifdef CONFIG_CPU_DCACHE_DISABLE
94 #else /* add by Victor Yu. 02-09-2007 */
97 #ifdef CONFIG_CPU_BPREDICT_DISABLE
100 #ifdef CONFIG_CPU_ICACHE_DISABLE
102 #else /* add by Victor Yu. 02-09-2007 */
105 #ifdef CONFIG_CPU_HIGH_VECTOR
110 mcr p15, 0, r0, c1, c0, 0 @ write control reg
111 #if 0 /* add by Victor Yu. 02-08-2007 */
113 mcr p15, 0, ip, c7, c5, 4 @ flush prefetch instruction
115 #endif /* CONFIG_CPU_CP15 */
117 mov pc, r13 @ clear the BSS and jump
121 #include "head-common.S"