2 * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and
3 * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
5 * Modified for the at91rm9200dk board by
7 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
9 * See file CREDITS for list of people who contributed to this
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
32 #include <asm/arch/hardware.h>
33 #include <asm/arch/at91_mc.h>
34 #include <asm/arch/at91_pmc.h>
35 #include <asm/arch/at91_pio.h>
37 #define ARM920T_CONTROL 0xC0000000 /* @ set bit 31 (iA) and 30 (nF) */
42 .word CONFIG_SYS_TEXT_BASE-PHYS_FLASH_1
44 .word CONFIG_SYS_TEXT_BASE
49 ldr r1, =AT91_ASM_PMC_MOR
50 /* Main oscillator Enable register */
51 #ifdef CONFIG_SYS_USE_MAIN_OSCILLATOR
52 ldr r0, =0x0000FF01 /* Enable main oscillator */
54 ldr r0, =0x0000FF00 /* Disable main oscillator */
56 str r0, [r1] /*AT91C_CKGR_MOR] */
57 /* Add loop to compensate Main Oscillator startup time */
63 /* memory control configuration */
64 /* this isn't very elegant, but what the heck */
78 /* delay - this is all done by guess */
80 /* (vs reading PMC_SR for LOCKA, LOCKB ... or MOSCS earlier) */
98 /* switch from FastBus to Asynchronous clock mode */
99 mrc p15, 0, r0, c1, c0, 0
100 orr r0, r0, #ARM920T_CONTROL
101 mcr p15, 0, r0, c1, c0, 0
103 /* everything is fine now */
109 .word AT91_ASM_MC_EBI_CFG
110 .word CONFIG_SYS_EBI_CFGR_VAL
111 .word AT91_ASM_MC_SMC_CSR0
112 .word CONFIG_SYS_SMC_CSR0_VAL
113 .word AT91_ASM_PMC_PLLAR
114 .word CONFIG_SYS_PLLAR_VAL
115 .word AT91_ASM_PMC_PLLBR
116 .word CONFIG_SYS_PLLBR_VAL
117 .word AT91_ASM_PMC_MCKR
118 .word CONFIG_SYS_MCKR_VAL
120 /* here there's a delay */
122 .word AT91_ASM_PIOC_ASR
123 .word CONFIG_SYS_PIOC_ASR_VAL
124 .word AT91_ASM_PIOC_BSR
125 .word CONFIG_SYS_PIOC_BSR_VAL
126 .word AT91_ASM_PIOC_PDR
127 .word CONFIG_SYS_PIOC_PDR_VAL
128 .word AT91_ASM_MC_EBI_CSA
129 .word CONFIG_SYS_EBI_CSA_VAL
130 .word AT91_ASM_MC_SDRAMC_CR
131 .word CONFIG_SYS_SDRC_CR_VAL
132 .word AT91_ASM_MC_SDRAMC_MR
133 .word CONFIG_SYS_SDRC_MR_VAL
134 .word CONFIG_SYS_SDRAM
135 .word CONFIG_SYS_SDRAM_VAL
136 .word AT91_ASM_MC_SDRAMC_MR
137 .word CONFIG_SYS_SDRC_MR_VAL1
138 .word CONFIG_SYS_SDRAM
139 .word CONFIG_SYS_SDRAM_VAL
140 .word CONFIG_SYS_SDRAM
141 .word CONFIG_SYS_SDRAM_VAL
142 .word CONFIG_SYS_SDRAM
143 .word CONFIG_SYS_SDRAM_VAL
144 .word CONFIG_SYS_SDRAM
145 .word CONFIG_SYS_SDRAM_VAL
146 .word CONFIG_SYS_SDRAM
147 .word CONFIG_SYS_SDRAM_VAL
148 .word CONFIG_SYS_SDRAM
149 .word CONFIG_SYS_SDRAM_VAL
150 .word CONFIG_SYS_SDRAM
151 .word CONFIG_SYS_SDRAM_VAL
152 .word CONFIG_SYS_SDRAM
153 .word CONFIG_SYS_SDRAM_VAL
154 .word AT91_ASM_MC_SDRAMC_MR
155 .word CONFIG_SYS_SDRC_MR_VAL2
156 .word CONFIG_SYS_SDRAM1
157 .word CONFIG_SYS_SDRAM_VAL
158 .word AT91_ASM_MC_SDRAMC_TR
159 .word CONFIG_SYS_SDRC_TR_VAL
160 .word CONFIG_SYS_SDRAM
161 .word CONFIG_SYS_SDRAM_VAL
162 .word AT91_ASM_MC_SDRAMC_MR
163 .word CONFIG_SYS_SDRC_MR_VAL3
164 .word CONFIG_SYS_SDRAM
165 .word CONFIG_SYS_SDRAM_VAL
167 /* SMRDATA1 is 176 bytes long */
168 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */