2 * Copyright (C) 2009, Emcraft Systems, Ilya Yanok <yanok@emcraft.com>
4 * Based on board/freescale/mx31ads/lowlevel_init.S
5 * by Guennadi Liakhovetski.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 #include <asm/arch/mx31-regs.h>
45 /* RedBoot: To support 133MHz DDR */
46 .macro init_drive_strength
48 * Disable maximum drive strength SDRAM/DDR lines by clearing DSE1 bits
49 * in SW_PAD_CTL registers
53 ldr r1, =IOMUXC_SW_PAD_CTL(0x2b)
55 bic r0, r0, #(1 << 12)
60 bic r0, r0, #(1 << 22)
70 bic r0, r0, #(1 << 22)
75 bic r0, r0, #(1 << 22)
78 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2DC) */
79 ldr r2, =22 /* (0x2E0 - 0x288) / 4 = 22 */
82 bic r0, r0, #(1 << 22)
83 bic r0, r0, #(1 << 12)
89 .endm /* init_drive_strength */
96 /* Image Processing Unit: */
97 /* Too early to switch display on? */
98 /* Switch on Display Interface */
99 REG IPU_CONF, IPU_CONF_DI_EN
100 /* Clock Control Module: */
101 REG CCM_CCMR, 0x074B0BF5 /* Use CKIH, MCU PLL off */
105 REG CCM_CCMR, 0x074B0BF5 | CCMR_MPE /* MCU PLL on */
106 /* Switch to MCU PLL */
107 REG CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS
114 ldr r1, MPCTL_PARAM_399
118 /* Set UPLL=240MHz, USB=60MHz */
122 ldr r1, UPCTL_PARAM_240
125 /* default CLKO to 1/8 of the ARM core */
130 /* Default: 1, 4, 12, 1 */
131 REG CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
133 /* B8xxxxxx - NAND, 8xxxxxxx - CSD0 RAM */
134 REG 0xB8001010, 0x00000004
135 REG 0xB8001004, ((3 << 21) | /* tXP */ \
136 (0 << 20) | /* tWTR */ \
137 (2 << 18) | /* tRP */ \
138 (1 << 16) | /* tMRD */ \
139 (0 << 15) | /* tWR */ \
140 (5 << 12) | /* tRAS */ \
141 (1 << 10) | /* tRRD */ \
142 (3 << 8) | /* tCAS */ \
143 (2 << 4) | /* tRCD */ \
145 REG 0xB8001000, 0x92100000
146 REG 0x80000f00, 0x12344321
147 REG 0xB8001000, 0xa2100000
148 REG 0x80000000, 0x12344321
149 REG 0x80000000, 0x12344321
150 REG 0xB8001000, 0xb2100000
151 REG8 0x80000033, 0xda
152 REG8 0x81000000, 0xff
153 REG 0xB8001000, ((1 << 31) | \
156 (3 << 24) | /* 14 rows */ \
157 (2 << 20) | /* 10 cols */ \
159 (4 << 13) | /* 3.91us (64ms/16384) */ \
164 REG 0x80000000, 0xDEADBEEF
165 REG 0xB8001010, 0x0000000c
170 .word (((1 - 1) << 26) + ((52 - 1) << 16) + (7 << 10) + (35 << 0))
172 .word (((2 - 1) << 26) + ((13 - 1) << 16) + (9 << 10) + (3 << 0))