Skip to contentSkip to conversation

mmc: bcm2835_sdhci: Parse generic MMC device tree properties

PATCH In review [email protected] 2 participants 2 messages May 10 – May 11

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: bcm2835_sdhci: Parse generic MMC device tree properties

From: Liel Harel <[email protected]>

The bcm2835 SDHCI driver sets up the MMC host configuration via sdhci_setup_cfg(), but does not parse generic MMC device tree properties.

As a result, properties such as bus-width are ignored. On Raspberry Pi Compute Module 4, the eMMC node describes an 8-bit bus, but U-Boot initialized the device as 4-bit.

Call mmc_of_parse() before sdhci_setup_cfg() so that generic MMC properties are folded into the host configuration before the MMC core selects the bus width.

Before this change, mmc info reported:

Bus Speed: 52000000
Bus Width: 4-bit

After this change, mmc info reports:

Bus Speed: 52000000
Bus Width: 8-bit

Tested on Raspberry Pi Compute Module 4 with onboard eMMC.

---
 drivers/mmc/bcm2835_sdhci.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/bcm2835_sdhci.c +4 -0
index 655d9902dfa..efa4d14f5da 100644
@@ -219,6 +219,10 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
 	host->mmc = &plat->mmc;
 	host->mmc->dev = dev;
 
+	ret = mmc_of_parse(dev, &plat->cfg);
+	if (ret)
+		return ret;
+
 	ret = sdhci_setup_cfg(&plat->cfg, host, emmc_freq, MIN_FREQ);
 	if (ret) {
 		debug("%s: Failed to setup SDHCI (err=%d)\n", __func__, ret);
Signature · 1 line
2.43.0
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 20 lines · Liel Harel

From: Liel Harel <[email protected]>

The bcm2835 SDHCI driver sets up the MMC host configuration via sdhci_setup_cfg(), but does not parse generic MMC device tree properties.

As a result, properties such as bus-width are ignored. On Raspberry Pi Compute Module 4, the eMMC node describes an 8-bit bus, but U-Boot initialized the device as 4-bit.

Call mmc_of_parse() before sdhci_setup_cfg() so that generic MMC properties are folded into the host configuration before the MMC core selects the bus width.

Before this change, mmc info reported:

Bus Speed: 52000000
Bus Width: 4-bit

Quoted 8 lines

After this change, mmc info reports:

Bus Speed: 52000000
Bus Width: 8-bit

Tested on Raspberry Pi Compute Module 4 with onboard eMMC.

Thanks

Quoted 22 lines
---
 drivers/mmc/bcm2835_sdhci.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/bcm2835_sdhci.c +4 -1
index 655d9902dfa..efa4d14f5da 100644
@@ -219,6 +219,10 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
        host->mmc = &plat->mmc;
        host->mmc->dev = dev;
 
+       ret = mmc_of_parse(dev, &plat->cfg);
+       if (ret)
+               return ret;
+
        ret = sdhci_setup_cfg(&plat->cfg, host, emmc_freq, MIN_FREQ);
        if (ret) {
                debug("%s: Failed to setup SDHCI (err=%d)\n", __func__, ret);
--

2.43.0