summaryrefslogtreecommitdiff
path: root/board/seco
diff options
context:
space:
mode:
authorJulien CORJON <corjon.j@ecagroup.com>2016-02-05 16:19:33 +0100
committerStefano Babic <sbabic@denx.de>2016-02-21 11:37:20 +0100
commit22bd6b4f601c14d62c38bde5186c652082353b8b (patch)
treecfc43c2398daf2d16044132177dce94283bcc8ef /board/seco
parentdd8bd015e8bb89891b1dc6caccbe67a0c603584a (diff)
downloadu-boot-imx-22bd6b4f601c14d62c38bde5186c652082353b8b.zip
u-boot-imx-22bd6b4f601c14d62c38bde5186c652082353b8b.tar.gz
u-boot-imx-22bd6b4f601c14d62c38bde5186c652082353b8b.tar.bz2
imx: mx6quq7: add sd card detection
Add board_mmc_getcd function and declare CD_GPIO for SDCard. Signed-off-by: Julien Corjon <corjon.j@ecagroup.com>
Diffstat (limited to 'board/seco')
-rw-r--r--board/seco/mx6quq7/mx6quq7.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/board/seco/mx6quq7/mx6quq7.c b/board/seco/mx6quq7/mx6quq7.c
index 89ae70d..6be0b98 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, 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;