blob: 10e9d36e5199f1863852667e347ba82a4c75f9de [file] [log] [blame]
Jason Liu938080d2011-05-13 01:58:55 +00001/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc.
3 * Jason Liu <r64343@freescale.com>
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24#include <common.h>
25#include <asm/io.h>
26#include <asm/arch/imx-regs.h>
Jason Liu938080d2011-05-13 01:58:55 +000027#include <asm/arch/sys_proto.h>
28#include <asm/arch/crm_regs.h>
Stefano Babicf92e4e62012-02-22 00:24:41 +000029#include <asm/arch/clock.h>
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +000030#include <asm/arch/iomux-mx53.h>
Jason Liu938080d2011-05-13 01:58:55 +000031#include <asm/arch/clock.h>
32#include <asm/errno.h>
Vikram Narayanan30ea4be2012-11-10 02:32:46 +000033#include <asm/imx-common/mx5_video.h>
Jason Liu938080d2011-05-13 01:58:55 +000034#include <netdev.h>
35#include <i2c.h>
36#include <mmc.h>
37#include <fsl_esdhc.h>
Stefano Babic50410072011-08-21 10:59:33 +020038#include <asm/gpio.h>
Łukasz Majewskic7336812012-11-13 03:21:55 +000039#include <power/pmic.h>
Fabio Estevame7e33722012-04-30 08:12:04 +000040#include <dialog_pmic.h>
Fabio Estevam5b547f32012-05-07 10:25:59 +000041#include <fsl_pmic.h>
Fabio Estevamf714b0a2012-05-10 15:07:35 +000042#include <linux/fb.h>
43#include <ipu_pixfmt.h>
44
Fabio Estevam3ef0a312012-08-21 10:01:56 +000045#define MX53LOCO_LCD_POWER IMX_GPIO_NR(3, 24)
Jason Liu938080d2011-05-13 01:58:55 +000046
47DECLARE_GLOBAL_DATA_PTR;
48
Jason Liu938080d2011-05-13 01:58:55 +000049int dram_init(void)
50{
51 u32 size1, size2;
52
Albert ARIBAUDa55d23c2011-07-03 05:55:33 +000053 size1 = get_ram_size((void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
54 size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
Jason Liu938080d2011-05-13 01:58:55 +000055
56 gd->ram_size = size1 + size2;
57
58 return 0;
59}
60void dram_init_banksize(void)
61{
62 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
63 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
64
65 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
66 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
67}
68
Fabio Estevam54cd1de2012-05-08 03:40:49 +000069u32 get_board_rev(void)
70{
71 struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
72 struct fuse_bank *bank = &iim->bank[0];
73 struct fuse_bank0_regs *fuse =
74 (struct fuse_bank0_regs *)bank->fuse_regs;
75
76 int rev = readl(&fuse->gp[6]);
77
Fabio Estevameae08eb2012-05-29 05:54:39 +000078 if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR))
79 rev = 0;
80
Fabio Estevam54cd1de2012-05-08 03:40:49 +000081 return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
82}
83
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +000084#define UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \
85 PAD_CTL_PUS_100K_UP | PAD_CTL_ODE)
86
Jason Liu938080d2011-05-13 01:58:55 +000087static void setup_iomux_uart(void)
88{
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +000089 static const iomux_v3_cfg_t uart_pads[] = {
90 NEW_PAD_CTRL(MX53_PAD_CSI0_DAT11__UART1_RXD_MUX, UART_PAD_CTRL),
91 NEW_PAD_CTRL(MX53_PAD_CSI0_DAT10__UART1_TXD_MUX, UART_PAD_CTRL),
92 };
Jason Liu938080d2011-05-13 01:58:55 +000093
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +000094 imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
Jason Liu938080d2011-05-13 01:58:55 +000095}
96
Wolfgang Grandegger45cf6ad2011-11-11 14:03:37 +010097#ifdef CONFIG_USB_EHCI_MX5
Anatolij Gustschin60bae5e2011-12-12 01:25:46 +000098int board_ehci_hcd_init(int port)
Wolfgang Grandegger45cf6ad2011-11-11 14:03:37 +010099{
Fabio Estevam6ecaee82012-05-07 10:42:57 +0000100 /* request VBUS power enable pin, GPIO7_8 */
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000101 imx_iomux_v3_setup_pad(MX53_PAD_PATA_DA_2__GPIO7_8);
102 gpio_direction_output(IMX_GPIO_NR(7, 8), 1);
Anatolij Gustschin60bae5e2011-12-12 01:25:46 +0000103 return 0;
Wolfgang Grandegger45cf6ad2011-11-11 14:03:37 +0100104}
105#endif
106
Jason Liu938080d2011-05-13 01:58:55 +0000107static void setup_iomux_fec(void)
108{
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000109 static const iomux_v3_cfg_t fec_pads[] = {
110 NEW_PAD_CTRL(MX53_PAD_FEC_MDIO__FEC_MDIO, PAD_CTL_HYS |
111 PAD_CTL_DSE_HIGH | PAD_CTL_PUS_22K_UP | PAD_CTL_ODE),
112 NEW_PAD_CTRL(MX53_PAD_FEC_MDC__FEC_MDC, PAD_CTL_DSE_HIGH),
113 NEW_PAD_CTRL(MX53_PAD_FEC_RXD1__FEC_RDATA_1,
114 PAD_CTL_HYS | PAD_CTL_PKE),
115 NEW_PAD_CTRL(MX53_PAD_FEC_RXD0__FEC_RDATA_0,
116 PAD_CTL_HYS | PAD_CTL_PKE),
117 NEW_PAD_CTRL(MX53_PAD_FEC_TXD1__FEC_TDATA_1, PAD_CTL_DSE_HIGH),
118 NEW_PAD_CTRL(MX53_PAD_FEC_TXD0__FEC_TDATA_0, PAD_CTL_DSE_HIGH),
119 NEW_PAD_CTRL(MX53_PAD_FEC_TX_EN__FEC_TX_EN, PAD_CTL_DSE_HIGH),
120 NEW_PAD_CTRL(MX53_PAD_FEC_REF_CLK__FEC_TX_CLK,
121 PAD_CTL_HYS | PAD_CTL_PKE),
122 NEW_PAD_CTRL(MX53_PAD_FEC_RX_ER__FEC_RX_ER,
123 PAD_CTL_HYS | PAD_CTL_PKE),
124 NEW_PAD_CTRL(MX53_PAD_FEC_CRS_DV__FEC_RX_DV,
125 PAD_CTL_HYS | PAD_CTL_PKE),
126 };
Jason Liu938080d2011-05-13 01:58:55 +0000127
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000128 imx_iomux_v3_setup_multiple_pads(fec_pads, ARRAY_SIZE(fec_pads));
Jason Liu938080d2011-05-13 01:58:55 +0000129}
130
131#ifdef CONFIG_FSL_ESDHC
132struct fsl_esdhc_cfg esdhc_cfg[2] = {
Benoît Thébaudeau16e43f32012-08-13 07:28:16 +0000133 {MMC_SDHC1_BASE_ADDR},
134 {MMC_SDHC3_BASE_ADDR},
Jason Liu938080d2011-05-13 01:58:55 +0000135};
136
Thierry Reding314284b2012-01-02 01:15:36 +0000137int board_mmc_getcd(struct mmc *mmc)
Jason Liu938080d2011-05-13 01:58:55 +0000138{
139 struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
Thierry Reding314284b2012-01-02 01:15:36 +0000140 int ret;
Jason Liu938080d2011-05-13 01:58:55 +0000141
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000142 imx_iomux_v3_setup_pad(MX53_PAD_EIM_DA11__GPIO3_11);
Ashok Kumar Reddy92550702012-08-28 07:39:38 +0530143 gpio_direction_input(IMX_GPIO_NR(3, 11));
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000144 imx_iomux_v3_setup_pad(MX53_PAD_EIM_DA13__GPIO3_13);
Ashok Kumar Reddy92550702012-08-28 07:39:38 +0530145 gpio_direction_input(IMX_GPIO_NR(3, 13));
Fabio Estevam73128aa2011-11-15 05:51:29 +0000146
Jason Liu938080d2011-05-13 01:58:55 +0000147 if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
Ashok Kumar Reddy92550702012-08-28 07:39:38 +0530148 ret = !gpio_get_value(IMX_GPIO_NR(3, 13));
Jason Liu938080d2011-05-13 01:58:55 +0000149 else
Ashok Kumar Reddy92550702012-08-28 07:39:38 +0530150 ret = !gpio_get_value(IMX_GPIO_NR(3, 11));
Jason Liu938080d2011-05-13 01:58:55 +0000151
Thierry Reding314284b2012-01-02 01:15:36 +0000152 return ret;
Jason Liu938080d2011-05-13 01:58:55 +0000153}
154
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000155#define SD_CMD_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \
156 PAD_CTL_PUS_100K_UP)
157#define SD_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_47K_UP | \
158 PAD_CTL_DSE_HIGH)
159
Jason Liu938080d2011-05-13 01:58:55 +0000160int board_mmc_init(bd_t *bis)
161{
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000162 static const iomux_v3_cfg_t sd1_pads[] = {
163 NEW_PAD_CTRL(MX53_PAD_SD1_CMD__ESDHC1_CMD, SD_CMD_PAD_CTRL),
164 NEW_PAD_CTRL(MX53_PAD_SD1_CLK__ESDHC1_CLK, SD_PAD_CTRL),
165 NEW_PAD_CTRL(MX53_PAD_SD1_DATA0__ESDHC1_DAT0, SD_PAD_CTRL),
166 NEW_PAD_CTRL(MX53_PAD_SD1_DATA1__ESDHC1_DAT1, SD_PAD_CTRL),
167 NEW_PAD_CTRL(MX53_PAD_SD1_DATA2__ESDHC1_DAT2, SD_PAD_CTRL),
168 NEW_PAD_CTRL(MX53_PAD_SD1_DATA3__ESDHC1_DAT3, SD_PAD_CTRL),
169 MX53_PAD_EIM_DA13__GPIO3_13,
170 };
171
172 static const iomux_v3_cfg_t sd2_pads[] = {
173 NEW_PAD_CTRL(MX53_PAD_PATA_RESET_B__ESDHC3_CMD,
174 SD_CMD_PAD_CTRL),
175 NEW_PAD_CTRL(MX53_PAD_PATA_IORDY__ESDHC3_CLK, SD_PAD_CTRL),
176 NEW_PAD_CTRL(MX53_PAD_PATA_DATA8__ESDHC3_DAT0, SD_PAD_CTRL),
177 NEW_PAD_CTRL(MX53_PAD_PATA_DATA9__ESDHC3_DAT1, SD_PAD_CTRL),
178 NEW_PAD_CTRL(MX53_PAD_PATA_DATA10__ESDHC3_DAT2, SD_PAD_CTRL),
179 NEW_PAD_CTRL(MX53_PAD_PATA_DATA11__ESDHC3_DAT3, SD_PAD_CTRL),
180 NEW_PAD_CTRL(MX53_PAD_PATA_DATA0__ESDHC3_DAT4, SD_PAD_CTRL),
181 NEW_PAD_CTRL(MX53_PAD_PATA_DATA1__ESDHC3_DAT5, SD_PAD_CTRL),
182 NEW_PAD_CTRL(MX53_PAD_PATA_DATA2__ESDHC3_DAT6, SD_PAD_CTRL),
183 NEW_PAD_CTRL(MX53_PAD_PATA_DATA3__ESDHC3_DAT7, SD_PAD_CTRL),
184 MX53_PAD_EIM_DA11__GPIO3_11,
185 };
186
Jason Liu938080d2011-05-13 01:58:55 +0000187 u32 index;
188 s32 status = 0;
189
Benoît Thébaudeaua2ac1b32012-10-01 08:36:25 +0000190 esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
191 esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
192
Jason Liu938080d2011-05-13 01:58:55 +0000193 for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM; index++) {
194 switch (index) {
195 case 0:
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000196 imx_iomux_v3_setup_multiple_pads(sd1_pads,
197 ARRAY_SIZE(sd1_pads));
Jason Liu938080d2011-05-13 01:58:55 +0000198 break;
199 case 1:
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000200 imx_iomux_v3_setup_multiple_pads(sd2_pads,
201 ARRAY_SIZE(sd2_pads));
Jason Liu938080d2011-05-13 01:58:55 +0000202 break;
203 default:
204 printf("Warning: you configured more ESDHC controller"
205 "(%d) as supported by the board(2)\n",
206 CONFIG_SYS_FSL_ESDHC_NUM);
207 return status;
208 }
209 status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
210 }
211
212 return status;
213}
214#endif
215
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000216#define I2C_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \
217 PAD_CTL_PUS_100K_UP | PAD_CTL_ODE)
218
Fabio Estevame7e33722012-04-30 08:12:04 +0000219static void setup_iomux_i2c(void)
220{
Benoît Thébaudeau721d0b02013-05-03 10:32:34 +0000221 static const iomux_v3_cfg_t i2c1_pads[] = {
222 NEW_PAD_CTRL(MX53_PAD_CSI0_DAT8__I2C1_SDA, I2C_PAD_CTRL),
223 NEW_PAD_CTRL(MX53_PAD_CSI0_DAT9__I2C1_SCL, I2C_PAD_CTRL),
224 };
225
226 imx_iomux_v3_setup_multiple_pads(i2c1_pads, ARRAY_SIZE(i2c1_pads));
Fabio Estevame7e33722012-04-30 08:12:04 +0000227}
228
229static int power_init(void)
230{
Fabio Estevam5b547f32012-05-07 10:25:59 +0000231 unsigned int val;
Fabio Estevam085e7282012-12-28 04:05:29 +0000232 int ret;
Fabio Estevame7e33722012-04-30 08:12:04 +0000233 struct pmic *p;
234
Fabio Estevam5b547f32012-05-07 10:25:59 +0000235 if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR)) {
Fabio Estevamd2292512012-12-28 04:05:28 +0000236 ret = pmic_dialog_init(I2C_PMIC);
237 if (ret)
238 return ret;
Łukasz Majewskic7336812012-11-13 03:21:55 +0000239
240 p = pmic_get("DIALOG_PMIC");
241 if (!p)
242 return -ENODEV;
Fabio Estevame7e33722012-04-30 08:12:04 +0000243
Fabio Estevam5b547f32012-05-07 10:25:59 +0000244 /* Set VDDA to 1.25V */
245 val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
246 ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
Fabio Estevam085e7282012-12-28 04:05:29 +0000247 if (ret) {
248 printf("Writing to BUCKCORE_REG failed: %d\n", ret);
249 return ret;
250 }
Fabio Estevame7e33722012-04-30 08:12:04 +0000251
Fabio Estevam085e7282012-12-28 04:05:29 +0000252 pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
Fabio Estevam5b547f32012-05-07 10:25:59 +0000253 val |= DA9052_SUPPLY_VBCOREGO;
Fabio Estevam085e7282012-12-28 04:05:29 +0000254 ret = pmic_reg_write(p, DA9053_SUPPLY_REG, val);
255 if (ret) {
256 printf("Writing to SUPPLY_REG failed: %d\n", ret);
257 return ret;
258 }
Fabio Estevame7e33722012-04-30 08:12:04 +0000259
Fabio Estevam5b547f32012-05-07 10:25:59 +0000260 /* Set Vcc peripheral to 1.30V */
Fabio Estevam085e7282012-12-28 04:05:29 +0000261 ret = pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
262 if (ret) {
263 printf("Writing to BUCKPRO_REG failed: %d\n", ret);
264 return ret;
265 }
266
267 ret = pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
268 if (ret) {
269 printf("Writing to SUPPLY_REG failed: %d\n", ret);
270 return ret;
271 }
272
273 return ret;
Fabio Estevam5b547f32012-05-07 10:25:59 +0000274 }
275
276 if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
Fabio Estevamd2292512012-12-28 04:05:28 +0000277 ret = pmic_init(I2C_PMIC);
278 if (ret)
279 return ret;
Łukasz Majewskic7336812012-11-13 03:21:55 +0000280
Fabio Estevam89651122012-12-11 06:36:58 +0000281 p = pmic_get("FSL_PMIC");
Łukasz Majewskic7336812012-11-13 03:21:55 +0000282 if (!p)
283 return -ENODEV;
Fabio Estevam5b547f32012-05-07 10:25:59 +0000284
285 /* Set VDDGP to 1.25V for 1GHz on SW1 */
286 pmic_reg_read(p, REG_SW_0, &val);
287 val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_250V_MC34708;
288 ret = pmic_reg_write(p, REG_SW_0, val);
Fabio Estevam085e7282012-12-28 04:05:29 +0000289 if (ret) {
290 printf("Writing to REG_SW_0 failed: %d\n", ret);
291 return ret;
292 }
Fabio Estevam5b547f32012-05-07 10:25:59 +0000293
294 /* Set VCC as 1.30V on SW2 */
295 pmic_reg_read(p, REG_SW_1, &val);
296 val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_300V_MC34708;
Fabio Estevam085e7282012-12-28 04:05:29 +0000297 ret = pmic_reg_write(p, REG_SW_1, val);
298 if (ret) {
299 printf("Writing to REG_SW_1 failed: %d\n", ret);
300 return ret;
301 }
Fabio Estevam5b547f32012-05-07 10:25:59 +0000302
303 /* Set global reset timer to 4s */
304 pmic_reg_read(p, REG_POWER_CTL2, &val);
305 val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
Fabio Estevam085e7282012-12-28 04:05:29 +0000306 ret = pmic_reg_write(p, REG_POWER_CTL2, val);
307 if (ret) {
308 printf("Writing to REG_POWER_CTL2 failed: %d\n", ret);
309 return ret;
310 }
Fabio Estevam768a0592012-05-07 10:26:00 +0000311
312 /* Set VUSBSEL and VUSBEN for USB PHY supply*/
313 pmic_reg_read(p, REG_MODE_0, &val);
314 val |= (VUSBSEL_MC34708 | VUSBEN_MC34708);
Fabio Estevam085e7282012-12-28 04:05:29 +0000315 ret = pmic_reg_write(p, REG_MODE_0, val);
316 if (ret) {
317 printf("Writing to REG_MODE_0 failed: %d\n", ret);
318 return ret;
319 }
Fabio Estevam768a0592012-05-07 10:26:00 +0000320
321 /* Set SWBST to 5V in auto mode */
322 val = SWBST_AUTO;
Fabio Estevam085e7282012-12-28 04:05:29 +0000323 ret = pmic_reg_write(p, SWBST_CTRL, val);
324 if (ret) {
325 printf("Writing to SWBST_CTRL failed: %d\n", ret);
326 return ret;
327 }
328
329 return ret;
Fabio Estevam5b547f32012-05-07 10:25:59 +0000330 }
Fabio Estevame7e33722012-04-30 08:12:04 +0000331
Fabio Estevam085e7282012-12-28 04:05:29 +0000332 return -1;
Fabio Estevame7e33722012-04-30 08:12:04 +0000333}
334
335static void clock_1GHz(void)
336{
337 int ret;
Benoît Thébaudeau833b6432012-09-27 10:19:58 +0000338 u32 ref_clk = MXC_HCLK;
Fabio Estevame7e33722012-04-30 08:12:04 +0000339 /*
340 * After increasing voltage to 1.25V, we can switch
341 * CPU clock to 1GHz and DDR to 400MHz safely
342 */
343 ret = mxc_set_clock(ref_clk, 1000, MXC_ARM_CLK);
344 if (ret)
345 printf("CPU: Switch CPU clock to 1GHZ failed\n");
346
347 ret = mxc_set_clock(ref_clk, 400, MXC_PERIPH_CLK);
348 ret |= mxc_set_clock(ref_clk, 400, MXC_DDR_CLK);
349 if (ret)
350 printf("CPU: Switch DDR clock to 400MHz failed\n");
351}
352
Jason Liu938080d2011-05-13 01:58:55 +0000353int board_early_init_f(void)
354{
355 setup_iomux_uart();
356 setup_iomux_fec();
Vikram Narayanan30ea4be2012-11-10 02:32:46 +0000357 setup_iomux_lcd();
Jason Liu938080d2011-05-13 01:58:55 +0000358
359 return 0;
360}
361
Fabio Estevam1fc56f12012-04-30 08:12:03 +0000362int print_cpuinfo(void)
363{
364 u32 cpurev;
365
366 cpurev = get_cpu_rev();
367 printf("CPU: Freescale i.MX%x family rev%d.%d at %d MHz\n",
368 (cpurev & 0xFF000) >> 12,
369 (cpurev & 0x000F0) >> 4,
370 (cpurev & 0x0000F) >> 0,
371 mxc_get_clock(MXC_ARM_CLK) / 1000000);
372 printf("Reset cause: %s\n", get_reset_cause());
373 return 0;
374}
375
Stefano Babic3e077372012-08-05 00:18:53 +0000376/*
377 * Do not overwrite the console
378 * Use always serial for U-Boot console
379 */
380int overwrite_console(void)
Fabio Estevam1fc56f12012-04-30 08:12:03 +0000381{
Stefano Babic3e077372012-08-05 00:18:53 +0000382 return 1;
Fabio Estevam1fc56f12012-04-30 08:12:03 +0000383}
Fabio Estevam1fc56f12012-04-30 08:12:03 +0000384
Jason Liu938080d2011-05-13 01:58:55 +0000385int board_init(void)
386{
Jason Liu938080d2011-05-13 01:58:55 +0000387 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
388
Stefano Babicf92e4e62012-02-22 00:24:41 +0000389 mxc_set_sata_internal_clock();
Fabio Estevameae08eb2012-05-29 05:54:39 +0000390 setup_iomux_i2c();
Fabio Estevam54bb8412012-12-26 05:50:20 +0000391
Fabio Estevam54bb8412012-12-26 05:50:20 +0000392 return 0;
393}
394
395int board_late_init(void)
396{
Fabio Estevameae08eb2012-05-29 05:54:39 +0000397 if (!power_init())
398 clock_1GHz();
399 print_cpuinfo();
Stefano Babicf92e4e62012-02-22 00:24:41 +0000400
Jason Liu938080d2011-05-13 01:58:55 +0000401 return 0;
402}
403
404int checkboard(void)
405{
406 puts("Board: MX53 LOCO\n");
407
408 return 0;
409}