summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-07-24 07:54:20 -0600
committerTom Rini <trini@konsulko.com>2025-07-24 07:54:20 -0600
commit47b4a9b1a6d92d0b53b427880226180ffc3c8fe3 (patch)
tree632bee726e3db3d1b53ff1e972bf169b892065a0
parent3532f1f5edfc97c9dcea723cdeb732eda44bc669 (diff)
parent1080815650a00257929f645bedf4e1795bf188bf (diff)
Merge tag 'mmc-master-2025-07-24' of https://source.denx.de/u-boot/custodians/u-boot-mmc
CI: https://source.denx.de/u-boot/custodians/u-boot-mmc/-/pipelines/27140 - Fix emmc error state after mmc write timeout - Minor cleanup s5p_sdhci - Support DT upstream for exynos5420 and exynos4210 mmc
-rw-r--r--drivers/mmc/exynos_dw_mmc.c6
-rw-r--r--drivers/mmc/mmc_write.c12
-rw-r--r--drivers/mmc/s5p_sdhci.c11
3 files changed, 17 insertions, 12 deletions
diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
index c8bf89d6d35..12e37cb4b78 100644
--- a/drivers/mmc/exynos_dw_mmc.c
+++ b/drivers/mmc/exynos_dw_mmc.c
@@ -373,6 +373,12 @@ static const struct udevice_id exynos_dwmmc_ids[] = {
.compatible = "samsung,exynos4412-dw-mshc",
.data = (ulong)&exynos4_drv_data,
}, {
+ .compatible = "samsung,exynos5420-dw-mshc-smu",
+ .data = (ulong)&exynos5_drv_data,
+ }, {
+ .compatible = "samsung,exynos5420-dw-mshc",
+ .data = (ulong)&exynos5_drv_data,
+ }, {
.compatible = "samsung,exynos-dwmmc",
.data = (ulong)&exynos5_drv_data,
}, {
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index 90fcf2679bb..928c05872ca 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -155,6 +155,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
struct mmc_cmd cmd;
struct mmc_data data;
int timeout_ms = 1000;
+ int err;
if ((start + blkcnt) > mmc_get_blk_desc(mmc)->lba) {
printf("MMC: block number 0x" LBAF " exceeds max(0x" LBAF ")\n",
@@ -181,9 +182,13 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
data.blocksize = mmc->write_bl_len;
data.flags = MMC_DATA_WRITE;
- if (mmc_send_cmd(mmc, &cmd, &data)) {
+ err = mmc_send_cmd(mmc, &cmd, &data);
+ if (err) {
printf("mmc write failed\n");
- return 0;
+ /*
+ * Don't return 0 here since the emmc will still be in data
+ * transfer mode continue to send the STOP_TRANSMISSION command
+ */
}
/* SPI multiblock writes terminate using a special
@@ -203,6 +208,9 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
if (mmc_poll_for_busy(mmc, timeout_ms))
return 0;
+ if (err)
+ return 0;
+
return blkcnt;
}
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 278019f02ab..c80033d8752 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -141,14 +141,6 @@ static int do_sdhci_init(struct sdhci_host *host)
}
}
- if (dm_gpio_is_valid(&host->cd_gpio)) {
- ret = dm_gpio_get_value(&host->cd_gpio);
- if (ret) {
- debug("no SD card detected (%d)\n", ret);
- return -ENODEV;
- }
- }
-
return s5p_sdhci_core_init(host);
}
@@ -183,8 +175,6 @@ static int sdhci_get_config(const void *blob, int node, struct sdhci_host *host)
gpio_request_by_name_nodev(offset_to_ofnode(node), "pwr-gpios", 0,
&host->pwr_gpio, GPIOD_IS_OUT);
- gpio_request_by_name_nodev(offset_to_ofnode(node), "cd-gpios", 0,
- &host->cd_gpio, GPIOD_IS_IN);
return 0;
}
@@ -236,6 +226,7 @@ static int s5p_sdhci_bind(struct udevice *dev)
static const struct udevice_id s5p_sdhci_ids[] = {
{ .compatible = "samsung,exynos4412-sdhci"},
+ { .compatible = "samsung,exynos4210-sdhci"},
{ }
};