Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * Author: Fabio Estevam <fabio.estevam@freescale.com> |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <asm/arch/clock.h> |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 10 | #include <asm/arch/crm_regs.h> |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 11 | #include <asm/arch/iomux.h> |
| 12 | #include <asm/arch/imx-regs.h> |
| 13 | #include <asm/arch/mx6-pins.h> |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 14 | #include <asm/arch/mxc_hdmi.h> |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 15 | #include <asm/arch/sys_proto.h> |
| 16 | #include <asm/gpio.h> |
| 17 | #include <asm/imx-common/iomux-v3.h> |
Otavio Salvador | 54b8ce2 | 2013-04-19 03:42:03 +0000 | [diff] [blame] | 18 | #include <asm/imx-common/boot_mode.h> |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 19 | #include <asm/io.h> |
Alexey Brodkin | 267d8e2 | 2014-02-26 17:47:58 +0400 | [diff] [blame] | 20 | #include <linux/sizes.h> |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 21 | #include <common.h> |
| 22 | #include <fsl_esdhc.h> |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 23 | #include <ipu_pixfmt.h> |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 24 | #include <mmc.h> |
| 25 | #include <miiphy.h> |
| 26 | #include <netdev.h> |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 27 | #include <linux/fb.h> |
Fabio Estevam | 55e0f19 | 2014-02-15 14:52:00 -0200 | [diff] [blame] | 28 | #include <phy.h> |
Fabio Estevam | 4d66313 | 2014-02-15 14:52:01 -0200 | [diff] [blame] | 29 | #include <input.h> |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 30 | |
| 31 | DECLARE_GLOBAL_DATA_PTR; |
| 32 | |
Benoît Thébaudeau | 2167024 | 2013-04-26 01:34:47 +0000 | [diff] [blame] | 33 | #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ |
| 34 | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ |
| 35 | PAD_CTL_SRE_FAST | PAD_CTL_HYS) |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 36 | |
Benoît Thébaudeau | 2167024 | 2013-04-26 01:34:47 +0000 | [diff] [blame] | 37 | #define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \ |
| 38 | PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ |
| 39 | PAD_CTL_SRE_FAST | PAD_CTL_HYS) |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 40 | |
Benoît Thébaudeau | 2167024 | 2013-04-26 01:34:47 +0000 | [diff] [blame] | 41 | #define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ |
| 42 | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS) |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 43 | |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 44 | #define USDHC1_CD_GPIO IMX_GPIO_NR(1, 2) |
Otavio Salvador | 36fda7f | 2013-04-19 03:42:01 +0000 | [diff] [blame] | 45 | #define USDHC3_CD_GPIO IMX_GPIO_NR(3, 9) |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 46 | #define ETH_PHY_RESET IMX_GPIO_NR(3, 29) |
| 47 | |
| 48 | int dram_init(void) |
| 49 | { |
Tapani Utriainen | 048a64d | 2013-06-26 17:51:49 +0800 | [diff] [blame] | 50 | gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024; |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 51 | |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | static iomux_v3_cfg_t const uart1_pads[] = { |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 56 | MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), |
| 57 | MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
Fabio Estevam | 4b89169 | 2014-02-15 14:51:58 -0200 | [diff] [blame] | 60 | static iomux_v3_cfg_t const usdhc1_pads[] = { |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 61 | MX6_PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 62 | MX6_PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 63 | MX6_PAD_SD1_DAT0__SD1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 64 | MX6_PAD_SD1_DAT1__SD1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 65 | MX6_PAD_SD1_DAT2__SD1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 66 | MX6_PAD_SD1_DAT3__SD1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 67 | /* Carrier MicroSD Card Detect */ |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 68 | MX6_PAD_GPIO_2__GPIO1_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL), |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 71 | static iomux_v3_cfg_t const usdhc3_pads[] = { |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 72 | MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 73 | MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 74 | MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 75 | MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 76 | MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
| 77 | MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
Otavio Salvador | 36fda7f | 2013-04-19 03:42:01 +0000 | [diff] [blame] | 78 | /* SOM MicroSD Card Detect */ |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 79 | MX6_PAD_EIM_DA9__GPIO3_IO09 | MUX_PAD_CTRL(NO_PAD_CTRL), |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | static iomux_v3_cfg_t const enet_pads[] = { |
| 83 | MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 84 | MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 85 | MX6_PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 86 | MX6_PAD_RGMII_TD0__RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 87 | MX6_PAD_RGMII_TD1__RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 88 | MX6_PAD_RGMII_TD2__RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 89 | MX6_PAD_RGMII_TD3__RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 90 | MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 91 | MX6_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL), |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 92 | MX6_PAD_RGMII_RXC__RGMII_RXC | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 93 | MX6_PAD_RGMII_RD0__RGMII_RD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 94 | MX6_PAD_RGMII_RD1__RGMII_RD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 95 | MX6_PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 96 | MX6_PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 97 | MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), |
| 98 | /* AR8031 PHY Reset */ |
Eric Nelson | 3d3be0a | 2013-11-04 17:00:51 -0700 | [diff] [blame] | 99 | MX6_PAD_EIM_D29__GPIO3_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL), |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 100 | }; |
| 101 | |
| 102 | static void setup_iomux_uart(void) |
| 103 | { |
| 104 | imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); |
| 105 | } |
| 106 | |
| 107 | static void setup_iomux_enet(void) |
| 108 | { |
| 109 | imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); |
| 110 | |
| 111 | /* Reset AR8031 PHY */ |
| 112 | gpio_direction_output(ETH_PHY_RESET, 0); |
| 113 | udelay(500); |
| 114 | gpio_set_value(ETH_PHY_RESET, 1); |
| 115 | } |
| 116 | |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 117 | static struct fsl_esdhc_cfg usdhc_cfg[2] = { |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 118 | {USDHC3_BASE_ADDR}, |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 119 | {USDHC1_BASE_ADDR}, |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 120 | }; |
| 121 | |
Otavio Salvador | 36fda7f | 2013-04-19 03:42:01 +0000 | [diff] [blame] | 122 | int board_mmc_getcd(struct mmc *mmc) |
| 123 | { |
| 124 | struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; |
| 125 | int ret = 0; |
| 126 | |
| 127 | switch (cfg->esdhc_base) { |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 128 | case USDHC1_BASE_ADDR: |
| 129 | ret = !gpio_get_value(USDHC1_CD_GPIO); |
| 130 | break; |
Otavio Salvador | 36fda7f | 2013-04-19 03:42:01 +0000 | [diff] [blame] | 131 | case USDHC3_BASE_ADDR: |
| 132 | ret = !gpio_get_value(USDHC3_CD_GPIO); |
| 133 | break; |
| 134 | } |
| 135 | |
| 136 | return ret; |
| 137 | } |
| 138 | |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 139 | int board_mmc_init(bd_t *bis) |
| 140 | { |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 141 | s32 status = 0; |
| 142 | u32 index = 0; |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 143 | |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 144 | /* |
| 145 | * Following map is done: |
| 146 | * (U-boot device node) (Physical Port) |
| 147 | * mmc0 SOM MicroSD |
| 148 | * mmc1 Carrier board MicroSD |
| 149 | */ |
| 150 | for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM; ++index) { |
| 151 | switch (index) { |
| 152 | case 0: |
| 153 | imx_iomux_v3_setup_multiple_pads( |
| 154 | usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); |
| 155 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 156 | usdhc_cfg[0].max_bus_width = 4; |
| 157 | gpio_direction_input(USDHC3_CD_GPIO); |
| 158 | break; |
| 159 | case 1: |
| 160 | imx_iomux_v3_setup_multiple_pads( |
| 161 | usdhc1_pads, ARRAY_SIZE(usdhc1_pads)); |
| 162 | usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); |
| 163 | usdhc_cfg[1].max_bus_width = 4; |
| 164 | gpio_direction_input(USDHC1_CD_GPIO); |
| 165 | break; |
| 166 | default: |
| 167 | printf("Warning: you configured more USDHC controllers" |
| 168 | "(%d) then supported by the board (%d)\n", |
| 169 | index + 1, CONFIG_SYS_FSL_USDHC_NUM); |
| 170 | return status; |
| 171 | } |
| 172 | |
| 173 | status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); |
| 174 | } |
Abbas Raza | e6bf977 | 2013-03-25 09:13:34 +0000 | [diff] [blame] | 175 | |
Otavio Salvador | fe65104 | 2013-04-19 03:42:02 +0000 | [diff] [blame] | 176 | return status; |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | static int mx6_rgmii_rework(struct phy_device *phydev) |
| 180 | { |
| 181 | unsigned short val; |
| 182 | |
| 183 | /* To enable AR8031 ouput a 125MHz clk from CLK_25M */ |
| 184 | phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7); |
| 185 | phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016); |
| 186 | phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007); |
| 187 | |
| 188 | val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe); |
| 189 | val &= 0xffe3; |
| 190 | val |= 0x18; |
| 191 | phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val); |
| 192 | |
| 193 | /* introduce tx clock delay */ |
| 194 | phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x5); |
| 195 | val = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e); |
| 196 | val |= 0x0100; |
| 197 | phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, val); |
| 198 | |
| 199 | return 0; |
| 200 | } |
| 201 | |
| 202 | int board_phy_config(struct phy_device *phydev) |
| 203 | { |
| 204 | mx6_rgmii_rework(phydev); |
| 205 | |
| 206 | if (phydev->drv->config) |
| 207 | phydev->drv->config(phydev); |
| 208 | |
| 209 | return 0; |
| 210 | } |
| 211 | |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 212 | #if defined(CONFIG_VIDEO_IPUV3) |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 213 | static struct fb_videomode const hdmi = { |
| 214 | .name = "HDMI", |
| 215 | .refresh = 60, |
| 216 | .xres = 1024, |
| 217 | .yres = 768, |
| 218 | .pixclock = 15385, |
| 219 | .left_margin = 220, |
| 220 | .right_margin = 40, |
| 221 | .upper_margin = 21, |
| 222 | .lower_margin = 7, |
| 223 | .hsync_len = 60, |
| 224 | .vsync_len = 10, |
| 225 | .sync = FB_SYNC_EXT, |
| 226 | .vmode = FB_VMODE_NONINTERLACED |
| 227 | }; |
| 228 | |
| 229 | int board_video_skip(void) |
| 230 | { |
| 231 | int ret; |
| 232 | |
| 233 | ret = ipuv3_fb_init(&hdmi, 0, IPU_PIX_FMT_RGB24); |
| 234 | |
Fabio Estevam | 7be45ce | 2013-11-03 22:03:03 -0200 | [diff] [blame] | 235 | if (ret) { |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 236 | printf("HDMI cannot be configured: %d\n", ret); |
Fabio Estevam | 7be45ce | 2013-11-03 22:03:03 -0200 | [diff] [blame] | 237 | return ret; |
| 238 | } |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 239 | |
Pardeep Kumar Singla | c1fa130 | 2013-07-25 12:12:13 -0500 | [diff] [blame] | 240 | imx_enable_hdmi_phy(); |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 241 | |
| 242 | return ret; |
| 243 | } |
| 244 | |
| 245 | static void setup_display(void) |
| 246 | { |
| 247 | struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 248 | int reg; |
| 249 | |
Pardeep Kumar Singla | c1fa130 | 2013-07-25 12:12:13 -0500 | [diff] [blame] | 250 | enable_ipu_clock(); |
| 251 | imx_setup_hdmi(); |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 252 | |
| 253 | reg = readl(&mxc_ccm->chsccdr); |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 254 | reg |= (CHSCCDR_CLK_SEL_LDB_DI0 |
Pardeep Kumar Singla | c1fa130 | 2013-07-25 12:12:13 -0500 | [diff] [blame] | 255 | << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET); |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 256 | writel(reg, &mxc_ccm->chsccdr); |
| 257 | } |
| 258 | #endif /* CONFIG_VIDEO_IPUV3 */ |
| 259 | |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 260 | int board_eth_init(bd_t *bis) |
| 261 | { |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 262 | setup_iomux_enet(); |
| 263 | |
Fabio Estevam | c3cc305 | 2014-01-04 17:36:28 -0200 | [diff] [blame] | 264 | return cpu_eth_init(bis); |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | int board_early_init_f(void) |
| 268 | { |
| 269 | setup_iomux_uart(); |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 270 | #if defined(CONFIG_VIDEO_IPUV3) |
| 271 | setup_display(); |
| 272 | #endif |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 273 | return 0; |
| 274 | } |
| 275 | |
Fabio Estevam | 0296f28 | 2013-05-23 07:50:23 +0000 | [diff] [blame] | 276 | /* |
| 277 | * Do not overwrite the console |
| 278 | * Use always serial for U-Boot console |
| 279 | */ |
| 280 | int overwrite_console(void) |
| 281 | { |
| 282 | return 1; |
| 283 | } |
| 284 | |
Otavio Salvador | 54b8ce2 | 2013-04-19 03:42:03 +0000 | [diff] [blame] | 285 | #ifdef CONFIG_CMD_BMODE |
| 286 | static const struct boot_mode board_boot_modes[] = { |
| 287 | /* 4 bit bus width */ |
| 288 | {"mmc0", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, |
| 289 | {"mmc1", MAKE_CFGVAL(0x40, 0x20, 0x00, 0x00)}, |
| 290 | {NULL, 0}, |
| 291 | }; |
| 292 | #endif |
| 293 | |
| 294 | int board_late_init(void) |
| 295 | { |
| 296 | #ifdef CONFIG_CMD_BMODE |
| 297 | add_board_boot_modes(board_boot_modes); |
| 298 | #endif |
| 299 | |
| 300 | return 0; |
| 301 | } |
| 302 | |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 303 | int board_init(void) |
| 304 | { |
| 305 | /* address of boot parameters */ |
| 306 | gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; |
| 307 | |
| 308 | return 0; |
| 309 | } |
| 310 | |
Fabio Estevam | 1102740 | 2013-03-15 10:43:48 +0000 | [diff] [blame] | 311 | int checkboard(void) |
| 312 | { |
| 313 | puts("Board: Wandboard\n"); |
| 314 | |
| 315 | return 0; |
| 316 | } |