]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: bcm2835_sdhci: Parse generic MMC device tree properties
authorLiel Harel <liel.harel@gmail.com>
Sat, 9 May 2026 21:06:07 +0000 (00:06 +0300)
committerPeter Robinson <pbrobinson@gmail.com>
Tue, 26 May 2026 11:11:50 +0000 (12:11 +0100)
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.

Signed-off-by: Liel Harel <liel.harel@gmail.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com> # on the CM4 as well
drivers/mmc/bcm2835_sdhci.c

index 655d9902dfa9bba9c6c0b9cdbc50ea59d6391e1f..efa4d14f5daf5ca02120a4cff75f4330d769d296 100644 (file)
@@ -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);