summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2013-03-16 08:05:06 +0000
committerStefano Babic <sbabic@denx.de>2013-04-03 10:41:28 +0200
commit60bb4621489d53aa255ccc35621a286a9a9b700d (patch)
tree1cba8cac15f738991578e2d25d19b6f00579180b /board
parent28ff917c28977e954d47148562a42d9468bfae62 (diff)
downloadu-boot-imx-60bb4621489d53aa255ccc35621a286a9a9b700d.zip
u-boot-imx-60bb4621489d53aa255ccc35621a286a9a9b700d.tar.gz
u-boot-imx-60bb4621489d53aa255ccc35621a286a9a9b700d.tar.bz2
mx6qsabresd: Fix card detection for invalid card id case
This changes the code so in case an unkown value is passed it will return as invalid. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx6qsabresd/mx6qsabresd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/board/freescale/mx6qsabresd/mx6qsabresd.c b/board/freescale/mx6qsabresd/mx6qsabresd.c
index 5ebbff3..d3019e9 100644
--- a/board/freescale/mx6qsabresd/mx6qsabresd.c
+++ b/board/freescale/mx6qsabresd/mx6qsabresd.c
@@ -145,15 +145,21 @@ struct fsl_esdhc_cfg usdhc_cfg[3] = {
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 USDHC2_BASE_ADDR:
- return !gpio_get_value(USDHC2_CD_GPIO);
+ ret = !gpio_get_value(USDHC2_CD_GPIO);
+ break;
case USDHC3_BASE_ADDR:
- return !gpio_get_value(USDHC3_CD_GPIO);
- default:
- return 1; /* eMMC/uSDHC4 is always present */
+ ret = !gpio_get_value(USDHC3_CD_GPIO);
+ break;
+ case USDHC4_BASE_ADDR:
+ ret = 1; /* eMMC/uSDHC4 is always present */
+ break;
}
+
+ return ret;
}
int board_mmc_init(bd_t *bis)