]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: sdhci-cadence: Use max-frequency property from device tree
authorTanmay Kathpalia <tanmay.kathpalia@altera.com>
Wed, 3 Dec 2025 12:21:33 +0000 (04:21 -0800)
committerPeng Fan <peng.fan@nxp.com>
Thu, 11 Dec 2025 12:53:50 +0000 (20:53 +0800)
When f_max parameter is 0 in sdhci_setup_cfg(), the function defaults
to using the maximum frequency from host controller capabilities register
instead of the max-frequency property parsed from device tree.

The max-frequency property from device tree is parsed by mmc_of_parse()
and stored in plat->cfg.f_max, but sdhci_setup_cfg() was being called
with f_max=0, causing it to ignore the device tree value and use the
host capabilities register value instead.

Fix this by passing plat->cfg.f_max to sdhci_setup_cfg() to ensure
the device tree specified maximum frequency is respected over the
hardware default.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Reviewed-by: Balsundar Ponnusamy <balsundar.ponnusamy@altera.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/sdhci-cadence.c

index 6c9d24fe5f74db169f9a969fb221b517b68910fd..b92b3df3ed965a3820143f393950e76b77c5de0d 100644 (file)
@@ -253,7 +253,7 @@ static int sdhci_cdns_probe(struct udevice *dev)
 
        host->mmc = &plat->mmc;
        host->mmc->dev = dev;
-       ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
+       ret = sdhci_setup_cfg(&plat->cfg, host, plat->cfg.f_max, 0);
        if (ret)
                return ret;