All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
@ 2010-11-28 18:30 Yauhen Kharuzhy
  2010-11-28 18:30 ` [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0 Yauhen Kharuzhy
                   ` (9 more replies)
  0 siblings, 10 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

Enable compilation of platform devices and initialization code used in
SMDK2416 board file.

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 arch/arm/mach-s3c2416/Kconfig |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
index 87b9c9f..27b3e7c 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -35,9 +35,12 @@ menu "S3C2416 Machines"
 config MACH_SMDK2416
 	bool "SMDK2416"
 	select CPU_S3C2416
+	select MACH_SMDK
 	select S3C_DEV_FB
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
+	select S3C_DEV_NAND
+	select S3C_DEV_USB_HOST
 	select S3C2416_PM if PM
 	help
 	  Say Y here if you are using an SMDK2416
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-30  7:21   ` Kukjin Kim
  2010-11-28 18:30 ` [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

Define maps for HSMMC devices.

S3C2443 has one HSMMC device with base address 0x4A800000.
S3C2416 has HSMMC0 at 0x4AC00000 and HSMMC1 at 0x4A800000.

So suppose that S3C2443 has only HSMMC1.

Define clock for hsmmc0 device and register it.

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 arch/arm/mach-s3c2410/include/mach/irqs.h          |    4 ++--
 arch/arm/mach-s3c2410/include/mach/map.h           |    4 ++--
 .../mach-s3c2410/include/mach/regs-s3c2443-clock.h |    1 +
 arch/arm/mach-s3c2416/clock.c                      |   18 +++++++++++++-----
 arch/arm/mach-s3c2443/Kconfig                      |    2 +-
 arch/arm/mach-s3c2443/clock.c                      |    4 ++--
 arch/arm/mach-s3c2443/mach-smdk2443.c              |    2 +-
 arch/arm/plat-s3c24xx/s3c2443-clock.c              |    2 +-
 8 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
index 11bb0f0..e5a68ea 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
@@ -152,8 +152,8 @@
 
 #define IRQ_S3C2416_HSMMC0	S3C2410_IRQ(21)		/* S3C2416/S3C2450 */
 
-#define IRQ_HSMMC0		IRQ_S3C2443_HSMMC
-#define IRQ_HSMMC1		IRQ_S3C2416_HSMMC0
+#define IRQ_HSMMC0		IRQ_S3C2416_HSMMC0
+#define IRQ_HSMMC1		IRQ_S3C2443_HSMMC
 
 #define IRQ_S3C2443_LCD1	S3C2410_IRQSUB(14)
 #define IRQ_S3C2443_LCD2	S3C2410_IRQSUB(15)
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index cd3983a..25bbf5a 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -112,8 +112,8 @@
 #define S3C_PA_IIC          S3C2410_PA_IIC
 #define S3C_PA_UART	    S3C24XX_PA_UART
 #define S3C_PA_USBHOST	S3C2410_PA_USBHOST
-#define S3C_PA_HSMMC0	    S3C2443_PA_HSMMC
-#define S3C_PA_HSMMC1	    S3C2416_PA_HSMMC0
+#define S3C_PA_HSMMC0	    S3C2416_PA_HSMMC0
+#define S3C_PA_HSMMC1	    S3C2443_PA_HSMMC
 #define S3C_PA_WDT	    S3C2410_PA_WATCHDOG
 #define S3C_PA_NAND	    S3C24XX_PA_NAND
 
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 101aeea..44494a5 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..3b02d85 100644
--- a/arch/arm/mach-s3c2416/clock.c
+++ b/arch/arm/mach-s3c2416/clock.c
@@ -38,12 +38,11 @@ static unsigned int armdiv[8] = {
 	[7] = 8,
 };
 
-/* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */
 static struct clksrc_clk hsmmc_div[] = {
 	[0] = {
 		.clk = {
 			.name	= "hsmmc-div",
-			.id	= 1,
+			.id	= 0,
 			.parent	= &clk_esysclk.clk,
 		},
 		.reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 },
@@ -51,7 +50,7 @@ static struct clksrc_clk hsmmc_div[] = {
 	[1] = {
 		.clk = {
 			.name	= "hsmmc-div",
-			.id	= 0,
+			.id	= 1,
 			.parent	= &clk_esysclk.clk,
 		},
 		.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
@@ -61,7 +60,7 @@ static struct clksrc_clk hsmmc_div[] = {
 static struct clksrc_clk hsmmc_mux[] = {
 	[0] = {
 		.clk	= {
-			.id	= 1,
+			.id	= 0,
 			.name	= "hsmmc-if",
 			.ctrlbit = (1 << 6),
 			.enable = s3c2443_clkcon_enable_s,
@@ -77,7 +76,7 @@ static struct clksrc_clk hsmmc_mux[] = {
 	},
 	[1] = {
 		.clk	= {
-			.id	= 0,
+			.id	= 1,
 			.name	= "hsmmc-if",
 			.ctrlbit = (1 << 12),
 			.enable = s3c2443_clkcon_enable_s,
@@ -93,6 +92,13 @@ static struct clksrc_clk hsmmc_mux[] = {
 	},
 };
 
+static struct clk hsmmc0_clk = {
+	.name		= "hsmmc",
+	.id		= 0,
+	.parent		= &clk_h,
+	.enable		= s3c2443_clkcon_enable_h,
+	.ctrlbit	= S3C2416_HCLKCON_HSMMC0,
+};
 
 static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0)
 {
@@ -130,6 +136,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(&hsmmc0_clk);
+
 	s3c_pwmclk_init();
 
 }
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index 4fef723..0b7f0d6 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -24,7 +24,7 @@ config MACH_SMDK2443
 	bool "SMDK2443"
 	select CPU_S3C2443
 	select MACH_SMDK
-	select S3C_DEV_HSMMC
+	select S3C_DEV_HSMMC1
 	help
 	  Say Y here if you are using an SMDK2443
 
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 0c3c0c8..f4ec6d5 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -196,7 +196,7 @@ static struct clksrc_clk clk_hsspi = {
 static struct clksrc_clk clk_hsmmc_div = {
 	.clk	= {
 		.name		= "hsmmc-div",
-		.id		= -1,
+		.id		= 1,
 		.parent		= &clk_esysclk.clk,
 	},
 	.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
@@ -231,7 +231,7 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int enable)
 
 static struct clk clk_hsmmc = {
 	.name		= "hsmmc-if",
-	.id		= -1,
+	.id		= 1,
 	.parent		= &clk_hsmmc_div.clk,
 	.enable		= s3c2443_enable_hsmmc,
 	.ops		= &(struct clk_ops) {
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index 4337f0a..d3b2922 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -105,7 +105,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
 static struct platform_device *smdk2443_devices[] __initdata = {
 	&s3c_device_wdt,
 	&s3c_device_i2c0,
-	&s3c_device_hsmmc0,
+	&s3c_device_hsmmc1,
 #ifdef CONFIG_SND_SOC_SMDK2443_WM9710
 	&s3c_device_ac97,
 #endif
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c
index 461f070..82f2d4a 100644
--- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
@@ -271,7 +271,7 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= S3C2443_HCLKCON_DMA5,
 	}, {
 		.name		= "hsmmc",
-		.id		= 0,
+		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_HSMMC,
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
  2010-11-28 18:30 ` [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0 Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-30  7:37   ` Kukjin Kim
  2010-11-28 18:30 ` [PATCH 04/10] ARM: S3C2416: Add support of SD/MMC card detect on SMDK2416 Yauhen Kharuzhy
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 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              |   12 +++++
 arch/arm/mach-s3c2416/Makefile             |    4 ++
 arch/arm/mach-s3c2416/s3c2416.c            |    5 ++
 arch/arm/mach-s3c2416/setup-sdhci-gpio.c   |   58 ++++++++++++++++++++++++++
 arch/arm/mach-s3c2416/setup-sdhci.c        |   62 ++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/sdhci.h |   35 ++++++++++++++++
 6 files changed, 176 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 27b3e7c..2eaadcf 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -30,6 +30,17 @@ config S3C2416_PM
 	help
 	  Internal config node to apply S3C2416 power management
 
+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
@@ -41,6 +52,7 @@ config MACH_SMDK2416
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_NAND
 	select S3C_DEV_USB_HOST
+	select S3C2416_SETUP_SDHCI
 	select S3C2416_PM if PM
 	help
 	  Say Y here if you are using an SMDK2416
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
index ef038d6..7b805b2 100644
--- a/arch/arm/mach-s3c2416/Makefile
+++ b/arch/arm/mach-s3c2416/Makefile
@@ -14,6 +14,10 @@ obj-$(CONFIG_CPU_S3C2416)	+= irq.o
 obj-$(CONFIG_S3C2416_PM)	+= pm.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
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 63f39cd..ba7fd87 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>
 #include <plat/fb-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..68ac523
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
@@ -0,0 +1,58 @@
+/* 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>
+
+void s3c2416_setup_sdhci0_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_sdhci1_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 85853f8..81d801e 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -121,6 +121,8 @@ extern void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
 extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
 extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
 extern void s5pv310_setup_sdhci3_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);
 
 /* S3C64XX SDHCI setup */
 
@@ -299,6 +301,39 @@ static inline void s5pv210_default_sdhci3(void) { }
 
 #endif /* CONFIG_S5PV210_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 */
+
 /* S5PV310 SDHCI setup */
 #ifdef CONFIG_S5PV310_SETUP_SDHCI
 extern char *s5pv310_hsmmc_clksrcs[4];
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 04/10] ARM: S3C2416: Add support of SD/MMC card detect on SMDK2416
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
  2010-11-28 18:30 ` [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0 Yauhen Kharuzhy
  2010-11-28 18:30 ` [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-28 18:30 ` [PATCH 05/10] ARM S3C2443: Select properly ARM core type Yauhen Kharuzhy
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

Enable card detect by GPIO pin on hsmmc1 device (SD0 on SMDK2416
board) and enable card polling on hsmmc0 (SD1).

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 arch/arm/mach-s3c2416/mach-smdk2416.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index 7fc3664..ad2497c 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -46,6 +46,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/nand.h>
+#include <plat/sdhci.h>
 
 #include <plat/regs-fb-v4.h>
 #include <plat/fb.h>
@@ -159,6 +160,18 @@ static struct s3c_fb_platdata smdk2416_fb_platdata = {
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 };
 
+static struct s3c_sdhci_platdata smdk2416_hsmmc0_pdata __initdata = {
+	.max_width		= 4,
+	.cd_type		= S3C_SDHCI_CD_GPIO,
+	.ext_cd_gpio		= S3C2410_GPF(1),
+	.ext_cd_gpio_invert	= 1,
+};
+
+static struct s3c_sdhci_platdata smdk2416_hsmmc1_pdata __initdata = {
+	.max_width		= 4,
+	.cd_type		= S3C_SDHCI_CD_NONE,
+};
+
 static struct platform_device *smdk2416_devices[] __initdata = {
 	&s3c_device_fb,
 	&s3c_device_wdt,
@@ -180,6 +193,9 @@ static void __init smdk2416_machine_init(void)
 	s3c_i2c0_set_platdata(NULL);
 	s3c_fb_set_platdata(&smdk2416_fb_platdata);
 
+	s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata);
+	s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata);
+
 	gpio_request(S3C2410_GPB(4), "USBHost Power");
 	gpio_direction_output(S3C2410_GPB(4), 1);
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 05/10] ARM S3C2443: Select properly ARM core type
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (2 preceding siblings ...)
  2010-11-28 18:30 ` [PATCH 04/10] ARM: S3C2416: Add support of SD/MMC card detect on SMDK2416 Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-29 11:08   ` Kukjin Kim
  2010-11-30  8:45   ` Ben Dooks
  2010-11-28 18:30 ` [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards Yauhen Kharuzhy
                   ` (5 subsequent siblings)
  9 siblings, 2 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>

Select ARM920T core when compiling kernel for s3c2443.

Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
---
 arch/arm/mach-s3c2443/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index 0b7f0d6..8814031 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -5,6 +5,7 @@
 config CPU_S3C2443
 	bool
 	depends on ARCH_S3C2410
+	select CPU_ARM920T
 	select S3C2443_DMA if S3C2410_DMA
 	select CPU_LLSERIAL_S3C2440
 	select SAMSUNG_CLKSRC
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (3 preceding siblings ...)
  2010-11-28 18:30 ` [PATCH 05/10] ARM S3C2443: Select properly ARM core type Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-30  7:45   ` Kukjin Kim
  2010-11-28 18:30 ` [PATCH 07/10] ARM S3C2443: Implement GPIO pull-up/down configuration methods Yauhen Kharuzhy
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>

Common SMDK code uses s3c_device_nand, but doesn't select it in Kconfig.

Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
---
 arch/arm/plat-s3c24xx/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 5a27b1b..f3e22f9 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -155,6 +155,7 @@ config S3C2412_IOTIMING
 
 config MACH_SMDK
 	bool
+	select S3C_DEV_NAND
 	help
 	  Common machine code for SMDK2410 and SMDK2440
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 07/10] ARM S3C2443: Implement GPIO pull-up/down configuration methods
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (4 preceding siblings ...)
  2010-11-28 18:30 ` [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-30  8:10   ` Kukjin Kim
  2010-11-28 18:30 ` [PATCH 08/10] ARM SAMSUNG: Don't export __init functions to modules Yauhen Kharuzhy
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>

S3C2443 has two-bits pull-up/pull-down configuration fields in GPIO
registers, but values are differ from other SoCs with two-bits
configuration. gpio-cfg-helpers.h already has prototypes for
s3c2443-style pull-up/down methods, so implement them.

Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
---
 arch/arm/mach-s3c2443/Kconfig                      |    1 +
 arch/arm/mach-s3c2443/s3c2443.c                    |    7 +++
 arch/arm/plat-samsung/Kconfig                      |    6 +++
 arch/arm/plat-samsung/gpio-config.c                |   42 ++++++++++++++++++++
 .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    2 +-
 5 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index 8814031..d8eb868 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -10,6 +10,7 @@ config CPU_S3C2443
 	select CPU_LLSERIAL_S3C2440
 	select SAMSUNG_CLKSRC
 	select S3C2443_CLOCK
+	select S3C_GPIO_PULL_S3C2443
 	help
 	  Support for the S3C2443 SoC from the S3C24XX line
 
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index 33d18dd..e6a28ba 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -16,6 +16,7 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/gpio.h>
 #include <linux/platform_device.h>
 #include <linux/serial_core.h>
 #include <linux/sysdev.h>
@@ -32,6 +33,9 @@
 #include <mach/regs-s3c2443-clock.h>
 #include <mach/reset.h>
 
+#include <plat/gpio-core.h>
+#include <plat/gpio-cfg.h>
+#include <plat/gpio-cfg-helpers.h>
 #include <plat/s3c2443.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
@@ -86,6 +90,9 @@ void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 
 void __init s3c2443_map_io(void)
 {
+	s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443;
+	s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443;
+
 	iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
 }
 
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index dcd6eff..4ecb155 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -95,6 +95,12 @@ config S3C_GPIO_PULL_UPDOWN
 	help
 	  Internal configuration to enable the correct GPIO pull helper
 
+config S3C_GPIO_PULL_S3C2443
+	bool
+	select S3C_GPIO_PULL_UPDOWN
+	help
+	  Internal configuration to enable the correct GPIO pull helper for S3C2443-style GPIO
+
 config S3C_GPIO_PULL_DOWN
 	bool
 	help
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index b732b77..6eeb20b 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -278,6 +278,48 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip,
 	pup &= 0x3;
 	return (__force s3c_gpio_pull_t)pup;
 }
+
+#ifdef CONFIG_S3C_GPIO_PULL_S3C2443
+int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
+				unsigned int off, s3c_gpio_pull_t pull)
+{
+	switch (pull) {
+	case S3C_GPIO_PULL_NONE:
+		pull = 0x01;
+		break;
+	case S3C_GPIO_PULL_UP:
+		pull = 0x00;
+		break;
+	case S3C_GPIO_PULL_DOWN:
+		pull = 0x02;
+		break;
+	}
+	return s3c_gpio_setpull_updown(chip, off, pull);
+}
+
+s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
+					unsigned int off)
+{
+	s3c_gpio_pull_t pull;
+
+	pull = s3c_gpio_getpull_updown(chip, off);
+
+	switch (pull) {
+	case 0x00:
+		pull = S3C_GPIO_PULL_UP;
+		break;
+	case 0x01:
+	case 0x03:
+		pull = S3C_GPIO_PULL_NONE;
+		break;
+	case 0x02:
+		pull = S3C_GPIO_PULL_DOWN;
+		break;
+	}
+
+	return pull;
+}
+#endif
 #endif
 
 #ifdef CONFIG_S3C_GPIO_PULL_UP
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
index 8fd65d8..b3bd3e8 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
@@ -233,7 +233,7 @@ extern int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
  * This helper function reads the state of the pull-{up,down} resistor for the
  * given GPIO in the same case as s3c_gpio_setpull_upown.
 */
-extern s3c_gpio_pull_t s3c_gpio_getpull_s3c24xx(struct s3c_gpio_chip *chip,
+extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
 						unsigned int off);
 
 #endif /* __PLAT_GPIO_CFG_HELPERS_H */
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 08/10] ARM SAMSUNG: Don't export __init functions to modules
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (5 preceding siblings ...)
  2010-11-28 18:30 ` [PATCH 07/10] ARM S3C2443: Implement GPIO pull-up/down configuration methods Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-28 18:30 ` [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition Yauhen Kharuzhy
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

There are few functions marked as __init, but exported to modules in
devices declaration files.

s3c_nand_set_platdata() and s3c24xx_ts_set_platdata() are used only by
boards init code now, so remove EXPORT_SYMBOL() for them.

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 arch/arm/plat-s3c24xx/devs.c     |    1 -
 arch/arm/plat-samsung/dev-nand.c |    2 --
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 2f91057..10ce666 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -194,7 +194,6 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_
 	memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info));
 	s3c_device_ts.dev.platform_data = &s3c2410ts_info;
 }
-EXPORT_SYMBOL(s3c24xx_ts_set_platdata);
 
 /* USB Device (Gadget)*/
 
diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
index 3a7b889..6927ae8 100644
--- a/arch/arm/plat-samsung/dev-nand.c
+++ b/arch/arm/plat-samsung/dev-nand.c
@@ -126,5 +126,3 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
 
 	s3c_device_nand.dev.platform_data = npd;
 }
-
-EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (6 preceding siblings ...)
  2010-11-28 18:30 ` [PATCH 08/10] ARM SAMSUNG: Don't export __init functions to modules Yauhen Kharuzhy
@ 2010-11-28 18:30 ` Yauhen Kharuzhy
  2010-11-30  7:38   ` Kukjin Kim
  2010-11-30  8:47   ` Ben Dooks
  2010-11-29 10:51 ` [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Kukjin Kim
  2010-11-30  8:33 ` Ben Dooks
  9 siblings, 2 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-28 18:30 UTC (permalink / raw)
  To: linux-arm-kernel

Dependency on (CPU_S3C2416 is not selected) was defined as "!CPU_2416",
instead of "!CPU_S3C2416". Fix it.

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 arch/arm/mach-s3c2412/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index cef6a65..fa2e5bf 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -16,7 +16,7 @@ config CPU_S3C2412
 config CPU_S3C2412_ONLY
 	bool
 	depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \
-		   !CPU_2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
+		   !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
 		   !CPU_S3C2443 && CPU_S3C2412
 	default y if CPU_S3C2412
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (7 preceding siblings ...)
  2010-11-28 18:30 ` [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition Yauhen Kharuzhy
@ 2010-11-29 10:51 ` Kukjin Kim
  2010-11-29 11:22   ` Yauhen Kharuzhy
  2010-11-30  8:33 ` Ben Dooks
  9 siblings, 1 reply; 33+ messages in thread
From: Kukjin Kim @ 2010-11-29 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> Enable compilation of platform devices and initialization code used in
> SMDK2416 board file.
> 
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> ---
>  arch/arm/mach-s3c2416/Kconfig |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
> index 87b9c9f..27b3e7c 100644
> --- a/arch/arm/mach-s3c2416/Kconfig
> +++ b/arch/arm/mach-s3c2416/Kconfig
> @@ -35,9 +35,12 @@ menu "S3C2416 Machines"
>  config MACH_SMDK2416
>  	bool "SMDK2416"
>  	select CPU_S3C2416
> +	select MACH_SMDK

No need to add this here.
According to mach-s3c2416/Kconfig, CPU_S3C2416 depends on ARCH_S3C2410.
Actually only selected it when selected ARCH_S3C24XX...

But I think need to sort out selection for S3C24XX in Kconfig.

>  	select S3C_DEV_FB
>  	select S3C_DEV_HSMMC
>  	select S3C_DEV_HSMMC1
> +	select S3C_DEV_NAND
> +	select S3C_DEV_USB_HOST

Probably, did you test NAND and USB_HOST on board?

>  	select S3C2416_PM if PM
>  	help
>  	  Say Y here if you are using an SMDK2416
> --


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] 33+ messages in thread

* [PATCH 05/10] ARM S3C2443: Select properly ARM core type
  2010-11-28 18:30 ` [PATCH 05/10] ARM S3C2443: Select properly ARM core type Yauhen Kharuzhy
@ 2010-11-29 11:08   ` Kukjin Kim
  2010-11-29 11:25     ` Yauhen Kharuzhy
  2010-11-30  8:45   ` Ben Dooks
  1 sibling, 1 reply; 33+ messages in thread
From: Kukjin Kim @ 2010-11-29 11:08 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> 
Your e-mail changed?

> Select ARM920T core when compiling kernel for s3c2443.
> 
> Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> ---
>  arch/arm/mach-s3c2443/Kconfig |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
> index 0b7f0d6..8814031 100644
> --- a/arch/arm/mach-s3c2443/Kconfig
> +++ b/arch/arm/mach-s3c2443/Kconfig
> @@ -5,6 +5,7 @@
>  config CPU_S3C2443
>  	bool
>  	depends on ARCH_S3C2410
> +	select CPU_ARM920T
>  	select S3C2443_DMA if S3C2410_DMA
>  	select CPU_LLSERIAL_S3C2440
>  	select SAMSUNG_CLKSRC
> --

This is ok to me.

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] 33+ messages in thread

* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
  2010-11-29 10:51 ` [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Kukjin Kim
@ 2010-11-29 11:22   ` Yauhen Kharuzhy
  2010-12-03 12:25     ` Kukjin Kim
  0 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-29 11:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 29, 2010 at 07:51:56PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy wrote:
> > 
> > Enable compilation of platform devices and initialization code used in
> > SMDK2416 board file.
> > 
> > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> > ---
> >  arch/arm/mach-s3c2416/Kconfig |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
> > index 87b9c9f..27b3e7c 100644
> > --- a/arch/arm/mach-s3c2416/Kconfig
> > +++ b/arch/arm/mach-s3c2416/Kconfig
> > @@ -35,9 +35,12 @@ menu "S3C2416 Machines"
> >  config MACH_SMDK2416
> >  	bool "SMDK2416"
> >  	select CPU_S3C2416
> > +	select MACH_SMDK
> 
> No need to add this here.

SMDK2416 board code uses generic SMDK code, so it should be compiled
also.

> According to mach-s3c2416/Kconfig, CPU_S3C2416 depends on ARCH_S3C2410.
> Actually only selected it when selected ARCH_S3C24XX...

Can you clarify this?

> 
> But I think need to sort out selection for S3C24XX in Kconfig.

> >  	select S3C_DEV_FB
> >  	select S3C_DEV_HSMMC
> >  	select S3C_DEV_HSMMC1
> > +	select S3C_DEV_NAND
> > +	select S3C_DEV_USB_HOST
> 
> Probably, did you test NAND and USB_HOST on board?
Yes, but one year ago. I don't have access to SMDK2416 anymore and usually
test my patches on another S3C2416 board (e-book reader prototype).

Without selection of S3C_DEV_NAND & S3C_DEV_USB_HOST mach-smdk2416.c
doesn't compile, so we should either enable this platform devices
definitions, either remove this devices from board file.

> 
> >  	select S3C2416_PM if PM
> >  	help
> >  	  Say Y here if you are using an SMDK2416
> > --
 

-- 
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] 33+ messages in thread

* [PATCH 05/10] ARM S3C2443: Select properly ARM core type
  2010-11-29 11:08   ` Kukjin Kim
@ 2010-11-29 11:25     ` Yauhen Kharuzhy
  0 siblings, 0 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-29 11:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 29, 2010 at 08:08:38PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy wrote:
> > 
> > From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> > 
> Your e-mail changed?
No, above is my e-mail at my primary job. I use it for patches which were made for my employer.

> > Select ARM920T core when compiling kernel for s3c2443.
> > 
> > Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> > ---
> >  arch/arm/mach-s3c2443/Kconfig |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
> > index 0b7f0d6..8814031 100644
> > --- a/arch/arm/mach-s3c2443/Kconfig
> > +++ b/arch/arm/mach-s3c2443/Kconfig
> > @@ -5,6 +5,7 @@
> >  config CPU_S3C2443
> >  	bool
> >  	depends on ARCH_S3C2410
> > +	select CPU_ARM920T
> >  	select S3C2443_DMA if S3C2410_DMA
> >  	select CPU_LLSERIAL_S3C2440
> >  	select SAMSUNG_CLKSRC
> > --
> 
> This is ok to me.
> 
> Thanks.
> 
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> 

-- 
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] 33+ messages in thread

* [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0
  2010-11-28 18:30 ` [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0 Yauhen Kharuzhy
@ 2010-11-30  7:21   ` Kukjin Kim
  2010-11-30  8:21     ` Yauhen Kharuzhy
  0 siblings, 1 reply; 33+ messages in thread
From: Kukjin Kim @ 2010-11-30  7:21 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> Define maps for HSMMC devices.
> 
> S3C2443 has one HSMMC device with base address 0x4A800000.

Hmm...according to data sheet, there are two SD/MMC on S3C2443.
The base address of channel 0 is 0x4A800000 and channel 1 is 0x5A000000.
So, need to update your patch.

> S3C2416 has HSMMC0 at 0x4AC00000 and HSMMC1 at 0x4A800000.
> 
> So suppose that S3C2443 has only HSMMC1.
> 
Hmm...

> Define clock for hsmmc0 device and register it.
> 
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>

I meant you used different here so asked...anyway...

> ---
>  arch/arm/mach-s3c2410/include/mach/irqs.h          |    4 ++--
>  arch/arm/mach-s3c2410/include/mach/map.h           |    4 ++--
>  .../mach-s3c2410/include/mach/regs-s3c2443-clock.h |    1 +
>  arch/arm/mach-s3c2416/clock.c                      |   18
+++++++++++++-----
>  arch/arm/mach-s3c2443/Kconfig                      |    2 +-
>  arch/arm/mach-s3c2443/clock.c                      |    4 ++--
>  arch/arm/mach-s3c2443/mach-smdk2443.c              |    2 +-
>  arch/arm/plat-s3c24xx/s3c2443-clock.c              |    2 +-
>  8 files changed, 23 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-
> s3c2410/include/mach/irqs.h
> index 11bb0f0..e5a68ea 100644
> --- a/arch/arm/mach-s3c2410/include/mach/irqs.h
> +++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
> @@ -152,8 +152,8 @@
> 
>  #define IRQ_S3C2416_HSMMC0	S3C2410_IRQ(21)		/*
> S3C2416/S3C2450 */
> 
> -#define IRQ_HSMMC0		IRQ_S3C2443_HSMMC
> -#define IRQ_HSMMC1		IRQ_S3C2416_HSMMC0
> +#define IRQ_HSMMC0		IRQ_S3C2416_HSMMC0
> +#define IRQ_HSMMC1		IRQ_S3C2443_HSMMC
> 
Hmm...yeah, IRQ_HSMMC0 is (21) and IRQ_HSMMC1 is (20).

>  #define IRQ_S3C2443_LCD1	S3C2410_IRQSUB(14)
>  #define IRQ_S3C2443_LCD2	S3C2410_IRQSUB(15)
> diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-
> s3c2410/include/mach/map.h
> index cd3983a..25bbf5a 100644
> --- a/arch/arm/mach-s3c2410/include/mach/map.h
> +++ b/arch/arm/mach-s3c2410/include/mach/map.h
> @@ -112,8 +112,8 @@
>  #define S3C_PA_IIC          S3C2410_PA_IIC
>  #define S3C_PA_UART	    S3C24XX_PA_UART
>  #define S3C_PA_USBHOST	S3C2410_PA_USBHOST
> -#define S3C_PA_HSMMC0	    S3C2443_PA_HSMMC
> -#define S3C_PA_HSMMC1	    S3C2416_PA_HSMMC0
> +#define S3C_PA_HSMMC0	    S3C2416_PA_HSMMC0
> +#define S3C_PA_HSMMC1	    S3C2443_PA_HSMMC

Please refer to my previous comment.
S3C2443 has 2 channel.

>  #define S3C_PA_WDT	    S3C2410_PA_WATCHDOG
>  #define S3C_PA_NAND	    S3C24XX_PA_NAND
> 
> 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 101aeea..44494a5 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)

Right.

>  #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..3b02d85 100644
> --- a/arch/arm/mach-s3c2416/clock.c
> +++ b/arch/arm/mach-s3c2416/clock.c
> @@ -38,12 +38,11 @@ static unsigned int armdiv[8] = {
>  	[7] = 8,
>  };
> 
> -/* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */

Why remove?

>  static struct clksrc_clk hsmmc_div[] = {
>  	[0] = {
>  		.clk = {
>  			.name	= "hsmmc-div",
> -			.id	= 1,
> +			.id	= 0,
>  			.parent	= &clk_esysclk.clk,
>  		},
>  		.reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6
},
> @@ -51,7 +50,7 @@ static struct clksrc_clk hsmmc_div[] = {
>  	[1] = {
>  		.clk = {
>  			.name	= "hsmmc-div",
> -			.id	= 0,
> +			.id	= 1,
>  			.parent	= &clk_esysclk.clk,
>  		},
>  		.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6
},
> @@ -61,7 +60,7 @@ static struct clksrc_clk hsmmc_div[] = {
>  static struct clksrc_clk hsmmc_mux[] = {
>  	[0] = {
>  		.clk	= {
> -			.id	= 1,
> +			.id	= 0,
>  			.name	= "hsmmc-if",
>  			.ctrlbit = (1 << 6),
>  			.enable = s3c2443_clkcon_enable_s,
> @@ -77,7 +76,7 @@ static struct clksrc_clk hsmmc_mux[] = {
>  	},
>  	[1] = {
>  		.clk	= {
> -			.id	= 0,
> +			.id	= 1,
>  			.name	= "hsmmc-if",
>  			.ctrlbit = (1 << 12),
>  			.enable = s3c2443_clkcon_enable_s,
> @@ -93,6 +92,13 @@ static struct clksrc_clk hsmmc_mux[] = {
>  	},
>  };
> 
> +static struct clk hsmmc0_clk = {
> +	.name		= "hsmmc",
> +	.id		= 0,
> +	.parent		= &clk_h,
> +	.enable		= s3c2443_clkcon_enable_h,
> +	.ctrlbit	= S3C2416_HCLKCON_HSMMC0,
> +};
> 
>  static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0)
>  {
> @@ -130,6 +136,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(&hsmmc0_clk);
> +
>  	s3c_pwmclk_init();
> 
>  }
> diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
> index 4fef723..0b7f0d6 100644
> --- a/arch/arm/mach-s3c2443/Kconfig
> +++ b/arch/arm/mach-s3c2443/Kconfig
> @@ -24,7 +24,7 @@ config MACH_SMDK2443
>  	bool "SMDK2443"
>  	select CPU_S3C2443
>  	select MACH_SMDK
> -	select S3C_DEV_HSMMC
> +	select S3C_DEV_HSMMC1

Please check S3C2443's HSMMC...

>  	help
>  	  Say Y here if you are using an SMDK2443
> 
> diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
> index 0c3c0c8..f4ec6d5 100644
> --- a/arch/arm/mach-s3c2443/clock.c
> +++ b/arch/arm/mach-s3c2443/clock.c
> @@ -196,7 +196,7 @@ static struct clksrc_clk clk_hsspi = {
>  static struct clksrc_clk clk_hsmmc_div = {
>  	.clk	= {
>  		.name		= "hsmmc-div",
> -		.id		= -1,
> +		.id		= 1,
>  		.parent		= &clk_esysclk.clk,
>  	},
>  	.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
> @@ -231,7 +231,7 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int
> enable)
> 
>  static struct clk clk_hsmmc = {
>  	.name		= "hsmmc-if",
> -	.id		= -1,
> +	.id		= 1,
>  	.parent		= &clk_hsmmc_div.clk,
>  	.enable		= s3c2443_enable_hsmmc,
>  	.ops		= &(struct clk_ops) {
> diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-
> s3c2443/mach-smdk2443.c
> index 4337f0a..d3b2922 100644
> --- a/arch/arm/mach-s3c2443/mach-smdk2443.c
> +++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
> @@ -105,7 +105,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[]
> __initdata = {
>  static struct platform_device *smdk2443_devices[] __initdata = {
>  	&s3c_device_wdt,
>  	&s3c_device_i2c0,
> -	&s3c_device_hsmmc0,
> +	&s3c_device_hsmmc1,
>  #ifdef CONFIG_SND_SOC_SMDK2443_WM9710
>  	&s3c_device_ac97,
>  #endif
> diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-
> s3c24xx/s3c2443-clock.c
> index 461f070..82f2d4a 100644
> --- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
> +++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
> @@ -271,7 +271,7 @@ static struct clk init_clocks[] = {
>  		.ctrlbit	= S3C2443_HCLKCON_DMA5,
>  	}, {
>  		.name		= "hsmmc",
> -		.id		= 0,
> +		.id		= 1,
>  		.parent		= &clk_h,
>  		.enable		= s3c2443_clkcon_enable_h,
>  		.ctrlbit	= S3C2443_HCLKCON_HSMMC,
> --


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] 33+ messages in thread

* [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI
  2010-11-28 18:30 ` [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
@ 2010-11-30  7:37   ` Kukjin Kim
  2010-11-30  8:34     ` Yauhen Kharuzhy
  2010-12-01  9:57     ` [PATCH v2] " Yauhen Kharuzhy
  0 siblings, 2 replies; 33+ messages in thread
From: Kukjin Kim @ 2010-11-30  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy 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              |   12 +++++
>  arch/arm/mach-s3c2416/Makefile             |    4 ++
>  arch/arm/mach-s3c2416/s3c2416.c            |    5 ++
>  arch/arm/mach-s3c2416/setup-sdhci-gpio.c   |   58
++++++++++++++++++++++++++
>  arch/arm/mach-s3c2416/setup-sdhci.c        |   62
> ++++++++++++++++++++++++++++
>  arch/arm/plat-samsung/include/plat/sdhci.h |   35 ++++++++++++++++
>  6 files changed, 176 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 27b3e7c..2eaadcf 100644
> --- a/arch/arm/mach-s3c2416/Kconfig
> +++ b/arch/arm/mach-s3c2416/Kconfig
> @@ -30,6 +30,17 @@ config S3C2416_PM
>  	help
>  	  Internal config node to apply S3C2416 power management
> 
> +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
> @@ -41,6 +52,7 @@ config MACH_SMDK2416
>  	select S3C_DEV_HSMMC1
>  	select S3C_DEV_NAND
>  	select S3C_DEV_USB_HOST
> +	select S3C2416_SETUP_SDHCI
>  	select S3C2416_PM if PM
>  	help
>  	  Say Y here if you are using an SMDK2416
> diff --git a/arch/arm/mach-s3c2416/Makefile
b/arch/arm/mach-s3c2416/Makefile
> index ef038d6..7b805b2 100644
> --- a/arch/arm/mach-s3c2416/Makefile
> +++ b/arch/arm/mach-s3c2416/Makefile
> @@ -14,6 +14,10 @@ obj-$(CONFIG_CPU_S3C2416)	+= irq.o
>  obj-$(CONFIG_S3C2416_PM)	+= pm.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
> diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-
> s3c2416/s3c2416.c
> index 63f39cd..ba7fd87 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>
>  #include <plat/fb-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..68ac523
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> @@ -0,0 +1,58 @@
> +/* 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>

Should be <linux/gpio.h>

> +#include <mach/regs-gpio.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s3c2416_setup_sdhci0_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);
> +	}
> +}

Following is better.

+void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+{
+	s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width,
S3C_GPIO_SFN(2));
+}

> +
> +void s3c2416_setup_sdhci1_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);
> +}
> +
> +
no need 2 empty lines.

Same...how about following?

+void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
+{
+	s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2));
+	s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2));
+}

> 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);
> +}
> +

no need last 1 empty line.

> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
> samsung/include/plat/sdhci.h
> index 85853f8..81d801e 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -121,6 +121,8 @@ extern void s5pv310_setup_sdhci0_cfg_gpio(struct
> platform_device *, int w);
>  extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int
w);
>  extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int
w);
>  extern void s5pv310_setup_sdhci3_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);
> 
>  /* S3C64XX SDHCI setup */
> 
> @@ -299,6 +301,39 @@ static inline void s5pv210_default_sdhci3(void) { }
> 
>  #endif /* CONFIG_S5PV210_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 */

+static inline void s3c2416_default_sdhci0(void)
+{
+#ifdef CONFIG_S3C_DEV_HSMMC
+	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;
+#endif
+}

And please move this before s3c6400_setup_...

> +
> +#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 */
> +

+static inline void s3c2416_default_sdhci1(void)
+{
+#ifdef CONFIG_S3C_DEV_HSMMC1
+	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;
+#endif
+}

> +#endif /* CONFIG_S3C2416_SETUP_SDHCI */
> +
>  /* S5PV310 SDHCI setup */
>  #ifdef CONFIG_S5PV310_SETUP_SDHCI
>  extern char *s5pv310_hsmmc_clksrcs[4];
> --

And there was no error on board?

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] 33+ messages in thread

* [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition
  2010-11-28 18:30 ` [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition Yauhen Kharuzhy
@ 2010-11-30  7:38   ` Kukjin Kim
  2010-11-30  8:47   ` Ben Dooks
  1 sibling, 0 replies; 33+ messages in thread
From: Kukjin Kim @ 2010-11-30  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> Dependency on (CPU_S3C2416 is not selected) was defined as "!CPU_2416",
> instead of "!CPU_S3C2416". Fix it.
> 
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> ---
>  arch/arm/mach-s3c2412/Kconfig |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
> index cef6a65..fa2e5bf 100644
> --- a/arch/arm/mach-s3c2412/Kconfig
> +++ b/arch/arm/mach-s3c2412/Kconfig
> @@ -16,7 +16,7 @@ config CPU_S3C2412
>  config CPU_S3C2412_ONLY
>  	bool
>  	depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \
> -		   !CPU_2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
> +		   !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
>  		   !CPU_S3C2443 && CPU_S3C2412
>  	default y if CPU_S3C2412
> 
> --

Yeah, looks ok to me.

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] 33+ messages in thread

* [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards
  2010-11-28 18:30 ` [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards Yauhen Kharuzhy
@ 2010-11-30  7:45   ` Kukjin Kim
  2010-11-30  8:27     ` Yauhen Kharuzhy
  0 siblings, 1 reply; 33+ messages in thread
From: Kukjin Kim @ 2010-11-30  7:45 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
Hi,

> From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> 
> Common SMDK code uses s3c_device_nand, but doesn't select it in Kconfig.
> 
Yeah, you're right. The common-smdk.c uses "s3c_device_nand" of
"plat-samsung/dev-nand.c".
But now the CONFIG_S3C_DEV_NAND already selected in CONFIG_PLAT_S3C24XX...

So I think this is useless...however, we need to sort dependencies of
Kconfig for S3C24XX out.

> Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> ---
>  arch/arm/plat-s3c24xx/Kconfig |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
> index 5a27b1b..f3e22f9 100644
> --- a/arch/arm/plat-s3c24xx/Kconfig
> +++ b/arch/arm/plat-s3c24xx/Kconfig
> @@ -155,6 +155,7 @@ config S3C2412_IOTIMING
> 
>  config MACH_SMDK
>  	bool
> +	select S3C_DEV_NAND
>  	help
>  	  Common machine code for SMDK2410 and SMDK2440
> 
> --

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] 33+ messages in thread

* [PATCH 07/10] ARM S3C2443: Implement GPIO pull-up/down configuration methods
  2010-11-28 18:30 ` [PATCH 07/10] ARM S3C2443: Implement GPIO pull-up/down configuration methods Yauhen Kharuzhy
@ 2010-11-30  8:10   ` Kukjin Kim
  0 siblings, 0 replies; 33+ messages in thread
From: Kukjin Kim @ 2010-11-30  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> 
> S3C2443 has two-bits pull-up/pull-down configuration fields in GPIO
> registers, but values are differ from other SoCs with two-bits
> configuration. gpio-cfg-helpers.h already has prototypes for
> s3c2443-style pull-up/down methods, so implement them.
> 
> Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> ---
>  arch/arm/mach-s3c2443/Kconfig                      |    1 +
>  arch/arm/mach-s3c2443/s3c2443.c                    |    7 +++
>  arch/arm/plat-samsung/Kconfig                      |    6 +++
>  arch/arm/plat-samsung/gpio-config.c                |   42
> ++++++++++++++++++++
>  .../plat-samsung/include/plat/gpio-cfg-helpers.h   |    2 +-
>  5 files changed, 57 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
> index 8814031..d8eb868 100644
> --- a/arch/arm/mach-s3c2443/Kconfig
> +++ b/arch/arm/mach-s3c2443/Kconfig
> @@ -10,6 +10,7 @@ config CPU_S3C2443
>  	select CPU_LLSERIAL_S3C2440
>  	select SAMSUNG_CLKSRC
>  	select S3C2443_CLOCK
> +	select S3C_GPIO_PULL_S3C2443
>  	help
>  	  Support for the S3C2443 SoC from the S3C24XX line
> 
> diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-
> s3c2443/s3c2443.c
> index 33d18dd..e6a28ba 100644
> --- a/arch/arm/mach-s3c2443/s3c2443.c
> +++ b/arch/arm/mach-s3c2443/s3c2443.c
> @@ -16,6 +16,7 @@
>  #include <linux/list.h>
>  #include <linux/timer.h>
>  #include <linux/init.h>
> +#include <linux/gpio.h>
>  #include <linux/platform_device.h>
>  #include <linux/serial_core.h>
>  #include <linux/sysdev.h>
> @@ -32,6 +33,9 @@
>  #include <mach/regs-s3c2443-clock.h>
>  #include <mach/reset.h>
> 
> +#include <plat/gpio-core.h>
> +#include <plat/gpio-cfg.h>
> +#include <plat/gpio-cfg-helpers.h>
>  #include <plat/s3c2443.h>
>  #include <plat/devs.h>
>  #include <plat/cpu.h>
> @@ -86,6 +90,9 @@ void __init s3c2443_init_uarts(struct s3c2410_uartcfg
*cfg,
> int no)
> 
>  void __init s3c2443_map_io(void)
>  {
> +	s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443;
> +	s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443;
> +
>  	iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
>  }
> 
> diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> index dcd6eff..4ecb155 100644
> --- a/arch/arm/plat-samsung/Kconfig
> +++ b/arch/arm/plat-samsung/Kconfig
> @@ -95,6 +95,12 @@ config S3C_GPIO_PULL_UPDOWN
>  	help
>  	  Internal configuration to enable the correct GPIO pull helper
> 
> +config S3C_GPIO_PULL_S3C2443
> +	bool
> +	select S3C_GPIO_PULL_UPDOWN
> +	help
> +	  Internal configuration to enable the correct GPIO pull helper for
> S3C2443-style GPIO
> +
>  config S3C_GPIO_PULL_DOWN
>  	bool
>  	help
> diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-
> samsung/gpio-config.c
> index b732b77..6eeb20b 100644
> --- a/arch/arm/plat-samsung/gpio-config.c
> +++ b/arch/arm/plat-samsung/gpio-config.c
> @@ -278,6 +278,48 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct
> s3c_gpio_chip *chip,
>  	pup &= 0x3;
>  	return (__force s3c_gpio_pull_t)pup;
>  }
> +
> +#ifdef CONFIG_S3C_GPIO_PULL_S3C2443
> +int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
> +				unsigned int off, s3c_gpio_pull_t pull)
> +{
> +	switch (pull) {
> +	case S3C_GPIO_PULL_NONE:
> +		pull = 0x01;
> +		break;
> +	case S3C_GPIO_PULL_UP:
> +		pull = 0x00;
> +		break;
> +	case S3C_GPIO_PULL_DOWN:
> +		pull = 0x02;
> +		break;
> +	}
> +	return s3c_gpio_setpull_updown(chip, off, pull);
> +}
> +
> +s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
> +					unsigned int off)
> +{
> +	s3c_gpio_pull_t pull;
> +
> +	pull = s3c_gpio_getpull_updown(chip, off);
> +
> +	switch (pull) {
> +	case 0x00:
> +		pull = S3C_GPIO_PULL_UP;
> +		break;
> +	case 0x01:
> +	case 0x03:
> +		pull = S3C_GPIO_PULL_NONE;
> +		break;
> +	case 0x02:
> +		pull = S3C_GPIO_PULL_DOWN;
> +		break;
> +	}
> +
> +	return pull;
> +}
> +#endif
>  #endif
> 
>  #ifdef CONFIG_S3C_GPIO_PULL_UP
> diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> index 8fd65d8..b3bd3e8 100644
> --- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
> @@ -233,7 +233,7 @@ extern int s3c_gpio_setpull_s3c2443(struct
s3c_gpio_chip
> *chip,
>   * This helper function reads the state of the pull-{up,down} resistor
for
> the
>   * given GPIO in the same case as s3c_gpio_setpull_upown.
>  */
> -extern s3c_gpio_pull_t s3c_gpio_getpull_s3c24xx(struct s3c_gpio_chip
*chip,
> +extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip
*chip,
>  						unsigned int off);
> 
>  #endif /* __PLAT_GPIO_CFG_HELPERS_H */
> --

You're right. Looks ok to me.

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] 33+ messages in thread

* [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0
  2010-11-30  7:21   ` Kukjin Kim
@ 2010-11-30  8:21     ` Yauhen Kharuzhy
  2010-12-03 12:46       ` Kukjin Kim
  0 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-30  8:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 30, 2010 at 04:21:01PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy wrote:
> > 
> > Define maps for HSMMC devices.
> > 
> > S3C2443 has one HSMMC device with base address 0x4A800000.
> 
> Hmm...according to data sheet, there are two SD/MMC on S3C2443.
> The base address of channel 0 is 0x4A800000 and channel 1 is 0x5A000000.
> So, need to update your patch.

No. 0x5A000000 is old-style SD Interface, HSMMC is SDHCI. They are
handled by different drivers.

> 
> > S3C2416 has HSMMC0 at 0x4AC00000 and HSMMC1 at 0x4A800000.
> > 
> > So suppose that S3C2443 has only HSMMC1.
> > 
> Hmm...
> 
> > Define clock for hsmmc0 device and register it.
> > 
> > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> 
> I meant you used different here so asked...anyway...
> 
> > ---
> >  arch/arm/mach-s3c2410/include/mach/irqs.h          |    4 ++--
> >  arch/arm/mach-s3c2410/include/mach/map.h           |    4 ++--
> >  .../mach-s3c2410/include/mach/regs-s3c2443-clock.h |    1 +
> >  arch/arm/mach-s3c2416/clock.c                      |   18
> +++++++++++++-----
> >  arch/arm/mach-s3c2443/Kconfig                      |    2 +-
> >  arch/arm/mach-s3c2443/clock.c                      |    4 ++--
> >  arch/arm/mach-s3c2443/mach-smdk2443.c              |    2 +-
> >  arch/arm/plat-s3c24xx/s3c2443-clock.c              |    2 +-
> >  8 files changed, 23 insertions(+), 14 deletions(-)
> > 
> > diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-
> > s3c2410/include/mach/irqs.h
> > index 11bb0f0..e5a68ea 100644
> > --- a/arch/arm/mach-s3c2410/include/mach/irqs.h
> > +++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
> > @@ -152,8 +152,8 @@
> > 
> >  #define IRQ_S3C2416_HSMMC0	S3C2410_IRQ(21)		/*
> > S3C2416/S3C2450 */
> > 
> > -#define IRQ_HSMMC0		IRQ_S3C2443_HSMMC
> > -#define IRQ_HSMMC1		IRQ_S3C2416_HSMMC0
> > +#define IRQ_HSMMC0		IRQ_S3C2416_HSMMC0
> > +#define IRQ_HSMMC1		IRQ_S3C2443_HSMMC
> > 
> Hmm...yeah, IRQ_HSMMC0 is (21) and IRQ_HSMMC1 is (20).
> 
> >  #define IRQ_S3C2443_LCD1	S3C2410_IRQSUB(14)
> >  #define IRQ_S3C2443_LCD2	S3C2410_IRQSUB(15)
> > diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-
> > s3c2410/include/mach/map.h
> > index cd3983a..25bbf5a 100644
> > --- a/arch/arm/mach-s3c2410/include/mach/map.h
> > +++ b/arch/arm/mach-s3c2410/include/mach/map.h
> > @@ -112,8 +112,8 @@
> >  #define S3C_PA_IIC          S3C2410_PA_IIC
> >  #define S3C_PA_UART	    S3C24XX_PA_UART
> >  #define S3C_PA_USBHOST	S3C2410_PA_USBHOST
> > -#define S3C_PA_HSMMC0	    S3C2443_PA_HSMMC
> > -#define S3C_PA_HSMMC1	    S3C2416_PA_HSMMC0
> > +#define S3C_PA_HSMMC0	    S3C2416_PA_HSMMC0
> > +#define S3C_PA_HSMMC1	    S3C2443_PA_HSMMC
> 
> Please refer to my previous comment.
> S3C2443 has 2 channel.
> 
> >  #define S3C_PA_WDT	    S3C2410_PA_WATCHDOG
> >  #define S3C_PA_NAND	    S3C24XX_PA_NAND
> > 
> > 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 101aeea..44494a5 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)
> 
> Right.
> 
> >  #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..3b02d85 100644
> > --- a/arch/arm/mach-s3c2416/clock.c
> > +++ b/arch/arm/mach-s3c2416/clock.c
> > @@ -38,12 +38,11 @@ static unsigned int armdiv[8] = {
> >  	[7] = 8,
> >  };
> > 
> > -/* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */
> 
> Why remove?
Now 0 is HSMMC0 and 1 is HSMMC1. I think that this should be obviously
without comment.
> 
> >  static struct clksrc_clk hsmmc_div[] = {
> >  	[0] = {
> >  		.clk = {
> >  			.name	= "hsmmc-div",
> > -			.id	= 1,
> > +			.id	= 0,
> >  			.parent	= &clk_esysclk.clk,
> >  		},
> >  		.reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6
> },
> > @@ -51,7 +50,7 @@ static struct clksrc_clk hsmmc_div[] = {
> >  	[1] = {
> >  		.clk = {
> >  			.name	= "hsmmc-div",
> > -			.id	= 0,
> > +			.id	= 1,
> >  			.parent	= &clk_esysclk.clk,
> >  		},
> >  		.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6
> },
> > @@ -61,7 +60,7 @@ static struct clksrc_clk hsmmc_div[] = {
> >  static struct clksrc_clk hsmmc_mux[] = {
> >  	[0] = {
> >  		.clk	= {
> > -			.id	= 1,
> > +			.id	= 0,
> >  			.name	= "hsmmc-if",
> >  			.ctrlbit = (1 << 6),
> >  			.enable = s3c2443_clkcon_enable_s,
> > @@ -77,7 +76,7 @@ static struct clksrc_clk hsmmc_mux[] = {
> >  	},
> >  	[1] = {
> >  		.clk	= {
> > -			.id	= 0,
> > +			.id	= 1,
> >  			.name	= "hsmmc-if",
> >  			.ctrlbit = (1 << 12),
> >  			.enable = s3c2443_clkcon_enable_s,
> > @@ -93,6 +92,13 @@ static struct clksrc_clk hsmmc_mux[] = {
> >  	},
> >  };
> > 
> > +static struct clk hsmmc0_clk = {
> > +	.name		= "hsmmc",
> > +	.id		= 0,
> > +	.parent		= &clk_h,
> > +	.enable		= s3c2443_clkcon_enable_h,
> > +	.ctrlbit	= S3C2416_HCLKCON_HSMMC0,
> > +};
> > 
> >  static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0)
> >  {
> > @@ -130,6 +136,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(&hsmmc0_clk);
> > +
> >  	s3c_pwmclk_init();
> > 
> >  }
> > diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
> > index 4fef723..0b7f0d6 100644
> > --- a/arch/arm/mach-s3c2443/Kconfig
> > +++ b/arch/arm/mach-s3c2443/Kconfig
> > @@ -24,7 +24,7 @@ config MACH_SMDK2443
> >  	bool "SMDK2443"
> >  	select CPU_S3C2443
> >  	select MACH_SMDK
> > -	select S3C_DEV_HSMMC
> > +	select S3C_DEV_HSMMC1
> 
> Please check S3C2443's HSMMC...
> 
> >  	help
> >  	  Say Y here if you are using an SMDK2443
> > 
> > diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
> > index 0c3c0c8..f4ec6d5 100644
> > --- a/arch/arm/mach-s3c2443/clock.c
> > +++ b/arch/arm/mach-s3c2443/clock.c
> > @@ -196,7 +196,7 @@ static struct clksrc_clk clk_hsspi = {
> >  static struct clksrc_clk clk_hsmmc_div = {
> >  	.clk	= {
> >  		.name		= "hsmmc-div",
> > -		.id		= -1,
> > +		.id		= 1,
> >  		.parent		= &clk_esysclk.clk,
> >  	},
> >  	.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
> > @@ -231,7 +231,7 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int
> > enable)
> > 
> >  static struct clk clk_hsmmc = {
> >  	.name		= "hsmmc-if",
> > -	.id		= -1,
> > +	.id		= 1,
> >  	.parent		= &clk_hsmmc_div.clk,
> >  	.enable		= s3c2443_enable_hsmmc,
> >  	.ops		= &(struct clk_ops) {
> > diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-
> > s3c2443/mach-smdk2443.c
> > index 4337f0a..d3b2922 100644
> > --- a/arch/arm/mach-s3c2443/mach-smdk2443.c
> > +++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
> > @@ -105,7 +105,7 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[]
> > __initdata = {
> >  static struct platform_device *smdk2443_devices[] __initdata = {
> >  	&s3c_device_wdt,
> >  	&s3c_device_i2c0,
> > -	&s3c_device_hsmmc0,
> > +	&s3c_device_hsmmc1,
> >  #ifdef CONFIG_SND_SOC_SMDK2443_WM9710
> >  	&s3c_device_ac97,
> >  #endif
> > diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-
> > s3c24xx/s3c2443-clock.c
> > index 461f070..82f2d4a 100644
> > --- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
> > +++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
> > @@ -271,7 +271,7 @@ static struct clk init_clocks[] = {
> >  		.ctrlbit	= S3C2443_HCLKCON_DMA5,
> >  	}, {
> >  		.name		= "hsmmc",
> > -		.id		= 0,
> > +		.id		= 1,
> >  		.parent		= &clk_h,
> >  		.enable		= s3c2443_clkcon_enable_h,
> >  		.ctrlbit	= S3C2443_HCLKCON_HSMMC,
> > --
> 

-- 
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] 33+ messages in thread

* [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards
  2010-11-30  7:45   ` Kukjin Kim
@ 2010-11-30  8:27     ` Yauhen Kharuzhy
  2010-12-03 12:37       ` Kukjin Kim
  0 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-30  8:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 30, 2010 at 04:45:53PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy wrote:
> > 
> Hi,
> 
> > From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> > 
> > Common SMDK code uses s3c_device_nand, but doesn't select it in Kconfig.
> > 
> Yeah, you're right. The common-smdk.c uses "s3c_device_nand" of
> "plat-samsung/dev-nand.c".
> But now the CONFIG_S3C_DEV_NAND already selected in CONFIG_PLAT_S3C24XX...
> 
> So I think this is useless...however, we need to sort dependencies of
> Kconfig for S3C24XX out.
OK. It was my rebased old patch and I didn't check necessity of it.

> 
> > Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> > ---
> >  arch/arm/plat-s3c24xx/Kconfig |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
> > index 5a27b1b..f3e22f9 100644
> > --- a/arch/arm/plat-s3c24xx/Kconfig
> > +++ b/arch/arm/plat-s3c24xx/Kconfig
> > @@ -155,6 +155,7 @@ config S3C2412_IOTIMING
> > 
> >  config MACH_SMDK
> >  	bool
> > +	select S3C_DEV_NAND
> >  	help
> >  	  Common machine code for SMDK2410 and SMDK2440
> > 
> > --
> 
> Thanks.
> 
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> 
> 
> 

-- 
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] 33+ messages in thread

* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
  2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
                   ` (8 preceding siblings ...)
  2010-11-29 10:51 ` [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Kukjin Kim
@ 2010-11-30  8:33 ` Ben Dooks
  9 siblings, 0 replies; 33+ messages in thread
From: Ben Dooks @ 2010-11-30  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/11/10 18:30, Yauhen Kharuzhy wrote:
> Enable compilation of platform devices and initialization code used in
> SMDK2416 board file.

ok, will apply.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI
  2010-11-30  7:37   ` Kukjin Kim
@ 2010-11-30  8:34     ` Yauhen Kharuzhy
  2010-12-01  9:57     ` [PATCH v2] " Yauhen Kharuzhy
  1 sibling, 0 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-11-30  8:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 30, 2010 at 04:37:03PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy 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              |   12 +++++
> >  arch/arm/mach-s3c2416/Makefile             |    4 ++
> >  arch/arm/mach-s3c2416/s3c2416.c            |    5 ++
> >  arch/arm/mach-s3c2416/setup-sdhci-gpio.c   |   58
> ++++++++++++++++++++++++++
> >  arch/arm/mach-s3c2416/setup-sdhci.c        |   62
> > ++++++++++++++++++++++++++++
> >  arch/arm/plat-samsung/include/plat/sdhci.h |   35 ++++++++++++++++
> >  6 files changed, 176 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 27b3e7c..2eaadcf 100644
> > --- a/arch/arm/mach-s3c2416/Kconfig
> > +++ b/arch/arm/mach-s3c2416/Kconfig
> > @@ -30,6 +30,17 @@ config S3C2416_PM
> >  	help
> >  	  Internal config node to apply S3C2416 power management
> > 
> > +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
> > @@ -41,6 +52,7 @@ config MACH_SMDK2416
> >  	select S3C_DEV_HSMMC1
> >  	select S3C_DEV_NAND
> >  	select S3C_DEV_USB_HOST
> > +	select S3C2416_SETUP_SDHCI
> >  	select S3C2416_PM if PM
> >  	help
> >  	  Say Y here if you are using an SMDK2416
> > diff --git a/arch/arm/mach-s3c2416/Makefile
> b/arch/arm/mach-s3c2416/Makefile
> > index ef038d6..7b805b2 100644
> > --- a/arch/arm/mach-s3c2416/Makefile
> > +++ b/arch/arm/mach-s3c2416/Makefile
> > @@ -14,6 +14,10 @@ obj-$(CONFIG_CPU_S3C2416)	+= irq.o
> >  obj-$(CONFIG_S3C2416_PM)	+= pm.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
> > diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-
> > s3c2416/s3c2416.c
> > index 63f39cd..ba7fd87 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>
> >  #include <plat/fb-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..68ac523
> > --- /dev/null
> > +++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> > @@ -0,0 +1,58 @@
> > +/* 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>
> 
> Should be <linux/gpio.h>
> 
> > +#include <mach/regs-gpio.h>
> > +#include <plat/gpio-cfg.h>
> > +
> > +void s3c2416_setup_sdhci0_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);
> > +	}
> > +}
> 
> Following is better.
> 
> +void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
> +{
> +	s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width,
> S3C_GPIO_SFN(2));
> +}
Hmm... Cool GPIO helpers. Thanks for pointing me to them :)

> 
> > +
> > +void s3c2416_setup_sdhci1_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);
> > +}
> > +
> > +
> no need 2 empty lines.
> 
> Same...how about following?
> 
> +void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
> +{
> +	s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2));
> +	s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2));
> +}
> 
> > 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);
> > +}
> > +
> 
> no need last 1 empty line.
> 
> > diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
> > samsung/include/plat/sdhci.h
> > index 85853f8..81d801e 100644
> > --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> > +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> > @@ -121,6 +121,8 @@ extern void s5pv310_setup_sdhci0_cfg_gpio(struct
> > platform_device *, int w);
> >  extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int
> w);
> >  extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int
> w);
> >  extern void s5pv310_setup_sdhci3_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);
> > 
> >  /* S3C64XX SDHCI setup */
> > 
> > @@ -299,6 +301,39 @@ static inline void s5pv210_default_sdhci3(void) { }
> > 
> >  #endif /* CONFIG_S5PV210_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 */
> 
> +static inline void s3c2416_default_sdhci0(void)
> +{
> +#ifdef CONFIG_S3C_DEV_HSMMC
> +	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;
> +#endif
> +}
> 
> And please move this before s3c6400_setup_...
> 
> > +
> > +#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 */
> > +
> 
> +static inline void s3c2416_default_sdhci1(void)
> +{
> +#ifdef CONFIG_S3C_DEV_HSMMC1
> +	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;
> +#endif
> +}
> 
> > +#endif /* CONFIG_S3C2416_SETUP_SDHCI */
> > +
> >  /* S5PV310 SDHCI setup */
> >  #ifdef CONFIG_S5PV310_SETUP_SDHCI
> >  extern char *s5pv310_hsmmc_clksrcs[4];
> > --
> 
> And there was no error on board?

No. Both channels works good on my board.

OK. Will fix and re-send this patch.


-- 
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] 33+ messages in thread

* [PATCH 05/10] ARM S3C2443: Select properly ARM core type
  2010-11-28 18:30 ` [PATCH 05/10] ARM S3C2443: Select properly ARM core type Yauhen Kharuzhy
  2010-11-29 11:08   ` Kukjin Kim
@ 2010-11-30  8:45   ` Ben Dooks
  1 sibling, 0 replies; 33+ messages in thread
From: Ben Dooks @ 2010-11-30  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/11/10 18:30, Yauhen Kharuzhy wrote:
> From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
> 
> Select ARM920T core when compiling kernel for s3c2443.
> 
> Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
ok, applied.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition
  2010-11-28 18:30 ` [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition Yauhen Kharuzhy
  2010-11-30  7:38   ` Kukjin Kim
@ 2010-11-30  8:47   ` Ben Dooks
  1 sibling, 0 replies; 33+ messages in thread
From: Ben Dooks @ 2010-11-30  8:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/11/10 18:30, Yauhen Kharuzhy wrote:
> Dependency on (CPU_S3C2416 is not selected) was defined as "!CPU_2416",
> instead of "!CPU_S3C2416". Fix it.

ok, applied.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH v2] ARM: S3C2416: Add platform helpers for setup SDHCI
  2010-11-30  7:37   ` Kukjin Kim
  2010-11-30  8:34     ` Yauhen Kharuzhy
@ 2010-12-01  9:57     ` Yauhen Kharuzhy
  2010-12-02 20:06       ` Yauhen Kharuzhy
  2010-12-10  1:35       ` Kukjin Kim
  1 sibling, 2 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-12-01  9:57 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 <yauhen.kharuzhy@promwad.com>
---
 arch/arm/mach-s3c2416/Kconfig              |   12 +++++
 arch/arm/mach-s3c2416/Makefile             |    4 ++
 arch/arm/mach-s3c2416/s3c2416.c            |    5 ++
 arch/arm/mach-s3c2416/setup-sdhci-gpio.c   |   34 +++++++++++++++
 arch/arm/mach-s3c2416/setup-sdhci.c        |   61 ++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/sdhci.h |   30 ++++++++++++++
 6 files changed, 146 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 27b3e7c..2eaadcf 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -30,6 +30,17 @@ config S3C2416_PM
 	help
 	  Internal config node to apply S3C2416 power management
 
+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
@@ -41,6 +52,7 @@ config MACH_SMDK2416
 	select S3C_DEV_HSMMC1
 	select S3C_DEV_NAND
 	select S3C_DEV_USB_HOST
+	select S3C2416_SETUP_SDHCI
 	select S3C2416_PM if PM
 	help
 	  Say Y here if you are using an SMDK2416
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
index ef038d6..7b805b2 100644
--- a/arch/arm/mach-s3c2416/Makefile
+++ b/arch/arm/mach-s3c2416/Makefile
@@ -14,6 +14,10 @@ obj-$(CONFIG_CPU_S3C2416)	+= irq.o
 obj-$(CONFIG_S3C2416_PM)	+= pm.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
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 63f39cd..ba7fd87 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>
 #include <plat/fb-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..f65cb3e
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
@@ -0,0 +1,34 @@
+/* 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 <linux/gpio.h>
+
+#include <mach/regs-gpio.h>
+#include <plat/gpio-cfg.h>
+
+void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+{
+	s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width, S3C_GPIO_SFN(2));
+}
+
+void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
+{
+	s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2));
+	s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2));
+}
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
new file mode 100644
index 0000000..f09e38f
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci.c
@@ -0,0 +1,61 @@
+/* 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 85853f8..87e621c 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -107,6 +107,8 @@ extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata;
 
 /* Helper function availablity */
 
+extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
+extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
 extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
 extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
 extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
@@ -122,6 +124,34 @@ extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
 extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
 extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
 
+/* 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);
+#endif /* CONFIG_S3C2416_SETUP_SDHCI */
+
+static inline void s3c2416_default_sdhci0(void)
+{
+#ifdef CONFIG_S3C_DEV_HSMMC
+	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;
+#endif /* CONFIG_S3C_DEV_HSMMC */
+}
+
+static inline void s3c2416_default_sdhci1(void)
+{
+#ifdef CONFIG_S3C_DEV_HSMMC1
+	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;
+#endif /* CONFIG_S3C_DEV_HSMMC1 */
+}
+
 /* S3C64XX SDHCI setup */
 
 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH v2] ARM: S3C2416: Add platform helpers for setup SDHCI
  2010-12-01  9:57     ` [PATCH v2] " Yauhen Kharuzhy
@ 2010-12-02 20:06       ` Yauhen Kharuzhy
  2010-12-10  1:35       ` Kukjin Kim
  1 sibling, 0 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-12-02 20:06 UTC (permalink / raw)
  To: linux-arm-kernel

2010/12/1 Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>:
> 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 <yauhen.kharuzhy@promwad.com>

ping?


-- 
Best regards,
? ? Yauhen Kharuzhy? ?? jekhor_(at)_gmail.com

A: No
Q: Should I quote below my post?

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
  2010-11-29 11:22   ` Yauhen Kharuzhy
@ 2010-12-03 12:25     ` Kukjin Kim
  2010-12-03 12:39       ` Yauhen Kharuzhy
  0 siblings, 1 reply; 33+ messages in thread
From: Kukjin Kim @ 2010-12-03 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> > > @@ -35,9 +35,12 @@ menu "S3C2416 Machines"
> > >  config MACH_SMDK2416
> > >  	bool "SMDK2416"
> > >  	select CPU_S3C2416
> > > +	select MACH_SMDK
> >
> > No need to add this here.
> 
> SMDK2416 board code uses generic SMDK code, so it should be compiled
> also.
> 
Yeah, I was confused. You're right.

If there is no 'MACH_SMDK', happened following error with only S3C2416
arch/arm/mach-s3c2416/built-in.o: In function `smdk2416_machine_init':
arch/arm/mach-s3c2416/mach-smdk2416.c:193: undefined reference to
`smdk_machine_init'

> > >  	select S3C_DEV_FB
> > >  	select S3C_DEV_HSMMC
> > >  	select S3C_DEV_HSMMC1
> > > +	select S3C_DEV_NAND
> > > +	select S3C_DEV_USB_HOST
> >
> > Probably, did you test NAND and USB_HOST on board?
> Yes, but one year ago. I don't have access to SMDK2416 anymore and usually
> test my patches on another S3C2416 board (e-book reader prototype).
> 
(Added Banajit in To)

Banajit, could you please test this on SMDK2416?

> Without selection of S3C_DEV_NAND & S3C_DEV_USB_HOST mach-smdk2416.c
> doesn't compile, so we should either enable this platform devices
> definitions, either remove this devices from board file.
> 

Yes, if there is no 'S3C_DEV_USB_HOST', happened following error.
arch/arm/mach-s3c2416/built-in.o:(.init.data+0x48): undefined reference to
`s3c_device_ohci'

But I couldn't find 's3c_device_nand' device in mach-smdk2416.c and any
regarding NAND build failure.

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] 33+ messages in thread

* [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards
  2010-11-30  8:27     ` Yauhen Kharuzhy
@ 2010-12-03 12:37       ` Kukjin Kim
  2010-12-03 13:24         ` Yauhen Kharuzhy
  0 siblings, 1 reply; 33+ messages in thread
From: Kukjin Kim @ 2010-12-03 12:37 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> > > Common SMDK code uses s3c_device_nand, but doesn't select it in
Kconfig.
> > >
> > Yeah, you're right. The common-smdk.c uses "s3c_device_nand" of
> > "plat-samsung/dev-nand.c".
> > But now the CONFIG_S3C_DEV_NAND already selected in
CONFIG_PLAT_S3C24XX...
> >

Oh, it's typo :-(

commit 7f4145abcee3e48d9f01cca16baa0f21e4b55e21
Author: Kukjin Kim <kgene.kim@samsung.com>
Date:   Fri Dec 3 21:22:42 2010 +0900

    ARM: S3C24XX: Fix CONFIG_S3C_DEV_NAND Kconfig entry

    Should be CONFIG_S3C_DEV_NAND instead of CONFIG_S3C_DEVICE_NAND.

    Cc: Ben Dooks <ben-linux@fluff.org>
    Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 5a27b1b..eb105e6 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -8,7 +8,7 @@ config PLAT_S3C24XX
        default y
        select NO_IOPORT
        select ARCH_REQUIRE_GPIOLIB
-       select S3C_DEVICE_NAND
+       select S3C_DEV_NAND
        select S3C_GPIO_CFG_S3C24XX
        help
          Base platform code for any Samsung S3C24XX device


> > So I think this is useless...however, we need to sort dependencies of
> > Kconfig for S3C24XX out.
> OK. It was my rebased old patch and I didn't check necessity of it.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
  2010-12-03 12:25     ` Kukjin Kim
@ 2010-12-03 12:39       ` Yauhen Kharuzhy
  2010-12-03 12:50         ` Kukjin Kim
  0 siblings, 1 reply; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-12-03 12:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 03, 2010 at 09:25:14PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy wrote:
> > 
> > > > @@ -35,9 +35,12 @@ menu "S3C2416 Machines"
> > > >  config MACH_SMDK2416
> > > >  	bool "SMDK2416"
> > > >  	select CPU_S3C2416
> > > > +	select MACH_SMDK
> > >
> > > No need to add this here.
> > 
> > SMDK2416 board code uses generic SMDK code, so it should be compiled
> > also.
> > 
> Yeah, I was confused. You're right.
> 
> If there is no 'MACH_SMDK', happened following error with only S3C2416
> arch/arm/mach-s3c2416/built-in.o: In function `smdk2416_machine_init':
> arch/arm/mach-s3c2416/mach-smdk2416.c:193: undefined reference to
> `smdk_machine_init'
> 
> > > >  	select S3C_DEV_FB
> > > >  	select S3C_DEV_HSMMC
> > > >  	select S3C_DEV_HSMMC1
> > > > +	select S3C_DEV_NAND
> > > > +	select S3C_DEV_USB_HOST
> > >
> > > Probably, did you test NAND and USB_HOST on board?
> > Yes, but one year ago. I don't have access to SMDK2416 anymore and usually
> > test my patches on another S3C2416 board (e-book reader prototype).
> > 
> (Added Banajit in To)
> 
> Banajit, could you please test this on SMDK2416?
> 
> > Without selection of S3C_DEV_NAND & S3C_DEV_USB_HOST mach-smdk2416.c
> > doesn't compile, so we should either enable this platform devices
> > definitions, either remove this devices from board file.
> > 
> 
> Yes, if there is no 'S3C_DEV_USB_HOST', happened following error.
> arch/arm/mach-s3c2416/built-in.o:(.init.data+0x48): undefined reference to
> `s3c_device_ohci'
> 
> But I couldn't find 's3c_device_nand' device in mach-smdk2416.c and any
> regarding NAND build failure.
s3c_device_nand is used by arch/arm/plat-samsung/common-smdk.c


-- 
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] 33+ messages in thread

* [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0
  2010-11-30  8:21     ` Yauhen Kharuzhy
@ 2010-12-03 12:46       ` Kukjin Kim
  0 siblings, 0 replies; 33+ messages in thread
From: Kukjin Kim @ 2010-12-03 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> On Tue, Nov 30, 2010 at 04:21:01PM +0900, Kukjin Kim wrote:
> > Yauhen Kharuzhy wrote:
> > >
> > > Define maps for HSMMC devices.
> > >
> > > S3C2443 has one HSMMC device with base address 0x4A800000.
> >
> > Hmm...according to data sheet, there are two SD/MMC on S3C2443.
> > The base address of channel 0 is 0x4A800000 and channel 1 is 0x5A000000.
> > So, need to update your patch.
> 
> No. 0x5A000000 is old-style SD Interface, HSMMC is SDHCI. They are
> handled by different drivers.
> 

Hi Yauhen,

Beginning next week, I will continue to review this and your other following
patches.

- [PATCH] ARM S3C24XX: Fix compilation of PM code for S3C2416
- [PATCH v2] ARM: S3C2416: Add platform helpers for setup SDHCI

It's late here ;-)

> >
> > > S3C2416 has HSMMC0 at 0x4AC00000 and HSMMC1 at 0x4A800000.
> > >
> > > So suppose that S3C2443 has only HSMMC1.
> > >
> > Hmm...
> >
> > > Define clock for hsmmc0 device and register it.
> > >
> > > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>


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] 33+ messages in thread

* [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST
  2010-12-03 12:39       ` Yauhen Kharuzhy
@ 2010-12-03 12:50         ` Kukjin Kim
  0 siblings, 0 replies; 33+ messages in thread
From: Kukjin Kim @ 2010-12-03 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy wrote:
> 
> On Fri, Dec 03, 2010 at 09:25:14PM +0900, Kukjin Kim wrote:
> > Yauhen Kharuzhy wrote:
> > >
> > > > > @@ -35,9 +35,12 @@ menu "S3C2416 Machines"
> > > > >  config MACH_SMDK2416
> > > > >  	bool "SMDK2416"
> > > > >  	select CPU_S3C2416
> > > > > +	select MACH_SMDK
> > > >
> > > > No need to add this here.
> > >
> > > SMDK2416 board code uses generic SMDK code, so it should be compiled
> > > also.
> > >
> > Yeah, I was confused. You're right.
> >
> > If there is no 'MACH_SMDK', happened following error with only S3C2416
> > arch/arm/mach-s3c2416/built-in.o: In function `smdk2416_machine_init':
> > arch/arm/mach-s3c2416/mach-smdk2416.c:193: undefined reference to
> > `smdk_machine_init'
> >
> > > > >  	select S3C_DEV_FB
> > > > >  	select S3C_DEV_HSMMC
> > > > >  	select S3C_DEV_HSMMC1
> > > > > +	select S3C_DEV_NAND
> > > > > +	select S3C_DEV_USB_HOST
> > > >
> > > > Probably, did you test NAND and USB_HOST on board?
> > > Yes, but one year ago. I don't have access to SMDK2416 anymore and
> usually
> > > test my patches on another S3C2416 board (e-book reader prototype).
> > >
> > (Added Banajit in To)
> >
> > Banajit, could you please test this on SMDK2416?
> >
> > > Without selection of S3C_DEV_NAND & S3C_DEV_USB_HOST mach-smdk2416.c
> > > doesn't compile, so we should either enable this platform devices
> > > definitions, either remove this devices from board file.
> > >
> >
> > Yes, if there is no 'S3C_DEV_USB_HOST', happened following error.
> > arch/arm/mach-s3c2416/built-in.o:(.init.data+0x48): undefined reference
to
> > `s3c_device_ohci'
> >
> > But I couldn't find 's3c_device_nand' device in mach-smdk2416.c and any
> > regarding NAND build failure.
> s3c_device_nand is used by arch/arm/plat-samsung/common-smdk.c
> 
plat-s3c24xx/common-smdk.c

Its failure is from typo :-(
You can find my patch for it in other my reply.

As a note, I will continue to review in next week.

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] 33+ messages in thread

* [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards
  2010-12-03 12:37       ` Kukjin Kim
@ 2010-12-03 13:24         ` Yauhen Kharuzhy
  0 siblings, 0 replies; 33+ messages in thread
From: Yauhen Kharuzhy @ 2010-12-03 13:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 03, 2010 at 09:37:58PM +0900, Kukjin Kim wrote:
> Yauhen Kharuzhy wrote:
> > 
> > > > Common SMDK code uses s3c_device_nand, but doesn't select it in
> Kconfig.
> > > >
> > > Yeah, you're right. The common-smdk.c uses "s3c_device_nand" of
> > > "plat-samsung/dev-nand.c".
> > > But now the CONFIG_S3C_DEV_NAND already selected in
> CONFIG_PLAT_S3C24XX...
> > >

> Oh, it's typo :-(
> 
> commit 7f4145abcee3e48d9f01cca16baa0f21e4b55e21
> Author: Kukjin Kim <kgene.kim@samsung.com>
> Date:   Fri Dec 3 21:22:42 2010 +0900
> 
>     ARM: S3C24XX: Fix CONFIG_S3C_DEV_NAND Kconfig entry
> 
>     Should be CONFIG_S3C_DEV_NAND instead of CONFIG_S3C_DEVICE_NAND.
> 
>     Cc: Ben Dooks <ben-linux@fluff.org>
>     Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> 
> diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
> index 5a27b1b..eb105e6 100644
> --- a/arch/arm/plat-s3c24xx/Kconfig
> +++ b/arch/arm/plat-s3c24xx/Kconfig
> @@ -8,7 +8,7 @@ config PLAT_S3C24XX
>         default y
>         select NO_IOPORT
>         select ARCH_REQUIRE_GPIOLIB
> -       select S3C_DEVICE_NAND
> +       select S3C_DEV_NAND
>         select S3C_GPIO_CFG_S3C24XX
>         help
>           Base platform code for any Samsung S3C24XX device
> 
> 
> > > So I think this is useless...however, we need to sort dependencies of
> > > Kconfig for S3C24XX out.
> > OK. It was my rebased old patch and I didn't check necessity of it.

Hmm... But this selects S3C_DEVICE_NAND for all S3C24XX boards.
Theoretically S3C24XX board without NAND can exist, and compiled-in
nand platform device will be overhead.

-- 
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] 33+ messages in thread

* [PATCH v2] ARM: S3C2416: Add platform helpers for setup SDHCI
  2010-12-01  9:57     ` [PATCH v2] " Yauhen Kharuzhy
  2010-12-02 20:06       ` Yauhen Kharuzhy
@ 2010-12-10  1:35       ` Kukjin Kim
  1 sibling, 0 replies; 33+ messages in thread
From: Kukjin Kim @ 2010-12-10  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

Yauhen Kharuzhy 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 <yauhen.kharuzhy@promwad.com>
> ---
>  arch/arm/mach-s3c2416/Kconfig              |   12 +++++
>  arch/arm/mach-s3c2416/Makefile             |    4 ++
>  arch/arm/mach-s3c2416/s3c2416.c            |    5 ++
>  arch/arm/mach-s3c2416/setup-sdhci-gpio.c   |   34 +++++++++++++++
>  arch/arm/mach-s3c2416/setup-sdhci.c        |   61
> ++++++++++++++++++++++++++++
>  arch/arm/plat-samsung/include/plat/sdhci.h |   30 ++++++++++++++
>  6 files changed, 146 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 27b3e7c..2eaadcf 100644
> --- a/arch/arm/mach-s3c2416/Kconfig
> +++ b/arch/arm/mach-s3c2416/Kconfig
> @@ -30,6 +30,17 @@ config S3C2416_PM
>  	help
>  	  Internal config node to apply S3C2416 power management
> 
> +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
> @@ -41,6 +52,7 @@ config MACH_SMDK2416
>  	select S3C_DEV_HSMMC1
>  	select S3C_DEV_NAND
>  	select S3C_DEV_USB_HOST
> +	select S3C2416_SETUP_SDHCI
>  	select S3C2416_PM if PM
>  	help
>  	  Say Y here if you are using an SMDK2416
> diff --git a/arch/arm/mach-s3c2416/Makefile
b/arch/arm/mach-s3c2416/Makefile
> index ef038d6..7b805b2 100644
> --- a/arch/arm/mach-s3c2416/Makefile
> +++ b/arch/arm/mach-s3c2416/Makefile
> @@ -14,6 +14,10 @@ obj-$(CONFIG_CPU_S3C2416)	+= irq.o
>  obj-$(CONFIG_S3C2416_PM)	+= pm.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
> diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-
> s3c2416/s3c2416.c
> index 63f39cd..ba7fd87 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>
>  #include <plat/fb-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..f65cb3e
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
> @@ -0,0 +1,34 @@
> +/* 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 <linux/gpio.h>
> +
> +#include <mach/regs-gpio.h>
> +#include <plat/gpio-cfg.h>
> +
> +void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int
width)
> +{
> +	s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width,
S3C_GPIO_SFN(2));
> +}
> +
> +void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int
width)
> +{
> +	s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2));
> +	s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2));
> +}
> diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-
> s3c2416/setup-sdhci.c
> new file mode 100644
> index 0000000..f09e38f
> --- /dev/null
> +++ b/arch/arm/mach-s3c2416/setup-sdhci.c
> @@ -0,0 +1,61 @@
> +/* 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 85853f8..87e621c 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -107,6 +107,8 @@ extern struct s3c_sdhci_platdata
s3c_hsmmc3_def_platdata;
> 
>  /* Helper function availablity */
> 
> +extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int
w);
> +extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int
w);
>  extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int
w);
>  extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int
w);
>  extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int
w);
> @@ -122,6 +124,34 @@ extern void s5pv310_setup_sdhci1_cfg_gpio(struct
> platform_device *, int w);
>  extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int
w);
>  extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int
w);
> 
> +/* 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);
> +#endif /* CONFIG_S3C2416_SETUP_SDHCI */
> +
> +static inline void s3c2416_default_sdhci0(void)
> +{
> +#ifdef CONFIG_S3C_DEV_HSMMC
> +	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;
> +#endif /* CONFIG_S3C_DEV_HSMMC */
> +}
> +
> +static inline void s3c2416_default_sdhci1(void)
> +{
> +#ifdef CONFIG_S3C_DEV_HSMMC1
> +	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;
> +#endif /* CONFIG_S3C_DEV_HSMMC1 */
> +}
> +
>  /* S3C64XX SDHCI setup */
> 
>  #ifdef CONFIG_S3C64XX_SETUP_SDHCI
> --

Sorry, it's late review. I came back from some kind of education just now.

Anyway, looks ok to me but __raw_readl/__raw_writel is better instead of
just readl/writel.
Because basically no need memory barrier between memory operation in there.

So if you don't mind, will apply with modifying.

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] 33+ messages in thread

end of thread, other threads:[~2010-12-10  1:35 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-28 18:30 [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Yauhen Kharuzhy
2010-11-28 18:30 ` [PATCH 02/10] ARM S3C2416: Add address map and clock definitions for HSMMC0 Yauhen Kharuzhy
2010-11-30  7:21   ` Kukjin Kim
2010-11-30  8:21     ` Yauhen Kharuzhy
2010-12-03 12:46       ` Kukjin Kim
2010-11-28 18:30 ` [PATCH 03/10] ARM: S3C2416: Add platform helpers for setup SDHCI Yauhen Kharuzhy
2010-11-30  7:37   ` Kukjin Kim
2010-11-30  8:34     ` Yauhen Kharuzhy
2010-12-01  9:57     ` [PATCH v2] " Yauhen Kharuzhy
2010-12-02 20:06       ` Yauhen Kharuzhy
2010-12-10  1:35       ` Kukjin Kim
2010-11-28 18:30 ` [PATCH 04/10] ARM: S3C2416: Add support of SD/MMC card detect on SMDK2416 Yauhen Kharuzhy
2010-11-28 18:30 ` [PATCH 05/10] ARM S3C2443: Select properly ARM core type Yauhen Kharuzhy
2010-11-29 11:08   ` Kukjin Kim
2010-11-29 11:25     ` Yauhen Kharuzhy
2010-11-30  8:45   ` Ben Dooks
2010-11-28 18:30 ` [PATCH 06/10] ARM S3C24XX: Compile NAND device definition for SMDK boards Yauhen Kharuzhy
2010-11-30  7:45   ` Kukjin Kim
2010-11-30  8:27     ` Yauhen Kharuzhy
2010-12-03 12:37       ` Kukjin Kim
2010-12-03 13:24         ` Yauhen Kharuzhy
2010-11-28 18:30 ` [PATCH 07/10] ARM S3C2443: Implement GPIO pull-up/down configuration methods Yauhen Kharuzhy
2010-11-30  8:10   ` Kukjin Kim
2010-11-28 18:30 ` [PATCH 08/10] ARM SAMSUNG: Don't export __init functions to modules Yauhen Kharuzhy
2010-11-28 18:30 ` [PATCH 09/10] ARM S3C2412: Fix typo in CONFIG_CPU_S3C2412_ONLY definition Yauhen Kharuzhy
2010-11-30  7:38   ` Kukjin Kim
2010-11-30  8:47   ` Ben Dooks
2010-11-29 10:51 ` [PATCH 01/10] SMDK2416: Select MACH_SMDK, S3C_DEV_NAND, S3C_DEV_USB_HOST Kukjin Kim
2010-11-29 11:22   ` Yauhen Kharuzhy
2010-12-03 12:25     ` Kukjin Kim
2010-12-03 12:39       ` Yauhen Kharuzhy
2010-12-03 12:50         ` Kukjin Kim
2010-11-30  8:33 ` Ben Dooks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.