2 * linux/arch/arm/mach-lpc22xx/head.S
4 * uClinux kernel startup code for lpc22xx
5 * which has no proper bootloader for linux startup
8 #include <linux/linkage.h>
9 #include <linux/init.h>
11 #include <asm/assembler.h>
12 #include <asm/mach-types.h>
13 #include <asm/procinfo.h>
14 #include <asm/ptrace.h>
15 #include <asm/mach/arch.h>
16 #include <asm/arch/hardware.h>
18 * Kernel startup entry point.
21 .type stext, #function
25 mov r0, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ make sure svc mode
26 msr cpsr_c, r0 @ and all irqs disabled
28 /* Do basic initialization */
29 /* Set the parameters of PLL, PINSEL, and MEMMAP carefully according to your board */
30 /* These settings can be done in your bootloader instead. */
33 #if((LPC22xx_Fcclk /4)/LPC22xx_Fpclk)==1
36 #if((LPC22xx_Fcclk /4)/LPC22xx_Fpclk)==2
39 #if((LPC22xx_Fcclk /4)/LPC22xx_Fpclk)==4
46 #if(LPC22xx_Fcco/LPC22xx_Fcclk/2)==1
47 mov r1,#(((LPC22xx_Fcclk/CONFIG_LPC22xx_Fosc)-1))
49 #if(LPC22xx_Fcco/LPC22xx_Fcclk/2)==2
50 mov r1,#(((LPC22xx_Fcclk/CONFIG_LPC22xx_Fosc)-1)|(1<<5))
52 #if(LPC22xx_Fcco/LPC22xx_Fcclk/2)==4
53 mov r1,#(((LPC22xx_Fcclk/CONFIG_LPC22xx_Fosc)-1)|(2<<5))
55 #if(LPC22xx_Fcco/LPC22xx_Fcclk/2)==8
56 mov r1,#(((LPC22xx_Fcclk/CONFIG_LPC22xx_Fosc)-1)|(3<<5))
71 1: ldr r2,rREG_PLLSTAT
114 .long 0x00 /* one fourth of cclk */
116 .long 0x23 /* Fosc=10Mhz cclk=40Mhz*/
118 .long 0x03 /* PLL enable & connecte*/
123 ldmia r5, {r5, r6, r8, r9, sp} @ Setup stack
125 /* Copy data sections to their new home. */
134 /* Pretend we know what our processor code is (for arm_id) */
136 ldr r2, LPC22xx_PROCESSOR_TYPE
139 ldr r2, LPC22xx_MACH_TYPE
149 .long __machine_arch_type
150 .long init_thread_union+8192
154 LPC22xx_PROCESSOR_TYPE:
157 .long MACH_TYPE_LPC22xx