aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/Kconfig8
-rw-r--r--drivers/mmc/fsl_esdhc.c2
-rw-r--r--drivers/mmc/meson_gx_mmc.c2
-rw-r--r--drivers/mmc/mmc.c20
-rw-r--r--drivers/mmc/socfpga_dw_mmc.c2
5 files changed, 23 insertions, 11 deletions
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 4fa8dd83bb7..3f15f85efda 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -124,6 +124,14 @@ config MMC_VERBOSE
Enable the output of more information about the card such as the
operating mode.
+config MMC_TRACE
+ bool "MMC debugging"
+ default n
+ help
+ This is an option for use by developer. Enable MMC core debugging.
+
+ If you need to see the MMC core message, say Y.
+
config SPL_MMC_TINY
bool "Tiny MMC framework in SPL"
help
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 1a006fa95f2..4528345c676 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -982,7 +982,7 @@ static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
#endif
/* Set the initial clock speed */
- mmc_set_clock(mmc, 400000, false);
+ mmc_set_clock(mmc, 400000, MMC_CLK_ENABLE);
/* Disable the BRR and BWR bits in IRQSTAT */
esdhc_clrbits32(&regs->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR);
diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
index 0aea4770c5b..332f1e12a58 100644
--- a/drivers/mmc/meson_gx_mmc.c
+++ b/drivers/mmc/meson_gx_mmc.c
@@ -252,7 +252,7 @@ static int meson_mmc_probe(struct udevice *dev)
mmc->priv = pdata;
upriv->mmc = mmc;
- mmc_set_clock(mmc, cfg->f_min, false);
+ mmc_set_clock(mmc, cfg->f_min, MMC_CLK_ENABLE);
/* reset all status bits */
meson_write(mmc, STATUS_MASK, MESON_SD_EMMC_STATUS);
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 01a02fba63f..a08c69476ca 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -529,7 +529,7 @@ static int mmc_switch_voltage(struct mmc *mmc, int signal_voltage)
* During a signal voltage level switch, the clock must be gated
* for 5 ms according to the SD spec
*/
- mmc_set_clock(mmc, mmc->clock, true);
+ mmc_set_clock(mmc, mmc->clock, MMC_CLK_DISABLE);
err = mmc_set_signal_voltage(mmc, signal_voltage);
if (err)
@@ -537,7 +537,7 @@ static int mmc_switch_voltage(struct mmc *mmc, int signal_voltage)
/* Keep clock gated for at least 10 ms, though spec only says 5 ms */
mdelay(10);
- mmc_set_clock(mmc, mmc->clock, false);
+ mmc_set_clock(mmc, mmc->clock, MMC_CLK_ENABLE);
/*
* Failure to switch is indicated by the card holding
@@ -1506,6 +1506,8 @@ int mmc_set_clock(struct mmc *mmc, uint clock, bool disable)
mmc->clock = clock;
mmc->clk_disable = disable;
+ debug("clock is %s (%dHz)\n", disable ? "disabled" : "enabled", clock);
+
return mmc_set_ios(mmc);
}
@@ -1672,7 +1674,8 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
/* configure the bus mode (host) */
mmc_select_mode(mmc, mwt->mode);
- mmc_set_clock(mmc, mmc->tran_speed, false);
+ mmc_set_clock(mmc, mmc->tran_speed,
+ MMC_CLK_ENABLE);
#ifdef MMC_SUPPORTS_TUNING
/* execute tuning if needed */
@@ -1697,7 +1700,8 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
error:
/* revert to a safer bus speed */
mmc_select_mode(mmc, SD_LEGACY);
- mmc_set_clock(mmc, mmc->tran_speed, false);
+ mmc_set_clock(mmc, mmc->tran_speed,
+ MMC_CLK_ENABLE);
}
}
}
@@ -1858,7 +1862,7 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
return -ENOTSUPP;
}
- mmc_set_clock(mmc, mmc->legacy_speed, false);
+ mmc_set_clock(mmc, mmc->legacy_speed, MMC_CLK_ENABLE);
for_each_mmc_mode_by_pref(card_caps, mwt) {
for_each_supported_width(card_caps & mwt->widths,
@@ -1901,7 +1905,7 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
/* configure the bus mode (host) */
mmc_select_mode(mmc, mwt->mode);
- mmc_set_clock(mmc, mmc->tran_speed, false);
+ mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE);
#ifdef MMC_SUPPORTS_TUNING
/* execute tuning if needed */
@@ -2426,7 +2430,7 @@ static void mmc_set_initial_state(struct mmc *mmc)
mmc_select_mode(mmc, MMC_LEGACY);
mmc_set_bus_width(mmc, 1);
- mmc_set_clock(mmc, 0, false);
+ mmc_set_clock(mmc, 0, MMC_CLK_ENABLE);
}
static int mmc_power_on(struct mmc *mmc)
@@ -2446,7 +2450,7 @@ static int mmc_power_on(struct mmc *mmc)
static int mmc_power_off(struct mmc *mmc)
{
- mmc_set_clock(mmc, 0, true);
+ mmc_set_clock(mmc, 0, MMC_CLK_DISABLE);
#if CONFIG_IS_ENABLED(DM_MMC) && CONFIG_IS_ENABLED(DM_REGULATOR)
if (mmc->vmmc_supply) {
int ret = regulator_set_enable(mmc->vmmc_supply, false);
diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c
index fa0e449b21b..d0a0362d7ea 100644
--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -123,7 +123,7 @@ static int socfpga_dwmmc_probe(struct udevice *dev)
upriv->mmc = host->mmc;
host->mmc->dev = dev;
- return 0;
+ return dwmci_probe(dev);
}
static int socfpga_dwmmc_bind(struct udevice *dev)