aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig40
-rw-r--r--arch/arm/mach-s3c64xx/Makefile4
-rw-r--r--arch/arm/mach-s3c64xx/dev-onenand1.c55
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/map.h14
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c363
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.h20
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq5.c185
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq7.c201
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c13
-rw-r--r--arch/arm/mach-s3c64xx/pm.c20
-rw-r--r--arch/arm/mach-s3c64xx/s3c6400.c4
-rw-r--r--arch/arm/mach-s3c64xx/s3c6410.c3
13 files changed, 926 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 69e9fbfea917..f5a59727949f 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -7,6 +7,7 @@
7config PLAT_S3C64XX 7config PLAT_S3C64XX
8 bool 8 bool
9 depends on ARCH_S3C64XX 9 depends on ARCH_S3C64XX
10 select SAMSUNG_WAKEMASK
10 default y 11 default y
11 help 12 help
12 Base platform code for any Samsung S3C64XX device 13 Base platform code for any Samsung S3C64XX device
@@ -35,6 +36,11 @@ config S3C64XX_SETUP_SDHCI
35 Internal configuration for default SDHCI setup for S3C6400 and 36 Internal configuration for default SDHCI setup for S3C6400 and
36 S3C6410 SoCs. 37 S3C6410 SoCs.
37 38
39config S3C64XX_DEV_ONENAND1
40 bool
41 help
42 Compile in platform device definition for OneNAND1 controller
43
38# platform specific device setup 44# platform specific device setup
39 45
40config S3C64XX_SETUP_I2C0 46config S3C64XX_SETUP_I2C0
@@ -90,8 +96,11 @@ config MACH_SMDK6410
90 select S3C_DEV_HSMMC1 96 select S3C_DEV_HSMMC1
91 select S3C_DEV_I2C1 97 select S3C_DEV_I2C1
92 select S3C_DEV_FB 98 select S3C_DEV_FB
99 select SAMSUNG_DEV_TS
93 select S3C_DEV_USB_HOST 100 select S3C_DEV_USB_HOST
94 select S3C_DEV_USB_HSOTG 101 select S3C_DEV_USB_HSOTG
102 select S3C_DEV_WDT
103 select HAVE_S3C2410_WATCHDOG
95 select S3C64XX_SETUP_SDHCI 104 select S3C64XX_SETUP_SDHCI
96 select S3C64XX_SETUP_I2C1 105 select S3C64XX_SETUP_I2C1
97 select S3C64XX_SETUP_FB_24BPP 106 select S3C64XX_SETUP_FB_24BPP
@@ -179,3 +188,34 @@ config MACH_HMT
179 select HAVE_PWM 188 select HAVE_PWM
180 help 189 help
181 Machine support for the Airgoo HMT 190 Machine support for the Airgoo HMT
191
192config MACH_SMARTQ
193 bool
194 select CPU_S3C6410
195 select S3C_DEV_HSMMC
196 select S3C_DEV_HSMMC1
197 select S3C_DEV_HSMMC2
198 select S3C_DEV_FB
199 select S3C_DEV_HWMON
200 select S3C_DEV_RTC
201 select S3C_DEV_USB_HSOTG
202 select S3C_DEV_USB_HOST
203 select S3C64XX_SETUP_SDHCI
204 select S3C64XX_SETUP_FB_24BPP
205 select SAMSUNG_DEV_ADC
206 select SAMSUNG_DEV_TS
207 select HAVE_PWM
208 help
209 Shared machine support for SmartQ 5/7
210
211config MACH_SMARTQ5
212 bool "SmartQ 5"
213 select MACH_SMARTQ
214 help
215 Machine support for the SmartQ 5
216
217config MACH_SMARTQ7
218 bool "SmartQ 7"
219 select MACH_SMARTQ
220 help
221 Machine support for the SmartQ 7
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index a10f1fc6b023..9d1006938f5c 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -52,6 +52,9 @@ obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
52obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 52obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
53obj-$(CONFIG_MACH_NCP) += mach-ncp.o 53obj-$(CONFIG_MACH_NCP) += mach-ncp.o
54obj-$(CONFIG_MACH_HMT) += mach-hmt.o 54obj-$(CONFIG_MACH_HMT) += mach-hmt.o
55obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o
56obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o
57obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o
55 58
56# device support 59# device support
57 60
@@ -59,3 +62,4 @@ obj-y += dev-uart.o
59obj-y += dev-audio.o 62obj-y += dev-audio.o
60obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 63obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
61obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o 64obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o
65obj-$(CONFIG_S3C64XX_DEV_ONENAND1) += dev-onenand1.o
diff --git a/arch/arm/mach-s3c64xx/dev-onenand1.c b/arch/arm/mach-s3c64xx/dev-onenand1.c
new file mode 100644
index 000000000000..92ffd5bac104
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/dev-onenand1.c
@@ -0,0 +1,55 @@
1/*
2 * linux/arch/arm/mach-s3c64xx/dev-onenand1.c
3 *
4 * Copyright (c) 2008-2010 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * S3C64XX series device definition for OneNAND devices
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/onenand.h>
18
19#include <mach/irqs.h>
20#include <mach/map.h>
21
22static struct resource s3c64xx_onenand1_resources[] = {
23 [0] = {
24 .start = S3C64XX_PA_ONENAND1,
25 .end = S3C64XX_PA_ONENAND1 + 0x400 - 1,
26 .flags = IORESOURCE_MEM,
27 },
28 [1] = {
29 .start = S3C64XX_PA_ONENAND1_BUF,
30 .end = S3C64XX_PA_ONENAND1_BUF + S3C64XX_SZ_ONENAND1_BUF - 1,
31 .flags = IORESOURCE_MEM,
32 },
33 [2] = {
34 .start = IRQ_ONENAND1,
35 .end = IRQ_ONENAND1,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40struct platform_device s3c64xx_device_onenand1 = {
41 .name = "samsung-onenand",
42 .id = 1,
43 .num_resources = ARRAY_SIZE(s3c64xx_onenand1_resources),
44 .resource = s3c64xx_onenand1_resources,
45};
46
47void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
48{
49 struct onenand_platform_data *pd;
50
51 pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL);
52 if (!pd)
53 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
54 s3c64xx_device_onenand1.dev.platform_data = pd;
55}
diff --git a/arch/arm/mach-s3c64xx/include/mach/irqs.h b/arch/arm/mach-s3c64xx/include/mach/irqs.h
index e9ab4ac0b9a8..8e2df26cf14a 100644
--- a/arch/arm/mach-s3c64xx/include/mach/irqs.h
+++ b/arch/arm/mach-s3c64xx/include/mach/irqs.h
@@ -212,5 +212,9 @@
212 212
213#define NR_IRQS (IRQ_BOARD_END + 1) 213#define NR_IRQS (IRQ_BOARD_END + 1)
214 214
215/* Compatibility */
216
217#define IRQ_ONENAND IRQ_ONENAND0
218
215#endif /* __ASM_MACH_S3C64XX_IRQS_H */ 219#endif /* __ASM_MACH_S3C64XX_IRQS_H */
216 220
diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h
index 9fdd50c8c767..e1eab3c94aea 100644
--- a/arch/arm/mach-s3c64xx/include/mach/map.h
+++ b/arch/arm/mach-s3c64xx/include/mach/map.h
@@ -52,6 +52,16 @@
52 52
53#define S3C64XX_PA_SROM (0x70000000) 53#define S3C64XX_PA_SROM (0x70000000)
54 54
55#define S3C64XX_PA_ONENAND0 (0x70100000)
56#define S3C64XX_PA_ONENAND0_BUF (0x20000000)
57#define S3C64XX_SZ_ONENAND0_BUF (SZ_64M)
58
59/* NAND and OneNAND1 controllers occupy the same register region
60 (depending on SoC POP version) */
61#define S3C64XX_PA_ONENAND1 (0x70200000)
62#define S3C64XX_PA_ONENAND1_BUF (0x28000000)
63#define S3C64XX_SZ_ONENAND1_BUF (SZ_64M)
64
55#define S3C64XX_PA_NAND (0x70200000) 65#define S3C64XX_PA_NAND (0x70200000)
56#define S3C64XX_PA_FB (0x77100000) 66#define S3C64XX_PA_FB (0x77100000)
57#define S3C64XX_PA_USB_HSOTG (0x7C000000) 67#define S3C64XX_PA_USB_HSOTG (0x7C000000)
@@ -99,11 +109,15 @@
99#define S3C_PA_IIC S3C64XX_PA_IIC0 109#define S3C_PA_IIC S3C64XX_PA_IIC0
100#define S3C_PA_IIC1 S3C64XX_PA_IIC1 110#define S3C_PA_IIC1 S3C64XX_PA_IIC1
101#define S3C_PA_NAND S3C64XX_PA_NAND 111#define S3C_PA_NAND S3C64XX_PA_NAND
112#define S3C_PA_ONENAND S3C64XX_PA_ONENAND0
113#define S3C_PA_ONENAND_BUF S3C64XX_PA_ONENAND0_BUF
114#define S3C_SZ_ONENAND_BUF S3C64XX_SZ_ONENAND0_BUF
102#define S3C_PA_FB S3C64XX_PA_FB 115#define S3C_PA_FB S3C64XX_PA_FB
103#define S3C_PA_USBHOST S3C64XX_PA_USBHOST 116#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
104#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG 117#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
105#define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY 118#define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY
106#define S3C_PA_RTC S3C64XX_PA_RTC 119#define S3C_PA_RTC S3C64XX_PA_RTC
120#define S3C_PA_WDT S3C64XX_PA_WATCHDOG
107 121
108#define SAMSUNG_PA_ADC S3C64XX_PA_ADC 122#define SAMSUNG_PA_ADC S3C64XX_PA_ADC
109 123
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
new file mode 100644
index 000000000000..028d080dcd35
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -0,0 +1,363 @@
1/*
2 * linux/arch/arm/mach-s3c64xx/mach-smartq.c
3 *
4 * Copyright (C) 2010 Maurus Cuelenaere
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/delay.h>
13#include <linux/fb.h>
14#include <linux/gpio.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/pwm_backlight.h>
18#include <linux/serial_core.h>
19#include <linux/usb/gpio_vbus.h>
20
21#include <asm/mach-types.h>
22#include <asm/mach/map.h>
23
24#include <mach/map.h>
25#include <mach/regs-gpio.h>
26#include <mach/regs-modem.h>
27
28#include <plat/clock.h>
29#include <plat/cpu.h>
30#include <plat/devs.h>
31#include <plat/iic.h>
32#include <plat/gpio-cfg.h>
33#include <plat/hwmon.h>
34#include <plat/regs-serial.h>
35#include <plat/udc-hs.h>
36#include <plat/usb-control.h>
37#include <plat/sdhci.h>
38#include <plat/ts.h>
39
40#include <video/platform_lcd.h>
41
42#define UCON S3C2410_UCON_DEFAULT
43#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)
44#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
45
46static struct s3c2410_uartcfg smartq_uartcfgs[] __initdata = {
47 [0] = {
48 .hwport = 0,
49 .flags = 0,
50 .ucon = UCON,
51 .ulcon = ULCON,
52 .ufcon = UFCON,
53 },
54 [1] = {
55 .hwport = 1,
56 .flags = 0,
57 .ucon = UCON,
58 .ulcon = ULCON,
59 .ufcon = UFCON,
60 },
61 [2] = {
62 .hwport = 2,
63 .flags = 0,
64 .ucon = UCON,
65 .ulcon = ULCON,
66 .ufcon = UFCON,
67 },
68};
69
70static void smartq_usb_host_powercontrol(int port, int to)
71{
72 pr_debug("%s(%d, %d)\n", __func__, port, to);
73
74 if (port == 0) {
75 gpio_set_value(S3C64XX_GPL(0), to);
76 gpio_set_value(S3C64XX_GPL(1), to);
77 }
78}
79
80static irqreturn_t smartq_usb_host_ocirq(int irq, void *pw)
81{
82 struct s3c2410_hcd_info *info = pw;
83
84 if (gpio_get_value(S3C64XX_GPL(10)) == 0) {
85 pr_debug("%s: over-current irq (oc detected)\n", __func__);
86 s3c2410_usb_report_oc(info, 3);
87 } else {
88 pr_debug("%s: over-current irq (oc cleared)\n", __func__);
89 s3c2410_usb_report_oc(info, 0);
90 }
91
92 return IRQ_HANDLED;
93}
94
95static void smartq_usb_host_enableoc(struct s3c2410_hcd_info *info, int on)
96{
97 int ret;
98
99 /* This isn't present on a SmartQ 5 board */
100 if (machine_is_smartq5())
101 return;
102
103 if (on) {
104 ret = request_irq(gpio_to_irq(S3C64XX_GPL(10)),
105 smartq_usb_host_ocirq, IRQF_DISABLED |
106 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
107 "USB host overcurrent", info);
108 if (ret != 0)
109 pr_err("failed to request usb oc irq: %d\n", ret);
110 } else {
111 free_irq(gpio_to_irq(S3C64XX_GPL(10)), info);
112 }
113}
114
115static struct s3c2410_hcd_info smartq_usb_host_info = {
116 .port[0] = {
117 .flags = S3C_HCDFLG_USED
118 },
119 .port[1] = {
120 .flags = 0
121 },
122
123 .power_control = smartq_usb_host_powercontrol,
124 .enable_oc = smartq_usb_host_enableoc,
125};
126
127static struct gpio_vbus_mach_info smartq_usb_otg_vbus_pdata = {
128 .gpio_vbus = S3C64XX_GPL(9),
129 .gpio_pullup = -1,
130 .gpio_vbus_inverted = true,
131};
132
133static struct platform_device smartq_usb_otg_vbus_dev = {
134 .name = "gpio-vbus",
135 .dev.platform_data = &smartq_usb_otg_vbus_pdata,
136};
137
138static int __init smartq_bl_init(struct device *dev)
139{
140 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
141
142 return 0;
143}
144
145static struct platform_pwm_backlight_data smartq_backlight_data = {
146 .pwm_id = 1,
147 .max_brightness = 1000,
148 .dft_brightness = 600,
149 .pwm_period_ns = 1000000000 / (1000 * 20),
150 .init = smartq_bl_init,
151};
152
153static struct platform_device smartq_backlight_device = {
154 .name = "pwm-backlight",
155 .dev = {
156 .parent = &s3c_device_timer[1].dev,
157 .platform_data = &smartq_backlight_data,
158 },
159};
160
161static struct s3c2410_ts_mach_info smartq_touchscreen_pdata __initdata = {
162 .delay = 65535,
163 .presc = 99,
164 .oversampling_shift = 4,
165};
166
167static struct s3c_sdhci_platdata smartq_internal_hsmmc_pdata = {
168 .max_width = 4,
169 /*.broken_card_detection = true,*/
170};
171
172static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
173 /* Battery voltage (?-4.2V) */
174 .in[0] = &(struct s3c_hwmon_chcfg) {
175 .name = "smartq:battery-voltage",
176 .mult = 3300,
177 .div = 2048,
178 },
179 /* Reference voltage (1.2V) */
180 .in[1] = &(struct s3c_hwmon_chcfg) {
181 .name = "smartq:reference-voltage",
182 .mult = 3300,
183 .div = 4096,
184 },
185};
186
187static void smartq_lcd_power_set(struct plat_lcd_data *pd, unsigned int power)
188{
189 gpio_direction_output(S3C64XX_GPM(3), power);
190}
191
192static struct plat_lcd_data smartq_lcd_power_data = {
193 .set_power = smartq_lcd_power_set,
194};
195
196static struct platform_device smartq_lcd_power_device = {
197 .name = "platform-lcd",
198 .dev.parent = &s3c_device_fb.dev,
199 .dev.platform_data = &smartq_lcd_power_data,
200};
201
202
203static struct platform_device *smartq_devices[] __initdata = {
204 &s3c_device_hsmmc1, /* Init iNAND first, ... */
205 &s3c_device_hsmmc0, /* ... then the external SD card */
206 &s3c_device_hsmmc2,
207 &s3c_device_adc,
208 &s3c_device_fb,
209 &s3c_device_hwmon,
210 &s3c_device_i2c0,
211 &s3c_device_ohci,
212 &s3c_device_rtc,
213 &s3c_device_timer[1],
214 &s3c_device_ts,
215 &s3c_device_usb_hsotg,
216 &smartq_backlight_device,
217 &smartq_lcd_power_device,
218 &smartq_usb_otg_vbus_dev,
219};
220
221static void __init smartq_lcd_mode_set(void)
222{
223 u32 tmp;
224
225 /* set the LCD type */
226 tmp = __raw_readl(S3C64XX_SPCON);
227 tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK;
228 tmp |= S3C64XX_SPCON_LCD_SEL_RGB;
229 __raw_writel(tmp, S3C64XX_SPCON);
230
231 /* remove the LCD bypass */
232 tmp = __raw_readl(S3C64XX_MODEM_MIFPCON);
233 tmp &= ~MIFPCON_LCD_BYPASS;
234 __raw_writel(tmp, S3C64XX_MODEM_MIFPCON);
235}
236
237static void smartq_power_off(void)
238{
239 gpio_direction_output(S3C64XX_GPK(15), 1);
240}
241
242static int __init smartq_power_off_init(void)
243{
244 int ret;
245
246 ret = gpio_request(S3C64XX_GPK(15), "Power control");
247 if (ret < 0) {
248 pr_err("%s: failed to get GPK15\n", __func__);
249 return ret;
250 }
251
252 /* leave power on */
253 gpio_direction_output(S3C64XX_GPK(15), 0);
254
255
256 pm_power_off = smartq_power_off;
257
258 return ret;
259}
260
261static int __init smartq_usb_host_init(void)
262{
263 int ret;
264
265 ret = gpio_request(S3C64XX_GPL(0), "USB power control");
266 if (ret < 0) {
267 pr_err("%s: failed to get GPL0\n", __func__);
268 return ret;
269 }
270
271 ret = gpio_request(S3C64XX_GPL(1), "USB host power control");
272 if (ret < 0) {
273 pr_err("%s: failed to get GPL1\n", __func__);
274 goto err;
275 }
276
277 if (!machine_is_smartq5()) {
278 /* This isn't present on a SmartQ 5 board */
279 ret = gpio_request(S3C64XX_GPL(10), "USB host overcurrent");
280 if (ret < 0) {
281 pr_err("%s: failed to get GPL10\n", __func__);
282 goto err2;
283 }
284 }
285
286 /* turn power off */
287 gpio_direction_output(S3C64XX_GPL(0), 0);
288 gpio_direction_output(S3C64XX_GPL(1), 0);
289 if (!machine_is_smartq5())
290 gpio_direction_input(S3C64XX_GPL(10));
291
292 s3c_device_ohci.dev.platform_data = &smartq_usb_host_info;
293
294 return 0;
295
296err2:
297 gpio_free(S3C64XX_GPL(1));
298err:
299 gpio_free(S3C64XX_GPL(0));
300 return ret;
301}
302
303static int __init smartq_usb_otg_init(void)
304{
305 clk_xusbxti.rate = 12000000;
306
307 return 0;
308}
309
310static int __init smartq_wifi_init(void)
311{
312 int ret;
313
314 ret = gpio_request(S3C64XX_GPK(1), "wifi control");
315 if (ret < 0) {
316 pr_err("%s: failed to get GPK1\n", __func__);
317 return ret;
318 }
319
320 ret = gpio_request(S3C64XX_GPK(2), "wifi reset");
321 if (ret < 0) {
322 pr_err("%s: failed to get GPK2\n", __func__);
323 gpio_free(S3C64XX_GPK(1));
324 return ret;
325 }
326
327 /* turn power on */
328 gpio_direction_output(S3C64XX_GPK(1), 1);
329
330 /* reset device */
331 gpio_direction_output(S3C64XX_GPK(2), 0);
332 mdelay(100);
333 gpio_set_value(S3C64XX_GPK(2), 1);
334 gpio_direction_input(S3C64XX_GPK(2));
335
336 return 0;
337}
338
339static struct map_desc smartq_iodesc[] __initdata = {};
340void __init smartq_map_io(void)
341{
342 s3c64xx_init_io(smartq_iodesc, ARRAY_SIZE(smartq_iodesc));
343 s3c24xx_init_clocks(12000000);
344 s3c24xx_init_uarts(smartq_uartcfgs, ARRAY_SIZE(smartq_uartcfgs));
345
346 smartq_lcd_mode_set();
347}
348
349void __init smartq_machine_init(void)
350{
351 s3c_i2c0_set_platdata(NULL);
352 s3c_hwmon_set_platdata(&smartq_hwmon_pdata);
353 s3c_sdhci1_set_platdata(&smartq_internal_hsmmc_pdata);
354 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
355 s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata);
356
357 WARN_ON(smartq_power_off_init());
358 WARN_ON(smartq_usb_host_init());
359 WARN_ON(smartq_usb_otg_init());
360 WARN_ON(smartq_wifi_init());
361
362 platform_add_devices(smartq_devices, ARRAY_SIZE(smartq_devices));
363}
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.h b/arch/arm/mach-s3c64xx/mach-smartq.h
new file mode 100644
index 000000000000..8e8b693db3af
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-smartq.h
@@ -0,0 +1,20 @@
1/*
2 * linux/arch/arm/mach-s3c64xx/mach-smartq.h
3 *
4 * Copyright (C) 2010 Maurus Cuelenaere
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef __MACH_SMARTQ_H
13#define __MACH_SMARTQ_H __FILE__
14
15#include <linux/init.h>
16
17extern void __init smartq_map_io(void);
18extern void __init smartq_machine_init(void);
19
20#endif /* __MACH_SMARTQ_H */
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
new file mode 100644
index 000000000000..1d0326ead90f
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -0,0 +1,185 @@
1/*
2 * linux/arch/arm/mach-s3c64xx/mach-smartq5.c
3 *
4 * Copyright (C) 2010 Maurus Cuelenaere
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/fb.h>
13#include <linux/gpio.h>
14#include <linux/gpio_keys.h>
15#include <linux/i2c-gpio.h>
16#include <linux/init.h>
17#include <linux/input.h>
18#include <linux/leds.h>
19#include <linux/platform_device.h>
20
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23
24#include <mach/map.h>
25#include <mach/regs-fb.h>
26#include <mach/regs-gpio.h>
27#include <mach/s3c6410.h>
28
29#include <plat/cpu.h>
30#include <plat/devs.h>
31#include <plat/fb.h>
32#include <plat/gpio-cfg.h>
33
34#include "mach-smartq.h"
35
36static void __init smartq5_lcd_setup_gpio(void)
37{
38 gpio_request(S3C64XX_GPM(0), "LCD SCEN pin");
39 gpio_request(S3C64XX_GPM(1), "LCD SCL pin");
40 gpio_request(S3C64XX_GPM(2), "LCD SDA pin");
41 gpio_request(S3C64XX_GPM(3), "LCD power");
42
43 /* turn power off */
44 gpio_direction_output(S3C64XX_GPM(0), 1);
45 gpio_direction_input(S3C64XX_GPM(1));
46 gpio_direction_input(S3C64XX_GPM(2));
47 gpio_direction_output(S3C64XX_GPM(3), 0);
48}
49
50static struct i2c_gpio_platform_data smartq5_lcd_control = {
51 .sda_pin = S3C64XX_GPM(2),
52 .scl_pin = S3C64XX_GPM(1),
53};
54
55static struct platform_device smartq5_lcd_control_device = {
56 .name = "i2c-gpio",
57 .id = 1,
58 .dev.platform_data = &smartq5_lcd_control,
59};
60
61static struct gpio_led smartq5_leds[] __initdata = {
62 {
63 .name = "smartq5:green",
64 .active_low = 1,
65 .gpio = S3C64XX_GPN(8),
66 },
67 {
68 .name = "smartq5:red",
69 .active_low = 1,
70 .gpio = S3C64XX_GPN(9),
71 },
72};
73
74static struct gpio_led_platform_data smartq5_led_data = {
75 .num_leds = ARRAY_SIZE(smartq5_leds),
76 .leds = smartq5_leds,
77};
78
79static struct platform_device smartq5_leds_device = {
80 .name = "leds-gpio",
81 .id = -1,
82 .dev.platform_data = &smartq5_led_data,
83};
84
85/* Labels according to the SmartQ manual */
86static struct gpio_keys_button smartq5_buttons[] = {
87 {
88 .gpio = S3C64XX_GPL(14),
89 .code = KEY_POWER,
90 .desc = "Power",
91 .active_low = 1,
92 .debounce_interval = 5,
93 .type = EV_KEY,
94 },
95 {
96 .gpio = S3C64XX_GPN(2),
97 .code = KEY_KPMINUS,
98 .desc = "Minus",
99 .active_low = 1,
100 .debounce_interval = 5,
101 .type = EV_KEY,
102 },
103 {
104 .gpio = S3C64XX_GPN(12),
105 .code = KEY_KPPLUS,
106 .desc = "Plus",
107 .active_low = 1,
108 .debounce_interval = 5,
109 .type = EV_KEY,
110 },
111 {
112 .gpio = S3C64XX_GPN(15),
113 .code = KEY_ENTER,
114 .desc = "Move",
115 .active_low = 1,
116 .debounce_interval = 5,
117 .type = EV_KEY,
118 },
119};
120
121static struct gpio_keys_platform_data smartq5_buttons_data = {
122 .buttons = smartq5_buttons,
123 .nbuttons = ARRAY_SIZE(smartq5_buttons),
124};
125
126static struct platform_device smartq5_buttons_device = {
127 .name = "gpio-keys",
128 .id = 0,
129 .num_resources = 0,
130 .dev = {
131 .platform_data = &smartq5_buttons_data,
132 }
133};
134
135static struct s3c_fb_pd_win smartq5_fb_win0 = {
136 .win_mode = {
137 .pixclock = 1000000000000ULL /
138 ((40+1+216+800)*(10+1+35+480)*80),
139 .left_margin = 40,
140 .right_margin = 216,
141 .upper_margin = 10,
142 .lower_margin = 35,
143 .hsync_len = 1,
144 .vsync_len = 1,
145 .xres = 800,
146 .yres = 480,
147 },
148 .max_bpp = 32,
149 .default_bpp = 16,
150};
151
152static struct s3c_fb_platdata smartq5_lcd_pdata __initdata = {
153 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
154 .win[0] = &smartq5_fb_win0,
155 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
156 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
157 VIDCON1_INV_VDEN,
158};
159
160static struct platform_device *smartq5_devices[] __initdata = {
161 &smartq5_leds_device,
162 &smartq5_buttons_device,
163 &smartq5_lcd_control_device,
164};
165
166static void __init smartq5_machine_init(void)
167{
168 s3c_fb_set_platdata(&smartq5_lcd_pdata);
169
170 smartq_machine_init();
171 smartq5_lcd_setup_gpio();
172
173 platform_add_devices(smartq5_devices, ARRAY_SIZE(smartq5_devices));
174}
175
176MACHINE_START(SMARTQ5, "SmartQ 5")
177 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
178 .phys_io = S3C_PA_UART & 0xfff00000,
179 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
180 .boot_params = S3C64XX_PA_SDRAM + 0x100,
181 .init_irq = s3c6410_init_irq,
182 .map_io = smartq_map_io,
183 .init_machine = smartq5_machine_init,
184 .timer = &s3c24xx_timer,
185MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
new file mode 100644
index 000000000000..e0bc78ecb156
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -0,0 +1,201 @@
1/*
2 * linux/arch/arm/mach-s3c64xx/mach-smartq7.c
3 *
4 * Copyright (C) 2010 Maurus Cuelenaere
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/fb.h>
13#include <linux/gpio.h>
14#include <linux/gpio_keys.h>
15#include <linux/i2c-gpio.h>
16#include <linux/init.h>
17#include <linux/input.h>
18#include <linux/leds.h>
19#include <linux/platform_device.h>
20
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23
24#include <mach/map.h>
25#include <mach/regs-fb.h>
26#include <mach/regs-gpio.h>
27#include <mach/s3c6410.h>
28
29#include <plat/cpu.h>
30#include <plat/devs.h>
31#include <plat/fb.h>
32#include <plat/gpio-cfg.h>
33
34#include "mach-smartq.h"
35
36static void __init smartq7_lcd_setup_gpio(void)
37{
38 gpio_request(S3C64XX_GPM(0), "LCD CSB pin");
39 gpio_request(S3C64XX_GPM(3), "LCD power");
40 gpio_request(S3C64XX_GPM(4), "LCD power status");
41
42 /* turn power off */
43 gpio_direction_output(S3C64XX_GPM(0), 1);
44 gpio_direction_output(S3C64XX_GPM(3), 0);
45 gpio_direction_input(S3C64XX_GPM(4));
46}
47
48static struct i2c_gpio_platform_data smartq7_lcd_control = {
49 .sda_pin = S3C64XX_GPM(2),
50 .scl_pin = S3C64XX_GPM(1),
51 .sda_is_open_drain = 1,
52 .scl_is_open_drain = 1,
53};
54
55static struct platform_device smartq7_lcd_control_device = {
56 .name = "i2c-gpio",
57 .id = 1,
58 .dev.platform_data = &smartq7_lcd_control,
59};
60
61static struct gpio_led smartq7_leds[] __initdata = {
62 {
63 .name = "smartq7:red",
64 .active_low = 1,
65 .gpio = S3C64XX_GPN(8),
66 },
67 {
68 .name = "smartq7:green",
69 .active_low = 1,
70 .gpio = S3C64XX_GPN(9),
71 },
72};
73
74static struct gpio_led_platform_data smartq7_led_data = {
75 .num_leds = ARRAY_SIZE(smartq7_leds),
76 .leds = smartq7_leds,
77};
78
79static struct platform_device smartq7_leds_device = {
80 .name = "leds-gpio",
81 .id = -1,
82 .dev.platform_data = &smartq7_led_data,
83};
84
85/* Labels according to the SmartQ manual */
86static struct gpio_keys_button smartq7_buttons[] = {
87 {
88 .gpio = S3C64XX_GPL(14),
89 .code = KEY_POWER,
90 .desc = "Power",
91 .active_low = 1,
92 .debounce_interval = 5,
93 .type = EV_KEY,
94 },
95 {
96 .gpio = S3C64XX_GPN(2),
97 .code = KEY_FN,
98 .desc = "Function",
99 .active_low = 1,
100 .debounce_interval = 5,
101 .type = EV_KEY,
102 },
103 {
104 .gpio = S3C64XX_GPN(3),
105 .code = KEY_KPMINUS,
106 .desc = "Minus",
107 .active_low = 1,
108 .debounce_interval = 5,
109 .type = EV_KEY,
110 },
111 {
112 .gpio = S3C64XX_GPN(4),
113 .code = KEY_KPPLUS,
114 .desc = "Plus",
115 .active_low = 1,
116 .debounce_interval = 5,
117 .type = EV_KEY,
118 },
119 {
120 .gpio = S3C64XX_GPN(12),
121 .code = KEY_ENTER,
122 .desc = "Enter",
123 .active_low = 1,
124 .debounce_interval = 5,
125 .type = EV_KEY,
126 },
127 {
128 .gpio = S3C64XX_GPN(15),
129 .code = KEY_ESC,
130 .desc = "Cancel",
131 .active_low = 1,
132 .debounce_interval = 5,
133 .type = EV_KEY,
134 },
135};
136
137static struct gpio_keys_platform_data smartq7_buttons_data = {
138 .buttons = smartq7_buttons,
139 .nbuttons = ARRAY_SIZE(smartq7_buttons),
140};
141
142static struct platform_device smartq7_buttons_device = {
143 .name = "gpio-keys",
144 .id = 0,
145 .num_resources = 0,
146 .dev = {
147 .platform_data = &smartq7_buttons_data,
148 }
149};
150
151static struct s3c_fb_pd_win smartq7_fb_win0 = {
152 .win_mode = {
153 .pixclock = 1000000000000ULL /
154 ((3+10+5+800)*(1+3+20+480)*80),
155 .left_margin = 3,
156 .right_margin = 5,
157 .upper_margin = 1,
158 .lower_margin = 20,
159 .hsync_len = 10,
160 .vsync_len = 3,
161 .xres = 800,
162 .yres = 480,
163 },
164 .max_bpp = 32,
165 .default_bpp = 16,
166};
167
168static struct s3c_fb_platdata smartq7_lcd_pdata __initdata = {
169 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
170 .win[0] = &smartq7_fb_win0,
171 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
172 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
173 VIDCON1_INV_VCLK,
174};
175
176static struct platform_device *smartq7_devices[] __initdata = {
177 &smartq7_leds_device,
178 &smartq7_buttons_device,
179 &smartq7_lcd_control_device,
180};
181
182static void __init smartq7_machine_init(void)
183{
184 s3c_fb_set_platdata(&smartq7_lcd_pdata);
185
186 smartq_machine_init();
187 smartq7_lcd_setup_gpio();
188
189 platform_add_devices(smartq7_devices, ARRAY_SIZE(smartq7_devices));
190}
191
192MACHINE_START(SMARTQ7, "SmartQ 7")
193 /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
194 .phys_io = S3C_PA_UART & 0xfff00000,
195 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
196 .boot_params = S3C64XX_PA_SDRAM + 0x100,
197 .init_irq = s3c6410_init_irq,
198 .map_io = smartq_map_io,
199 .init_machine = smartq7_machine_init,
200 .timer = &s3c24xx_timer,
201MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 9d51455feb31..d9a03555f88b 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -64,6 +64,8 @@
64#include <plat/clock.h> 64#include <plat/clock.h>
65#include <plat/devs.h> 65#include <plat/devs.h>
66#include <plat/cpu.h> 66#include <plat/cpu.h>
67#include <plat/adc.h>
68#include <plat/ts.h>
67 69
68#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 70#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
69#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 71#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -262,6 +264,9 @@ static struct platform_device *smdk6410_devices[] __initdata = {
262 &smdk6410_lcd_powerdev, 264 &smdk6410_lcd_powerdev,
263 265
264 &smdk6410_smsc911x, 266 &smdk6410_smsc911x,
267 &s3c_device_adc,
268 &s3c_device_ts,
269 &s3c_device_wdt,
265}; 270};
266 271
267#ifdef CONFIG_REGULATOR 272#ifdef CONFIG_REGULATOR
@@ -596,6 +601,12 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
596 { I2C_BOARD_INFO("24c128", 0x57), }, /* Samsung S524AD0XD1 */ 601 { I2C_BOARD_INFO("24c128", 0x57), }, /* Samsung S524AD0XD1 */
597}; 602};
598 603
604static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
605 .delay = 10000,
606 .presc = 49,
607 .oversampling_shift = 2,
608};
609
599static void __init smdk6410_map_io(void) 610static void __init smdk6410_map_io(void)
600{ 611{
601 u32 tmp; 612 u32 tmp;
@@ -625,6 +636,8 @@ static void __init smdk6410_machine_init(void)
625 s3c_i2c1_set_platdata(NULL); 636 s3c_i2c1_set_platdata(NULL);
626 s3c_fb_set_platdata(&smdk6410_lcd_pdata); 637 s3c_fb_set_platdata(&smdk6410_lcd_pdata);
627 638
639 s3c24xx_ts_set_platdata(&s3c_ts_platform);
640
628 /* configure nCS1 width to 16 bits */ 641 /* configure nCS1 width to 16 bits */
629 642
630 cs1 = __raw_readl(S3C64XX_SROM_BW) & 643 cs1 = __raw_readl(S3C64XX_SROM_BW) &
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index b8ac4597fad7..79412f735a8d 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -18,8 +18,11 @@
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <mach/map.h> 20#include <mach/map.h>
21#include <mach/irqs.h>
21 22
22#include <plat/pm.h> 23#include <plat/pm.h>
24#include <plat/wakeup-mask.h>
25
23#include <mach/regs-sys.h> 26#include <mach/regs-sys.h>
24#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
25#include <mach/regs-clock.h> 28#include <mach/regs-clock.h>
@@ -153,8 +156,25 @@ static void s3c64xx_cpu_suspend(void)
153 panic("sleep resumed to originator?"); 156 panic("sleep resumed to originator?");
154} 157}
155 158
159/* mapping of interrupts to parts of the wakeup mask */
160static struct samsung_wakeup_mask wake_irqs[] = {
161 { .irq = IRQ_RTC_ALARM, .bit = S3C64XX_PWRCFG_RTC_ALARM_DISABLE, },
162 { .irq = IRQ_RTC_TIC, .bit = S3C64XX_PWRCFG_RTC_TICK_DISABLE, },
163 { .irq = IRQ_PENDN, .bit = S3C64XX_PWRCFG_TS_DISABLE, },
164 { .irq = IRQ_HSMMC0, .bit = S3C64XX_PWRCFG_MMC0_DISABLE, },
165 { .irq = IRQ_HSMMC1, .bit = S3C64XX_PWRCFG_MMC1_DISABLE, },
166 { .irq = IRQ_HSMMC2, .bit = S3C64XX_PWRCFG_MMC2_DISABLE, },
167 { .irq = NO_WAKEUP_IRQ, .bit = S3C64XX_PWRCFG_BATF_DISABLE},
168 { .irq = NO_WAKEUP_IRQ, .bit = S3C64XX_PWRCFG_MSM_DISABLE },
169 { .irq = NO_WAKEUP_IRQ, .bit = S3C64XX_PWRCFG_HSI_DISABLE },
170 { .irq = NO_WAKEUP_IRQ, .bit = S3C64XX_PWRCFG_MSM_DISABLE },
171};
172
156static void s3c64xx_pm_prepare(void) 173static void s3c64xx_pm_prepare(void)
157{ 174{
175 samsung_sync_wakemask(S3C64XX_PWR_CFG,
176 wake_irqs, ARRAY_SIZE(wake_irqs));
177
158 /* store address of resume. */ 178 /* store address of resume. */
159 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C64XX_INFORM0); 179 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C64XX_INFORM0);
160 180
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 707e34e3afd1..5e93fe3f3f40 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -37,6 +37,7 @@
37#include <plat/clock.h> 37#include <plat/clock.h>
38#include <plat/sdhci.h> 38#include <plat/sdhci.h>
39#include <plat/iic-core.h> 39#include <plat/iic-core.h>
40#include <plat/onenand-core.h>
40#include <mach/s3c6400.h> 41#include <mach/s3c6400.h>
41 42
42void __init s3c6400_map_io(void) 43void __init s3c6400_map_io(void)
@@ -51,6 +52,9 @@ void __init s3c6400_map_io(void)
51 s3c_i2c0_setname("s3c2440-i2c"); 52 s3c_i2c0_setname("s3c2440-i2c");
52 53
53 s3c_device_nand.name = "s3c6400-nand"; 54 s3c_device_nand.name = "s3c6400-nand";
55
56 s3c_onenand_setname("s3c6400-onenand");
57 s3c64xx_onenand1_setname("s3c6400-onenand");
54} 58}
55 59
56void __init s3c6400_init_clocks(int xtal) 60void __init s3c6400_init_clocks(int xtal)
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 3ab695c691ee..014401c39f36 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -39,6 +39,7 @@
39#include <plat/sdhci.h> 39#include <plat/sdhci.h>
40#include <plat/iic-core.h> 40#include <plat/iic-core.h>
41#include <plat/adc.h> 41#include <plat/adc.h>
42#include <plat/onenand-core.h>
42#include <mach/s3c6400.h> 43#include <mach/s3c6400.h>
43#include <mach/s3c6410.h> 44#include <mach/s3c6410.h>
44 45
@@ -55,6 +56,8 @@ void __init s3c6410_map_io(void)
55 56
56 s3c_device_adc.name = "s3c64xx-adc"; 57 s3c_device_adc.name = "s3c64xx-adc";
57 s3c_device_nand.name = "s3c6400-nand"; 58 s3c_device_nand.name = "s3c6400-nand";
59 s3c_onenand_setname("s3c6410-onenand");
60 s3c64xx_onenand1_setname("s3c6410-onenand");
58} 61}
59 62
60void __init s3c6410_init_clocks(int xtal) 63void __init s3c6410_init_clocks(int xtal)