* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
@ 2010-06-22 13:16 Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Yauhen Kharuzhy
2010-06-25 10:55 ` S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Darius Augulis
0 siblings, 2 replies; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 13:16 UTC (permalink / raw)
To: linux-arm-kernel
This patch series fixes SDHCI on S3C2416. I got SD card working with this patches
and with patches for GPIO card detection support by Marek Szyprowski.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M
2010-06-22 13:16 S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Yauhen Kharuzhy
@ 2010-06-22 13:16 ` Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 2/4] ARM: S3C2416: Set name of the framebuffer device only if it present Yauhen Kharuzhy
2010-06-22 13:40 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Vasily Khoruzhick
2010-06-25 10:55 ` S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Darius Augulis
1 sibling, 2 replies; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 13:16 UTC (permalink / raw)
To: linux-arm-kernel
S3C2443 and S3C2416 has 12 GPIO banks (from A to M), increase
ARCH_NR_GPIOS for this architectures.
Also typo from previous commit has been fixed: CONFIG_CPU_S3C24XX
instead CONFIG_CPU_244X.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
arch/arm/mach-s3c2410/include/mach/gpio.h | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index b649bf2..f7f6b07 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -22,6 +22,8 @@
#ifdef CONFIG_CPU_S3C244X
#define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
+#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
+#define ARCH_NR_GPIOS (32 * 12 + CONFIG_S3C24XX_GPIO_EXTRA)
#else
#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
#endif
@@ -30,8 +32,10 @@
#include <mach/gpio-nrs.h>
#include <mach/gpio-fns.h>
-#ifdef CONFIG_CPU_S3C24XX
-#define S3C_GPIO_END (S3C2410_GPIO_BANKJ + 32)
+#ifdef CONFIG_CPU_S3C244X
+#define S3C_GPIO_END (S3C2410_GPJ(0) + 32)
+#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
+#define S3C_GPIO_END (S3C2410_GPM(0) + 32)
#else
-#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32)
+#define S3C_GPIO_END (S3C2410_GPH(0) + 32)
#endif
--
1.6.6.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/4] ARM: S3C2416: Set name of the framebuffer device only if it present
2010-06-22 13:16 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Yauhen Kharuzhy
@ 2010-06-22 13:16 ` Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 3/4] ARM: S3C2416: Add clock definition for HSMMC1 Yauhen Kharuzhy
2010-06-22 13:40 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Vasily Khoruzhick
1 sibling, 1 reply; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 13:16 UTC (permalink / raw)
To: linux-arm-kernel
Fix case when board doesn't have LCD connected and doesn't have
corresponding platform device compiled.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
arch/arm/mach-s3c2416/s3c2416.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 35dabcc..355ab62 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -90,7 +90,9 @@ int __init s3c2416_init(void)
s3c_i2c0_setname("s3c2440-i2c");
s3c_i2c1_setname("s3c2440-i2c");
+#ifdef CONFIG_S3C_DEV_FB
s3c_device_fb.name = "s3c2443-fb";
+#endif
return sysdev_register(&s3c2416_sysdev);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/4] ARM: S3C2416: Add clock definition for HSMMC1
2010-06-22 13:16 ` [PATCH 2/4] ARM: S3C2416: Set name of the framebuffer device only if it present Yauhen Kharuzhy
@ 2010-06-22 13:16 ` Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
0 siblings, 1 reply; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 13:16 UTC (permalink / raw)
To: linux-arm-kernel
Define clock for hsmmc1 device and register it.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
.../mach-s3c2410/include/mach/regs-s3c2443-clock.h | 1 +
arch/arm/mach-s3c2416/clock.c | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
index 08ab9df..c073a5a 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
@@ -86,6 +86,7 @@
#define S3C2443_HCLKCON_LCDC (1<<9)
#define S3C2443_HCLKCON_USBH (1<<11)
#define S3C2443_HCLKCON_USBD (1<<12)
+#define S3C2416_HCLKCON_HSMMC0 (1<<15)
#define S3C2443_HCLKCON_HSMMC (1<<16)
#define S3C2443_HCLKCON_CFC (1<<17)
#define S3C2443_HCLKCON_SSMC (1<<18)
diff --git a/arch/arm/mach-s3c2416/clock.c b/arch/arm/mach-s3c2416/clock.c
index 7ccf5a2..f11d131 100644
--- a/arch/arm/mach-s3c2416/clock.c
+++ b/arch/arm/mach-s3c2416/clock.c
@@ -93,6 +93,13 @@ static struct clksrc_clk hsmmc_mux[] = {
},
};
+static struct clk hsmmc1_clk = {
+ .name = "hsmmc",
+ .id = 1,
+ .parent = &clk_h,
+ .enable = s3c2443_clkcon_enable_h,
+ .ctrlbit = S3C2416_HCLKCON_HSMMC0,
+};
static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0)
{
@@ -130,6 +137,8 @@ void __init s3c2416_init_clocks(int xtal)
for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
s3c_register_clksrc(clksrcs[ptr], 1);
+ s3c24xx_register_clock(&hsmmc1_clk);
+
s3c_pwmclk_init();
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI
2010-06-22 13:16 ` [PATCH 3/4] ARM: S3C2416: Add clock definition for HSMMC1 Yauhen Kharuzhy
@ 2010-06-22 13:16 ` Yauhen Kharuzhy
2010-06-22 13:19 ` Maurus Cuelenaere
2010-06-22 13:45 ` Darius Augulis
0 siblings, 2 replies; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 13:16 UTC (permalink / raw)
To: linux-arm-kernel
Samsung S3C2416 has two SDHCI controllers compatible with other
Samsung's SoCs (S3C64XX, S5PC100 etc...).
Add required platform setup code that the devices can be used with
sdhci-s3c driver.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
arch/arm/mach-s3c2416/Kconfig | 23 ++++++++++
arch/arm/mach-s3c2416/Makefile | 5 ++
arch/arm/mach-s3c2416/s3c2416.c | 5 ++
arch/arm/mach-s3c2416/setup-sdhci-gpio.c | 60 +++++++++++++++++++++++++++
arch/arm/mach-s3c2416/setup-sdhci.c | 62 ++++++++++++++++++++++++++++
arch/arm/plat-samsung/include/plat/sdhci.h | 34 +++++++++++++++
6 files changed, 189 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-s3c2416/setup-sdhci-gpio.c
create mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
index eafb0ed..e055c7f 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -25,6 +25,17 @@ config S3C2416_DMA
help
Internal config node for S3C2416 DMA support
+config S3C2416_SETUP_SDHCI
+ bool
+ select S3C2416_SETUP_SDHCI_GPIO
+ help
+ Internal helper functions for S3C2416 based SDHCI systems
+
+config S3C2416_SETUP_SDHCI_GPIO
+ bool
+ help
+ Common setup code for SDHCI gpio.
+
menu "S3C2416 Machines"
config MACH_SMDK2416
@@ -36,7 +47,19 @@ config MACH_SMDK2416
select S3C_DEV_HSMMC1
select S3C_DEV_NAND
select S3C_DEV_USB_HOST
+ select S3C2416_SETUP_SDHCI
help
Say Y here if you are using an SMDK2416
+config MACH_HANLIN_V3C
+ bool "Hanlin eReader V3C"
+ select CPU_S3C2416
+ select S3C_DEV_HSMMC
+ select S3C_DEV_HSMMC1
+ select S3C_DEV_NAND
+ select S3C_DEV_USB_HOST
+ select S3C2416_SETUP_SDHCI
+ help
+ Say Y here if you are using an Jinke's Hanlin V3C eReader
+
endmenu
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
index 6c12c7b..678e148 100644
--- a/arch/arm/mach-s3c2416/Makefile
+++ b/arch/arm/mach-s3c2416/Makefile
@@ -14,6 +14,11 @@ obj-$(CONFIG_CPU_S3C2416) += irq.o
#obj-$(CONFIG_S3C2416_DMA) += dma.o
+# Device setup
+obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
+obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
+
# Machine support
obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
+obj-$(CONFIG_MACH_HANLIN_V3C) += mach-v3c.o
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 355ab62..06eacf8 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -53,6 +53,7 @@
#include <plat/s3c2416.h>
#include <plat/devs.h>
#include <plat/cpu.h>
+#include <plat/sdhci.h>
#include <plat/iic-core.h>
@@ -115,6 +116,10 @@ void __init s3c2416_map_io(void)
s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown;
s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown;
+ /* initialize device information early */
+ s3c2416_default_sdhci0();
+ s3c2416_default_sdhci1();
+
iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
}
diff --git a/arch/arm/mach-s3c2416/setup-sdhci-gpio.c b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
new file mode 100644
index 0000000..ebdab15
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
@@ -0,0 +1,60 @@
+/* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c
+ *
+ * Copyright 2010 Promwad Innovation Company
+ * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
+ *
+ * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
+ *
+ * Based on mach-s3c64xx/setup-sdhci-gpio.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+
+#include <mach/gpio.h>
+#include <mach/regs-gpio.h>
+#include <plat/gpio-cfg.h>
+
+/* Note: hsmmc1 and hsmmc0 are swapped versus datasheet */
+
+void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
+{
+ unsigned int gpio;
+ unsigned int end;
+
+ end = S3C2410_GPE(7 + width);
+
+ /* Set all the necessary GPE pins to special-function 0 */
+ for (gpio = S3C2410_GPE(5); gpio < end; gpio++) {
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ }
+}
+
+void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+{
+ unsigned int gpio;
+ unsigned int end;
+
+ end = S3C2410_GPL(0 + width);
+
+ /* Set all the necessary GPG pins to special-function 0 */
+ for (gpio = S3C2410_GPL(0); gpio < end; gpio++) {
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ }
+
+ s3c_gpio_cfgpin(S3C2410_GPL(8), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S3C2410_GPL(8), S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgpin(S3C2410_GPL(9), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S3C2410_GPL(9), S3C_GPIO_PULL_NONE);
+}
+
+
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
new file mode 100644
index 0000000..345ddd1
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci.c
@@ -0,0 +1,62 @@
+/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
+ *
+ * Copyright 2010 Promwad Innovation Company
+ * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
+ *
+ * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
+ *
+ * Based on mach-s3c64xx/setup-sdhci.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+
+#include <linux/mmc/card.h>
+#include <linux/mmc/host.h>
+
+#include <plat/regs-sdhci.h>
+#include <plat/sdhci.h>
+
+/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
+
+char *s3c2416_hsmmc_clksrcs[4] = {
+ [0] = "hsmmc",
+ [1] = "hsmmc",
+ [2] = "hsmmc-if",
+ /* [3] = "48m", - note not successfully used yet */
+};
+
+void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
+ void __iomem *r,
+ struct mmc_ios *ios,
+ struct mmc_card *card)
+{
+ u32 ctrl2, ctrl3;
+
+ ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
+ ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
+ ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
+ S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
+ S3C_SDHCI_CTRL2_ENFBCLKRX |
+ S3C_SDHCI_CTRL2_DFCNT_NONE |
+ S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
+
+ if (ios->clock < 25 * 1000000)
+ ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
+ S3C_SDHCI_CTRL3_FCSEL2 |
+ S3C_SDHCI_CTRL3_FCSEL1 |
+ S3C_SDHCI_CTRL3_FCSEL0);
+ else
+ ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
+
+ writel(ctrl2, r + S3C_SDHCI_CONTROL2);
+ writel(ctrl3, r + S3C_SDHCI_CONTROL3);
+}
+
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 13f9fb2..d408140 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -78,6 +78,8 @@ extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
+extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
+extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
/* S3C6400 SDHCI setup */
@@ -270,6 +272,38 @@ static inline void s5pv210_default_sdhci1(void) { }
static inline void s5pv210_default_sdhci2(void) { }
#endif /* CONFIG_S5PC100_SETUP_SDHCI */
+/* S3C2416 SDHCI setup */
+#ifdef CONFIG_S3C2416_SETUP_SDHCI
+extern char *s3c2416_hsmmc_clksrcs[4];
+
+extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
+ void __iomem *r,
+ struct mmc_ios *ios,
+ struct mmc_card *card);
+
+#ifdef CONFIG_S3C_DEV_HSMMC
+static inline void s3c2416_default_sdhci0(void)
+{
+ s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
+ s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
+ s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
+}
+#else
+static inline void s3c2416_default_sdhci0(void) { }
+#endif /* CONFIG_S3C_DEV_HSMMC */
+
+#ifdef CONFIG_S3C_DEV_HSMMC1
+static inline void s3c2416_default_sdhci1(void)
+{
+ s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
+ s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
+ s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
+}
+#else
+static inline void s3c2416_default_sdhci1(void) { }
+#endif /* CONFIG_S3C_DEV_HSMMC1 */
+
+#endif /* CONFIG_S3C2416_SETUP_SDHCI */
--
1.6.6.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI
2010-06-22 13:16 ` [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
@ 2010-06-22 13:19 ` Maurus Cuelenaere
2010-06-22 14:05 ` Yauhen Kharuzhy
2010-06-22 13:45 ` Darius Augulis
1 sibling, 1 reply; 19+ messages in thread
From: Maurus Cuelenaere @ 2010-06-22 13:19 UTC (permalink / raw)
To: linux-arm-kernel
Op 22-06-10 15:16, Yauhen Kharuzhy schreef:
> Samsung S3C2416 has two SDHCI controllers compatible with other
> Samsung's SoCs (S3C64XX, S5PC100 etc...).
>
> Add required platform setup code that the devices can be used with
> sdhci-s3c driver.
>
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> ---
> arch/arm/mach-s3c2416/Kconfig | 23 ++++++++++
> arch/arm/mach-s3c2416/Makefile | 5 ++
> arch/arm/mach-s3c2416/s3c2416.c | 5 ++
> arch/arm/mach-s3c2416/setup-sdhci-gpio.c | 60 +++++++++++++++++++++++++++
> arch/arm/mach-s3c2416/setup-sdhci.c | 62 ++++++++++++++++++++++++++++
> arch/arm/plat-samsung/include/plat/sdhci.h | 34 +++++++++++++++
> 6 files changed, 189 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> create mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
>
> diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
> index eafb0ed..e055c7f 100644
> --- a/arch/arm/mach-s3c2416/Kconfig
> +++ b/arch/arm/mach-s3c2416/Kconfig
> @@ -25,6 +25,17 @@ config S3C2416_DMA
> help
> Internal config node for S3C2416 DMA support
>
> +config S3C2416_SETUP_SDHCI
> + bool
> + select S3C2416_SETUP_SDHCI_GPIO
> + help
> + Internal helper functions for S3C2416 based SDHCI systems
> +
> +config S3C2416_SETUP_SDHCI_GPIO
> + bool
> + help
> + Common setup code for SDHCI gpio.
> +
> menu "S3C2416 Machines"
>
> config MACH_SMDK2416
> @@ -36,7 +47,19 @@ config MACH_SMDK2416
> select S3C_DEV_HSMMC1
> select S3C_DEV_NAND
> select S3C_DEV_USB_HOST
> + select S3C2416_SETUP_SDHCI
> help
> Say Y here if you are using an SMDK2416
>
> +config MACH_HANLIN_V3C
> + bool "Hanlin eReader V3C"
> + select CPU_S3C2416
> + select S3C_DEV_HSMMC
> + select S3C_DEV_HSMMC1
> + select S3C_DEV_NAND
> + select S3C_DEV_USB_HOST
> + select S3C2416_SETUP_SDHCI
> + help
> + Say Y here if you are using an Jinke's Hanlin V3C eReader
> +
>
This seems to be unrelated to the patch?
> endmenu
> diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
> index 6c12c7b..678e148 100644
> --- a/arch/arm/mach-s3c2416/Makefile
> +++ b/arch/arm/mach-s3c2416/Makefile
> @@ -14,6 +14,11 @@ obj-$(CONFIG_CPU_S3C2416) += irq.o
>
> #obj-$(CONFIG_S3C2416_DMA) += dma.o
>
> +# Device setup
> +obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
> +obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
> +
> # Machine support
>
> obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
> +obj-$(CONFIG_MACH_HANLIN_V3C) += mach-v3c.o
> diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
> index 355ab62..06eacf8 100644
> --- a/arch/arm/mach-s3c2416/s3c2416.c
> +++ b/arch/arm/mach-s3c2416/s3c2416.c
> @@ -53,6 +53,7 @@
> #include <plat/s3c2416.h>
> #include <plat/devs.h>
> #include <plat/cpu.h>
> +#include <plat/sdhci.h>
>
> #include <plat/iic-core.h>
>
> @@ -115,6 +116,10 @@ void __init s3c2416_map_io(void)
> s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown;
> s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown;
>
> + /* initialize device information early */
> + s3c2416_default_sdhci0();
> + s3c2416_default_sdhci1();
> +
> iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
> }
>
> diff --git a/arch/arm/mach-s3c2416/setup-sdhci-gpio.c b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> new file mode 100644
> index 0000000..ebdab15
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> @@ -0,0 +1,60 @@
> +/* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c
> + *
> + * Copyright 2010 Promwad Innovation Company
> + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> + *
> + * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
> + *
> + * Based on mach-s3c64xx/setup-sdhci-gpio.c
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/io.h>
> +
> +#include <mach/gpio.h>
> +#include <mach/regs-gpio.h>
> +#include <plat/gpio-cfg.h>
> +
> +/* Note: hsmmc1 and hsmmc0 are swapped versus datasheet */
> +
> +void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
> +{
> + unsigned int gpio;
> + unsigned int end;
> +
> + end = S3C2410_GPE(7 + width);
> +
> + /* Set all the necessary GPE pins to special-function 0 */
> + for (gpio = S3C2410_GPE(5); gpio < end; gpio++) {
> + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> + }
> +}
> +
> +void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
> +{
> + unsigned int gpio;
> + unsigned int end;
> +
> + end = S3C2410_GPL(0 + width);
> +
> + /* Set all the necessary GPG pins to special-function 0 */
> + for (gpio = S3C2410_GPL(0); gpio < end; gpio++) {
> + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> + }
> +
> + s3c_gpio_cfgpin(S3C2410_GPL(8), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S3C2410_GPL(8), S3C_GPIO_PULL_NONE);
> + s3c_gpio_cfgpin(S3C2410_GPL(9), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S3C2410_GPL(9), S3C_GPIO_PULL_NONE);
> +}
> +
> +
> diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
> new file mode 100644
> index 0000000..345ddd1
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci.c
> @@ -0,0 +1,62 @@
> +/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
> + *
> + * Copyright 2010 Promwad Innovation Company
> + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> + *
> + * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
> + *
> + * Based on mach-s3c64xx/setup-sdhci.c
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/io.h>
> +
> +#include <linux/mmc/card.h>
> +#include <linux/mmc/host.h>
> +
> +#include <plat/regs-sdhci.h>
> +#include <plat/sdhci.h>
> +
> +/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
> +
> +char *s3c2416_hsmmc_clksrcs[4] = {
> + [0] = "hsmmc",
> + [1] = "hsmmc",
> + [2] = "hsmmc-if",
> + /* [3] = "48m", - note not successfully used yet */
> +};
> +
> +void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> + void __iomem *r,
> + struct mmc_ios *ios,
> + struct mmc_card *card)
> +{
> + u32 ctrl2, ctrl3;
> +
> + ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> + ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> + S3C_SDHCI_CTRL2_ENFBCLKRX |
> + S3C_SDHCI_CTRL2_DFCNT_NONE |
> + S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> +
> + if (ios->clock < 25 * 1000000)
> + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> + S3C_SDHCI_CTRL3_FCSEL2 |
> + S3C_SDHCI_CTRL3_FCSEL1 |
> + S3C_SDHCI_CTRL3_FCSEL0);
> + else
> + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
> +
> + writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> + writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> +}
> +
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
> index 13f9fb2..d408140 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -78,6 +78,8 @@ extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
> extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
> extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
> extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
> +extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
> +extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
>
> /* S3C6400 SDHCI setup */
>
> @@ -270,6 +272,38 @@ static inline void s5pv210_default_sdhci1(void) { }
> static inline void s5pv210_default_sdhci2(void) { }
> #endif /* CONFIG_S5PC100_SETUP_SDHCI */
>
> +/* S3C2416 SDHCI setup */
> +#ifdef CONFIG_S3C2416_SETUP_SDHCI
> +extern char *s3c2416_hsmmc_clksrcs[4];
> +
> +extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> + void __iomem *r,
> + struct mmc_ios *ios,
> + struct mmc_card *card);
> +
> +#ifdef CONFIG_S3C_DEV_HSMMC
> +static inline void s3c2416_default_sdhci0(void)
> +{
> + s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> + s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
> + s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
> +}
> +#else
> +static inline void s3c2416_default_sdhci0(void) { }
> +#endif /* CONFIG_S3C_DEV_HSMMC */
> +
> +#ifdef CONFIG_S3C_DEV_HSMMC1
> +static inline void s3c2416_default_sdhci1(void)
> +{
> + s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> + s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
> + s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
> +}
> +#else
> +static inline void s3c2416_default_sdhci1(void) { }
> +#endif /* CONFIG_S3C_DEV_HSMMC1 */
> +
> +#endif /* CONFIG_S3C2416_SETUP_SDHCI */
>
>
>
>
--
Maurus Cuelenaere
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M
2010-06-22 13:16 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 2/4] ARM: S3C2416: Set name of the framebuffer device only if it present Yauhen Kharuzhy
@ 2010-06-22 13:40 ` Vasily Khoruzhick
1 sibling, 0 replies; 19+ messages in thread
From: Vasily Khoruzhick @ 2010-06-22 13:40 UTC (permalink / raw)
To: linux-arm-kernel
? ????????? ?? 22 ???? 2010 16:16:22 ????? Yauhen Kharuzhy ???????:
> S3C2443 and S3C2416 has 12 GPIO banks (from A to M), increase
> ARCH_NR_GPIOS for this architectures.
>
> Also typo from previous commit has been fixed: CONFIG_CPU_S3C24XX
> instead CONFIG_CPU_244X.
>
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> arch/arm/mach-s3c2410/include/mach/gpio.h | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h
> b/arch/arm/mach-s3c2410/include/mach/gpio.h index b649bf2..f7f6b07 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
> @@ -22,6 +22,8 @@
>
> #ifdef CONFIG_CPU_S3C244X
> #define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
> +#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
> +#define ARCH_NR_GPIOS (32 * 12 + CONFIG_S3C24XX_GPIO_EXTRA)
> #else
> #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
> #endif
> @@ -30,8 +32,10 @@
> #include <mach/gpio-nrs.h>
> #include <mach/gpio-fns.h>
>
> -#ifdef CONFIG_CPU_S3C24XX
> -#define S3C_GPIO_END (S3C2410_GPIO_BANKJ + 32)
> +#ifdef CONFIG_CPU_S3C244X
> +#define S3C_GPIO_END (S3C2410_GPJ(0) + 32)
> +#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
> +#define S3C_GPIO_END (S3C2410_GPM(0) + 32)
> #else
> -#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32)
> +#define S3C_GPIO_END (S3C2410_GPH(0) + 32)
> #endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100622/88d38f5a/attachment.sig>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI
2010-06-22 13:16 ` [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
2010-06-22 13:19 ` Maurus Cuelenaere
@ 2010-06-22 13:45 ` Darius Augulis
2010-06-22 14:19 ` Yauhen Kharuzhy
1 sibling, 1 reply; 19+ messages in thread
From: Darius Augulis @ 2010-06-22 13:45 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jun 22, 2010 at 4:16 PM, Yauhen Kharuzhy <jekhor@gmail.com> wrote:
> Samsung S3C2416 has two SDHCI controllers compatible with other
> Samsung's SoCs (S3C64XX, S5PC100 etc...).
>
> Add required platform setup code that the devices can be used with
> sdhci-s3c driver.
>
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> ---
> arch/arm/mach-s3c2416/Kconfig | 23 ++++++++++
> arch/arm/mach-s3c2416/Makefile | 5 ++
> arch/arm/mach-s3c2416/s3c2416.c | 5 ++
> arch/arm/mach-s3c2416/setup-sdhci-gpio.c | 60
> +++++++++++++++++++++++++++
> arch/arm/mach-s3c2416/setup-sdhci.c | 62
> ++++++++++++++++++++++++++++
> arch/arm/plat-samsung/include/plat/sdhci.h | 34 +++++++++++++++
> 6 files changed, 189 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> create mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
>
> diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
> index eafb0ed..e055c7f 100644
> --- a/arch/arm/mach-s3c2416/Kconfig
> +++ b/arch/arm/mach-s3c2416/Kconfig
> @@ -25,6 +25,17 @@ config S3C2416_DMA
> help
> Internal config node for S3C2416 DMA support
>
> +config S3C2416_SETUP_SDHCI
> + bool
> + select S3C2416_SETUP_SDHCI_GPIO
> + help
> + Internal helper functions for S3C2416 based SDHCI systems
> +
> +config S3C2416_SETUP_SDHCI_GPIO
> + bool
> + help
> + Common setup code for SDHCI gpio.
> +
> menu "S3C2416 Machines"
>
> config MACH_SMDK2416
> @@ -36,7 +47,19 @@ config MACH_SMDK2416
> select S3C_DEV_HSMMC1
> select S3C_DEV_NAND
> select S3C_DEV_USB_HOST
> + select S3C2416_SETUP_SDHCI
> help
> Say Y here if you are using an SMDK2416
>
> +config MACH_HANLIN_V3C
> + bool "Hanlin eReader V3C"
> + select CPU_S3C2416
> + select S3C_DEV_HSMMC
> + select S3C_DEV_HSMMC1
> + select S3C_DEV_NAND
> + select S3C_DEV_USB_HOST
> + select S3C2416_SETUP_SDHCI
> + help
> + Say Y here if you are using an Jinke's Hanlin V3C eReader
> +
> endmenu
> diff --git a/arch/arm/mach-s3c2416/Makefile
> b/arch/arm/mach-s3c2416/Makefile
> index 6c12c7b..678e148 100644
> --- a/arch/arm/mach-s3c2416/Makefile
> +++ b/arch/arm/mach-s3c2416/Makefile
> @@ -14,6 +14,11 @@ obj-$(CONFIG_CPU_S3C2416) += irq.o
>
> #obj-$(CONFIG_S3C2416_DMA) += dma.o
>
> +# Device setup
> +obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
> +obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
> +
> # Machine support
>
> obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
> +obj-$(CONFIG_MACH_HANLIN_V3C) += mach-v3c.o
> diff --git a/arch/arm/mach-s3c2416/s3c2416.c
> b/arch/arm/mach-s3c2416/s3c2416.c
> index 355ab62..06eacf8 100644
> --- a/arch/arm/mach-s3c2416/s3c2416.c
> +++ b/arch/arm/mach-s3c2416/s3c2416.c
> @@ -53,6 +53,7 @@
> #include <plat/s3c2416.h>
> #include <plat/devs.h>
> #include <plat/cpu.h>
> +#include <plat/sdhci.h>
>
> #include <plat/iic-core.h>
>
> @@ -115,6 +116,10 @@ void __init s3c2416_map_io(void)
> s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown;
> s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown;
>
> + /* initialize device information early */
> + s3c2416_default_sdhci0();
> + s3c2416_default_sdhci1();
> +
> iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
> }
>
> diff --git a/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> new file mode 100644
> index 0000000..ebdab15
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> @@ -0,0 +1,60 @@
> +/* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c
> + *
> + * Copyright 2010 Promwad Innovation Company
> + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> + *
> + * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
> + *
> + * Based on mach-s3c64xx/setup-sdhci-gpio.c
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/io.h>
> +
> +#include <mach/gpio.h>
> +#include <mach/regs-gpio.h>
> +#include <plat/gpio-cfg.h>
> +
> +/* Note: hsmmc1 and hsmmc0 are swapped versus datasheet */
>
would be nice to provide more accurate link to information source (document
version, page).
And there is a bit tricky place: clock ids are swapped and names of helper
functions are not.
So, it's not clear which helper function corresponds to real physical SDHC
interface.
+
> +void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
> +{
> + unsigned int gpio;
> + unsigned int end;
> +
> + end = S3C2410_GPE(7 + width);
> +
> + /* Set all the necessary GPE pins to special-function 0 */
> + for (gpio = S3C2410_GPE(5); gpio < end; gpio++) {
> + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> + }
> +}
> +
> +void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
> +{
> + unsigned int gpio;
> + unsigned int end;
> +
> + end = S3C2410_GPL(0 + width);
> +
> + /* Set all the necessary GPG pins to special-function 0 */
> + for (gpio = S3C2410_GPL(0); gpio < end; gpio++) {
> + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> + }
> +
> + s3c_gpio_cfgpin(S3C2410_GPL(8), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S3C2410_GPL(8), S3C_GPIO_PULL_NONE);
> + s3c_gpio_cfgpin(S3C2410_GPL(9), S3C_GPIO_SFN(2));
> + s3c_gpio_setpull(S3C2410_GPL(9), S3C_GPIO_PULL_NONE);
> +}
> +
> +
> diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c
> b/arch/arm/mach-s3c2416/setup-sdhci.c
> new file mode 100644
> index 0000000..345ddd1
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci.c
> @@ -0,0 +1,62 @@
> +/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
> + *
> + * Copyright 2010 Promwad Innovation Company
> + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> + *
> + * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
> + *
> + * Based on mach-s3c64xx/setup-sdhci.c
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/io.h>
> +
> +#include <linux/mmc/card.h>
> +#include <linux/mmc/host.h>
> +
> +#include <plat/regs-sdhci.h>
> +#include <plat/sdhci.h>
> +
> +/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
> +
> +char *s3c2416_hsmmc_clksrcs[4] = {
> + [0] = "hsmmc",
> + [1] = "hsmmc",
> + [2] = "hsmmc-if",
> + /* [3] = "48m", - note not successfully used yet */
> +};
> +
> +void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> + void __iomem *r,
> + struct mmc_ios *ios,
> + struct mmc_card *card)
> +{
> + u32 ctrl2, ctrl3;
> +
> + ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> + ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> + S3C_SDHCI_CTRL2_ENFBCLKRX |
> + S3C_SDHCI_CTRL2_DFCNT_NONE |
> + S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> +
> + if (ios->clock < 25 * 1000000)
> + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> + S3C_SDHCI_CTRL3_FCSEL2 |
> + S3C_SDHCI_CTRL3_FCSEL1 |
> + S3C_SDHCI_CTRL3_FCSEL0);
> + else
> + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
> +
> + writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> + writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> +}
> +
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h
> b/arch/arm/plat-samsung/include/plat/sdhci.h
> index 13f9fb2..d408140 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -78,6 +78,8 @@ extern void s3c64xx_setup_sdhci2_cfg_gpio(struct
> platform_device *, int w);
> extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int
> w);
> extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int
> w);
> extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int
> w);
> +extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int
> w);
> +extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int
> w);
>
> /* S3C6400 SDHCI setup */
>
> @@ -270,6 +272,38 @@ static inline void s5pv210_default_sdhci1(void) { }
> static inline void s5pv210_default_sdhci2(void) { }
> #endif /* CONFIG_S5PC100_SETUP_SDHCI */
>
> +/* S3C2416 SDHCI setup */
> +#ifdef CONFIG_S3C2416_SETUP_SDHCI
> +extern char *s3c2416_hsmmc_clksrcs[4];
> +
> +extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> + void __iomem *r,
> + struct mmc_ios *ios,
> + struct mmc_card *card);
> +
> +#ifdef CONFIG_S3C_DEV_HSMMC
> +static inline void s3c2416_default_sdhci0(void)
> +{
> + s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> + s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
> + s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
>
helper id 0 gets to interface 0 - not swapped.
> +}
> +#else
> +static inline void s3c2416_default_sdhci0(void) { }
> +#endif /* CONFIG_S3C_DEV_HSMMC */
> +
> +#ifdef CONFIG_S3C_DEV_HSMMC1
> +static inline void s3c2416_default_sdhci1(void)
> +{
> + s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> + s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
> + s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
>
helper id 1 gets to interface 1 - not swapped.
> +}
> +#else
> +static inline void s3c2416_default_sdhci1(void) { }
> +#endif /* CONFIG_S3C_DEV_HSMMC1 */
> +
> +#endif /* CONFIG_S3C2416_SETUP_SDHCI */
>
>
>
> --
> 1.6.6.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100622/797d796b/attachment-0001.html>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI
2010-06-22 13:19 ` Maurus Cuelenaere
@ 2010-06-22 14:05 ` Yauhen Kharuzhy
0 siblings, 0 replies; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 14:05 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jun 22, 2010 at 03:19:28PM +0200, Maurus Cuelenaere wrote:
> Op 22-06-10 15:16, Yauhen Kharuzhy schreef:
> > Samsung S3C2416 has two SDHCI controllers compatible with other
> > Samsung's SoCs (S3C64XX, S5PC100 etc...).
> >
> > Add required platform setup code that the devices can be used with
> > sdhci-s3c driver.
> >
> > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> > ---
> > arch/arm/mach-s3c2416/Kconfig | 23 ++++++++++
> > arch/arm/mach-s3c2416/Makefile | 5 ++
> > arch/arm/mach-s3c2416/s3c2416.c | 5 ++
> > arch/arm/mach-s3c2416/setup-sdhci-gpio.c | 60 +++++++++++++++++++++++++++
> > arch/arm/mach-s3c2416/setup-sdhci.c | 62 ++++++++++++++++++++++++++++
> > arch/arm/plat-samsung/include/plat/sdhci.h | 34 +++++++++++++++
> > 6 files changed, 189 insertions(+), 0 deletions(-)
> > create mode 100644 arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> > create mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
> >
> > diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
> > index eafb0ed..e055c7f 100644
> > --- a/arch/arm/mach-s3c2416/Kconfig
> > +++ b/arch/arm/mach-s3c2416/Kconfig
> > @@ -25,6 +25,17 @@ config S3C2416_DMA
> > help
> > Internal config node for S3C2416 DMA support
> >
> > +config S3C2416_SETUP_SDHCI
> > + bool
> > + select S3C2416_SETUP_SDHCI_GPIO
> > + help
> > + Internal helper functions for S3C2416 based SDHCI systems
> > +
> > +config S3C2416_SETUP_SDHCI_GPIO
> > + bool
> > + help
> > + Common setup code for SDHCI gpio.
> > +
> > menu "S3C2416 Machines"
> >
> > config MACH_SMDK2416
> > @@ -36,7 +47,19 @@ config MACH_SMDK2416
> > select S3C_DEV_HSMMC1
> > select S3C_DEV_NAND
> > select S3C_DEV_USB_HOST
> > + select S3C2416_SETUP_SDHCI
> > help
> > Say Y here if you are using an SMDK2416
> >
> > +config MACH_HANLIN_V3C
> > + bool "Hanlin eReader V3C"
> > + select CPU_S3C2416
> > + select S3C_DEV_HSMMC
> > + select S3C_DEV_HSMMC1
> > + select S3C_DEV_NAND
> > + select S3C_DEV_USB_HOST
> > + select S3C2416_SETUP_SDHCI
> > + help
> > + Say Y here if you are using an Jinke's Hanlin V3C eReader
> > +
> >
>
> This seems to be unrelated to the patch?
I am sorry, will resend.
>
> > endmenu
--
Yauhen Kharuzhy jekhor _at_ gmail.com
JID: jek at jabber.ru
A: No
Q: Should I quote below my post?
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI
2010-06-22 13:45 ` Darius Augulis
@ 2010-06-22 14:19 ` Yauhen Kharuzhy
0 siblings, 0 replies; 19+ messages in thread
From: Yauhen Kharuzhy @ 2010-06-22 14:19 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jun 22, 2010 at 04:45:18PM +0300, Darius Augulis wrote:
> On Tue, Jun 22, 2010 at 4:16 PM, Yauhen Kharuzhy <jekhor@gmail.com> wrote:
>
> > Samsung S3C2416 has two SDHCI controllers compatible with other
> > Samsung's SoCs (S3C64XX, S5PC100 etc...).
> >
> > Add required platform setup code that the devices can be used with
> > sdhci-s3c driver.
> >
> > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> > ---
> > arch/arm/mach-s3c2416/Kconfig | 23 ++++++++++
> > arch/arm/mach-s3c2416/Makefile | 5 ++
> > arch/arm/mach-s3c2416/s3c2416.c | 5 ++
> > arch/arm/mach-s3c2416/setup-sdhci-gpio.c | 60
> > +++++++++++++++++++++++++++
> > arch/arm/mach-s3c2416/setup-sdhci.c | 62
> > ++++++++++++++++++++++++++++
> > arch/arm/plat-samsung/include/plat/sdhci.h | 34 +++++++++++++++
> > 6 files changed, 189 insertions(+), 0 deletions(-)
> > create mode 100644 arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> > create mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
> >
> > diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
> > index eafb0ed..e055c7f 100644
> > --- a/arch/arm/mach-s3c2416/Kconfig
> > +++ b/arch/arm/mach-s3c2416/Kconfig
> > @@ -25,6 +25,17 @@ config S3C2416_DMA
> > help
> > Internal config node for S3C2416 DMA support
> >
> > +config S3C2416_SETUP_SDHCI
> > + bool
> > + select S3C2416_SETUP_SDHCI_GPIO
> > + help
> > + Internal helper functions for S3C2416 based SDHCI systems
> > +
> > +config S3C2416_SETUP_SDHCI_GPIO
> > + bool
> > + help
> > + Common setup code for SDHCI gpio.
> > +
> > menu "S3C2416 Machines"
> >
> > config MACH_SMDK2416
> > @@ -36,7 +47,19 @@ config MACH_SMDK2416
> > select S3C_DEV_HSMMC1
> > select S3C_DEV_NAND
> > select S3C_DEV_USB_HOST
> > + select S3C2416_SETUP_SDHCI
> > help
> > Say Y here if you are using an SMDK2416
> >
> > +config MACH_HANLIN_V3C
> > + bool "Hanlin eReader V3C"
> > + select CPU_S3C2416
> > + select S3C_DEV_HSMMC
> > + select S3C_DEV_HSMMC1
> > + select S3C_DEV_NAND
> > + select S3C_DEV_USB_HOST
> > + select S3C2416_SETUP_SDHCI
> > + help
> > + Say Y here if you are using an Jinke's Hanlin V3C eReader
> > +
> > endmenu
> > diff --git a/arch/arm/mach-s3c2416/Makefile
> > b/arch/arm/mach-s3c2416/Makefile
> > index 6c12c7b..678e148 100644
> > --- a/arch/arm/mach-s3c2416/Makefile
> > +++ b/arch/arm/mach-s3c2416/Makefile
> > @@ -14,6 +14,11 @@ obj-$(CONFIG_CPU_S3C2416) += irq.o
> >
> > #obj-$(CONFIG_S3C2416_DMA) += dma.o
> >
> > +# Device setup
> > +obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
> > +obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
> > +
> > # Machine support
> >
> > obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
> > +obj-$(CONFIG_MACH_HANLIN_V3C) += mach-v3c.o
> > diff --git a/arch/arm/mach-s3c2416/s3c2416.c
> > b/arch/arm/mach-s3c2416/s3c2416.c
> > index 355ab62..06eacf8 100644
> > --- a/arch/arm/mach-s3c2416/s3c2416.c
> > +++ b/arch/arm/mach-s3c2416/s3c2416.c
> > @@ -53,6 +53,7 @@
> > #include <plat/s3c2416.h>
> > #include <plat/devs.h>
> > #include <plat/cpu.h>
> > +#include <plat/sdhci.h>
> >
> > #include <plat/iic-core.h>
> >
> > @@ -115,6 +116,10 @@ void __init s3c2416_map_io(void)
> > s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown;
> > s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown;
> >
> > + /* initialize device information early */
> > + s3c2416_default_sdhci0();
> > + s3c2416_default_sdhci1();
> > +
> > iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
> > }
> >
> > diff --git a/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> > b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> > new file mode 100644
> > index 0000000..ebdab15
> > --- /dev/null
> > +++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> > @@ -0,0 +1,60 @@
> > +/* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c
> > + *
> > + * Copyright 2010 Promwad Innovation Company
> > + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> > + *
> > + * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
> > + *
> > + * Based on mach-s3c64xx/setup-sdhci-gpio.c
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > +*/
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/types.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/io.h>
> > +
> > +#include <mach/gpio.h>
> > +#include <mach/regs-gpio.h>
> > +#include <plat/gpio-cfg.h>
> > +
> > +/* Note: hsmmc1 and hsmmc0 are swapped versus datasheet */
> >
>
> would be nice to provide more accurate link to information source (document
> version, page).
> And there is a bit tricky place: clock ids are swapped and names of helper
> functions are not.
> So, it's not clear which helper function corresponds to real physical SDHC
> interface.
S3C2416 User's Manual, pages 238 (10-4) and 241 (10-7): GPE5-GPE10
correspond to SD0, GPL0-GPL3, GPL8-GPL9 --- to SD1. So all platform
devices and GPIO config functions have namas swapped versus datasheet.
We have HSMMC1 and HSMMC0 swapped due to historical reasons --- there are HSMMC
block in S3C2443 and HSMMC1 block in S3C2416 on same address. I am going
to revert this swapping later.
> > +void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
> > +{
> > + unsigned int gpio;
> > + unsigned int end;
> > +
> > + end = S3C2410_GPE(7 + width);
> > +
> > + /* Set all the necessary GPE pins to special-function 0 */
> > + for (gpio = S3C2410_GPE(5); gpio < end; gpio++) {
> > + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
> > + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> > + }
> > +}
> > +
> > +void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
> > +{
> > + unsigned int gpio;
> > + unsigned int end;
> > +
> > + end = S3C2410_GPL(0 + width);
> > +
> > + /* Set all the necessary GPG pins to special-function 0 */
> > + for (gpio = S3C2410_GPL(0); gpio < end; gpio++) {
> > + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
> > + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> > + }
> > +
> > + s3c_gpio_cfgpin(S3C2410_GPL(8), S3C_GPIO_SFN(2));
> > + s3c_gpio_setpull(S3C2410_GPL(8), S3C_GPIO_PULL_NONE);
> > + s3c_gpio_cfgpin(S3C2410_GPL(9), S3C_GPIO_SFN(2));
> > + s3c_gpio_setpull(S3C2410_GPL(9), S3C_GPIO_PULL_NONE);
> > +}
> > +
> > +
> > diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c
> > b/arch/arm/mach-s3c2416/setup-sdhci.c
> > new file mode 100644
> > index 0000000..345ddd1
> > --- /dev/null
> > +++ b/arch/arm/mach-s3c2416/setup-sdhci.c
> > @@ -0,0 +1,62 @@
> > +/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
> > + *
> > + * Copyright 2010 Promwad Innovation Company
> > + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> > + *
> > + * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
> > + *
> > + * Based on mach-s3c64xx/setup-sdhci.c
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > +*/
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/types.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/io.h>
> > +
> > +#include <linux/mmc/card.h>
> > +#include <linux/mmc/host.h>
> > +
> > +#include <plat/regs-sdhci.h>
> > +#include <plat/sdhci.h>
> > +
> > +/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
> > +
> > +char *s3c2416_hsmmc_clksrcs[4] = {
> > + [0] = "hsmmc",
> > + [1] = "hsmmc",
> > + [2] = "hsmmc-if",
> > + /* [3] = "48m", - note not successfully used yet */
> > +};
> > +
> > +void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> > + void __iomem *r,
> > + struct mmc_ios *ios,
> > + struct mmc_card *card)
> > +{
> > + u32 ctrl2, ctrl3;
> > +
> > + ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> > + ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> > + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> > + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> > + S3C_SDHCI_CTRL2_ENFBCLKRX |
> > + S3C_SDHCI_CTRL2_DFCNT_NONE |
> > + S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> > +
> > + if (ios->clock < 25 * 1000000)
> > + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> > + S3C_SDHCI_CTRL3_FCSEL2 |
> > + S3C_SDHCI_CTRL3_FCSEL1 |
> > + S3C_SDHCI_CTRL3_FCSEL0);
> > + else
> > + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
> > +
> > + writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> > + writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> > +}
> > +
> > diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h
> > b/arch/arm/plat-samsung/include/plat/sdhci.h
> > index 13f9fb2..d408140 100644
> > --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> > +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> > @@ -78,6 +78,8 @@ extern void s3c64xx_setup_sdhci2_cfg_gpio(struct
> > platform_device *, int w);
> > extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int
> > w);
> > extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int
> > w);
> > extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int
> > w);
> > +extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int
> > w);
> > +extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int
> > w);
> >
> > /* S3C6400 SDHCI setup */
> >
> > @@ -270,6 +272,38 @@ static inline void s5pv210_default_sdhci1(void) { }
> > static inline void s5pv210_default_sdhci2(void) { }
> > #endif /* CONFIG_S5PC100_SETUP_SDHCI */
> >
> > +/* S3C2416 SDHCI setup */
> > +#ifdef CONFIG_S3C2416_SETUP_SDHCI
> > +extern char *s3c2416_hsmmc_clksrcs[4];
> > +
> > +extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> > + void __iomem *r,
> > + struct mmc_ios *ios,
> > + struct mmc_card *card);
> > +
> > +#ifdef CONFIG_S3C_DEV_HSMMC
> > +static inline void s3c2416_default_sdhci0(void)
> > +{
> > + s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> > + s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
> > + s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
> >
>
> helper id 0 gets to interface 0 - not swapped.
>
>
> > +}
> > +#else
> > +static inline void s3c2416_default_sdhci0(void) { }
> > +#endif /* CONFIG_S3C_DEV_HSMMC */
> > +
> > +#ifdef CONFIG_S3C_DEV_HSMMC1
> > +static inline void s3c2416_default_sdhci1(void)
> > +{
> > + s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> > + s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
> > + s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
> >
>
> helper id 1 gets to interface 1 - not swapped.
>
>
> > +}
> > +#else
> > +static inline void s3c2416_default_sdhci1(void) { }
> > +#endif /* CONFIG_S3C_DEV_HSMMC1 */
> > +
> > +#endif /* CONFIG_S3C2416_SETUP_SDHCI */
> >
> >
> >
> > --
> > 1.6.6.1
> >
> >
--
Yauhen Kharuzhy jekhor _at_ gmail.com
JID: jek at jabber.ru
A: No
Q: Should I quote below my post?
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-06-22 13:16 S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Yauhen Kharuzhy
@ 2010-06-25 10:55 ` Darius Augulis
2010-06-28 6:01 ` Marek Szyprowski
1 sibling, 1 reply; 19+ messages in thread
From: Darius Augulis @ 2010-06-25 10:55 UTC (permalink / raw)
To: linux-arm-kernel
On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
> This patch series fixes SDHCI on S3C2416. I got SD card working with this patches
> and with patches for GPIO card detection support by Marek Szyprowski.
>
Unfortunately I did not get SD card working with these patches. I'm
using custom board, not SMDK2416, but SD slot connection and schematics
are the same like in SMDK2416. I've tried to debug a bit this problem
and this is what I got: kernel do detection of card insert/remove,
driver prints messages:
s3c-sdhci s3c-sdhci.1: card inserted.
s3c-sdhci s3c-sdhci.1: card removed.
Then I put some printk in s3c-sdhci driver and MMC core and found that
mmc_rescan() is called only once at startup and no more when
inserting/removing SD card. Also mmc_rescan() stops at that point where
mmc_power_up() is called and does not return. And mmc_power_up() stops
where mmc_delay(10) is called and does not return too.
Every time when inserting/removing SD card only functions
sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
happens. Kernel doesn't detect the card inserted.
Maybe this info could help to debug where the problem is - in my custom
board or in your patches?
Darius.
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-06-25 10:55 ` S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Darius Augulis
@ 2010-06-28 6:01 ` Marek Szyprowski
2010-07-06 17:02 ` Darius Augulis
0 siblings, 1 reply; 19+ messages in thread
From: Marek Szyprowski @ 2010-06-28 6:01 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Friday, June 25, 2010 12:56 PM Darius Augulis wrote:
> On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
> > This patch series fixes SDHCI on S3C2416. I got SD card working with this
> patches
> > and with patches for GPIO card detection support by Marek Szyprowski.
> >
>
> Unfortunately I did not get SD card working with these patches. I'm
> using custom board, not SMDK2416, but SD slot connection and schematics
> are the same like in SMDK2416. I've tried to debug a bit this problem
> and this is what I got: kernel do detection of card insert/remove,
> driver prints messages:
>
> s3c-sdhci s3c-sdhci.1: card inserted.
> s3c-sdhci s3c-sdhci.1: card removed.
>
> Then I put some printk in s3c-sdhci driver and MMC core and found that
> mmc_rescan() is called only once at startup and no more when
> inserting/removing SD card. Also mmc_rescan() stops at that point where
> mmc_power_up() is called and does not return. And mmc_power_up() stops
> where mmc_delay(10) is called and does not return too.
> Every time when inserting/removing SD card only functions
> sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
> happens. Kernel doesn't detect the card inserted.
> Maybe this info could help to debug where the problem is - in my custom
> board or in your patches?
Have you tried with polled card detection method (SDHCI_CD_NONE)? If it
doesn't work I suspect something with the hardware. Checking with mmc debug
enabled might also help figuring this issue out.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-06-28 6:01 ` Marek Szyprowski
@ 2010-07-06 17:02 ` Darius Augulis
2010-07-08 7:23 ` Marek Szyprowski
0 siblings, 1 reply; 19+ messages in thread
From: Darius Augulis @ 2010-07-06 17:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On 06/28/2010 09:01 AM, Marek Szyprowski wrote:
> Hello,
>
> On Friday, June 25, 2010 12:56 PM Darius Augulis wrote:
>
>> On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
>>> This patch series fixes SDHCI on S3C2416. I got SD card working with this
>> patches
>>> and with patches for GPIO card detection support by Marek Szyprowski.
>>>
>>
>> Unfortunately I did not get SD card working with these patches. I'm
>> using custom board, not SMDK2416, but SD slot connection and schematics
>> are the same like in SMDK2416. I've tried to debug a bit this problem
>> and this is what I got: kernel do detection of card insert/remove,
>> driver prints messages:
>>
>> s3c-sdhci s3c-sdhci.1: card inserted.
>> s3c-sdhci s3c-sdhci.1: card removed.
>>
>> Then I put some printk in s3c-sdhci driver and MMC core and found that
>> mmc_rescan() is called only once at startup and no more when
>> inserting/removing SD card. Also mmc_rescan() stops at that point where
>> mmc_power_up() is called and does not return. And mmc_power_up() stops
>> where mmc_delay(10) is called and does not return too.
>> Every time when inserting/removing SD card only functions
>> sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
>> happens. Kernel doesn't detect the card inserted.
>> Maybe this info could help to debug where the problem is - in my custom
>> board or in your patches?
>
> Have you tried with polled card detection method (SDHCI_CD_NONE)? If it
> doesn't work I suspect something with the hardware. Checking with mmc debug
> enabled might also help figuring this issue out.
yes, I've tried that, but didn't get sd card working. I got schematics
from China manufacturer, SD card connection is the same like in
smdk2416. with mmc debug enabled I found that SD card is detected when
inserted or removed, but after detection card initialisation is not
performed.
Darius.
>
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-07-06 17:02 ` Darius Augulis
@ 2010-07-08 7:23 ` Marek Szyprowski
2010-07-08 17:08 ` Darius Augulis
0 siblings, 1 reply; 19+ messages in thread
From: Marek Szyprowski @ 2010-07-08 7:23 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Tuesday, July 06, 2010 7:03 PM Darius Augulis wrote:
> On 06/28/2010 09:01 AM, Marek Szyprowski wrote:
> > Hello,
> >
> > On Friday, June 25, 2010 12:56 PM Darius Augulis wrote:
> >
> >> On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
> >>> This patch series fixes SDHCI on S3C2416. I got SD card working with
> this
> >> patches
> >>> and with patches for GPIO card detection support by Marek Szyprowski.
> >>>
> >>
> >> Unfortunately I did not get SD card working with these patches. I'm
> >> using custom board, not SMDK2416, but SD slot connection and schematics
> >> are the same like in SMDK2416. I've tried to debug a bit this problem
> >> and this is what I got: kernel do detection of card insert/remove,
> >> driver prints messages:
> >>
> >> s3c-sdhci s3c-sdhci.1: card inserted.
> >> s3c-sdhci s3c-sdhci.1: card removed.
> >>
> >> Then I put some printk in s3c-sdhci driver and MMC core and found that
> >> mmc_rescan() is called only once at startup and no more when
> >> inserting/removing SD card. Also mmc_rescan() stops at that point where
> >> mmc_power_up() is called and does not return. And mmc_power_up() stops
> >> where mmc_delay(10) is called and does not return too.
> >> Every time when inserting/removing SD card only functions
> >> sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
> >> happens. Kernel doesn't detect the card inserted.
> >> Maybe this info could help to debug where the problem is - in my custom
> >> board or in your patches?
> >
> > Have you tried with polled card detection method (SDHCI_CD_NONE)? If it
> > doesn't work I suspect something with the hardware. Checking with mmc
> debug
> > enabled might also help figuring this issue out.
>
> yes, I've tried that, but didn't get sd card working. I got schematics
> from China manufacturer, SD card connection is the same like in
> smdk2416. with mmc debug enabled I found that SD card is detected when
> inserted or removed, but after detection card initialisation is not
> performed.
Does it work without my patches or with other Linux kernel? You can try to
check the custom Linux 2.6.29 from
git://git.kernel.org/pub/scm/linux/kernel/git/kki_ap/linux-2.6-samsung.git
I would like to know whether my patches cause the problem or there is some
kind of hardware issue with your board.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-07-08 7:23 ` Marek Szyprowski
@ 2010-07-08 17:08 ` Darius Augulis
2010-10-18 12:30 ` Kukjin Kim
0 siblings, 1 reply; 19+ messages in thread
From: Darius Augulis @ 2010-07-08 17:08 UTC (permalink / raw)
To: linux-arm-kernel
On 07/08/2010 10:23 AM, Marek Szyprowski wrote:
> Hello,
>
> On Tuesday, July 06, 2010 7:03 PM Darius Augulis wrote:
>
>> On 06/28/2010 09:01 AM, Marek Szyprowski wrote:
>>> Hello,
>>>
>>> On Friday, June 25, 2010 12:56 PM Darius Augulis wrote:
>>>
>>>> On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
>>>>> This patch series fixes SDHCI on S3C2416. I got SD card working with
>> this
>>>> patches
>>>>> and with patches for GPIO card detection support by Marek Szyprowski.
>>>>>
>>>>
>>>> Unfortunately I did not get SD card working with these patches. I'm
>>>> using custom board, not SMDK2416, but SD slot connection and schematics
>>>> are the same like in SMDK2416. I've tried to debug a bit this problem
>>>> and this is what I got: kernel do detection of card insert/remove,
>>>> driver prints messages:
>>>>
>>>> s3c-sdhci s3c-sdhci.1: card inserted.
>>>> s3c-sdhci s3c-sdhci.1: card removed.
>>>>
>>>> Then I put some printk in s3c-sdhci driver and MMC core and found that
>>>> mmc_rescan() is called only once at startup and no more when
>>>> inserting/removing SD card. Also mmc_rescan() stops at that point where
>>>> mmc_power_up() is called and does not return. And mmc_power_up() stops
>>>> where mmc_delay(10) is called and does not return too.
>>>> Every time when inserting/removing SD card only functions
>>>> sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
>>>> happens. Kernel doesn't detect the card inserted.
>>>> Maybe this info could help to debug where the problem is - in my custom
>>>> board or in your patches?
>>>
>>> Have you tried with polled card detection method (SDHCI_CD_NONE)? If it
>>> doesn't work I suspect something with the hardware. Checking with mmc
>> debug
>>> enabled might also help figuring this issue out.
>>
>> yes, I've tried that, but didn't get sd card working. I got schematics
>> from China manufacturer, SD card connection is the same like in
>> smdk2416. with mmc debug enabled I found that SD card is detected when
>> inserted or removed, but after detection card initialisation is not
>> performed.
>
> Does it work without my patches or with other Linux kernel? You can try to
> check the custom Linux 2.6.29 from
> git://git.kernel.org/pub/scm/linux/kernel/git/kki_ap/linux-2.6-samsung.git
I did try with and without your patches. First, I applied only s3c2416
realated patches from Yauhen, then I've added your patches, but nothing
changed.
>
> I would like to know whether my patches cause the problem or there is some
> kind of hardware issue with your board.
>
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-07-08 17:08 ` Darius Augulis
@ 2010-10-18 12:30 ` Kukjin Kim
2010-10-18 13:00 ` Darius Augulis
0 siblings, 1 reply; 19+ messages in thread
From: Kukjin Kim @ 2010-10-18 12:30 UTC (permalink / raw)
To: linux-arm-kernel
Darius Augulis wrote:
>
> On 07/08/2010 10:23 AM, Marek Szyprowski wrote:
> > Hello,
> >
> > On Tuesday, July 06, 2010 7:03 PM Darius Augulis wrote:
> >
> >> On 06/28/2010 09:01 AM, Marek Szyprowski wrote:
> >>> Hello,
> >>>
> >>> On Friday, June 25, 2010 12:56 PM Darius Augulis wrote:
> >>>
> >>>> On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
> >>>>> This patch series fixes SDHCI on S3C2416. I got SD card working with
> >> this
> >>>> patches
> >>>>> and with patches for GPIO card detection support by Marek
Szyprowski.
> >>>>>
> >>>>
> >>>> Unfortunately I did not get SD card working with these patches. I'm
> >>>> using custom board, not SMDK2416, but SD slot connection and
schematics
> >>>> are the same like in SMDK2416. I've tried to debug a bit this problem
> >>>> and this is what I got: kernel do detection of card insert/remove,
> >>>> driver prints messages:
> >>>>
> >>>> s3c-sdhci s3c-sdhci.1: card inserted.
> >>>> s3c-sdhci s3c-sdhci.1: card removed.
> >>>>
> >>>> Then I put some printk in s3c-sdhci driver and MMC core and found
that
> >>>> mmc_rescan() is called only once at startup and no more when
> >>>> inserting/removing SD card. Also mmc_rescan() stops at that point
where
> >>>> mmc_power_up() is called and does not return. And mmc_power_up()
stops
> >>>> where mmc_delay(10) is called and does not return too.
> >>>> Every time when inserting/removing SD card only functions
> >>>> sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
> >>>> happens. Kernel doesn't detect the card inserted.
> >>>> Maybe this info could help to debug where the problem is - in my
custom
> >>>> board or in your patches?
> >>>
> >>> Have you tried with polled card detection method (SDHCI_CD_NONE)? If
it
> >>> doesn't work I suspect something with the hardware. Checking with mmc
> >> debug
> >>> enabled might also help figuring this issue out.
> >>
> >> yes, I've tried that, but didn't get sd card working. I got schematics
> >> from China manufacturer, SD card connection is the same like in
> >> smdk2416. with mmc debug enabled I found that SD card is detected when
> >> inserted or removed, but after detection card initialisation is not
> >> performed.
> >
> > Does it work without my patches or with other Linux kernel? You can try
to
> > check the custom Linux 2.6.29 from
> >
git://git.kernel.org/pub/scm/linux/kernel/git/kki_ap/linux-2.6-samsung.git
>
> I did try with and without your patches. First, I applied only s3c2416
> realated patches from Yauhen, then I've added your patches, but nothing
> changed.
>
> >
> > I would like to know whether my patches cause the problem or there is
some
> > kind of hardware issue with your board.
> >
Hi Darius,
Was there any progress about above issue?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-10-18 12:30 ` Kukjin Kim
@ 2010-10-18 13:00 ` Darius Augulis
2010-10-18 13:04 ` Kukjin Kim
0 siblings, 1 reply; 19+ messages in thread
From: Darius Augulis @ 2010-10-18 13:00 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
actually, no. I moved my work from S3C24xx to S3C64xx and didn't test
it anymore.
Regards,
Darius
On Mon, Oct 18, 2010 at 3:30 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Darius Augulis wrote:
>>
>> On 07/08/2010 10:23 AM, Marek Szyprowski wrote:
>> > Hello,
>> >
>> > On Tuesday, July 06, 2010 7:03 PM Darius Augulis wrote:
>> >
>> >> On 06/28/2010 09:01 AM, Marek Szyprowski wrote:
>> >>> Hello,
>> >>>
>> >>> On Friday, June 25, 2010 12:56 PM Darius Augulis wrote:
>> >>>
>> >>>> On 06/22/2010 04:16 PM, Yauhen Kharuzhy wrote:
>> >>>>> This patch series fixes SDHCI on S3C2416. I got SD card working with
>> >> this
>> >>>> patches
>> >>>>> and with patches for GPIO card detection support by Marek
> Szyprowski.
>> >>>>>
>> >>>>
>> >>>> Unfortunately I did not get SD card working with these patches. I'm
>> >>>> using custom board, not SMDK2416, but SD slot connection and
> schematics
>> >>>> are the same like in SMDK2416. I've tried to debug a bit this problem
>> >>>> and this is what I got: kernel do detection of card insert/remove,
>> >>>> driver prints messages:
>> >>>>
>> >>>> s3c-sdhci s3c-sdhci.1: card inserted.
>> >>>> s3c-sdhci s3c-sdhci.1: card removed.
>> >>>>
>> >>>> Then I put some printk in s3c-sdhci driver and MMC core and found
> that
>> >>>> mmc_rescan() is called only once at startup and no more when
>> >>>> inserting/removing SD card. Also mmc_rescan() stops at that point
> where
>> >>>> mmc_power_up() is called and does not return. And mmc_power_up()
> stops
>> >>>> where mmc_delay(10) is called and does not return too.
>> >>>> Every time when inserting/removing SD card only functions
>> >>>> sdhci_tasklet_card() and mmc_detect_change() are called, and nothing
>> >>>> happens. Kernel doesn't detect the card inserted.
>> >>>> Maybe this info could help to debug where the problem is - in my
> custom
>> >>>> board or in your patches?
>> >>>
>> >>> Have you tried with polled card detection method (SDHCI_CD_NONE)? If
> it
>> >>> doesn't work I suspect something with the hardware. Checking with mmc
>> >> debug
>> >>> enabled might also help figuring this issue out.
>> >>
>> >> yes, I've tried that, but didn't get sd card working. I got schematics
>> >> from China manufacturer, SD card connection is the same like in
>> >> smdk2416. with mmc debug enabled I found that SD card is detected when
>> >> inserted or removed, but after detection card initialisation is not
>> >> performed.
>> >
>> > Does it work without my patches or with other Linux kernel? You can try
> to
>> > check the custom Linux 2.6.29 from
>> >
> git://git.kernel.org/pub/scm/linux/kernel/git/kki_ap/linux-2.6-samsung.git
>>
>> I did try with and without your patches. First, I applied only s3c2416
>> realated patches from Yauhen, then I've added your patches, but nothing
>> changed.
>>
>> >
>> > I would like to know whether my patches cause the problem or there is
> some
>> > kind of hardware issue with your board.
>> >
>
> Hi Darius,
>
> Was there any progress about above issue?
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-10-18 13:00 ` Darius Augulis
@ 2010-10-18 13:04 ` Kukjin Kim
2010-10-18 13:11 ` Darius Augulis
0 siblings, 1 reply; 19+ messages in thread
From: Kukjin Kim @ 2010-10-18 13:04 UTC (permalink / raw)
To: linux-arm-kernel
Darius Augulis wrote:
>
> Hi,
>
> actually, no. I moved my work from S3C24xx to S3C64xx and didn't test
> it anymore.
>
Oh, ok...maybe mini6410 and real6410? ;-)
...I didn't get S3C24XX stuff in my mailbox...so missed it.
Anyway ok...will sort it out soon.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 19+ messages in thread
* S3C2416 fixes (gpiolib, SDHCI, compilation without FB device)
2010-10-18 13:04 ` Kukjin Kim
@ 2010-10-18 13:11 ` Darius Augulis
0 siblings, 0 replies; 19+ messages in thread
From: Darius Augulis @ 2010-10-18 13:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Oct 18, 2010 at 4:04 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Darius Augulis wrote:
>>
>> Hi,
>>
>> actually, no. I moved my work from S3C24xx to S3C64xx and didn't test
>> it anymore.
>>
> Oh, ok...maybe mini6410 and real6410? ;-)
yes. while talking about this - what is state of my s3c64xx patches for next?
are you going to merge them or Ben should do this?
>
> ...I didn't get S3C24XX stuff in my mailbox...so missed it.
> Anyway ok...will sort it out soon.
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2010-10-18 13:11 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 13:16 S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 2/4] ARM: S3C2416: Set name of the framebuffer device only if it present Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 3/4] ARM: S3C2416: Add clock definition for HSMMC1 Yauhen Kharuzhy
2010-06-22 13:16 ` [PATCH 4/4] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
2010-06-22 13:19 ` Maurus Cuelenaere
2010-06-22 14:05 ` Yauhen Kharuzhy
2010-06-22 13:45 ` Darius Augulis
2010-06-22 14:19 ` Yauhen Kharuzhy
2010-06-22 13:40 ` [PATCH 1/4] ARM: S3C24XX: Fix gpiolib support for ports K..M Vasily Khoruzhick
2010-06-25 10:55 ` S3C2416 fixes (gpiolib, SDHCI, compilation without FB device) Darius Augulis
2010-06-28 6:01 ` Marek Szyprowski
2010-07-06 17:02 ` Darius Augulis
2010-07-08 7:23 ` Marek Szyprowski
2010-07-08 17:08 ` Darius Augulis
2010-10-18 12:30 ` Kukjin Kim
2010-10-18 13:00 ` Darius Augulis
2010-10-18 13:04 ` Kukjin Kim
2010-10-18 13:11 ` Darius Augulis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).