diff mbox

[U-Boot,1/2] mmc: sdhci: use the host version value in sdhci_setup_cfg

Message ID 1474625686-6181-1-git-send-email-jh80.chung@samsung.com
State Accepted
Commit 895549a2d994ecf1ca1636792e55019e56be2d7d
Delegated to: Jaehoon Chung
Headers show

Commit Message

Jaehoon Chung Sept. 23, 2016, 10:14 a.m. UTC
"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>
---
 drivers/mmc/atmel_sdhci.c   | 1 -
 drivers/mmc/bcm2835_sdhci.c | 1 -
 drivers/mmc/kona_sdhci.c    | 5 -----
 drivers/mmc/msm_sdhci.c     | 3 ---
 drivers/mmc/mv_sdhci.c      | 4 ----
 drivers/mmc/s5p_sdhci.c     | 1 -
 drivers/mmc/sdhci.c         | 6 +++++-
 drivers/mmc/spear_sdhci.c   | 5 -----
 drivers/mmc/zynq_sdhci.c    | 2 --
 9 files changed, 5 insertions(+), 23 deletions(-)

Comments

Simon Glass Sept. 27, 2016, 12:33 a.m. UTC | #1
On 23 September 2016 at 04:14, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> "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>
> ---
>  drivers/mmc/atmel_sdhci.c   | 1 -
>  drivers/mmc/bcm2835_sdhci.c | 1 -
>  drivers/mmc/kona_sdhci.c    | 5 -----
>  drivers/mmc/msm_sdhci.c     | 3 ---
>  drivers/mmc/mv_sdhci.c      | 4 ----
>  drivers/mmc/s5p_sdhci.c     | 1 -
>  drivers/mmc/sdhci.c         | 6 +++++-
>  drivers/mmc/spear_sdhci.c   | 5 -----
>  drivers/mmc/zynq_sdhci.c    | 2 --
>  9 files changed, 5 insertions(+), 23 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Jaehoon Chung Oct. 10, 2016, 6:34 a.m. UTC | #2
On 09/27/2016 09:33 AM, Simon Glass wrote:
> On 23 September 2016 at 04:14, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> "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>
>> ---
>>  drivers/mmc/atmel_sdhci.c   | 1 -
>>  drivers/mmc/bcm2835_sdhci.c | 1 -
>>  drivers/mmc/kona_sdhci.c    | 5 -----
>>  drivers/mmc/msm_sdhci.c     | 3 ---
>>  drivers/mmc/mv_sdhci.c      | 4 ----
>>  drivers/mmc/s5p_sdhci.c     | 1 -
>>  drivers/mmc/sdhci.c         | 6 +++++-
>>  drivers/mmc/spear_sdhci.c   | 5 -----
>>  drivers/mmc/zynq_sdhci.c    | 2 --
>>  9 files changed, 5 insertions(+), 23 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 

Applied on u-boot-mmc.

Best Regards,
Jaehoon Chung

> 
>
diff mbox

Patch

diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c
index dd6bd33..c197b09 100644
--- a/drivers/mmc/atmel_sdhci.c
+++ b/drivers/mmc/atmel_sdhci.c
@@ -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__);
diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index 680b754..c1d8700 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -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;
diff --git a/drivers/mmc/kona_sdhci.c b/drivers/mmc/kona_sdhci.c
index 3653d00..0c4f30e 100644
--- a/drivers/mmc/kona_sdhci.c
+++ b/drivers/mmc/kona_sdhci.c
@@ -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;
 }
diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
index 8d4399e..90e90bc 100644
--- a/drivers/mmc/msm_sdhci.c
+++ b/drivers/mmc/msm_sdhci.c
@@ -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)
diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c
index 82c695f..ca5f872 100644
--- a/drivers/mmc/mv_sdhci.c
+++ b/drivers/mmc/mv_sdhci.c
@@ -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);
 }
diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 3bace21..7827b28 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -71,7 +71,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;
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 504f2d2..7fc11c0 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -524,7 +524,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
diff --git a/drivers/mmc/spear_sdhci.c b/drivers/mmc/spear_sdhci.c
index 6ca96a2..06179cd 100644
--- a/drivers/mmc/spear_sdhci.c
+++ b/drivers/mmc/spear_sdhci.c
@@ -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;
 }
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index 3815b94..299d820 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -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;