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

mmc: tegra: fix reporting of base clock frequency

Tegra SDHCI controllers, by default, report a base clock frequency of
208Mhz in SDHCI_CAPABILTIES which may or may not be equal to the actual
base clock frequency. This is because the clock rate is configured by
the clock controller, which is external to the SD/MMC controller. Since
the SD/MMC controller has no knowledge of how this clock is configured,
it will simply report the maximum frequency. While the reported value
can be overridden by setting BASE_CLK_FREQ in VENDOR_CLOCK_CTRL on
Tegra30 and later SoCs, just set CAP_CLOCK_BASE_BROKEN and supply
sdhci_pltfm_clk_get_max_clock(), which simply does a clk_get_rate(),
as the get_max_clock() callback.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>

authored by

Andrew Bresticker and committed by
Chris Ball
f9260355 3145351a

+7 -3
+7 -3
drivers/mmc/host/sdhci-tegra.c
··· 154 154 .set_bus_width = tegra_sdhci_set_bus_width, 155 155 .reset = tegra_sdhci_reset, 156 156 .set_uhs_signaling = sdhci_set_uhs_signaling, 157 + .get_max_clock = sdhci_pltfm_clk_get_max_clock, 157 158 }; 158 159 159 160 static const struct sdhci_pltfm_data sdhci_tegra20_pdata = { 160 161 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | 161 162 SDHCI_QUIRK_SINGLE_POWER_WRITE | 162 163 SDHCI_QUIRK_NO_HISPD_BIT | 163 - SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC, 164 + SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | 165 + SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, 164 166 .ops = &tegra_sdhci_ops, 165 167 }; 166 168 ··· 177 175 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | 178 176 SDHCI_QUIRK_SINGLE_POWER_WRITE | 179 177 SDHCI_QUIRK_NO_HISPD_BIT | 180 - SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC, 178 + SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | 179 + SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, 181 180 .ops = &tegra_sdhci_ops, 182 181 }; 183 182 ··· 194 191 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | 195 192 SDHCI_QUIRK_SINGLE_POWER_WRITE | 196 193 SDHCI_QUIRK_NO_HISPD_BIT | 197 - SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC, 194 + SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | 195 + SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, 198 196 .ops = &tegra_sdhci_ops, 199 197 }; 200 198