blob: 37e6e4dbe8014d8c7893a0e2a3158db4164ae5e1 [file] [log] [blame]
Stefano Babic421834e2010-02-05 15:13:58 +01001/*
2 * (C) Copyright 2009 Freescale Semiconductor, Inc.
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
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.
11 *
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.
16 *
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,
20 * MA 02111-1307 USA
21 */
22
23#include <common.h>
24#include <asm/io.h>
Stefano Babic57008812011-08-21 23:29:52 +020025#include <asm/gpio.h>
Stefano Babic421834e2010-02-05 15:13:58 +010026#include <asm/arch/imx-regs.h>
Jason Liue7a7ed22010-10-18 11:09:26 +080027#include <asm/arch/mx5x_pins.h>
Stefano Babic421834e2010-02-05 15:13:58 +010028#include <asm/arch/iomux.h>
29#include <asm/errno.h>
Stefano Babicac41d4d2010-03-05 17:54:37 +010030#include <asm/arch/sys_proto.h>
Stefano Babic96651272010-03-16 17:22:21 +010031#include <asm/arch/crm_regs.h>
Stefano Babic421834e2010-02-05 15:13:58 +010032#include <i2c.h>
33#include <mmc.h>
34#include <fsl_esdhc.h>
Stefano Babicdba2efc2011-10-08 10:59:20 +020035#include <pmic.h>
Stefano Babic96651272010-03-16 17:22:21 +010036#include <fsl_pmic.h>
37#include <mc13892.h>
Stefano Babic421834e2010-02-05 15:13:58 +010038
39DECLARE_GLOBAL_DATA_PTR;
40
Stefano Babic421834e2010-02-05 15:13:58 +010041#ifdef CONFIG_FSL_ESDHC
42struct fsl_esdhc_cfg esdhc_cfg[2] = {
Stefano Babicfaddac22010-04-18 20:01:01 +020043 {MMC_SDHC1_BASE_ADDR, 1},
44 {MMC_SDHC2_BASE_ADDR, 1},
Stefano Babic421834e2010-02-05 15:13:58 +010045};
46#endif
47
Stefano Babic421834e2010-02-05 15:13:58 +010048int dram_init(void)
49{
Shawn Guobc08e7e2010-10-28 10:13:15 +080050 /* dram_init must store complete ramsize in gd->ram_size */
Albert ARIBAUDa9606732011-07-03 05:55:33 +000051 gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
Shawn Guobc08e7e2010-10-28 10:13:15 +080052 PHYS_SDRAM_1_SIZE);
Stefano Babic421834e2010-02-05 15:13:58 +010053 return 0;
54}
55
56static void setup_iomux_uart(void)
57{
58 unsigned int pad = PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
59 PAD_CTL_PUE_PULL | PAD_CTL_DRV_HIGH;
60
61 mxc_request_iomux(MX51_PIN_UART1_RXD, IOMUX_CONFIG_ALT0);
62 mxc_iomux_set_pad(MX51_PIN_UART1_RXD, pad | PAD_CTL_SRE_FAST);
63 mxc_request_iomux(MX51_PIN_UART1_TXD, IOMUX_CONFIG_ALT0);
64 mxc_iomux_set_pad(MX51_PIN_UART1_TXD, pad | PAD_CTL_SRE_FAST);
65 mxc_request_iomux(MX51_PIN_UART1_RTS, IOMUX_CONFIG_ALT0);
66 mxc_iomux_set_pad(MX51_PIN_UART1_RTS, pad);
67 mxc_request_iomux(MX51_PIN_UART1_CTS, IOMUX_CONFIG_ALT0);
68 mxc_iomux_set_pad(MX51_PIN_UART1_CTS, pad);
69}
70
Stefano Babic421834e2010-02-05 15:13:58 +010071static void setup_iomux_fec(void)
72{
73 /*FEC_MDIO*/
74 mxc_request_iomux(MX51_PIN_EIM_EB2 , IOMUX_CONFIG_ALT3);
75 mxc_iomux_set_pad(MX51_PIN_EIM_EB2 , 0x1FD);
76
77 /*FEC_MDC*/
78 mxc_request_iomux(MX51_PIN_NANDF_CS3, IOMUX_CONFIG_ALT2);
79 mxc_iomux_set_pad(MX51_PIN_NANDF_CS3, 0x2004);
80
81 /* FEC RDATA[3] */
82 mxc_request_iomux(MX51_PIN_EIM_CS3, IOMUX_CONFIG_ALT3);
83 mxc_iomux_set_pad(MX51_PIN_EIM_CS3, 0x180);
84
85 /* FEC RDATA[2] */
86 mxc_request_iomux(MX51_PIN_EIM_CS2, IOMUX_CONFIG_ALT3);
87 mxc_iomux_set_pad(MX51_PIN_EIM_CS2, 0x180);
88
89 /* FEC RDATA[1] */
90 mxc_request_iomux(MX51_PIN_EIM_EB3, IOMUX_CONFIG_ALT3);
91 mxc_iomux_set_pad(MX51_PIN_EIM_EB3, 0x180);
92
93 /* FEC RDATA[0] */
94 mxc_request_iomux(MX51_PIN_NANDF_D9, IOMUX_CONFIG_ALT2);
95 mxc_iomux_set_pad(MX51_PIN_NANDF_D9, 0x2180);
96
97 /* FEC TDATA[3] */
98 mxc_request_iomux(MX51_PIN_NANDF_CS6, IOMUX_CONFIG_ALT2);
99 mxc_iomux_set_pad(MX51_PIN_NANDF_CS6, 0x2004);
100
101 /* FEC TDATA[2] */
102 mxc_request_iomux(MX51_PIN_NANDF_CS5, IOMUX_CONFIG_ALT2);
103 mxc_iomux_set_pad(MX51_PIN_NANDF_CS5, 0x2004);
104
105 /* FEC TDATA[1] */
106 mxc_request_iomux(MX51_PIN_NANDF_CS4, IOMUX_CONFIG_ALT2);
107 mxc_iomux_set_pad(MX51_PIN_NANDF_CS4, 0x2004);
108
109 /* FEC TDATA[0] */
110 mxc_request_iomux(MX51_PIN_NANDF_D8, IOMUX_CONFIG_ALT2);
111 mxc_iomux_set_pad(MX51_PIN_NANDF_D8, 0x2004);
112
113 /* FEC TX_EN */
114 mxc_request_iomux(MX51_PIN_NANDF_CS7, IOMUX_CONFIG_ALT1);
115 mxc_iomux_set_pad(MX51_PIN_NANDF_CS7, 0x2004);
116
117 /* FEC TX_ER */
118 mxc_request_iomux(MX51_PIN_NANDF_CS2, IOMUX_CONFIG_ALT2);
119 mxc_iomux_set_pad(MX51_PIN_NANDF_CS2, 0x2004);
120
121 /* FEC TX_CLK */
122 mxc_request_iomux(MX51_PIN_NANDF_RDY_INT, IOMUX_CONFIG_ALT1);
123 mxc_iomux_set_pad(MX51_PIN_NANDF_RDY_INT, 0x2180);
124
125 /* FEC TX_COL */
126 mxc_request_iomux(MX51_PIN_NANDF_RB2, IOMUX_CONFIG_ALT1);
127 mxc_iomux_set_pad(MX51_PIN_NANDF_RB2, 0x2180);
128
129 /* FEC RX_CLK */
130 mxc_request_iomux(MX51_PIN_NANDF_RB3, IOMUX_CONFIG_ALT1);
131 mxc_iomux_set_pad(MX51_PIN_NANDF_RB3, 0x2180);
132
133 /* FEC RX_CRS */
134 mxc_request_iomux(MX51_PIN_EIM_CS5, IOMUX_CONFIG_ALT3);
135 mxc_iomux_set_pad(MX51_PIN_EIM_CS5, 0x180);
136
137 /* FEC RX_ER */
138 mxc_request_iomux(MX51_PIN_EIM_CS4, IOMUX_CONFIG_ALT3);
139 mxc_iomux_set_pad(MX51_PIN_EIM_CS4, 0x180);
140
141 /* FEC RX_DV */
142 mxc_request_iomux(MX51_PIN_NANDF_D11, IOMUX_CONFIG_ALT2);
143 mxc_iomux_set_pad(MX51_PIN_NANDF_D11, 0x2180);
144}
145
Stefano Babic96651272010-03-16 17:22:21 +0100146#ifdef CONFIG_MXC_SPI
147static void setup_iomux_spi(void)
148{
149 /* 000: Select mux mode: ALT0 mux port: MOSI of instance: ecspi1 */
150 mxc_request_iomux(MX51_PIN_CSPI1_MOSI, IOMUX_CONFIG_ALT0);
151 mxc_iomux_set_pad(MX51_PIN_CSPI1_MOSI, 0x105);
152
153 /* 000: Select mux mode: ALT0 mux port: MISO of instance: ecspi1. */
154 mxc_request_iomux(MX51_PIN_CSPI1_MISO, IOMUX_CONFIG_ALT0);
155 mxc_iomux_set_pad(MX51_PIN_CSPI1_MISO, 0x105);
156
157 /* de-select SS1 of instance: ecspi1. */
158 mxc_request_iomux(MX51_PIN_CSPI1_SS1, IOMUX_CONFIG_ALT3);
159 mxc_iomux_set_pad(MX51_PIN_CSPI1_SS1, 0x85);
160
161 /* 000: Select mux mode: ALT0 mux port: SS0 ecspi1 */
162 mxc_request_iomux(MX51_PIN_CSPI1_SS0, IOMUX_CONFIG_ALT0);
163 mxc_iomux_set_pad(MX51_PIN_CSPI1_SS0, 0x185);
164
165 /* 000: Select mux mode: ALT0 mux port: RDY of instance: ecspi1. */
166 mxc_request_iomux(MX51_PIN_CSPI1_RDY, IOMUX_CONFIG_ALT0);
167 mxc_iomux_set_pad(MX51_PIN_CSPI1_RDY, 0x180);
168
169 /* 000: Select mux mode: ALT0 mux port: SCLK of instance: ecspi1. */
170 mxc_request_iomux(MX51_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT0);
171 mxc_iomux_set_pad(MX51_PIN_CSPI1_SCLK, 0x105);
172}
173#endif
174
175static void power_init(void)
176{
177 unsigned int val;
Stefano Babic96651272010-03-16 17:22:21 +0100178 struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200179 struct pmic *p;
180
181 pmic_init();
182 p = get_pmic();
Stefano Babic96651272010-03-16 17:22:21 +0100183
184 /* Write needed to Power Gate 2 register */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200185 pmic_reg_read(p, REG_POWER_MISC, &val);
Stefano Babic96651272010-03-16 17:22:21 +0100186 val &= ~PWGT2SPIEN;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200187 pmic_reg_write(p, REG_POWER_MISC, val);
Stefano Babic96651272010-03-16 17:22:21 +0100188
Shawn Guo4546eb72010-10-27 23:36:04 +0800189 /* Externally powered */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200190 pmic_reg_read(p, REG_CHARGE, &val);
Shawn Guo4546eb72010-10-27 23:36:04 +0800191 val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200192 pmic_reg_write(p, REG_CHARGE, val);
Stefano Babic96651272010-03-16 17:22:21 +0100193
194 /* power up the system first */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200195 pmic_reg_write(p, REG_POWER_MISC, PWUP);
Stefano Babic96651272010-03-16 17:22:21 +0100196
197 /* Set core voltage to 1.1V */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200198 pmic_reg_read(p, REG_SW_0, &val);
Marek Vasutb043f702011-01-19 04:40:36 +0000199 val = (val & ~SWx_VOLT_MASK) | SWx_1_100V;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200200 pmic_reg_write(p, REG_SW_0, val);
Stefano Babic96651272010-03-16 17:22:21 +0100201
202 /* Setup VCC (SW2) to 1.25 */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200203 pmic_reg_read(p, REG_SW_1, &val);
Marek Vasutb043f702011-01-19 04:40:36 +0000204 val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200205 pmic_reg_write(p, REG_SW_1, val);
Stefano Babic96651272010-03-16 17:22:21 +0100206
207 /* Setup 1V2_DIG1 (SW3) to 1.25 */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200208 pmic_reg_read(p, REG_SW_2, &val);
Marek Vasutb043f702011-01-19 04:40:36 +0000209 val = (val & ~SWx_VOLT_MASK) | SWx_1_250V;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200210 pmic_reg_write(p, REG_SW_2, val);
Stefano Babic96651272010-03-16 17:22:21 +0100211 udelay(50);
212
213 /* Raise the core frequency to 800MHz */
214 writel(0x0, &mxc_ccm->cacrr);
215
216 /* Set switchers in Auto in NORMAL mode & STANDBY mode */
217 /* Setup the switcher mode for SW1 & SW2*/
Stefano Babicdba2efc2011-10-08 10:59:20 +0200218 pmic_reg_read(p, REG_SW_4, &val);
Stefano Babic96651272010-03-16 17:22:21 +0100219 val = (val & ~((SWMODE_MASK << SWMODE1_SHIFT) |
220 (SWMODE_MASK << SWMODE2_SHIFT)));
221 val |= (SWMODE_AUTO_AUTO << SWMODE1_SHIFT) |
222 (SWMODE_AUTO_AUTO << SWMODE2_SHIFT);
Stefano Babicdba2efc2011-10-08 10:59:20 +0200223 pmic_reg_write(p, REG_SW_4, val);
Stefano Babic96651272010-03-16 17:22:21 +0100224
225 /* Setup the switcher mode for SW3 & SW4 */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200226 pmic_reg_read(p, REG_SW_5, &val);
Stefano Babic96651272010-03-16 17:22:21 +0100227 val = (val & ~((SWMODE_MASK << SWMODE3_SHIFT) |
228 (SWMODE_MASK << SWMODE4_SHIFT)));
229 val |= (SWMODE_AUTO_AUTO << SWMODE3_SHIFT) |
230 (SWMODE_AUTO_AUTO << SWMODE4_SHIFT);
Stefano Babicdba2efc2011-10-08 10:59:20 +0200231 pmic_reg_write(p, REG_SW_5, val);
Stefano Babic96651272010-03-16 17:22:21 +0100232
233 /* Set VDIG to 1.65V, VGEN3 to 1.8V, VCAM to 2.6V */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200234 pmic_reg_read(p, REG_SETTING_0, &val);
Stefano Babic96651272010-03-16 17:22:21 +0100235 val &= ~(VCAM_MASK | VGEN3_MASK | VDIG_MASK);
236 val |= VDIG_1_65 | VGEN3_1_8 | VCAM_2_6;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200237 pmic_reg_write(p, REG_SETTING_0, val);
Stefano Babic96651272010-03-16 17:22:21 +0100238
239 /* Set VVIDEO to 2.775V, VAUDIO to 3V, VSD to 3.15V */
Stefano Babicdba2efc2011-10-08 10:59:20 +0200240 pmic_reg_read(p, REG_SETTING_1, &val);
Stefano Babic96651272010-03-16 17:22:21 +0100241 val &= ~(VVIDEO_MASK | VSD_MASK | VAUDIO_MASK);
242 val |= VSD_3_15 | VAUDIO_3_0 | VVIDEO_2_775;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200243 pmic_reg_write(p, REG_SETTING_1, val);
Stefano Babic96651272010-03-16 17:22:21 +0100244
245 /* Configure VGEN3 and VCAM regulators to use external PNP */
246 val = VGEN3CONFIG | VCAMCONFIG;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200247 pmic_reg_write(p, REG_MODE_1, val);
Stefano Babic96651272010-03-16 17:22:21 +0100248 udelay(200);
249
Stefano Babic96651272010-03-16 17:22:21 +0100250 /* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
251 val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
252 VVIDEOEN | VAUDIOEN | VSDEN;
Stefano Babicdba2efc2011-10-08 10:59:20 +0200253 pmic_reg_write(p, REG_MODE_1, val);
Stefano Babic96651272010-03-16 17:22:21 +0100254
Fabio Estevamc38e0d62011-10-25 03:14:00 +0000255 mxc_request_iomux(MX51_PIN_EIM_A20, IOMUX_CONFIG_ALT1);
256 gpio_direction_output(46, 0);
257
Stefano Babic96651272010-03-16 17:22:21 +0100258 udelay(500);
259
Stefano Babic57008812011-08-21 23:29:52 +0200260 gpio_set_value(46, 1);
Stefano Babic96651272010-03-16 17:22:21 +0100261}
262
Stefano Babic421834e2010-02-05 15:13:58 +0100263#ifdef CONFIG_FSL_ESDHC
264int board_mmc_getcd(u8 *cd, struct mmc *mmc)
265{
266 struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
267
268 if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
Stefano Babic57008812011-08-21 23:29:52 +0200269 *cd = gpio_get_value(0);
Stefano Babic421834e2010-02-05 15:13:58 +0100270 else
Stefano Babic57008812011-08-21 23:29:52 +0200271 *cd = gpio_get_value(6);
Stefano Babic421834e2010-02-05 15:13:58 +0100272
273 return 0;
274}
275
276int board_mmc_init(bd_t *bis)
277{
278 u32 index;
279 s32 status = 0;
280
281 for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM;
282 index++) {
283 switch (index) {
284 case 0:
285 mxc_request_iomux(MX51_PIN_SD1_CMD,
286 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
287 mxc_request_iomux(MX51_PIN_SD1_CLK,
288 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
289 mxc_request_iomux(MX51_PIN_SD1_DATA0,
290 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
291 mxc_request_iomux(MX51_PIN_SD1_DATA1,
292 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
293 mxc_request_iomux(MX51_PIN_SD1_DATA2,
294 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
295 mxc_request_iomux(MX51_PIN_SD1_DATA3,
296 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
297 mxc_iomux_set_pad(MX51_PIN_SD1_CMD,
298 PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
299 PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
300 PAD_CTL_PUE_PULL |
301 PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
302 mxc_iomux_set_pad(MX51_PIN_SD1_CLK,
303 PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
304 PAD_CTL_HYS_NONE | PAD_CTL_47K_PU |
305 PAD_CTL_PUE_PULL |
306 PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
307 mxc_iomux_set_pad(MX51_PIN_SD1_DATA0,
308 PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
309 PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
310 PAD_CTL_PUE_PULL |
311 PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
312 mxc_iomux_set_pad(MX51_PIN_SD1_DATA1,
313 PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
314 PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
315 PAD_CTL_PUE_PULL |
316 PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
317 mxc_iomux_set_pad(MX51_PIN_SD1_DATA2,
318 PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
319 PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
320 PAD_CTL_PUE_PULL |
321 PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
322 mxc_iomux_set_pad(MX51_PIN_SD1_DATA3,
323 PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
324 PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PD |
325 PAD_CTL_PUE_PULL |
326 PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
327 mxc_request_iomux(MX51_PIN_GPIO1_0,
328 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
329 mxc_iomux_set_pad(MX51_PIN_GPIO1_0,
330 PAD_CTL_HYS_ENABLE);
331 mxc_request_iomux(MX51_PIN_GPIO1_1,
332 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
333 mxc_iomux_set_pad(MX51_PIN_GPIO1_1,
334 PAD_CTL_HYS_ENABLE);
335 break;
336 case 1:
337 mxc_request_iomux(MX51_PIN_SD2_CMD,
338 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
339 mxc_request_iomux(MX51_PIN_SD2_CLK,
340 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
341 mxc_request_iomux(MX51_PIN_SD2_DATA0,
342 IOMUX_CONFIG_ALT0);
343 mxc_request_iomux(MX51_PIN_SD2_DATA1,
344 IOMUX_CONFIG_ALT0);
345 mxc_request_iomux(MX51_PIN_SD2_DATA2,
346 IOMUX_CONFIG_ALT0);
347 mxc_request_iomux(MX51_PIN_SD2_DATA3,
348 IOMUX_CONFIG_ALT0);
349 mxc_iomux_set_pad(MX51_PIN_SD2_CMD,
350 PAD_CTL_DRV_MAX | PAD_CTL_22K_PU |
351 PAD_CTL_SRE_FAST);
352 mxc_iomux_set_pad(MX51_PIN_SD2_CLK,
353 PAD_CTL_DRV_MAX | PAD_CTL_22K_PU |
354 PAD_CTL_SRE_FAST);
355 mxc_iomux_set_pad(MX51_PIN_SD2_DATA0,
356 PAD_CTL_DRV_MAX | PAD_CTL_22K_PU |
357 PAD_CTL_SRE_FAST);
358 mxc_iomux_set_pad(MX51_PIN_SD2_DATA1,
359 PAD_CTL_DRV_MAX | PAD_CTL_22K_PU |
360 PAD_CTL_SRE_FAST);
361 mxc_iomux_set_pad(MX51_PIN_SD2_DATA2,
362 PAD_CTL_DRV_MAX | PAD_CTL_22K_PU |
363 PAD_CTL_SRE_FAST);
364 mxc_iomux_set_pad(MX51_PIN_SD2_DATA3,
365 PAD_CTL_DRV_MAX | PAD_CTL_22K_PU |
366 PAD_CTL_SRE_FAST);
367 mxc_request_iomux(MX51_PIN_SD2_CMD,
368 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
369 mxc_request_iomux(MX51_PIN_GPIO1_6,
370 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
371 mxc_iomux_set_pad(MX51_PIN_GPIO1_6,
372 PAD_CTL_HYS_ENABLE);
373 mxc_request_iomux(MX51_PIN_GPIO1_5,
374 IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
375 mxc_iomux_set_pad(MX51_PIN_GPIO1_5,
376 PAD_CTL_HYS_ENABLE);
377 break;
378 default:
379 printf("Warning: you configured more ESDHC controller"
380 "(%d) as supported by the board(2)\n",
381 CONFIG_SYS_FSL_ESDHC_NUM);
382 return status;
383 }
384 status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
385 }
386 return status;
387}
388#endif
389
Liu Hui-R643431e929df2010-12-23 01:13:17 +0000390int board_early_init_f(void)
391{
392 setup_iomux_uart();
393 setup_iomux_fec();
394
395 return 0;
396}
397
Stefano Babic421834e2010-02-05 15:13:58 +0100398int board_init(void)
399{
Stefano Babic421834e2010-02-05 15:13:58 +0100400 /* address of boot parameters */
401 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
402
Stefano Babic421834e2010-02-05 15:13:58 +0100403 return 0;
404}
405
Helmut Raigerd5a184b2011-10-20 04:19:47 +0000406#ifdef CONFIG_BOARD_LATE_INIT
Stefano Babic96651272010-03-16 17:22:21 +0100407int board_late_init(void)
408{
409#ifdef CONFIG_MXC_SPI
410 setup_iomux_spi();
411 power_init();
412#endif
413 return 0;
414}
415#endif
416
Stefano Babic421834e2010-02-05 15:13:58 +0100417int checkboard(void)
418{
Jason Liu8b7b69b2011-04-22 02:55:42 +0000419 puts("Board: MX51EVK\n");
Stefano Babic421834e2010-02-05 15:13:58 +0100420
Stefano Babic421834e2010-02-05 15:13:58 +0100421 return 0;
422}