Commit 22bd6b4f authored by Julien CORJON's avatar Julien CORJON Committed by Stefano Babic

imx: mx6quq7: add sd card detection

Add board_mmc_getcd function and declare CD_GPIO for SDCard.
Signed-off-by: default avatarJulien Corjon <corjon.j@ecagroup.com>
parent dd8bd015
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment