]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: sdhci: use the host version value in sdhci_setup_cfg
authorJaehoon Chung <jh80.chung@samsung.com>
Sun, 25 Sep 2016 23:10:01 +0000 (08:10 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 10 Oct 2016 06:23:33 +0000 (15:23 +0900)
"host->version" isn't a SoC specific value.
It doesn't need to get in each SoC drivers.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/mmc/atmel_sdhci.c
drivers/mmc/bcm2835_sdhci.c
drivers/mmc/kona_sdhci.c
drivers/mmc/msm_sdhci.c
drivers/mmc/mv_sdhci.c
drivers/mmc/s5p_sdhci.c
drivers/mmc/sdhci.c
drivers/mmc/spear_sdhci.c
drivers/mmc/zynq_sdhci.c

index d8f8087b680711cf9ae36cd79d7316bcff2b04c7..20bba1a2797481830d7fde7a3d47d0f63c936f1f 100644 (file)
@@ -29,7 +29,6 @@ int atmel_sdhci_init(void *regbase, u32 id)
        host->name = "atmel_sdhci";
        host->ioaddr = regbase;
        host->quirks = 0;
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
        max_clk = at91_get_periph_generated_clk(id);
        if (!max_clk) {
                printf("%s: Failed to get the proper clock\n", __func__);
index 680b754af63e30b5bc6fef4038da6c9c3b0ef349..c1d870098f0749be39ca6b34709d1125b26ad031 100644 (file)
@@ -184,7 +184,6 @@ int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq)
        host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
        host->ops = &bcm2835_ops;
 
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
        add_sdhci(host, emmc_freq, MIN_FREQ);
 
        return 0;
index e730caa2079c8db90d30ee5a5bd0609b72d36ed4..c67a262c7ae8272b92b5b2fc72540a85982a4ebb 100644 (file)
@@ -127,11 +127,6 @@ int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks)
                return -EINVAL;
        }
 
-       if (quirks & SDHCI_QUIRK_REG32_RW)
-               host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
-       else
-               host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
-
        add_sdhci(host, max_clk, min_clk);
        return ret;
 }
index 1b82991c0ee2aa23390ad225570b8d73b4cc9d04..f33714b1d8193af233a2f68b7006672a3ed2b55a 100644 (file)
@@ -140,9 +140,6 @@ static int msm_sdc_probe(struct udevice *dev)
                writel(caps, host->ioaddr + SDHCI_VENDOR_SPEC_CAPABILITIES0);
        }
 
-       /* Set host controller version */
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
-
        ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
        host->mmc = &plat->mmc;
        if (ret)
index 82c695f906079a0a1a568b29d223f0b7bb8b51fc..ca5f8724a3facf72c883da748b9558c770801bb2 100644 (file)
@@ -88,9 +88,5 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks)
                sdhci_mvebu_mbus_config((void __iomem *)regbase);
        }
 
-       if (quirks & SDHCI_QUIRK_REG32_RW)
-               host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
-       else
-               host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
        return add_sdhci(host, max_clk, min_clk);
 }
index 0d65783b2ce388e870f4b6fbac63507eea13b642..d7cfa3e2e9e9769297a15132186aa66e292e6d32 100644 (file)
@@ -81,7 +81,6 @@ static int s5p_sdhci_core_init(struct sdhci_host *host)
                SDHCI_QUIRK_32BIT_DMA_ADDR |
                SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_USE_WIDE8;
        host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
 
        host->set_control_reg = &s5p_sdhci_set_control_reg;
        host->set_clock = set_mmc_clk;
index b2bf5a03fa84d9c1be6895bb0ef995cb5c7f6b94..73377227befbd9e53533124677eb72ca6e7d8763 100644 (file)
@@ -546,7 +546,11 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
                return -EINVAL;
        }
 #endif
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
+       if (host->quirks & SDHCI_QUIRK_REG32_RW)
+               host->version =
+                       sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
+       else
+               host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
 
        cfg->name = host->name;
 #ifndef CONFIG_DM_MMC_OPS
index 6ca96a2d06ac5fb7113679ded3b79693f739ea0d..06179cd9f4165f0f3570898cee499d469c129d65 100644 (file)
@@ -22,11 +22,6 @@ int spear_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
        host->ioaddr = (void *)regbase;
        host->quirks = quirks;
 
-       if (quirks & SDHCI_QUIRK_REG32_RW)
-               host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
-       else
-               host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
-
        add_sdhci(host, max_clk, min_clk);
        return 0;
 }
index b991102c2a1438d5e9cb664040b31e7578dca551..3da138562ab9494bb88aefefa4f4fc79e704ceee 100644 (file)
@@ -36,8 +36,6 @@ static int arasan_sdhci_probe(struct udevice *dev)
        host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
 #endif
 
-       host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
-
        ret = sdhci_setup_cfg(&plat->cfg, host, CONFIG_ZYNQ_SDHCI_MAX_FREQ,
                              CONFIG_ZYNQ_SDHCI_MIN_FREQ);
        host->mmc = &plat->mmc;