summaryrefslogtreecommitdiff
path: root/board/seco/mx6quq7
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-02-21 07:56:16 -0500
committerTom Rini <trini@konsulko.com>2016-02-21 07:56:16 -0500
commit595af9db2422fa5ae734cfe615415b17a5098f34 (patch)
tree21a9287dd2998798c2dbb1613eefc7d5f5a58159 /board/seco/mx6quq7
parent03bfc78359a2d749252b7dfdbff33898f6da0385 (diff)
parent35c4ce5e20d3d10d1089ba336a248896faed284c (diff)
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
Diffstat (limited to 'board/seco/mx6quq7')
-rw-r--r--board/seco/mx6quq7/mx6quq7.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/board/seco/mx6quq7/mx6quq7.c b/board/seco/mx6quq7/mx6quq7.c
index e7523f168b..08566fcb8d 100644
--- a/board/seco/mx6quq7/mx6quq7.c
+++ b/board/seco/mx6quq7/mx6quq7.c
@@ -91,11 +91,30 @@ int board_eth_init(bd_t *bis)
return ret;
}
+#define USDHC4_CD_GPIO IMX_GPIO_NR(2, 6)
+
static struct fsl_esdhc_cfg usdhc_cfg[2] = {
- {USDHC3_BASE_ADDR},
- {USDHC2_BASE_ADDR},
+ {USDHC3_BASE_ADDR, 0, 4},
+ {USDHC4_BASE_ADDR, 0, 4},
};
+int board_mmc_getcd(struct mmc *mmc)
+{
+ struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+ int ret = 0;
+
+ switch (cfg->esdhc_base) {
+ case USDHC3_BASE_ADDR:
+ ret = 1; /* Assume eMMC is always present */
+ break;
+ case USDHC4_BASE_ADDR:
+ ret = !gpio_get_value(USDHC4_CD_GPIO);
+ break;
+ }
+
+ return ret;
+}
+
int board_mmc_init(bd_t *bis)
{
u32 index = 0;
@@ -112,12 +131,10 @@ int board_mmc_init(bd_t *bis)
case 0:
seco_mx6_setup_usdhc_iomux(3);
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
- usdhc_cfg[0].max_bus_width = 4;
break;
case 1:
seco_mx6_setup_usdhc_iomux(4);
usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
- usdhc_cfg[1].max_bus_width = 4;
break;
default: