]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: tegra: use max-frequency from device tree if provided
authorPeter Geis <pgwipeout@gmail.com>
Tue, 19 Dec 2023 13:35:52 +0000 (15:35 +0200)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Tue, 19 Dec 2023 19:24:12 +0000 (21:24 +0200)
The driver currently hard-codes the max freqency for the sdhci
controllers. If the controller is unable to operate at the max
frequency, the mmc card will not be available on the first scan.
Subsequent scans will eventually find a working combination.

Fix this by allowing the driver to check for the max-frequency
property and default to the original value if it doesn't exist.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
drivers/mmc/tegra_mmc.c

index d507adbb363a4c7ba33ae282f5f90e212cf1d5bc..c01fb3d01657f639819d741c316481b30c0488e4 100644 (file)
@@ -698,7 +698,7 @@ static int tegra_mmc_probe(struct udevice *dev)
         *  (actually 52MHz)
         */
        cfg->f_min = 375000;
-       cfg->f_max = 48000000;
+       cfg->f_max = dev_read_u32_default(dev, "max-frequency", 48000000);
 
        cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;