aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-03 11:52:42 -0600
committerTom Rini <trini@konsulko.com>2024-10-03 11:52:42 -0600
commit0d28900dd171d3444ea16d9cc18af35a90c03e27 (patch)
tree246e8a9bb1b15c7c2791f6a8b60e6420bcf35216 /drivers/mmc
parent08990e2254ffd63ade7f633b78b6573abc9b7e90 (diff)
parentfe38b88453d2ed40e1009d22f3f4d4213d2016b7 (diff)
downloadu-boot-0d28900dd171d3444ea16d9cc18af35a90c03e27.tar.gz
Merge patch series "vbe: Series part D"
Simon Glass <sjg@chromium.org> says: This includes various patches towards implementing the VBE abrec bootmeth in U-Boot.
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/Kconfig11
-rw-r--r--drivers/mmc/mmc.c2
-rw-r--r--drivers/mmc/rockchip_dw_mmc.c10
-rw-r--r--drivers/mmc/rockchip_sdhci.c11
4 files changed, 21 insertions, 13 deletions
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 982e84dc3bc..22c65681f0a 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -61,6 +61,17 @@ config SPL_DM_MMC
appear as block devices in U-Boot and can support filesystems such
as EXT4 and FAT.
+config TPL_DM_MMC
+ bool "Enable MMC controllers using Driver Model in TPL"
+ depends on TPL_DM && DM_MMC
+ select TPL_BLK
+ help
+ This enables the MultiMediaCard (MMC) uclass which supports MMC and
+ Secure Digital I/O (SDIO) cards. Both removable (SD, micro-SD, etc.)
+ and non-removable (e.g. eMMC chip) devices are supported. These
+ appear as block devices in U-Boot and can support filesystems such
+ as EXT4 and FAT.
+
if MMC
config MMC_SDHCI_ADMA_HELPERS
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 96b0e20d669..d4f2fd5bf89 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -3213,7 +3213,7 @@ int mmc_init_device(int num)
if (uclass_get_device_by_seq(UCLASS_MMC, num, &dev)) {
ret = uclass_get_device(UCLASS_MMC, num, &dev);
if (ret)
- return ret;
+ return log_msg_ret("ini", ret);
}
m = mmc_get_mmc_dev(dev);
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index fb77b049834..5ba99d68b7d 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -80,7 +80,7 @@ static int rockchip_dwmmc_of_to_plat(struct udevice *dev)
priv->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0);
if (priv->fifo_depth < 0)
- return -EINVAL;
+ return log_msg_ret("rkp", -EINVAL);
priv->fifo_mode = dev_read_bool(dev, "fifo-mode");
#ifdef CONFIG_SPL_BUILD
@@ -96,7 +96,7 @@ static int rockchip_dwmmc_of_to_plat(struct udevice *dev)
int val = dev_read_u32_default(dev, "max-frequency", -EINVAL);
if (val < 0)
- return val;
+ return log_msg_ret("rkc", val);
priv->minmax[0] = 400000; /* 400 kHz */
priv->minmax[1] = val;
@@ -131,13 +131,11 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
priv->minmax[1] = dtplat->max_frequency;
ret = clk_get_by_phandle(dev, &dtplat->clocks[1], &priv->clk);
- if (ret < 0)
- return ret;
#else
ret = clk_get_by_index(dev, 1, &priv->clk);
- if (ret < 0)
- return ret;
#endif
+ if (ret < 0 && ret != -ENOSYS)
+ return log_msg_ret("clk", ret);
host->fifo_depth = priv->fifo_depth;
host->fifo_mode = priv->fifo_mode;
diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index 35667b86b50..4ea3307ed9c 100644
--- a/drivers/mmc/rockchip_sdhci.c
+++ b/drivers/mmc/rockchip_sdhci.c
@@ -230,7 +230,7 @@ static int rk3399_emmc_get_phy(struct udevice *dev)
grf_base = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
if (IS_ERR_OR_NULL(grf_base)) {
- printf("%s Get syscon grf failed", __func__);
+ printf("%s: Get syscon grf failed\n", __func__);
return -ENODEV;
}
grf_phy_offset = ofnode_read_u32_default(phy_node, "reg", 0);
@@ -571,20 +571,19 @@ static int rockchip_sdhci_probe(struct udevice *dev)
struct rockchip_sdhc *priv = dev_get_priv(dev);
struct mmc_config *cfg = &plat->cfg;
struct sdhci_host *host = &priv->host;
- struct clk clk;
+ struct clk *clk = &priv->emmc_clk;
int ret;
host->max_clk = cfg->f_max;
- ret = clk_get_by_index(dev, 0, &clk);
+ ret = clk_get_by_index(dev, 0, clk);
if (!ret) {
- ret = clk_set_rate(&clk, host->max_clk);
+ ret = clk_set_rate(clk, host->max_clk);
if (IS_ERR_VALUE(ret))
printf("%s clk set rate fail!\n", __func__);
- } else {
+ } else if (ret != -ENOSYS) {
printf("%s fail to get clk\n", __func__);
}
- priv->emmc_clk = clk;
priv->dev = dev;
if (data->get_phy) {