blob: 10e9d36e5199f1863852667e347ba82a4c75f9de [file] [log] [blame]
Jason Liuf5b81c82011-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 Liuf5b81c82011-05-13 01:58:55 +000027#include <asm/arch/sys_proto.h>
28#include <asm/arch/crm_regs.h>
Stefano Babic59dffd62012-02-22 00:24:41 +000029#include <asm/arch/clock.h>
Benoît Thébaudeaub66011e2013-05-03 10:32:34 +000030#include <asm/arch/iomux-mx53.h>
Jason Liuf5b81c82011-05-13 01:58:55 +000031#include <asm/arch/clock.h>
32#include <asm/errno.h>
Vikram Narayanan8bb48d62012-11-10 02:32:46 +000033#include <asm/imx-common/mx5_video.h>
Jason Liuf5b81c82011-05-13 01:58:55 +000034#include <netdev.h>
35#include <i2c.h>
36#include <mmc.h>
37#include <fsl_esdhc.h>
Stefano Babic831096b2011-08-21 10:59:33 +020038#include <asm/gpio.h>
Łukasz Majewski1c6dba12012-11-13 03:21:55 +000039#include <power/pmic.h>
Fabio Estevam2fc58322012-04-30 08:12:04 +000040#include <dialog_pmic.h>
Fabio Estevam082a1122012-05-07 10:25:59 +000041#include <fsl_pmic.h>
Fabio Estevam20c49da2012-05-10 15:07:35 +000042#include <linux/fb.h>
43#include <ipu_pixfmt.h>
44
Fabio Estevam642af862012-08-21 10:01:56 +000045#define MX53LOCO_LCD_POWER IMX_GPIO_NR(3, 24)
Jason Liuf5b81c82011-05-13 01:58:55 +000046
47DECLARE_GLOBAL_DATA_PTR;
48
Jason Liuf5b81c82011-05-13 01:58:55 +000049int dram_init(void)
50{
51 u32 size1, size2;
52
Albert ARIBAUDa9606732011-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 Liuf5b81c82011-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 Estevam8b3533c2012-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 Estevam99f896e2012-05-29 05:54:39 +000078 if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR))
79 rev = 0;
80
Fabio Estevam8b3533c2012-05-08 03:40:49 +000081 return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
82}
83
Benoît Thébaudeaub66011e2013-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 Liuf5b81c82011-05-13 01:58:55 +000087static void setup_iomux_uart(void)
88{
Benoît Thébaudeaub66011e2013-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 Liuf5b81c82011-05-13 01:58:55 +000093
Benoît Thébaudeaub66011e2013-05-03 10:32:34 +000094 imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
Jason Liuf5b81c82011-05-13 01:58:55 +000095}
96
Wolfgang Grandeggerfde87332011-11-11 14:03:37 +010097#ifdef CONFIG_USB_EHCI_MX5
Anatolij Gustschinef2f5792011-12-12 01:25:46 +000098int board_ehci_hcd_init(int port)
Wolfgang Grandeggerfde87332011-11-11 14:03:37 +010099{
Fabio Estevam925f2832012-05-07 10:42:57 +0000100 /* request VBUS power enable pin, GPIO7_8 */
Benoît Thébaudeaub66011e2013-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 Gustschinef2f5792011-12-12 01:25:46 +0000103 return 0;
Wolfgang Grandeggerfde87332011-11-11 14:03:37 +0100104}
105#endif
106
Jason Liuf5b81c82011-05-13 01:58:55 +0000107static void setup_iomux_fec(void)
108{
Benoît Thébaudeaub66011e2013-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 Liuf5b81c82011-05-13 01:58:55 +0000127
Benoît Thébaudeaub66011e2013-05-03 10:32:34 +0000128 imx_iomux_v3_setup_multiple_pads(fec_pads, ARRAY_SIZE(fec_pads));
Jason Liuf5b81c82011-05-13 01:58:55 +0000129}
130
131#ifdef CONFIG_FSL_ESDHC
132struct fsl_esdhc_cfg esdhc_cfg[2] = {
Benoît Thébaudeauc08d11c2012-08-13 07:28:16 +0000133 {MMC_SDHC1_BASE_ADDR},
134 {MMC_SDHC3_BASE_ADDR},
Jason Liuf5b81c82011-05-13 01:58:55 +0000135};
136
Thierry Redingd7aebf42012-01-02 01:15:36 +0000137int board_mmc_getcd(struct mmc *mmc)
Jason Liuf5b81c82011-05-13 01:58:55 +0000138{
139 struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
Thierry Redingd7aebf42012-01-02 01:15:36 +0000140 int ret;
Jason Liuf5b81c82011-05-13 01:58:55 +0000141
Benoît Thébaudeaub66011e2013-05-03 10:32:34 +0000142 imx_iomux_v3_setup_pad(MX53_PAD_EIM_DA11__GPIO3_11);
Ashok Kumar Reddy7d04bd72012-08-28 07:39:38 +0530143 gpio_direction_input(IMX_GPIO_NR(3, 11));
Benoît Thébaudeaub66011e2013-05-03 10:32:34 +0000144 imx_iomux_v3_setup_pad(MX53_PAD_EIM_DA13__GPIO3_13);
Ashok Kumar Reddy7d04bd72012-08-28 07:39:38 +0530145 gpio_direction_input(IMX_GPIO_NR(3, 13));
Fabio Estevam828f5e52011-11-15 05:51:29 +0000146
Jason Liuf5b81c82011-05-13 01:58:55 +0000147 if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
Ashok Kumar Reddy7d04bd72012-08-28 07:39:38 +0530148 ret = !gpio_get_value(IMX_GPIO_NR(3, 13));
Jason Liuf5b81c82011-05-13 01:58:55 +0000149 else
Ashok Kumar Reddy7d04bd72012-08-28 07:39:38 +0530150 ret = !gpio_get_value(IMX_GPIO_NR(3, 11));
Jason Liuf5b81c82011-05-13 01:58:55 +0000151
Thierry Redingd7aebf42012-01-02 01:15:36 +0000152 return ret;
Jason Liuf5b81c82011-05-13 01:58:55 +0000153}
154
Benoît Thébaudeaub66011e2013-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 Liuf5b81c82011-05-13 01:58:55 +0000160int board_mmc_init(bd_t *bis)
161{
Benoît Thébaudeaub66011e2013-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 Liuf5b81c82011-05-13 01:58:55 +0000187 u32 index;
188 s32 status = 0;
189
Benoît Thébaudeauc58ff342012-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 Liuf5b81c82011-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ébaudeaub66011e2013-05-03 10:32:34 +0000196 imx_iomux_v3_setup_multiple_pads(sd1_pads,
197 ARRAY_SIZE(sd1_pads));
Jason Liuf5b81c82011-05-13 01:58:55 +0000198 break;
199 case 1:
Benoît Thébaudeaub66011e2013-05-03 10:32:34 +0000200 imx_iomux_v3_setup_multiple_pads(sd2_pads,
201 ARRAY_SIZE(sd2_pads));
Jason Liuf5b81c82011-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ébaudeaub66011e2013-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 Estevam2fc58322012-04-30 08:12:04 +0000219static void setup_iomux_i2c(void)
220{
Benoît Thébaudeaub66011e2013-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 Estevam2fc58322012-04-30 08:12:04 +0000227}
228
229static int power_init(void)
230{
Fabio Estevam082a1122012-05-07 10:25:59 +0000231 unsigned int val;
Fabio Estevamfbbdadf2012-12-28 04:05:29 +0000232 int ret;
Fabio Estevam2fc58322012-04-30 08:12:04 +0000233 struct pmic *p;
234
Fabio Estevam082a1122012-05-07 10:25:59 +0000235 if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR)) {
Fabio Estevamdf5b4c32012-12-28 04:05:28 +0000236 ret = pmic_dialog_init(I2C_PMIC);
237 if (ret)
238 return ret;
Łukasz Majewski1c6dba12012-11-13 03:21:55 +0000239
240 p = pmic_get("DIALOG_PMIC");
241 if (!p)
242 return -ENODEV;
Fabio Estevam2fc58322012-04-30 08:12:04 +0000243
Fabio Estevam082a1122012-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 Estevamfbbdadf2012-12-28 04:05:29 +0000247 if (ret) {
248 printf("Writing to BUCKCORE_REG failed: %d\n", ret);
249 return ret;
250 }
Fabio Estevam2fc58322012-04-30 08:12:04 +0000251
Fabio Estevamfbbdadf2012-12-28 04:05:29 +0000252 pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
Fabio Estevam082a1122012-05-07 10:25:59 +0000253 val |= DA9052_SUPPLY_VBCOREGO;
Fabio Estevamfbbdadf2012-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 Estevam2fc58322012-04-30 08:12:04 +0000259
Fabio Estevam082a1122012-05-07 10:25:59 +0000260 /* Set Vcc peripheral to 1.30V */
Fabio Estevamfbbdadf2012-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 Estevam082a1122012-05-07 10:25:59 +0000274 }
275
276 if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
Fabio Estevamdf5b4c32012-12-28 04:05:28 +0000277 ret = pmic_init(I2C_PMIC);
278 if (ret)
279 return ret;
Łukasz Majewski1c6dba12012-11-13 03:21:55 +0000280
Fabio Estevam39ffa1f2012-12-11 06:36:58 +0000281 p = pmic_get("FSL_PMIC");
Łukasz Majewski1c6dba12012-11-13 03:21:55 +0000282 if (!p)
283 return -ENODEV;
Fabio Estevam082a1122012-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 Estevamfbbdadf2012-12-28 04:05:29 +0000289 if (ret) {
290 printf("Writing to REG_SW_0 failed: %d\n", ret);
291 return ret;
292 }
Fabio Estevam082a1122012-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 Estevamfbbdadf2012-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 Estevam082a1122012-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 Estevamfbbdadf2012-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 Estevam0436b7a2012-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 Estevamfbbdadf2012-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 Estevam0436b7a2012-05-07 10:26:00 +0000320
321 /* Set SWBST to 5V in auto mode */
322 val = SWBST_AUTO;
Fabio Estevamfbbdadf2012-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 Estevam082a1122012-05-07 10:25:59 +0000330 }
Fabio Estevam2fc58322012-04-30 08:12:04 +0000331
Fabio Estevamfbbdadf2012-12-28 04:05:29 +0000332 return -1;
Fabio Estevam2fc58322012-04-30 08:12:04 +0000333}
334
335static void clock_1GHz(void)
336{
337 int ret;
Benoît Thébaudeauafac1652012-09-27 10:19:58 +0000338 u32 ref_clk = MXC_HCLK;
Fabio Estevam2fc58322012-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 Liuf5b81c82011-05-13 01:58:55 +0000353int board_early_init_f(void)
354{
355 setup_iomux_uart();
356 setup_iomux_fec();
Vikram Narayanan8bb48d62012-11-10 02:32:46 +0000357 setup_iomux_lcd();
Jason Liuf5b81c82011-05-13 01:58:55 +0000358
359 return 0;
360}
361
Fabio Estevam026c9862012-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 Babiccbf6c9c2012-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 Estevam026c9862012-04-30 08:12:03 +0000381{
Stefano Babiccbf6c9c2012-08-05 00:18:53 +0000382 return 1;
Fabio Estevam026c9862012-04-30 08:12:03 +0000383}
Fabio Estevam026c9862012-04-30 08:12:03 +0000384
Jason Liuf5b81c82011-05-13 01:58:55 +0000385int board_init(void)
386{
Jason Liuf5b81c82011-05-13 01:58:55 +0000387 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
388
Stefano Babic59dffd62012-02-22 00:24:41 +0000389 mxc_set_sata_internal_clock();
Fabio Estevam99f896e2012-05-29 05:54:39 +0000390 setup_iomux_i2c();
Fabio Estevamb665c832012-12-26 05:50:20 +0000391
Fabio Estevamb665c832012-12-26 05:50:20 +0000392 return 0;
393}
394
395int board_late_init(void)
396{
Fabio Estevam99f896e2012-05-29 05:54:39 +0000397 if (!power_init())
398 clock_1GHz();
399 print_cpuinfo();
Stefano Babic59dffd62012-02-22 00:24:41 +0000400
Jason Liuf5b81c82011-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}