aboutsummaryrefslogtreecommitdiff
path: root/board/kontron
diff options
context:
space:
mode:
authorHeiko Thiery <heiko.thiery@gmail.com>2022-02-16 15:58:10 +0100
committerStefano Babic <sbabic@denx.de>2022-02-19 23:32:23 +0100
commit3240d011ae883a4ee842c0890c321ef1129fd3d4 (patch)
treeaff530236d379e1e25221f66dd0c3f5518c3de1f /board/kontron
parent891a32465d3b3c01f3374590500450604cd7d38a (diff)
downloadu-boot-3240d011ae883a4ee842c0890c321ef1129fd3d4.zip
u-boot-3240d011ae883a4ee842c0890c321ef1129fd3d4.tar.gz
u-boot-3240d011ae883a4ee842c0890c321ef1129fd3d4.tar.bz2
kontron-pitx-imx8m: fix board_mmc_getcd()
The function wrongly will return the card detection status of the SD card (USDHC2) for the eMMC (USDHC1). Thus booting from eMMC without an inserted SD card will fail. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Diffstat (limited to 'board/kontron')
-rw-r--r--board/kontron/pitx_imx8m/spl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/board/kontron/pitx_imx8m/spl.c b/board/kontron/pitx_imx8m/spl.c
index c043dd2..ef32568 100644
--- a/board/kontron/pitx_imx8m/spl.c
+++ b/board/kontron/pitx_imx8m/spl.c
@@ -76,17 +76,16 @@ static struct i2c_pads_info i2c_pad_info1 = {
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 USDHC1_BASE_ADDR:
/* the eMMC does not have a CD pin */
- ret = 1;
+ return 1;
case USDHC2_BASE_ADDR:
- ret = !gpio_get_value(USDHC2_CD_GPIO);
+ return !gpio_get_value(USDHC2_CD_GPIO);
}
- return ret;
+ return 0;
}