/*1* linux/arch/arm/kernel/head-nommu.S2*3* Copyright (C) 1994-2002 Russell King4* Copyright (C) 2003-2006 Hyok S. Choi5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License version 2 as8* published by the Free Software Foundation.9*10* Common kernel startup code (non-paged MM)11*12*/13#include <linux/linkage.h>14#include <linux/init.h>1516#include <asm/assembler.h>17#include <asm/ptrace.h>18#include <asm/asm-offsets.h>19#include <asm/thread_info.h>20#include <asm/system.h>2122/*23* Kernel startup entry point.24* ---------------------------25*26* This is normally called from the decompressor code. The requirements27* are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,28* r1 = machine nr.29*30* See linux/arch/arm/tools/mach-types for the complete list of machine31* numbers for r1.32*33*/34__HEAD35ENTRY(stext)36setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode37@ and irqs disabled38#ifndef CONFIG_CPU_CP1539ldr r9, =CONFIG_PROCESSOR_ID40#else41mrc p15, 0, r9, c0, c0 @ get processor id42#endif43bl __lookup_processor_type @ r5=procinfo r9=cpuid44movs r10, r5 @ invalid processor (r5=0)?45beq __error_p @ yes, error 'p'4647adr lr, BSYM(__after_proc_init) @ return (PIC) address48ARM( add pc, r10, #PROCINFO_INITFUNC )49THUMB( add r12, r10, #PROCINFO_INITFUNC )50THUMB( mov pc, r12 )51ENDPROC(stext)5253/*54* Set the Control Register and Read the process ID.55*/56__after_proc_init:57#ifdef CONFIG_CPU_CP1558/*59* CP15 system control register value returned in r0 from60* the CPU init function.61*/62#ifdef CONFIG_ALIGNMENT_TRAP63orr r0, r0, #CR_A64#else65bic r0, r0, #CR_A66#endif67#ifdef CONFIG_CPU_DCACHE_DISABLE68bic r0, r0, #CR_C69#endif70#ifdef CONFIG_CPU_BPREDICT_DISABLE71bic r0, r0, #CR_Z72#endif73#ifdef CONFIG_CPU_ICACHE_DISABLE74bic r0, r0, #CR_I75#endif76#ifdef CONFIG_CPU_HIGH_VECTOR77orr r0, r0, #CR_V78#else79bic r0, r0, #CR_V80#endif81mcr p15, 0, r0, c1, c0, 0 @ write control reg82#endif /* CONFIG_CPU_CP15 */8384b __mmap_switched @ clear the BSS and jump85@ to start_kernel86ENDPROC(__after_proc_init)87.ltorg8889#include "head-common.S"909192