From: Jaehoon Chung Date: Fri, 21 Oct 2016 11:52:35 +0000 (+0900) Subject: mmc: sdhci: assign to clk_mul when host version is upper than SD3.0 X-Git-Tag: v2016.11-rc3~34^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2a1bedaa03a27b3d4a94f9e251f269814ed72e3e;p=oweals%2Fu-boot.git mmc: sdhci: assign to clk_mul when host version is upper than SD3.0 To prevent the wrong value check the SD version. Signed-off-by: Jaehoon Chung --- diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 10ff57ec8c..766e9eef84 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -608,9 +608,11 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, * In case of Host Controller v3.00, find out whether clock * multiplier is supported. */ - caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); - host->clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >> - SDHCI_CLOCK_MUL_SHIFT; + if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { + caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); + host->clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >> + SDHCI_CLOCK_MUL_SHIFT; + } return 0; }