2 * Copyright (C) 2014 Eukréa Electromatique
7 * based on sabresd.c which is :
8 * Copyright (C) 2012 Freescale Semiconductor, Inc.
9 * and on hummingboard.c which is :
10 * Copyright (C) 2013 SolidRun ltd.
13 * SPDX-License-Identifier: GPL-2.0+
16 #include <asm/arch/clock.h>
17 #include <asm/arch/sys_proto.h>
18 #include <asm/arch/imx-regs.h>
19 #include <asm/arch/iomux.h>
20 #include <asm/arch/mx6-pins.h>
21 #include <asm/errno.h>
23 #include <asm/imx-common/iomux-v3.h>
24 #include <asm/imx-common/boot_mode.h>
25 #include <asm/imx-common/mxc_i2c.h>
26 #include <asm/imx-common/video.h>
29 #include <fsl_esdhc.h>
32 #include <asm/arch/mxc_hdmi.h>
33 #include <asm/arch/crm_regs.h>
35 #include <ipu_pixfmt.h>
37 #include <asm/arch/sys_proto.h>
38 DECLARE_GLOBAL_DATA_PTR;
40 #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
41 PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
42 PAD_CTL_SRE_FAST | PAD_CTL_HYS)
44 #define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \
45 PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \
46 PAD_CTL_SRE_FAST | PAD_CTL_HYS)
48 #define USDHC_PAD_CLK_CTRL (PAD_CTL_SPEED_LOW | \
49 PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | \
52 #define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
53 PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
55 #define ENET_PAD_CTRL_PD (PAD_CTL_PUS_100K_DOWN | \
56 PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
58 #define ENET_PAD_CTRL_CLK ((PAD_CTL_PUS_100K_UP & ~PAD_CTL_PKE) | \
59 PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
61 #define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
62 PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \
63 PAD_CTL_ODE | PAD_CTL_SRE_FAST)
65 #define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \
66 PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
68 static int board_type = -1;
69 #define BOARD_IS_MARSBOARD 0
70 #define BOARD_IS_RIOTBOARD 1
74 gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
79 static iomux_v3_cfg_t const uart2_pads[] = {
80 MX6_PAD_EIM_D26__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
81 MX6_PAD_EIM_D27__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
84 static void setup_iomux_uart(void)
86 imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
89 iomux_v3_cfg_t const enet_pads[] = {
90 MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL),
91 MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL),
92 /* GPIO16 -> AR8035 25MHz */
93 MX6_PAD_GPIO_16__ENET_REF_CLK | MUX_PAD_CTRL(NO_PAD_CTRL),
94 MX6_PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(NO_PAD_CTRL),
95 MX6_PAD_RGMII_TD0__RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL),
96 MX6_PAD_RGMII_TD1__RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL),
97 MX6_PAD_RGMII_TD2__RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL),
98 MX6_PAD_RGMII_TD3__RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL),
99 MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),
100 /* AR8035 CLK_25M --> ENET_REF_CLK (V22) */
101 MX6_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL_CLK),
102 MX6_PAD_RGMII_RXC__RGMII_RXC | MUX_PAD_CTRL(ENET_PAD_CTRL),
103 MX6_PAD_RGMII_RD0__RGMII_RD0 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD),
104 MX6_PAD_RGMII_RD1__RGMII_RD1 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD),
105 MX6_PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL),
106 MX6_PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL),
107 MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL_PD),
108 /* AR8035 PHY Reset */
109 MX6_PAD_EIM_D31__GPIO3_IO31 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD),
110 /* AR8035 PHY Interrupt */
111 MX6_PAD_ENET_TX_EN__GPIO1_IO28 | MUX_PAD_CTRL(ENET_PAD_CTRL),
114 static void setup_iomux_enet(void)
116 imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads));
118 /* Reset AR8035 PHY */
119 gpio_direction_output(IMX_GPIO_NR(3, 31) , 0);
121 gpio_set_value(IMX_GPIO_NR(3, 31), 1);
124 int mx6_rgmii_rework(struct phy_device *phydev)
126 /* from linux/arch/arm/mach-imx/mach-imx6q.c :
127 * Ar803x phy SmartEEE feature cause link status generates glitch,
128 * which cause ethernet link down/up issue, so disable SmartEEE
130 phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);
131 phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x805d);
132 phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4003);
137 int board_phy_config(struct phy_device *phydev)
139 mx6_rgmii_rework(phydev);
141 if (phydev->drv->config)
142 phydev->drv->config(phydev);
147 iomux_v3_cfg_t const usdhc2_pads[] = {
148 MX6_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CLK_CTRL),
149 MX6_PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
150 MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
151 MX6_PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
152 MX6_PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
153 MX6_PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
154 MX6_PAD_GPIO_2__GPIO1_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL), /* WP */
155 MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */
158 iomux_v3_cfg_t const usdhc3_pads[] = {
159 MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CLK_CTRL),
160 MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
161 MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
162 MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
163 MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
164 MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
167 iomux_v3_cfg_t const riotboard_usdhc3_pads[] = {
168 MX6_PAD_SD3_DAT4__GPIO7_IO01 | MUX_PAD_CTRL(NO_PAD_CTRL), /* WP */
169 MX6_PAD_SD3_DAT5__GPIO7_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */
172 iomux_v3_cfg_t const usdhc4_pads[] = {
173 MX6_PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CLK_CTRL),
174 MX6_PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
175 MX6_PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
176 MX6_PAD_SD4_DAT1__SD4_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
177 MX6_PAD_SD4_DAT2__SD4_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
178 MX6_PAD_SD4_DAT3__SD4_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
180 MX6_PAD_NANDF_ALE__GPIO6_IO08 | MUX_PAD_CTRL(NO_PAD_CTRL),
183 #ifdef CONFIG_FSL_ESDHC
184 struct fsl_esdhc_cfg usdhc_cfg[3] = {
190 #define USDHC2_CD_GPIO IMX_GPIO_NR(1, 4)
191 #define USDHC3_CD_GPIO IMX_GPIO_NR(7, 0)
193 int board_mmc_getcd(struct mmc *mmc)
195 struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
198 switch (cfg->esdhc_base) {
199 case USDHC2_BASE_ADDR:
200 ret = !gpio_get_value(USDHC2_CD_GPIO);
202 case USDHC3_BASE_ADDR:
203 if (board_type == BOARD_IS_RIOTBOARD)
204 ret = !gpio_get_value(USDHC3_CD_GPIO);
205 else if (board_type == BOARD_IS_MARSBOARD)
206 ret = 1; /* eMMC/uSDHC3 is always present */
208 case USDHC4_BASE_ADDR:
209 ret = 1; /* eMMC/uSDHC4 is always present */
216 int board_mmc_init(bd_t *bis)
222 * According to the board_mmc_init() the following map is done:
223 * (U-boot device node) (Physical Port)
225 * mmc0 SDCard slot (bottom)
226 * mmc1 uSDCard slot (top)
229 * mmc0 uSDCard slot (bottom)
232 for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
235 imx_iomux_v3_setup_multiple_pads(
236 usdhc2_pads, ARRAY_SIZE(usdhc2_pads));
237 gpio_direction_input(USDHC2_CD_GPIO);
238 usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
239 usdhc_cfg[0].max_bus_width = 4;
242 imx_iomux_v3_setup_multiple_pads(
243 usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
244 if (board_type == BOARD_IS_RIOTBOARD) {
245 imx_iomux_v3_setup_multiple_pads(
246 riotboard_usdhc3_pads,
247 ARRAY_SIZE(riotboard_usdhc3_pads));
248 gpio_direction_input(USDHC3_CD_GPIO);
249 gpio_direction_output(IMX_GPIO_NR(7, 8) , 0);
251 gpio_set_value(IMX_GPIO_NR(7, 8), 1);
253 usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
254 usdhc_cfg[1].max_bus_width = 4;
257 imx_iomux_v3_setup_multiple_pads(
258 usdhc4_pads, ARRAY_SIZE(usdhc4_pads));
259 usdhc_cfg[2].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
260 usdhc_cfg[2].max_bus_width = 4;
261 gpio_direction_output(IMX_GPIO_NR(6, 8) , 0);
263 gpio_set_value(IMX_GPIO_NR(6, 8), 1);
266 printf("Warning: you configured more USDHC controllers"
267 "(%d) then supported by the board (%d)\n",
268 i + 1, CONFIG_SYS_FSL_USDHC_NUM);
272 status |= fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
279 #ifdef CONFIG_MXC_SPI
280 iomux_v3_cfg_t const ecspi1_pads[] = {
281 MX6_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
282 MX6_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
283 MX6_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
284 MX6_PAD_EIM_EB2__GPIO2_IO30 | MUX_PAD_CTRL(NO_PAD_CTRL),
287 static void setup_spi(void)
289 imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads));
293 struct i2c_pads_info i2c_pad_info1 = {
295 .i2c_mode = MX6_PAD_CSI0_DAT9__I2C1_SCL
296 | MUX_PAD_CTRL(I2C_PAD_CTRL),
297 .gpio_mode = MX6_PAD_CSI0_DAT9__GPIO5_IO27
298 | MUX_PAD_CTRL(I2C_PAD_CTRL),
299 .gp = IMX_GPIO_NR(5, 27)
302 .i2c_mode = MX6_PAD_CSI0_DAT8__I2C1_SDA
303 | MUX_PAD_CTRL(I2C_PAD_CTRL),
304 .gpio_mode = MX6_PAD_CSI0_DAT8__GPIO5_IO26
305 | MUX_PAD_CTRL(I2C_PAD_CTRL),
306 .gp = IMX_GPIO_NR(5, 26)
310 struct i2c_pads_info i2c_pad_info2 = {
312 .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL
313 | MUX_PAD_CTRL(I2C_PAD_CTRL),
314 .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12
315 | MUX_PAD_CTRL(I2C_PAD_CTRL),
316 .gp = IMX_GPIO_NR(4, 12)
319 .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA
320 | MUX_PAD_CTRL(I2C_PAD_CTRL),
321 .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13
322 | MUX_PAD_CTRL(I2C_PAD_CTRL),
323 .gp = IMX_GPIO_NR(4, 13)
327 struct i2c_pads_info i2c_pad_info3 = {
329 .i2c_mode = MX6_PAD_GPIO_5__I2C3_SCL
330 | MUX_PAD_CTRL(I2C_PAD_CTRL),
331 .gpio_mode = MX6_PAD_GPIO_5__GPIO1_IO05
332 | MUX_PAD_CTRL(I2C_PAD_CTRL),
333 .gp = IMX_GPIO_NR(1, 5)
336 .i2c_mode = MX6_PAD_GPIO_6__I2C3_SDA
337 | MUX_PAD_CTRL(I2C_PAD_CTRL),
338 .gpio_mode = MX6_PAD_GPIO_6__GPIO1_IO06
339 | MUX_PAD_CTRL(I2C_PAD_CTRL),
340 .gp = IMX_GPIO_NR(1, 6)
344 iomux_v3_cfg_t const tft_pads_riot[] = {
346 MX6_PAD_ENET_TXD1__GPIO1_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
348 MX6_PAD_NANDF_CS1__GPIO6_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL),
350 MX6_PAD_NANDF_CS2__GPIO6_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL),
352 MX6_PAD_SD1_CMD__GPIO1_IO18 | MUX_PAD_CTRL(NO_PAD_CTRL),
355 iomux_v3_cfg_t const tft_pads_mars[] = {
357 MX6_PAD_ENET_TXD1__GPIO1_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
359 MX6_PAD_NANDF_CS1__GPIO6_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL),
361 MX6_PAD_NANDF_CS2__GPIO6_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL),
362 /* BL LEVEL (PWM4) */
363 MX6_PAD_SD4_DAT2__GPIO2_IO10 | MUX_PAD_CTRL(NO_PAD_CTRL),
366 #if defined(CONFIG_VIDEO_IPUV3)
368 static void enable_lvds(struct display_info_t const *dev)
370 struct iomuxc *iomux = (struct iomuxc *)
372 setbits_le32(&iomux->gpr[2],
373 IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT);
374 /* set backlight level to ON */
375 if (board_type == BOARD_IS_RIOTBOARD)
376 gpio_direction_output(IMX_GPIO_NR(1, 18) , 1);
377 else if (board_type == BOARD_IS_MARSBOARD)
378 gpio_direction_output(IMX_GPIO_NR(2, 10) , 1);
381 static void disable_lvds(struct display_info_t const *dev)
383 struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
385 /* set backlight level to OFF */
386 if (board_type == BOARD_IS_RIOTBOARD)
387 gpio_direction_output(IMX_GPIO_NR(1, 18) , 0);
388 else if (board_type == BOARD_IS_MARSBOARD)
389 gpio_direction_output(IMX_GPIO_NR(2, 10) , 0);
391 clrbits_le32(&iomux->gpr[2],
392 IOMUXC_GPR2_LVDS_CH0_MODE_MASK);
395 static void do_enable_hdmi(struct display_info_t const *dev)
398 imx_enable_hdmi_phy();
401 static int detect_i2c(struct display_info_t const *dev)
403 return (0 == i2c_set_bus_num(dev->bus)) &&
404 (0 == i2c_probe(dev->addr));
407 struct display_info_t const displays[] = {{
410 .pixfmt = IPU_PIX_FMT_RGB24,
411 .detect = detect_hdmi,
412 .enable = do_enable_hdmi,
426 .vmode = FB_VMODE_NONINTERLACED
430 .pixfmt = IPU_PIX_FMT_LVDS666,
431 .detect = detect_i2c,
432 .enable = enable_lvds,
434 .name = "LCD8000-97C",
446 .vmode = FB_VMODE_NONINTERLACED
448 size_t display_count = ARRAY_SIZE(displays);
450 static void setup_display(void)
452 struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
453 struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
459 /* Turn on LDB0, IPU,IPU DI0 clocks */
460 setbits_le32(&mxc_ccm->CCGR3,
461 MXC_CCM_CCGR3_LDB_DI0_MASK);
463 /* set LDB0 clk select to 011/011 */
464 clrsetbits_le32(&mxc_ccm->cs2cdr,
465 MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK,
466 (3 << MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET));
468 setbits_le32(&mxc_ccm->cscmr2,
469 MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV);
471 setbits_le32(&mxc_ccm->chsccdr,
472 (CHSCCDR_CLK_SEL_LDB_DI0
473 << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET));
475 reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES
476 | IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW
477 | IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG
478 | IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT
479 | IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG
480 | IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT
481 | IOMUXC_GPR2_LVDS_CH1_MODE_DISABLED
482 | IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI0;
483 writel(reg, &iomux->gpr[2]);
485 clrsetbits_le32(&iomux->gpr[3],
486 IOMUXC_GPR3_LVDS0_MUX_CTL_MASK |
487 IOMUXC_GPR3_HDMI_MUX_CTL_MASK,
488 IOMUXC_GPR3_MUX_SRC_IPU1_DI0
489 << IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET);
491 #endif /* CONFIG_VIDEO_IPUV3 */
494 * Do not overwrite the console
495 * Use always serial for U-Boot console
497 int overwrite_console(void)
502 int board_eth_init(bd_t *bis)
506 return cpu_eth_init(bis);
509 int board_early_init_f(void)
511 u32 cputype = cpu_type(get_cpu_rev());
514 case MXC_CPU_MX6SOLO:
515 board_type = BOARD_IS_RIOTBOARD;
518 board_type = BOARD_IS_MARSBOARD;
524 if (board_type == BOARD_IS_RIOTBOARD)
525 imx_iomux_v3_setup_multiple_pads(
526 tft_pads_riot, ARRAY_SIZE(tft_pads_riot));
527 else if (board_type == BOARD_IS_MARSBOARD)
528 imx_iomux_v3_setup_multiple_pads(
529 tft_pads_mars, ARRAY_SIZE(tft_pads_mars));
530 #if defined(CONFIG_VIDEO_IPUV3)
532 gpio_direction_output(IMX_GPIO_NR(1, 29) , 1);
533 /* touch interrupt is an input */
534 gpio_direction_input(IMX_GPIO_NR(6, 14));
535 /* power ON backlight */
536 gpio_direction_output(IMX_GPIO_NR(6, 15) , 1);
537 /* set backlight level to off */
538 if (board_type == BOARD_IS_RIOTBOARD)
539 gpio_direction_output(IMX_GPIO_NR(1, 18) , 0);
540 else if (board_type == BOARD_IS_MARSBOARD)
541 gpio_direction_output(IMX_GPIO_NR(2, 10) , 0);
550 /* address of boot parameters */
551 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
552 /* i2c1 : PMIC, Audio codec on RiOT, Expansion connector on MarS */
553 setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
554 /* i2c2 : HDMI EDID */
555 setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
556 /* i2c3 : LVDS, Expansion connector */
557 setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3);
558 #ifdef CONFIG_MXC_SPI
564 #ifdef CONFIG_CMD_BMODE
565 static const struct boot_mode riotboard_boot_modes[] = {
566 {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)},
567 {"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)},
568 {"emmc", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)},
571 static const struct boot_mode marsboard_boot_modes[] = {
572 {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)},
573 {"emmc", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)},
578 int board_late_init(void)
580 #ifdef CONFIG_CMD_BMODE
581 if (board_type == BOARD_IS_RIOTBOARD)
582 add_board_boot_modes(riotboard_boot_modes);
583 else if (board_type == BOARD_IS_RIOTBOARD)
584 add_board_boot_modes(marsboard_boot_modes);
593 if (board_type == BOARD_IS_MARSBOARD)
595 else if (board_type == BOARD_IS_RIOTBOARD)
598 printf("unknown - cputype : %02x\n", cpu_type(get_cpu_rev()));