aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-s3c2410/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/map.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h1
-rw-r--r--arch/arm/mach-s3c2416/Kconfig12
-rw-r--r--arch/arm/mach-s3c2416/Makefile4
-rw-r--r--arch/arm/mach-s3c2416/clock.c18
-rw-r--r--arch/arm/mach-s3c2416/mach-smdk2416.c23
-rw-r--r--arch/arm/mach-s3c2416/s3c2416.c5
-rw-r--r--arch/arm/mach-s3c2416/setup-sdhci-gpio.c34
-rw-r--r--arch/arm/mach-s3c2416/setup-sdhci.c61
-rw-r--r--arch/arm/mach-s3c2443/Kconfig3
-rw-r--r--arch/arm/mach-s3c2443/clock.c4
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c9
-rw-r--r--arch/arm/mach-s3c2443/s3c2443.c7
-rw-r--r--arch/arm/plat-s3c24xx/devs.c1
-rw-r--r--arch/arm/plat-s3c24xx/s3c2443-clock.c2
-rw-r--r--arch/arm/plat-samsung/Kconfig6
-rw-r--r--arch/arm/plat-samsung/dev-nand.c2
-rw-r--r--arch/arm/plat-samsung/gpio-config.c42
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h35
21 files changed, 261 insertions, 18 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
index 11bb0f08fe6a..e5a68ea13113 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
@@ -152,8 +152,8 @@
152 152
153#define IRQ_S3C2416_HSMMC0 S3C2410_IRQ(21) /* S3C2416/S3C2450 */ 153#define IRQ_S3C2416_HSMMC0 S3C2410_IRQ(21) /* S3C2416/S3C2450 */
154 154
155#define IRQ_HSMMC0 IRQ_S3C2443_HSMMC 155#define IRQ_HSMMC0 IRQ_S3C2416_HSMMC0
156#define IRQ_HSMMC1 IRQ_S3C2416_HSMMC0 156#define IRQ_HSMMC1 IRQ_S3C2443_HSMMC
157 157
158#define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) 158#define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14)
159#define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15) 159#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 cd3983ad4160..25bbf5a942dd 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -112,8 +112,8 @@
112#define S3C_PA_IIC S3C2410_PA_IIC 112#define S3C_PA_IIC S3C2410_PA_IIC
113#define S3C_PA_UART S3C24XX_PA_UART 113#define S3C_PA_UART S3C24XX_PA_UART
114#define S3C_PA_USBHOST S3C2410_PA_USBHOST 114#define S3C_PA_USBHOST S3C2410_PA_USBHOST
115#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 115#define S3C_PA_HSMMC0 S3C2416_PA_HSMMC0
116#define S3C_PA_HSMMC1 S3C2416_PA_HSMMC0 116#define S3C_PA_HSMMC1 S3C2443_PA_HSMMC
117#define S3C_PA_WDT S3C2410_PA_WATCHDOG 117#define S3C_PA_WDT S3C2410_PA_WATCHDOG
118#define S3C_PA_NAND S3C24XX_PA_NAND 118#define S3C_PA_NAND S3C24XX_PA_NAND
119 119
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 101aeea22310..44494a56e68b 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 @@
86#define S3C2443_HCLKCON_LCDC (1<<9) 86#define S3C2443_HCLKCON_LCDC (1<<9)
87#define S3C2443_HCLKCON_USBH (1<<11) 87#define S3C2443_HCLKCON_USBH (1<<11)
88#define S3C2443_HCLKCON_USBD (1<<12) 88#define S3C2443_HCLKCON_USBD (1<<12)
89#define S3C2416_HCLKCON_HSMMC0 (1<<15)
89#define S3C2443_HCLKCON_HSMMC (1<<16) 90#define S3C2443_HCLKCON_HSMMC (1<<16)
90#define S3C2443_HCLKCON_CFC (1<<17) 91#define S3C2443_HCLKCON_CFC (1<<17)
91#define S3C2443_HCLKCON_SSMC (1<<18) 92#define S3C2443_HCLKCON_SSMC (1<<18)
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
index df8d14974c90..69b48a7d1dbd 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -31,6 +31,17 @@ config S3C2416_PM
31 help 31 help
32 Internal config node to apply S3C2416 power management 32 Internal config node to apply S3C2416 power management
33 33
34config S3C2416_SETUP_SDHCI
35 bool
36 select S3C2416_SETUP_SDHCI_GPIO
37 help
38 Internal helper functions for S3C2416 based SDHCI systems
39
40config S3C2416_SETUP_SDHCI_GPIO
41 bool
42 help
43 Common setup code for SDHCI gpio.
44
34menu "S3C2416 Machines" 45menu "S3C2416 Machines"
35 46
36config MACH_SMDK2416 47config MACH_SMDK2416
@@ -42,6 +53,7 @@ config MACH_SMDK2416
42 select S3C_DEV_HSMMC1 53 select S3C_DEV_HSMMC1
43 select S3C_DEV_NAND 54 select S3C_DEV_NAND
44 select S3C_DEV_USB_HOST 55 select S3C_DEV_USB_HOST
56 select S3C2416_SETUP_SDHCI
45 select S3C2416_PM if PM 57 select S3C2416_PM if PM
46 help 58 help
47 Say Y here if you are using an SMDK2416 59 Say Y here if you are using an SMDK2416
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
index ef038d62ffdb..7b805b279caf 100644
--- a/arch/arm/mach-s3c2416/Makefile
+++ b/arch/arm/mach-s3c2416/Makefile
@@ -14,6 +14,10 @@ obj-$(CONFIG_CPU_S3C2416) += irq.o
14obj-$(CONFIG_S3C2416_PM) += pm.o 14obj-$(CONFIG_S3C2416_PM) += pm.o
15#obj-$(CONFIG_S3C2416_DMA) += dma.o 15#obj-$(CONFIG_S3C2416_DMA) += dma.o
16 16
17# Device setup
18obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
19obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
20
17# Machine support 21# Machine support
18 22
19obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o 23obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
diff --git a/arch/arm/mach-s3c2416/clock.c b/arch/arm/mach-s3c2416/clock.c
index 7ccf5a2a2bfc..3b02d8506e25 100644
--- a/arch/arm/mach-s3c2416/clock.c
+++ b/arch/arm/mach-s3c2416/clock.c
@@ -38,12 +38,11 @@ static unsigned int armdiv[8] = {
38 [7] = 8, 38 [7] = 8,
39}; 39};
40 40
41/* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */
42static struct clksrc_clk hsmmc_div[] = { 41static struct clksrc_clk hsmmc_div[] = {
43 [0] = { 42 [0] = {
44 .clk = { 43 .clk = {
45 .name = "hsmmc-div", 44 .name = "hsmmc-div",
46 .id = 1, 45 .id = 0,
47 .parent = &clk_esysclk.clk, 46 .parent = &clk_esysclk.clk,
48 }, 47 },
49 .reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 }, 48 .reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 },
@@ -51,7 +50,7 @@ static struct clksrc_clk hsmmc_div[] = {
51 [1] = { 50 [1] = {
52 .clk = { 51 .clk = {
53 .name = "hsmmc-div", 52 .name = "hsmmc-div",
54 .id = 0, 53 .id = 1,
55 .parent = &clk_esysclk.clk, 54 .parent = &clk_esysclk.clk,
56 }, 55 },
57 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, 56 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
@@ -61,7 +60,7 @@ static struct clksrc_clk hsmmc_div[] = {
61static struct clksrc_clk hsmmc_mux[] = { 60static struct clksrc_clk hsmmc_mux[] = {
62 [0] = { 61 [0] = {
63 .clk = { 62 .clk = {
64 .id = 1, 63 .id = 0,
65 .name = "hsmmc-if", 64 .name = "hsmmc-if",
66 .ctrlbit = (1 << 6), 65 .ctrlbit = (1 << 6),
67 .enable = s3c2443_clkcon_enable_s, 66 .enable = s3c2443_clkcon_enable_s,
@@ -77,7 +76,7 @@ static struct clksrc_clk hsmmc_mux[] = {
77 }, 76 },
78 [1] = { 77 [1] = {
79 .clk = { 78 .clk = {
80 .id = 0, 79 .id = 1,
81 .name = "hsmmc-if", 80 .name = "hsmmc-if",
82 .ctrlbit = (1 << 12), 81 .ctrlbit = (1 << 12),
83 .enable = s3c2443_clkcon_enable_s, 82 .enable = s3c2443_clkcon_enable_s,
@@ -93,6 +92,13 @@ static struct clksrc_clk hsmmc_mux[] = {
93 }, 92 },
94}; 93};
95 94
95static struct clk hsmmc0_clk = {
96 .name = "hsmmc",
97 .id = 0,
98 .parent = &clk_h,
99 .enable = s3c2443_clkcon_enable_h,
100 .ctrlbit = S3C2416_HCLKCON_HSMMC0,
101};
96 102
97static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0) 103static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0)
98{ 104{
@@ -130,6 +136,8 @@ void __init s3c2416_init_clocks(int xtal)
130 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) 136 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
131 s3c_register_clksrc(clksrcs[ptr], 1); 137 s3c_register_clksrc(clksrcs[ptr], 1);
132 138
139 s3c24xx_register_clock(&hsmmc0_clk);
140
133 s3c_pwmclk_init(); 141 s3c_pwmclk_init();
134 142
135} 143}
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c
index 7fc366476d7e..3f83177246c7 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c2416/mach-smdk2416.c
@@ -46,6 +46,7 @@
46#include <plat/devs.h> 46#include <plat/devs.h>
47#include <plat/cpu.h> 47#include <plat/cpu.h>
48#include <plat/nand.h> 48#include <plat/nand.h>
49#include <plat/sdhci.h>
49 50
50#include <plat/regs-fb-v4.h> 51#include <plat/regs-fb-v4.h>
51#include <plat/fb.h> 52#include <plat/fb.h>
@@ -110,6 +111,13 @@ static struct s3c2410_uartcfg smdk2416_uartcfgs[] __initdata = {
110 .ucon = UCON, 111 .ucon = UCON,
111 .ulcon = ULCON | 0x50, 112 .ulcon = ULCON | 0x50,
112 .ufcon = UFCON, 113 .ufcon = UFCON,
114 },
115 [3] = {
116 .hwport = 3,
117 .flags = 0,
118 .ucon = UCON,
119 .ulcon = ULCON,
120 .ufcon = UFCON,
113 } 121 }
114}; 122};
115 123
@@ -159,6 +167,18 @@ static struct s3c_fb_platdata smdk2416_fb_platdata = {
159 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 167 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
160}; 168};
161 169
170static struct s3c_sdhci_platdata smdk2416_hsmmc0_pdata __initdata = {
171 .max_width = 4,
172 .cd_type = S3C_SDHCI_CD_GPIO,
173 .ext_cd_gpio = S3C2410_GPF(1),
174 .ext_cd_gpio_invert = 1,
175};
176
177static struct s3c_sdhci_platdata smdk2416_hsmmc1_pdata __initdata = {
178 .max_width = 4,
179 .cd_type = S3C_SDHCI_CD_NONE,
180};
181
162static struct platform_device *smdk2416_devices[] __initdata = { 182static struct platform_device *smdk2416_devices[] __initdata = {
163 &s3c_device_fb, 183 &s3c_device_fb,
164 &s3c_device_wdt, 184 &s3c_device_wdt,
@@ -180,6 +200,9 @@ static void __init smdk2416_machine_init(void)
180 s3c_i2c0_set_platdata(NULL); 200 s3c_i2c0_set_platdata(NULL);
181 s3c_fb_set_platdata(&smdk2416_fb_platdata); 201 s3c_fb_set_platdata(&smdk2416_fb_platdata);
182 202
203 s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata);
204 s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata);
205
183 gpio_request(S3C2410_GPB(4), "USBHost Power"); 206 gpio_request(S3C2410_GPB(4), "USBHost Power");
184 gpio_direction_output(S3C2410_GPB(4), 1); 207 gpio_direction_output(S3C2410_GPB(4), 1);
185 208
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 63f39cdc0972..ba7fd8737434 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -53,6 +53,7 @@
53#include <plat/s3c2416.h> 53#include <plat/s3c2416.h>
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/sdhci.h>
56 57
57#include <plat/iic-core.h> 58#include <plat/iic-core.h>
58#include <plat/fb-core.h> 59#include <plat/fb-core.h>
@@ -115,6 +116,10 @@ void __init s3c2416_map_io(void)
115 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown; 116 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown;
116 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown; 117 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown;
117 118
119 /* initialize device information early */
120 s3c2416_default_sdhci0();
121 s3c2416_default_sdhci1();
122
118 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); 123 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
119} 124}
120 125
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 000000000000..f65cb3ef16ce
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
@@ -0,0 +1,34 @@
1/* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c
2 *
3 * Copyright 2010 Promwad Innovation Company
4 * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
5 *
6 * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
7 *
8 * Based on mach-s3c64xx/setup-sdhci-gpio.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20#include <linux/gpio.h>
21
22#include <mach/regs-gpio.h>
23#include <plat/gpio-cfg.h>
24
25void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
26{
27 s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width, S3C_GPIO_SFN(2));
28}
29
30void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
31{
32 s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2));
33 s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2));
34}
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
new file mode 100644
index 000000000000..ed34fad8f2c6
--- /dev/null
+++ b/arch/arm/mach-s3c2416/setup-sdhci.c
@@ -0,0 +1,61 @@
1/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
2 *
3 * Copyright 2010 Promwad Innovation Company
4 * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
5 *
6 * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
7 *
8 * Based on mach-s3c64xx/setup-sdhci.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20
21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h>
23
24#include <plat/regs-sdhci.h>
25#include <plat/sdhci.h>
26
27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
28
29char *s3c2416_hsmmc_clksrcs[4] = {
30 [0] = "hsmmc",
31 [1] = "hsmmc",
32 [2] = "hsmmc-if",
33 /* [3] = "48m", - note not successfully used yet */
34};
35
36void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 ctrl2 = __raw_readl(r + S3C_SDHCI_CONTROL2);
44 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
45 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
46 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
47 S3C_SDHCI_CTRL2_ENFBCLKRX |
48 S3C_SDHCI_CTRL2_DFCNT_NONE |
49 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
50
51 if (ios->clock < 25 * 1000000)
52 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
53 S3C_SDHCI_CTRL3_FCSEL2 |
54 S3C_SDHCI_CTRL3_FCSEL1 |
55 S3C_SDHCI_CTRL3_FCSEL0);
56 else
57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
58
59 __raw_writel(ctrl2, r + S3C_SDHCI_CONTROL2);
60 __raw_writel(ctrl3, r + S3C_SDHCI_CONTROL3);
61}
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index 31babec90cec..d8eb86823df7 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -10,6 +10,7 @@ config CPU_S3C2443
10 select CPU_LLSERIAL_S3C2440 10 select CPU_LLSERIAL_S3C2440
11 select SAMSUNG_CLKSRC 11 select SAMSUNG_CLKSRC
12 select S3C2443_CLOCK 12 select S3C2443_CLOCK
13 select S3C_GPIO_PULL_S3C2443
13 help 14 help
14 Support for the S3C2443 SoC from the S3C24XX line 15 Support for the S3C2443 SoC from the S3C24XX line
15 16
@@ -25,7 +26,7 @@ config MACH_SMDK2443
25 bool "SMDK2443" 26 bool "SMDK2443"
26 select CPU_S3C2443 27 select CPU_S3C2443
27 select MACH_SMDK 28 select MACH_SMDK
28 select S3C_DEV_HSMMC 29 select S3C_DEV_HSMMC1
29 help 30 help
30 Say Y here if you are using an SMDK2443 31 Say Y here if you are using an SMDK2443
31 32
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 0c3c0c884cd3..f4ec6d5715c8 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 = {
196static struct clksrc_clk clk_hsmmc_div = { 196static struct clksrc_clk clk_hsmmc_div = {
197 .clk = { 197 .clk = {
198 .name = "hsmmc-div", 198 .name = "hsmmc-div",
199 .id = -1, 199 .id = 1,
200 .parent = &clk_esysclk.clk, 200 .parent = &clk_esysclk.clk,
201 }, 201 },
202 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, 202 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
@@ -231,7 +231,7 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int enable)
231 231
232static struct clk clk_hsmmc = { 232static struct clk clk_hsmmc = {
233 .name = "hsmmc-if", 233 .name = "hsmmc-if",
234 .id = -1, 234 .id = 1,
235 .parent = &clk_hsmmc_div.clk, 235 .parent = &clk_hsmmc_div.clk,
236 .enable = s3c2443_enable_hsmmc, 236 .enable = s3c2443_enable_hsmmc,
237 .ops = &(struct clk_ops) { 237 .ops = &(struct clk_ops) {
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index 4337f0a9960d..514275e43ca0 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -99,13 +99,20 @@ static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
99 .ucon = 0x3c5, 99 .ucon = 0x3c5,
100 .ulcon = 0x43, 100 .ulcon = 0x43,
101 .ufcon = 0x51, 101 .ufcon = 0x51,
102 },
103 [3] = {
104 .hwport = 3,
105 .flags = 0,
106 .ucon = 0x3c5,
107 .ulcon = 0x03,
108 .ufcon = 0x51,
102 } 109 }
103}; 110};
104 111
105static struct platform_device *smdk2443_devices[] __initdata = { 112static struct platform_device *smdk2443_devices[] __initdata = {
106 &s3c_device_wdt, 113 &s3c_device_wdt,
107 &s3c_device_i2c0, 114 &s3c_device_i2c0,
108 &s3c_device_hsmmc0, 115 &s3c_device_hsmmc1,
109#ifdef CONFIG_SND_SOC_SMDK2443_WM9710 116#ifdef CONFIG_SND_SOC_SMDK2443_WM9710
110 &s3c_device_ac97, 117 &s3c_device_ac97,
111#endif 118#endif
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index 33d18dd1ebd5..e6a28ba52c7d 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/sysdev.h> 22#include <linux/sysdev.h>
@@ -32,6 +33,9 @@
32#include <mach/regs-s3c2443-clock.h> 33#include <mach/regs-s3c2443-clock.h>
33#include <mach/reset.h> 34#include <mach/reset.h>
34 35
36#include <plat/gpio-core.h>
37#include <plat/gpio-cfg.h>
38#include <plat/gpio-cfg-helpers.h>
35#include <plat/s3c2443.h> 39#include <plat/s3c2443.h>
36#include <plat/devs.h> 40#include <plat/devs.h>
37#include <plat/cpu.h> 41#include <plat/cpu.h>
@@ -86,6 +90,9 @@ void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
86 90
87void __init s3c2443_map_io(void) 91void __init s3c2443_map_io(void)
88{ 92{
93 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443;
94 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443;
95
89 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 96 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
90} 97}
91 98
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 2f91057a0c02..10ce6666687e 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_
194 memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); 194 memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info));
195 s3c_device_ts.dev.platform_data = &s3c2410ts_info; 195 s3c_device_ts.dev.platform_data = &s3c2410ts_info;
196} 196}
197EXPORT_SYMBOL(s3c24xx_ts_set_platdata);
198 197
199/* USB Device (Gadget)*/ 198/* USB Device (Gadget)*/
200 199
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c
index 461f070eb62d..82f2d4a39291 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[] = {
271 .ctrlbit = S3C2443_HCLKCON_DMA5, 271 .ctrlbit = S3C2443_HCLKCON_DMA5,
272 }, { 272 }, {
273 .name = "hsmmc", 273 .name = "hsmmc",
274 .id = 0, 274 .id = 1,
275 .parent = &clk_h, 275 .parent = &clk_h,
276 .enable = s3c2443_clkcon_enable_h, 276 .enable = s3c2443_clkcon_enable_h,
277 .ctrlbit = S3C2443_HCLKCON_HSMMC, 277 .ctrlbit = S3C2443_HCLKCON_HSMMC,
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 2ebf4157d93a..32be05cf82a3 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -95,6 +95,12 @@ config S3C_GPIO_PULL_UPDOWN
95 help 95 help
96 Internal configuration to enable the correct GPIO pull helper 96 Internal configuration to enable the correct GPIO pull helper
97 97
98config S3C_GPIO_PULL_S3C2443
99 bool
100 select S3C_GPIO_PULL_UPDOWN
101 help
102 Internal configuration to enable the correct GPIO pull helper for S3C2443-style GPIO
103
98config S3C_GPIO_PULL_DOWN 104config S3C_GPIO_PULL_DOWN
99 bool 105 bool
100 help 106 help
diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
index 3a7b8891ba4f..6927ae8fd118 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)
126 126
127 s3c_device_nand.dev.platform_data = npd; 127 s3c_device_nand.dev.platform_data = npd;
128} 128}
129
130EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index 0aa32f242ee4..1c0b0401594b 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,
278 pup &= 0x3; 278 pup &= 0x3;
279 return (__force s3c_gpio_pull_t)pup; 279 return (__force s3c_gpio_pull_t)pup;
280} 280}
281
282#ifdef CONFIG_S3C_GPIO_PULL_S3C2443
283int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
284 unsigned int off, s3c_gpio_pull_t pull)
285{
286 switch (pull) {
287 case S3C_GPIO_PULL_NONE:
288 pull = 0x01;
289 break;
290 case S3C_GPIO_PULL_UP:
291 pull = 0x00;
292 break;
293 case S3C_GPIO_PULL_DOWN:
294 pull = 0x02;
295 break;
296 }
297 return s3c_gpio_setpull_updown(chip, off, pull);
298}
299
300s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
301 unsigned int off)
302{
303 s3c_gpio_pull_t pull;
304
305 pull = s3c_gpio_getpull_updown(chip, off);
306
307 switch (pull) {
308 case 0x00:
309 pull = S3C_GPIO_PULL_UP;
310 break;
311 case 0x01:
312 case 0x03:
313 pull = S3C_GPIO_PULL_NONE;
314 break;
315 case 0x02:
316 pull = S3C_GPIO_PULL_DOWN;
317 break;
318 }
319
320 return pull;
321}
322#endif
281#endif 323#endif
282 324
283#if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN) 325#if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN)
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 0d2c5703f1ee..5603db0b79bc 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
@@ -244,7 +244,7 @@ extern int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip,
244 * This helper function reads the state of the pull-{up,down} resistor for the 244 * This helper function reads the state of the pull-{up,down} resistor for the
245 * given GPIO in the same case as s3c_gpio_setpull_upown. 245 * given GPIO in the same case as s3c_gpio_setpull_upown.
246*/ 246*/
247extern s3c_gpio_pull_t s3c_gpio_getpull_s3c24xx(struct s3c_gpio_chip *chip, 247extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip,
248 unsigned int off); 248 unsigned int off);
249 249
250#endif /* __PLAT_GPIO_CFG_HELPERS_H */ 250#endif /* __PLAT_GPIO_CFG_HELPERS_H */
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 85853f8c4c5d..5a41a0b69eec 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;
107 107
108/* Helper function availablity */ 108/* Helper function availablity */
109 109
110extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
111extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
110extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 112extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
111extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 113extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
112extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 114extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
@@ -122,6 +124,39 @@ extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
122extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 124extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
123extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w); 125extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
124 126
127/* S3C2416 SDHCI setup */
128
129#ifdef CONFIG_S3C2416_SETUP_SDHCI
130extern char *s3c2416_hsmmc_clksrcs[4];
131
132extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
133 void __iomem *r,
134 struct mmc_ios *ios,
135 struct mmc_card *card);
136
137static inline void s3c2416_default_sdhci0(void)
138{
139#ifdef CONFIG_S3C_DEV_HSMMC
140 s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
141 s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
142 s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
143#endif /* CONFIG_S3C_DEV_HSMMC */
144}
145
146static inline void s3c2416_default_sdhci1(void)
147{
148#ifdef CONFIG_S3C_DEV_HSMMC1
149 s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
150 s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
151 s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
152#endif /* CONFIG_S3C_DEV_HSMMC1 */
153}
154
155#else
156static inline void s3c2416_default_sdhci0(void) { }
157static inline void s3c2416_default_sdhci1(void) { }
158
159#endif /* CONFIG_S3C2416_SETUP_SDHCI */
125/* S3C64XX SDHCI setup */ 160/* S3C64XX SDHCI setup */
126 161
127#ifdef CONFIG_S3C64XX_SETUP_SDHCI 162#ifdef CONFIG_S3C64XX_SETUP_SDHCI