Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: core: Parse and use the new max-sd-hs-hz DT property

Introduce a new device tree flag to cap the maximum High-Speed (HS)
mode frequency for SD cards, accommodating board-specific
electrical limitations which cannot support the default 50Mhz HS
frequency and others.

Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Sarthak Garg and committed by
Ulf Hansson
f338529c 98682689

+4 -1
+2
drivers/mmc/core/host.c
··· 302 302 /* f_max is obtained from the optional "max-frequency" property */ 303 303 device_property_read_u32(dev, "max-frequency", &host->f_max); 304 304 305 + device_property_read_u32(dev, "max-sd-hs-hz", &host->max_sd_hs_hz); 306 + 305 307 /* 306 308 * Configure CD and WP pins. They are both by default active low to 307 309 * match the SDHCI spec. If GPIOs are provided for CD and / or WP, the
+1 -1
drivers/mmc/core/sd.c
··· 359 359 } 360 360 361 361 if (status[13] & SD_MODE_HIGH_SPEED) 362 - card->sw_caps.hs_max_dtr = HIGH_SPEED_MAX_DTR; 362 + card->sw_caps.hs_max_dtr = card->host->max_sd_hs_hz ?: HIGH_SPEED_MAX_DTR; 363 363 364 364 if (card->scr.sda_spec3) { 365 365 card->sw_caps.sd3_bus_mode = status[13];
+1
include/linux/mmc/host.h
··· 576 576 int hsq_depth; 577 577 578 578 u32 err_stats[MMC_ERR_MAX]; 579 + u32 max_sd_hs_hz; 579 580 unsigned long private[] ____cacheline_aligned; 580 581 }; 581 582