summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-04-23 08:57:13 -0600
committerTom Rini <trini@konsulko.com>2025-04-23 08:57:13 -0600
commit873bca77a3dd4f6ba69c244bb1aaecb82679271f (patch)
tree17e549cdbb96981aa13192b38c3cef05eaea1fec
parent5d4a6995bb4311203a024200a402508fdf5d7dfb (diff)
parent2a8e7ea4f948e3de7033b297fd827fe082cd63da (diff)
Merge tag 'mmc-2025-04-23' of https://source.denx.de/u-boot/custodians/u-boot-mmc
- Introducing back send_init_stream for omap_hsmmc to perform the 74 clocks cycle sequence - Move scmi regulator subnode hack to scmi_regulator - Typo fix
-rw-r--r--drivers/firmware/scmi/scmi_agent-uclass.c8
-rw-r--r--drivers/mmc/mmc-uclass.c13
-rw-r--r--drivers/mmc/mmc.c8
-rw-r--r--drivers/mmc/omap_hsmmc.c13
-rw-r--r--drivers/power/regulator/scmi_regulator.c9
-rw-r--r--include/mmc.h9
6 files changed, 49 insertions, 11 deletions
diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
index 8c907c3b032..e6e43ae936a 100644
--- a/drivers/firmware/scmi/scmi_agent-uclass.c
+++ b/drivers/firmware/scmi/scmi_agent-uclass.c
@@ -427,14 +427,8 @@ static int scmi_bind_protocols(struct udevice *dev)
break;
case SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN:
if (IS_ENABLED(CONFIG_DM_REGULATOR_SCMI) &&
- scmi_protocol_is_supported(dev, protocol_id)) {
- node = ofnode_find_subnode(node, "regulators");
- if (!ofnode_valid(node)) {
- dev_err(dev, "no regulators node\n");
- return -ENXIO;
- }
+ scmi_protocol_is_supported(dev, protocol_id))
drv = DM_DRIVER_GET(scmi_voltage_domain);
- }
break;
default:
break;
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 9af84da1599..2f4dc5bd887 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -83,6 +83,19 @@ int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us)
return dm_mmc_wait_dat0(mmc->dev, state, timeout_us);
}
+void dm_mmc_send_init_stream(struct udevice *dev)
+{
+ struct dm_mmc_ops *ops = mmc_get_ops(dev);
+
+ if (ops->send_init_stream)
+ ops->send_init_stream(dev);
+}
+
+void mmc_send_init_stream(struct mmc *mmc)
+{
+ dm_mmc_send_init_stream(mmc->dev);
+}
+
static int dm_mmc_get_wp(struct udevice *dev)
{
struct dm_mmc_ops *ops = mmc_get_ops(dev);
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 47139e0a911..cdcf2e0c8fe 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1663,6 +1663,10 @@ static int mmc_execute_tuning(struct mmc *mmc, uint opcode)
}
#endif
+static void mmc_send_init_stream(struct mmc *mmc)
+{
+}
+
static int mmc_set_ios(struct mmc *mmc)
{
int ret = 0;
@@ -2550,7 +2554,7 @@ static int mmc_startup(struct mmc *mmc)
/*
* For MMC cards, set the Relative Address.
- * For SD cards, get the Relatvie Address.
+ * For SD cards, get the Relative Address.
* This also puts the cards into Standby State
*/
if (!mmc_host_is_spi(mmc)) { /* cmd not supported in spi */
@@ -2929,6 +2933,8 @@ int mmc_get_op_cond(struct mmc *mmc, bool quiet)
retry:
mmc_set_initial_state(mmc);
+ mmc_send_init_stream(mmc);
+
/* Reset the Card */
err = mmc_go_idle(mmc);
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index e66ab25d02a..92bc72b267c 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -780,6 +780,14 @@ tuning_error:
return ret;
}
#endif
+
+static void omap_hsmmc_send_init_stream(struct udevice *dev)
+{
+ struct omap_hsmmc_data *priv = dev_get_priv(dev);
+ struct hsmmc *mmc_base = priv->base_addr;
+
+ mmc_init_stream(mmc_base);
+}
#endif
static void mmc_enable_irq(struct mmc *mmc, struct mmc_cmd *cmd)
@@ -1515,9 +1523,10 @@ static const struct dm_mmc_ops omap_hsmmc_ops = {
.get_wp = omap_hsmmc_getwp,
#endif
#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING)
- .execute_tuning = omap_hsmmc_execute_tuning,
+ .execute_tuning = omap_hsmmc_execute_tuning,
#endif
- .wait_dat0 = omap_hsmmc_wait_dat0,
+ .send_init_stream = omap_hsmmc_send_init_stream,
+ .wait_dat0 = omap_hsmmc_wait_dat0,
};
#else
static const struct mmc_ops omap_hsmmc_ops = {
diff --git a/drivers/power/regulator/scmi_regulator.c b/drivers/power/regulator/scmi_regulator.c
index 99f6506f162..79db1a6a8aa 100644
--- a/drivers/power/regulator/scmi_regulator.c
+++ b/drivers/power/regulator/scmi_regulator.c
@@ -175,12 +175,19 @@ U_BOOT_DRIVER(scmi_regulator) = {
static int scmi_regulator_bind(struct udevice *dev)
{
struct driver *drv;
+ ofnode regul_node;
ofnode node;
int ret;
+ regul_node = ofnode_find_subnode(dev_ofnode(dev), "regulators");
+ if (!ofnode_valid(regul_node)) {
+ dev_err(dev, "no regulators node\n");
+ return -ENXIO;
+ }
+
drv = DM_DRIVER_GET(scmi_regulator);
- ofnode_for_each_subnode(node, dev_ofnode(dev)) {
+ ofnode_for_each_subnode(node, regul_node) {
ret = device_bind(dev, drv, ofnode_get_name(node),
NULL, node, NULL);
if (ret)
diff --git a/include/mmc.h b/include/mmc.h
index 52cacfd0eab..eead666ae44 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -494,6 +494,14 @@ struct dm_mmc_ops {
int (*set_ios)(struct udevice *dev);
/**
+ * send_init_stream() - send the initialization stream: 74 clock cycles
+ * This is used after power up before sending the first command
+ *
+ * @dev: Device to update
+ */
+ void (*send_init_stream)(struct udevice *dev);
+
+ /**
* get_cd() - See whether a card is present
*
* @dev: Device to check
@@ -572,6 +580,7 @@ struct dm_mmc_ops {
/* Transition functions for compatibility */
int mmc_set_ios(struct mmc *mmc);
+void mmc_send_init_stream(struct mmc *mmc);
int mmc_getcd(struct mmc *mmc);
int mmc_getwp(struct mmc *mmc);
int mmc_execute_tuning(struct mmc *mmc, uint opcode);