2 * Board specific setup info
5 * Texas Instruments, <www.ti.com>
6 * Kshitij Gupta <Kshitij@ti.com>
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #if defined(CONFIG_OMAP1610)
31 #include <./configs/omap1510.h>
36 .word TEXT_BASE /* sdram load addr from config.mk */
42 /*------------------------------------------------------*
43 * Set up ARM CLM registers (IDLECT1) *
44 *------------------------------------------------------*/
45 ldr r0, REG_ARM_IDLECT1
46 ldr r1, VAL_ARM_IDLECT1
49 /*------------------------------------------------------*
50 * Set up ARM CLM registers (IDLECT2) *
51 *------------------------------------------------------*/
52 ldr r0, REG_ARM_IDLECT2
53 ldr r1, VAL_ARM_IDLECT2
56 /*------------------------------------------------------*
57 * Set up ARM CLM registers (IDLECT3) *
58 *------------------------------------------------------*/
59 ldr r0, REG_ARM_IDLECT3
60 ldr r1, VAL_ARM_IDLECT3
64 mov r1, #0x01 /* PER_EN bit */
65 ldr r0, REG_ARM_RSTCT2
66 strh r1, [r0] /* CLKM; Peripheral reset. */
68 /* Set CLKM to Sync-Scalable */
69 /* I supposedly need to enable the dsp clock before switching */
75 subs r0, r0, #0x1 /* wait for any bubbles to finish */
81 /* a few nops to let settle */
94 /* Ramp up the clock to 96Mhz */
98 ands r1, r1, #0x10 /* Check if PLL is enabled. */
99 beq lock_end /* Do not look for lock if BYPASS selected */
102 ands r1, r1, #0x01 /* Check the LOCK bit.*/
103 beq 2b /* loop until bit goes hi. */
107 /*------------------------------------------------------*
108 * Turn off the watchdog during init... *
109 *------------------------------------------------------*/
111 ldr r1, WATCHDOG_VAL1
113 ldr r1, WATCHDOG_VAL2
137 /* Set memory timings corresponding to the new clock speed */
139 /* Check execution location to determine current execution location
140 * and branch to appropriate initialization code.
142 /* Load physical SDRAM base. */
144 /* Get current execution location. */
148 /* Skip over EMIF-fast initialization if running from SDRAM. */
152 * Delay for SDRAM initialization.
154 mov r3, #0x1800 /* value should be checked */
156 subs r3, r3, #0x1 /* Decrement count */
161 * Set SDRAM control values. Disable refresh before MRS command.
164 /* mobile ddr operation */
165 ldr r0, REG_SDRAM_OPERATION
169 /* config register */
170 ldr r0, REG_SDRAM_CONFIG
171 ldr r1, SDRAM_CONFIG_VAL
174 /* manual command register */
175 ldr r0, REG_SDRAM_MANUAL_CMD
176 /* issue set cke high */
177 mov r1, #CMD_SDRAM_CKE_SET_HIGH
180 mov r1, #CMD_SDRAM_NOP
186 bne waitMDDR1 /* delay loop */
188 /* issue precharge */
189 mov r1, #CMD_SDRAM_PRECHARGE
192 /* issue autorefresh x 2 */
193 mov r1, #CMD_SDRAM_AUTOREFRESH
197 /* mrs register ddr mobile */
198 ldr r0, REG_SDRAM_MRS
202 /* emrs1 low-power register */
203 ldr r0, REG_SDRAM_EMRS1
204 /* self refresh on all banks */
208 ldr r0, REG_DLL_URD_CONTROL
209 ldr r1, DLL_URD_CONTROL_VAL
212 ldr r0, REG_DLL_LRD_CONTROL
213 ldr r1, DLL_LRD_CONTROL_VAL
216 ldr r0, REG_DLL_WRT_CONTROL
217 ldr r1, DLL_WRT_CONTROL_VAL
227 * Delay for SDRAM initialization.
231 subs r3, r3, #1 /* Decrement count. */
237 ldr r0, REG_SDRAM_CONFIG
238 ldr r1, SDRAM_CONFIG_VAL
243 ldr r1, VAL_TC_EMIFS_CS0_CONFIG
244 ldr r0, REG_TC_EMIFS_CS0_CONFIG
245 str r1, [r0] /* Chip Select 0 */
247 ldr r1, VAL_TC_EMIFS_CS1_CONFIG
248 ldr r0, REG_TC_EMIFS_CS1_CONFIG
249 str r1, [r0] /* Chip Select 1 */
250 ldr r1, VAL_TC_EMIFS_CS3_CONFIG
251 ldr r0, REG_TC_EMIFS_CS3_CONFIG
252 str r1, [r0] /* Chip Select 3 */
253 /* back to arch calling code */
256 /* the literal pools origin */
260 REG_TC_EMIFS_CONFIG: /* 32 bits */
262 REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */
264 REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */
266 REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */
268 REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */
271 /* MPU clock/reset/power mode control registers */
272 REG_ARM_CKCTL: /* 16 bits */
275 REG_ARM_IDLECT3: /* 16 bits */
277 REG_ARM_IDLECT2: /* 16 bits */
279 REG_ARM_IDLECT1: /* 16 bits */
282 REG_ARM_RSTCT2: /* 16 bits */
284 REG_ARM_SYSST: /* 16 bits */
286 /* DPLL control registers */
287 REG_DPLL1_CTL: /* 16 bits */
290 /* Watch Dog register */
291 /* secure watchdog stop */
294 /* watchdog write pending */
303 /* SDRAM config is: auto refresh enabled, 16 bit 4 bank,
304 counter @8192 rows, 10 ns, 8 burst */
308 /* Operation register */
312 /* Manual command register */
313 REG_SDRAM_MANUAL_CMD:
316 /* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */
320 /* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */
324 /* WRT DLL register */
330 /* URD DLL register */
336 /* LRD DLL register */
343 /* 96 MHz Samsung Mobile DDR */
355 VAL_TC_EMIFS_CS0_CONFIG:
357 VAL_TC_EMIFS_CS1_CONFIG:
359 VAL_TC_EMIFS_CS2_CONFIG:
361 VAL_TC_EMIFS_CS3_CONFIG:
363 VAL_TC_EMIFF_SDRAM_CONFIG:
382 .equ CMD_SDRAM_NOP, 0x00000000
383 .equ CMD_SDRAM_PRECHARGE, 0x00000001
384 .equ CMD_SDRAM_AUTOREFRESH, 0x00000002
385 .equ CMD_SDRAM_CKE_SET_HIGH, 0x00000007