Skip to contentSkip to conversation

ARM: EXYNOS: fixed the wrong function argument.

PATCH New Jaehoon Chung 2 participants 2 messages Jul 11, 2012 – Jul 19, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: EXYNOS: fixed the wrong function argument.

This patch is fixed the wrong function argument. And quirks should be set into s5p_sdhci.c. There are only exynos specific codes. (this patch is based on u-boot-samsung repository)

---
 arch/arm/include/asm/arch-exynos/mmc.h  |    4 ++--
 arch/arm/include/asm/arch-s5pc1xx/mmc.h |    4 ++--
 drivers/mmc/s5p_sdhci.c                 |   11 ++++++-----
 3 files changed, 10 insertions(+), 9 deletions(-)
arch/arm/include/asm/arch-exynos/mmc.h +2 -2
index 0f701c9..1ede23c 100644
@@ -64,11 +64,11 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x)	((_x) << 16)
 #define SDHCI_CTRL4_DRIVE_SHIFT		(16)
 
-int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks);
+int s5p_sdhci_init(u32 regbase, int index, int buswidth);
 
 static inline unsigned int s5p_mmc_init(int index, int bus_width)
 {
 	unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
-	return s5p_sdhci_init(base, 52000000, 400000, index);
+	return s5p_sdhci_init(base, index, bus_width);
 }
 #endif
arch/arm/include/asm/arch-s5pc1xx/mmc.h +2 -2
index 0f701c9..1ede23c 100644
@@ -64,11 +64,11 @@
 #define SDHCI_CTRL4_DRIVE_MASK(_x)	((_x) << 16)
 #define SDHCI_CTRL4_DRIVE_SHIFT		(16)
 
-int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks);
+int s5p_sdhci_init(u32 regbase, int index, int buswidth);
 
 static inline unsigned int s5p_mmc_init(int index, int bus_width)
 {
 	unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
-	return s5p_sdhci_init(base, 52000000, 400000, index);
+	return s5p_sdhci_init(base, index, bus_width);
 }
 #endif
drivers/mmc/s5p_sdhci.c +6 -5
index 1d4481b..420cbc8 100644
@@ -69,7 +69,7 @@ static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
 	sdhci_writel(host, ctrl, SDHCI_CONTROL2);
 }
 
-int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
+int s5p_sdhci_init(u32 regbase, int index, int buswidth)
 {
 	struct sdhci_host *host = NULL;
 	host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
@@ -80,11 +80,10 @@ int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
 
 	host->name = S5P_NAME;
 	host->ioaddr = (void *)regbase;
-	host->quirks = quirks;
 
-	host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE;
+	host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE;
 	host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
-	if (quirks & SDHCI_QUIRK_REG32_RW)
+	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);
@@ -92,7 +91,9 @@ int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
 	host->set_control_reg = &s5p_sdhci_set_control_reg;
 
 	host->host_caps = MMC_MODE_HC;
+	if (buswidth == 8)
+		host->host_caps |= MMC_MODE_8BIT;
 
-	add_sdhci(host, max_clk, min_clk);
+	add_sdhci(host, 520000000, 400000);
 	return 0;
 }
#1 lore raw

PATCH 1/1 ARM: EXYNOS: fixed the wrong function argument.

Hi,

Quoted 41 lines · Jaehoon Chung

This patch is fixed the wrong function argument. And quirks should be set into s5p_sdhci.c. There are only exynos specific codes. (this patch is based on u-boot-samsung repository)

---
 arch/arm/include/asm/arch-exynos/mmc.h  |    4 ++--
 arch/arm/include/asm/arch-s5pc1xx/mmc.h |    4 ++--
 drivers/mmc/s5p_sdhci.c                 |   11 ++++++-----
 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/mmc/s5p_sdhci.c +3 -4
index 1d4481b..420cbc8 100644
@@ -69,7 +69,7 @@ static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
        sdhci_writel(host, ctrl, SDHCI_CONTROL2);
 }
 
-int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
+int s5p_sdhci_init(u32 regbase, int index, int buswidth)
 {
        struct sdhci_host *host = NULL;
        host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
@@ -80,11 +80,10 @@ int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
 
        host->name = S5P_NAME;
        host->ioaddr = (void *)regbase;
-       host->quirks = quirks;
 
-       host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE;
+       host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE;
        host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
-       if (quirks & SDHCI_QUIRK_REG32_RW)
+       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);

drivers/mmc/s5p_sdhci.c int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks) · line 97

Quoted 8 lines
drivers/mmc/s5p_sdhci.c +3 -1
@@ -92,7 +91,9 @@ int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
        host->set_control_reg = &s5p_sdhci_set_control_reg;
 
        host->host_caps = MMC_MODE_HC;
+       if (buswidth == 8)
+               host->host_caps |= MMC_MODE_8BIT;
 
-       add_sdhci(host, max_clk, min_clk);
+       add_sdhci(host, 520000000, 400000);

52000000 is right : )
please fix it.

drivers/mmc/s5p_sdhci.c int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks) · line 99

Quoted 2 lines
drivers/mmc/s5p_sdhci.c +0 -0
        return 0;
 }

Thanks.
Minkyu Kang.

Signature · 2 lines
from. prom.
www.promsoft.net