3 #include <asm/arch/pxa-regs.h>
5 DRAM_SIZE: .long CONFIG_SYS_DRAM_SIZE
12 /* ---- GPIO INITIALISATION ---- */
13 /* Set up GPIO pins first (3 groups [31:0] [63:32] [80:64]) */
15 /* General purpose set registers */
17 ldr r1, =CONFIG_SYS_GPSR0_VAL
20 ldr r1, =CONFIG_SYS_GPSR1_VAL
23 ldr r1, =CONFIG_SYS_GPSR2_VAL
26 /* General purpose clear registers */
28 ldr r1, =CONFIG_SYS_GPCR0_VAL
31 ldr r1, =CONFIG_SYS_GPCR1_VAL
34 ldr r1, =CONFIG_SYS_GPCR2_VAL
37 /* General rising edge registers */
39 ldr r1, =CONFIG_SYS_GRER0_VAL
42 ldr r1, =CONFIG_SYS_GRER1_VAL
45 ldr r1, =CONFIG_SYS_GRER2_VAL
48 /* General falling edge registers */
50 ldr r1, =CONFIG_SYS_GFER0_VAL
53 ldr r1, =CONFIG_SYS_GFER1_VAL
56 ldr r1, =CONFIG_SYS_GFER2_VAL
59 /* General edge detect registers */
61 ldr r1, =CONFIG_SYS_GPDR0_VAL
64 ldr r1, =CONFIG_SYS_GPDR1_VAL
67 ldr r1, =CONFIG_SYS_GPDR2_VAL
70 /* General alternate function registers */
71 ldr r0, =GAFR0_L /* [0:15] */
72 ldr r1, =CONFIG_SYS_GAFR0_L_VAL
74 ldr r0, =GAFR0_U /* [31:16] */
75 ldr r1, =CONFIG_SYS_GAFR0_U_VAL
77 ldr r0, =GAFR1_L /* [47:32] */
78 ldr r1, =CONFIG_SYS_GAFR1_L_VAL
80 ldr r0, =GAFR1_U /* [63:48] */
81 ldr r1, =CONFIG_SYS_GAFR1_U_VAL
83 ldr r0, =GAFR2_L /* [79:64] */
84 ldr r1, =CONFIG_SYS_GAFR2_L_VAL
86 ldr r0, =GAFR2_U /* [80] */
87 ldr r1, =CONFIG_SYS_GAFR2_U_VAL
90 /* General purpose direction registers */
92 ldr r1, =CONFIG_SYS_GPDR0_VAL
95 ldr r1, =CONFIG_SYS_GPDR1_VAL
98 ldr r1, =CONFIG_SYS_GPDR2_VAL
101 /* Power manager sleep status */
103 ldr r1, =CONFIG_SYS_PSSR_VAL
106 /* ---- MEMORY INITIALISATION ---- */
107 /* Initialize Memory Controller, see PXA250 Operating System Developer's Guide */
108 /* pause for 200 uSecs- allow internal clocks to settle */
109 ldr r3, =OSCR /* reset the OS Timer Count to zero */
112 ldr r4, =0x300 /* really 0x2E1 is about 200usec, so 0x300 should be plenty */
119 /* get memory controller base address */
122 /* ---- FLASH INITIALISATION ---- */
123 /* Write MSC0 and read back to ensure data change is accepted by cpu */
124 ldr r2, =CONFIG_SYS_MSC0_VAL
125 str r2, [r1, #MSC0_OFFSET]
126 ldr r2, [r1, #MSC0_OFFSET]
128 /* ---- SDRAM INITIALISATION ---- */
129 /* get the MDREFR settings */
130 ldr r2, =CONFIG_SYS_MDREFR_VAL
131 str r2, [r1, #MDREFR_OFFSET]
133 /* fetch platform value of MDCNFG */
134 ldr r2, =CONFIG_SYS_MDCNFG_VAL
136 /* disable all sdram banks */
137 bic r2, r2, #(MDCNFG_DE0 | MDCNFG_DE1)
138 bic r2, r2, #(MDCNFG_DE2 | MDCNFG_DE3)
140 /* write initial value of MDCNFG, w/o enabling sdram banks */
141 str r2, [r1, #MDCNFG_OFFSET]
143 /* pause for 200 uSecs */
144 ldr r3, =OSCR /* reset the OS Timer Count to zero */
147 ldr r4, =0x300 /* about 200 usec */
153 /* Access memory *not yet enabled* for CBR refresh cycles (8) */
154 /* CBR is generated for all banks */
156 ldr r2, =CONFIG_SYS_DRAM_BASE
166 /* get memory controller base address */
169 /* Enable SDRAM bank 0 in MDCNFG register */
170 ldr r2, [r1, #MDCNFG_OFFSET]
171 orr r2, r2, #MDCNFG_DE0
172 str r2, [r1, #MDCNFG_OFFSET]
174 /* write MDMRS to trigger an MSR command to all enabled SDRAM banks */
175 ldr r2, =CONFIG_SYS_MDMRS_VAL
176 str r2, [r1, #MDMRS_OFFSET]
178 /* ---- INTERRUPT INITIALISATION ---- */
179 /* Disable (mask) all interrupts at the interrupt controller */
180 /* clear the interrupt level register (use IRQ, not FIQ) */
185 /* Set interrupt mask register */
186 ldr r1, =CONFIG_SYS_ICMR_VAL
190 /* ---- CLOCK INITIALISATION ---- */
191 /* Disable the peripheral clocks, and set the core clock */
193 /* Turn Off ALL on-chip peripheral clocks for re-configuration */
198 /* set core clocks */
199 ldr r2, =CONFIG_SYS_CCCR_VAL
204 /* enable the 32Khz oscillator for RTC and PowerManager */
209 /* NOTE: spin here until OSCC.OOK get set, meaning the PLL has settled. */
216 /* Turn on needed clocks */
218 ldr r2, =CONFIG_SYS_CKEN_VAL