aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-07-02 13:34:32 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-07-18 15:32:10 -0400
commit28c8331d386a0c4122501a848a8fc3680bb65427 (patch)
treea4c1eac3003e6e45be6e70255509b4d17074a897 /arch/arm/mach-s5pv210
parentb672b27d232e337c848f51a371538b665ca4fcf3 (diff)
ARM: S5PV210: Remove support for board files
Since all in-tree boards have been moved to device tree, we can now drop legacy code and make mach-s5pv210 DT-only. This patch does it. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r--arch/arm/mach-s5pv210/Kconfig173
-rw-r--r--arch/arm/mach-s5pv210/Makefile19
-rw-r--r--arch/arm/mach-s5pv210/common.c281
-rw-r--r--arch/arm/mach-s5pv210/common.h17
-rw-r--r--arch/arm/mach-s5pv210/dev-audio.c246
-rw-r--r--arch/arm/mach-s5pv210/dma.c130
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c687
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c915
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c159
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c336
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c135
-rw-r--r--arch/arm/mach-s5pv210/pm.c24
-rw-r--r--arch/arm/mach-s5pv210/setup-fb-24bpp.c49
-rw-r--r--arch/arm/mach-s5pv210/setup-fimc.c43
-rw-r--r--arch/arm/mach-s5pv210/setup-i2c0.c6
-rw-r--r--arch/arm/mach-s5pv210/setup-i2c1.c28
-rw-r--r--arch/arm/mach-s5pv210/setup-i2c2.c28
-rw-r--r--arch/arm/mach-s5pv210/setup-ide.c39
-rw-r--r--arch/arm/mach-s5pv210/setup-keypad.c24
-rw-r--r--arch/arm/mach-s5pv210/setup-sdhci-gpio.c103
-rw-r--r--arch/arm/mach-s5pv210/setup-spi.c34
-rw-r--r--arch/arm/mach-s5pv210/setup-usb-phy.c95
22 files changed, 8 insertions, 3563 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index ed492cf10a16..d6d0f9268935 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -19,181 +19,8 @@ config CPU_S5PV210
19 help 19 help
20 Enable S5PV210 CPU support 20 Enable S5PV210 CPU support
21 21
22config S5PV210_SETUP_I2C1
23 bool
24 help
25 Common setup code for i2c bus 1.
26
27config S5PV210_SETUP_I2C2
28 bool
29 help
30 Common setup code for i2c bus 2.
31
32config S5PV210_SETUP_IDE
33 bool
34 help
35 Common setup code for S5PV210 IDE GPIO configurations
36
37config S5PV210_SETUP_FB_24BPP
38 bool
39 help
40 Common setup code for S5PV210 with an 24bpp RGB display helper.
41
42config S5PV210_SETUP_KEYPAD
43 bool
44 help
45 Common setup code for keypad.
46
47config S5PV210_SETUP_SDHCI
48 bool
49 select S5PV210_SETUP_SDHCI_GPIO
50 help
51 Internal helper functions for S5PV210 based SDHCI systems
52
53config S5PV210_SETUP_SDHCI_GPIO
54 bool
55 help
56 Common setup code for SDHCI gpio.
57
58config S5PV210_SETUP_FIMC
59 bool
60 help
61 Common setup code for the camera interfaces.
62
63config S5PV210_SETUP_SPI
64 bool
65 help
66 Common setup code for SPI GPIO configurations.
67
68config S5PV210_SETUP_USB_PHY
69 bool
70 help
71 Common setup code for USB PHY controller
72
73menu "S5PC110 Machines"
74
75config MACH_AQUILA
76 bool "Aquila"
77 select CPU_S5PV210
78 select S3C_DEV_FB
79 select S3C_DEV_HSMMC
80 select S3C_DEV_HSMMC1
81 select S3C_DEV_HSMMC2
82 select S5PV210_SETUP_FB_24BPP
83 select S5PV210_SETUP_SDHCI
84 select S5PV210_SETUP_USB_PHY
85 select S5P_DEV_FIMC0
86 select S5P_DEV_FIMC1
87 select S5P_DEV_FIMC2
88 select S5P_DEV_ONENAND
89 help
90 Machine support for the Samsung Aquila target based on S5PC110 SoC
91
92config MACH_GONI
93 bool "GONI"
94 select CPU_S5PV210
95 select S3C_DEV_FB
96 select S3C_DEV_HSMMC
97 select S3C_DEV_HSMMC1
98 select S3C_DEV_HSMMC2
99 select S3C_DEV_I2C1
100 select S3C_DEV_I2C2
101 select S3C_DEV_USB_HSOTG
102 select S5PV210_SETUP_FB_24BPP
103 select S5PV210_SETUP_FIMC
104 select S5PV210_SETUP_I2C1
105 select S5PV210_SETUP_I2C2
106 select S5PV210_SETUP_KEYPAD
107 select S5PV210_SETUP_SDHCI
108 select S5PV210_SETUP_USB_PHY
109 select S5P_DEV_FIMC0
110 select S5P_DEV_FIMC1
111 select S5P_DEV_FIMC2
112 select S5P_DEV_MFC
113 select S5P_DEV_ONENAND
114 select S5P_DEV_TV
115 select S5P_GPIO_INT
116 select SAMSUNG_DEV_KEYPAD
117 help
118 Machine support for Samsung GONI board
119 S5PC110(MCP) is one of package option of S5PV210
120
121config MACH_SMDKC110
122 bool "SMDKC110"
123 select CPU_S5PV210
124 select S3C_DEV_I2C1
125 select S3C_DEV_I2C2
126 select S3C_DEV_RTC
127 select S3C_DEV_WDT
128 select S5PV210_SETUP_I2C1
129 select S5PV210_SETUP_I2C2
130 select S5PV210_SETUP_IDE
131 select S5P_DEV_FIMC0
132 select S5P_DEV_FIMC1
133 select S5P_DEV_FIMC2
134 select S5P_DEV_MFC
135 select SAMSUNG_DEV_IDE
136 help
137 Machine support for Samsung SMDKC110
138 S5PC110(MCP) is one of package option of S5PV210
139
140endmenu
141
142menu "S5PV210 Machines" 22menu "S5PV210 Machines"
143 23
144config MACH_SMDKV210
145 bool "SMDKV210"
146 select CPU_S5PV210
147 select S3C_DEV_FB
148 select S3C_DEV_HSMMC
149 select S3C_DEV_HSMMC1
150 select S3C_DEV_HSMMC2
151 select S3C_DEV_HSMMC3
152 select S3C_DEV_I2C1
153 select S3C_DEV_I2C2
154 select S3C_DEV_RTC
155 select S3C_DEV_USB_HSOTG
156 select S3C_DEV_WDT
157 select S5PV210_SETUP_FB_24BPP
158 select S5PV210_SETUP_I2C1
159 select S5PV210_SETUP_I2C2
160 select S5PV210_SETUP_IDE
161 select S5PV210_SETUP_KEYPAD
162 select S5PV210_SETUP_SDHCI
163 select S5PV210_SETUP_USB_PHY
164 select S5P_DEV_FIMC0
165 select S5P_DEV_FIMC1
166 select S5P_DEV_FIMC2
167 select S5P_DEV_JPEG
168 select S5P_DEV_MFC
169 select SAMSUNG_DEV_ADC
170 select SAMSUNG_DEV_BACKLIGHT
171 select SAMSUNG_DEV_IDE
172 select SAMSUNG_DEV_KEYPAD
173 select SAMSUNG_DEV_PWM
174 select SAMSUNG_DEV_TS
175 help
176 Machine support for Samsung SMDKV210
177
178config MACH_TORBRECK
179 bool "Torbreck"
180 select ARCH_SPARSEMEM_ENABLE
181 select CPU_S5PV210
182 select S3C_DEV_HSMMC
183 select S3C_DEV_HSMMC1
184 select S3C_DEV_HSMMC2
185 select S3C_DEV_HSMMC3
186 select S3C_DEV_I2C1
187 select S3C_DEV_I2C2
188 select S3C_DEV_RTC
189 select S3C_DEV_WDT
190 select S5PV210_SETUP_I2C1
191 select S5PV210_SETUP_I2C2
192 select S5PV210_SETUP_SDHCI
193 select SAMSUNG_DEV_IDE
194 help
195 Machine support for aESOP Torbreck
196
197config MACH_S5PV210_DT 24config MACH_S5PV210_DT
198 bool "Samsung S5PV210/S5PC110 machine using Device Tree" 25 bool "Samsung S5PV210/S5PC110 machine using Device Tree"
199 select CLKSRC_OF 26 select CLKSRC_OF
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 8d87b10ea461..83993fc87d87 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -12,30 +12,11 @@ obj- :=
12 12
13# Core 13# Core
14 14
15obj-y += common.o
16obj-$(CONFIG_PM) += pm.o 15obj-$(CONFIG_PM) += pm.o
17 16
18obj-y += dma.o
19
20# machine support 17# machine support
21 18
22obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o
23obj-$(CONFIG_MACH_GONI) += mach-goni.o
24obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
25obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
26obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o
27obj-$(CONFIG_MACH_S5PV210_DT) += s5pv210.o 19obj-$(CONFIG_MACH_S5PV210_DT) += s5pv210.o
28# device support 20# device support
29 21
30obj-y += dev-audio.o
31
32obj-y += setup-i2c0.o 22obj-y += setup-i2c0.o
33obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
34obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o
35obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o
36obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o
37obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o
38obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o
39obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
40obj-$(CONFIG_S5PV210_SETUP_SPI) += setup-spi.o
41obj-$(CONFIG_S5PV210_SETUP_USB_PHY) += setup-usb-phy.o
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c
deleted file mode 100644
index 30bd5421aa79..000000000000
--- a/arch/arm/mach-s5pv210/common.c
+++ /dev/null
@@ -1,281 +0,0 @@
1/*
2 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Codes for S5PV210
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/module.h>
19#include <linux/clk.h>
20#include <linux/clk-provider.h>
21#include <linux/io.h>
22#include <linux/device.h>
23#include <clocksource/samsung_pwm.h>
24#include <linux/platform_device.h>
25#include <linux/sched.h>
26#include <linux/dma-mapping.h>
27#include <linux/serial_core.h>
28#include <linux/serial_s3c.h>
29#include <linux/of.h>
30
31#include <asm/proc-fns.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34#include <asm/mach/irq.h>
35
36#include <mach/map.h>
37#include <mach/regs-clock.h>
38
39#include <plat/cpu.h>
40
41#include <plat/devs.h>
42#include <plat/sdhci.h>
43#include <plat/adc-core.h>
44#include <plat/ata-core.h>
45#include <plat/fb-core.h>
46#include <plat/fimc-core.h>
47#include <plat/iic-core.h>
48#include <plat/keypad-core.h>
49#include <plat/pwm-core.h>
50#include <plat/tv-core.h>
51#include <plat/spi-core.h>
52
53#include "common.h"
54
55/* External clock frequency */
56static unsigned long xusbxti_f;
57
58static const char name_s5pv210[] = "S5PV210/S5PC110";
59
60static struct cpu_table cpu_ids[] __initdata = {
61 {
62 .idcode = S5PV210_CPU_ID,
63 .idmask = S5PV210_CPU_MASK,
64 .map_io = s5pv210_map_io,
65 .init_clocks = s5pv210_init_clocks,
66 .init_uarts = s5pv210_init_uarts,
67 .init = s5pv210_init,
68 .name = name_s5pv210,
69 },
70};
71
72/* Initial IO mappings */
73
74static struct map_desc s5pv210_iodesc[] __initdata = {
75 {
76 .virtual = (unsigned long)S5P_VA_CHIPID,
77 .pfn = __phys_to_pfn(S5PV210_PA_CHIPID),
78 .length = SZ_4K,
79 .type = MT_DEVICE,
80 }, {
81 .virtual = (unsigned long)S3C_VA_SYS,
82 .pfn = __phys_to_pfn(S5PV210_PA_SYSCON),
83 .length = SZ_64K,
84 .type = MT_DEVICE,
85 }, {
86 .virtual = (unsigned long)S3C_VA_TIMER,
87 .pfn = __phys_to_pfn(S5PV210_PA_TIMER),
88 .length = SZ_16K,
89 .type = MT_DEVICE,
90 }, {
91 .virtual = (unsigned long)S3C_VA_WATCHDOG,
92 .pfn = __phys_to_pfn(S5PV210_PA_WATCHDOG),
93 .length = SZ_4K,
94 .type = MT_DEVICE,
95 }, {
96 .virtual = (unsigned long)S5P_VA_SROMC,
97 .pfn = __phys_to_pfn(S5PV210_PA_SROMC),
98 .length = SZ_4K,
99 .type = MT_DEVICE,
100 }, {
101 .virtual = (unsigned long)S5P_VA_SYSTIMER,
102 .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER),
103 .length = SZ_4K,
104 .type = MT_DEVICE,
105 }, {
106 .virtual = (unsigned long)S5P_VA_GPIO,
107 .pfn = __phys_to_pfn(S5PV210_PA_GPIO),
108 .length = SZ_4K,
109 .type = MT_DEVICE,
110 }, {
111 .virtual = (unsigned long)VA_VIC0,
112 .pfn = __phys_to_pfn(S5PV210_PA_VIC0),
113 .length = SZ_16K,
114 .type = MT_DEVICE,
115 }, {
116 .virtual = (unsigned long)VA_VIC1,
117 .pfn = __phys_to_pfn(S5PV210_PA_VIC1),
118 .length = SZ_16K,
119 .type = MT_DEVICE,
120 }, {
121 .virtual = (unsigned long)VA_VIC2,
122 .pfn = __phys_to_pfn(S5PV210_PA_VIC2),
123 .length = SZ_16K,
124 .type = MT_DEVICE,
125 }, {
126 .virtual = (unsigned long)VA_VIC3,
127 .pfn = __phys_to_pfn(S5PV210_PA_VIC3),
128 .length = SZ_16K,
129 .type = MT_DEVICE,
130 }, {
131 .virtual = (unsigned long)S3C_VA_UART,
132 .pfn = __phys_to_pfn(S3C_PA_UART),
133 .length = SZ_512K,
134 .type = MT_DEVICE,
135 }, {
136 .virtual = (unsigned long)S5P_VA_DMC0,
137 .pfn = __phys_to_pfn(S5PV210_PA_DMC0),
138 .length = SZ_4K,
139 .type = MT_DEVICE,
140 }, {
141 .virtual = (unsigned long)S5P_VA_DMC1,
142 .pfn = __phys_to_pfn(S5PV210_PA_DMC1),
143 .length = SZ_4K,
144 .type = MT_DEVICE,
145 }, {
146 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
147 .pfn =__phys_to_pfn(S5PV210_PA_HSPHY),
148 .length = SZ_4K,
149 .type = MT_DEVICE,
150 }
151};
152
153void s5pv210_restart(enum reboot_mode mode, const char *cmd)
154{
155 __raw_writel(0x1, S5P_SWRESET);
156}
157
158static struct samsung_pwm_variant s5pv210_pwm_variant = {
159 .bits = 32,
160 .div_base = 0,
161 .has_tint_cstat = true,
162 .tclk_mask = (1 << 5),
163};
164
165void __init samsung_set_timer_source(unsigned int event, unsigned int source)
166{
167 s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
168 s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
169}
170
171void __init samsung_timer_init(void)
172{
173 unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
174 IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
175 IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
176 };
177
178 samsung_pwm_clocksource_init(S3C_VA_TIMER,
179 timer_irqs, &s5pv210_pwm_variant);
180}
181
182/*
183 * s5pv210_map_io
184 *
185 * register the standard cpu IO areas
186 */
187
188void __init s5pv210_init_io(struct map_desc *mach_desc, int size)
189{
190 /* initialize the io descriptors we need for initialization */
191 iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
192 if (mach_desc)
193 iotable_init(mach_desc, size);
194
195 /* detect cpu id and rev. */
196 s5p_init_cpu(S5P_VA_CHIPID);
197
198 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
199
200 samsung_pwm_set_platdata(&s5pv210_pwm_variant);
201}
202
203void __init s5pv210_map_io(void)
204{
205 /* initialise device information early */
206 s5pv210_default_sdhci0();
207 s5pv210_default_sdhci1();
208 s5pv210_default_sdhci2();
209 s5pv210_default_sdhci3();
210
211 s3c_adc_setname("samsung-adc-v3");
212
213 s3c_cfcon_setname("s5pv210-pata");
214
215 s3c_fimc_setname(0, "s5pv210-fimc");
216 s3c_fimc_setname(1, "s5pv210-fimc");
217 s3c_fimc_setname(2, "s5pv210-fimc");
218
219 /* the i2c devices are directly compatible with s3c2440 */
220 s3c_i2c0_setname("s3c2440-i2c");
221 s3c_i2c1_setname("s3c2440-i2c");
222 s3c_i2c2_setname("s3c2440-i2c");
223
224 s3c_fb_setname("s5pv210-fb");
225
226 /* Use s5pv210-keypad instead of samsung-keypad */
227 samsung_keypad_setname("s5pv210-keypad");
228
229 /* setup TV devices */
230 s5p_hdmi_setname("s5pv210-hdmi");
231
232 s3c64xx_spi_setname("s5pv210-spi");
233}
234
235void __init s5pv210_init_clocks(int xtal)
236{
237 xusbxti_f = xtal;
238}
239
240void __init s5pv210_init_irq(void)
241{
242 u32 vic[4]; /* S5PV210 supports 4 VIC */
243
244 s5pv210_clk_init(0, xusbxti_f, S3C_VA_SYS);
245
246 /* All the VICs are fully populated. */
247 vic[0] = ~0;
248 vic[1] = ~0;
249 vic[2] = ~0;
250 vic[3] = ~0;
251
252 s5p_init_irq(vic, ARRAY_SIZE(vic));
253}
254
255struct bus_type s5pv210_subsys = {
256 .name = "s5pv210-core",
257 .dev_name = "s5pv210-core",
258};
259
260static struct device s5pv210_dev = {
261 .bus = &s5pv210_subsys,
262};
263
264static int __init s5pv210_core_init(void)
265{
266 return subsys_system_register(&s5pv210_subsys, NULL);
267}
268core_initcall(s5pv210_core_init);
269
270int __init s5pv210_init(void)
271{
272 printk(KERN_INFO "S5PV210: Initializing architecture\n");
273 return device_register(&s5pv210_dev);
274}
275
276/* uart registration process */
277
278void __init s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no)
279{
280 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
281}
diff --git a/arch/arm/mach-s5pv210/common.h b/arch/arm/mach-s5pv210/common.h
index 083ffe7b5079..0b694c798ad1 100644
--- a/arch/arm/mach-s5pv210/common.h
+++ b/arch/arm/mach-s5pv210/common.h
@@ -12,22 +12,5 @@
12#ifndef __ARCH_ARM_MACH_S5PV210_COMMON_H 12#ifndef __ARCH_ARM_MACH_S5PV210_COMMON_H
13#define __ARCH_ARM_MACH_S5PV210_COMMON_H 13#define __ARCH_ARM_MACH_S5PV210_COMMON_H
14 14
15#include <linux/reboot.h>
16
17void s5pv210_clk_init(unsigned long xxti_f, unsigned long xusbxti_f,
18 void __iomem *reg_base);
19
20void s5pv210_init_io(struct map_desc *mach_desc, int size);
21void s5pv210_init_irq(void);
22
23void s5pv210_register_clocks(void);
24void s5pv210_setup_clocks(void);
25
26void s5pv210_restart(enum reboot_mode mode, const char *cmd);
27
28extern int s5pv210_init(void);
29extern void s5pv210_map_io(void);
30extern void s5pv210_init_clocks(int xtal);
31extern void s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no);
32 15
33#endif /* __ARCH_ARM_MACH_S5PV210_COMMON_H */ 16#endif /* __ARCH_ARM_MACH_S5PV210_COMMON_H */
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
deleted file mode 100644
index 2d67361ef431..000000000000
--- a/arch/arm/mach-s5pv210/dev-audio.c
+++ /dev/null
@@ -1,246 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/dev-audio.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com>
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#include <linux/platform_device.h>
12#include <linux/dma-mapping.h>
13#include <linux/gpio.h>
14
15#include <plat/gpio-cfg.h>
16#include <linux/platform_data/asoc-s3c.h>
17
18#include <mach/map.h>
19#include <mach/dma.h>
20#include <mach/irqs.h>
21
22#define S5PV210_AUDSS_INT_MEM (0xC0000000)
23
24static int s5pv210_cfg_i2s(struct platform_device *pdev)
25{
26 /* configure GPIO for i2s port */
27 switch (pdev->id) {
28 case 0:
29 s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2));
30 break;
31 case 1:
32 s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2));
33 break;
34 case 2:
35 s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4));
36 break;
37 default:
38 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
39 return -EINVAL;
40 }
41
42 return 0;
43}
44
45static struct s3c_audio_pdata i2sv5_pdata = {
46 .cfg_gpio = s5pv210_cfg_i2s,
47 .type = {
48 .i2s = {
49 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
50 | QUIRK_NEED_RSTCLR,
51 .idma_addr = S5PV210_AUDSS_INT_MEM,
52 },
53 },
54};
55
56static struct resource s5pv210_iis0_resource[] = {
57 [0] = DEFINE_RES_MEM(S5PV210_PA_IIS0, SZ_256),
58 [1] = DEFINE_RES_DMA(DMACH_I2S0_TX),
59 [2] = DEFINE_RES_DMA(DMACH_I2S0_RX),
60 [3] = DEFINE_RES_DMA(DMACH_I2S0S_TX),
61};
62
63struct platform_device s5pv210_device_iis0 = {
64 .name = "samsung-i2s",
65 .id = 0,
66 .num_resources = ARRAY_SIZE(s5pv210_iis0_resource),
67 .resource = s5pv210_iis0_resource,
68 .dev = {
69 .platform_data = &i2sv5_pdata,
70 },
71};
72
73static struct s3c_audio_pdata i2sv3_pdata = {
74 .cfg_gpio = s5pv210_cfg_i2s,
75};
76
77static struct resource s5pv210_iis1_resource[] = {
78 [0] = DEFINE_RES_MEM(S5PV210_PA_IIS1, SZ_256),
79 [1] = DEFINE_RES_DMA(DMACH_I2S1_TX),
80 [2] = DEFINE_RES_DMA(DMACH_I2S1_RX),
81};
82
83struct platform_device s5pv210_device_iis1 = {
84 .name = "samsung-i2s",
85 .id = 1,
86 .num_resources = ARRAY_SIZE(s5pv210_iis1_resource),
87 .resource = s5pv210_iis1_resource,
88 .dev = {
89 .platform_data = &i2sv3_pdata,
90 },
91};
92
93static struct resource s5pv210_iis2_resource[] = {
94 [0] = DEFINE_RES_MEM(S5PV210_PA_IIS2, SZ_256),
95 [1] = DEFINE_RES_DMA(DMACH_I2S2_TX),
96 [2] = DEFINE_RES_DMA(DMACH_I2S2_RX),
97};
98
99struct platform_device s5pv210_device_iis2 = {
100 .name = "samsung-i2s",
101 .id = 2,
102 .num_resources = ARRAY_SIZE(s5pv210_iis2_resource),
103 .resource = s5pv210_iis2_resource,
104 .dev = {
105 .platform_data = &i2sv3_pdata,
106 },
107};
108
109/* PCM Controller platform_devices */
110
111static int s5pv210_pcm_cfg_gpio(struct platform_device *pdev)
112{
113 switch (pdev->id) {
114 case 0:
115 s3c_gpio_cfgpin_range(S5PV210_GPI(0), 5, S3C_GPIO_SFN(3));
116 break;
117 case 1:
118 s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(3));
119 break;
120 case 2:
121 s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(2));
122 break;
123 default:
124 printk(KERN_DEBUG "Invalid PCM Controller number!");
125 return -EINVAL;
126 }
127
128 return 0;
129}
130
131static struct s3c_audio_pdata s3c_pcm_pdata = {
132 .cfg_gpio = s5pv210_pcm_cfg_gpio,
133};
134
135static struct resource s5pv210_pcm0_resource[] = {
136 [0] = DEFINE_RES_MEM(S5PV210_PA_PCM0, SZ_256),
137 [1] = DEFINE_RES_DMA(DMACH_PCM0_TX),
138 [2] = DEFINE_RES_DMA(DMACH_PCM0_RX),
139};
140
141struct platform_device s5pv210_device_pcm0 = {
142 .name = "samsung-pcm",
143 .id = 0,
144 .num_resources = ARRAY_SIZE(s5pv210_pcm0_resource),
145 .resource = s5pv210_pcm0_resource,
146 .dev = {
147 .platform_data = &s3c_pcm_pdata,
148 },
149};
150
151static struct resource s5pv210_pcm1_resource[] = {
152 [0] = DEFINE_RES_MEM(S5PV210_PA_PCM1, SZ_256),
153 [1] = DEFINE_RES_DMA(DMACH_PCM1_TX),
154 [2] = DEFINE_RES_DMA(DMACH_PCM1_RX),
155};
156
157struct platform_device s5pv210_device_pcm1 = {
158 .name = "samsung-pcm",
159 .id = 1,
160 .num_resources = ARRAY_SIZE(s5pv210_pcm1_resource),
161 .resource = s5pv210_pcm1_resource,
162 .dev = {
163 .platform_data = &s3c_pcm_pdata,
164 },
165};
166
167static struct resource s5pv210_pcm2_resource[] = {
168 [0] = DEFINE_RES_MEM(S5PV210_PA_PCM2, SZ_256),
169 [1] = DEFINE_RES_DMA(DMACH_PCM2_TX),
170 [2] = DEFINE_RES_DMA(DMACH_PCM2_RX),
171};
172
173struct platform_device s5pv210_device_pcm2 = {
174 .name = "samsung-pcm",
175 .id = 2,
176 .num_resources = ARRAY_SIZE(s5pv210_pcm2_resource),
177 .resource = s5pv210_pcm2_resource,
178 .dev = {
179 .platform_data = &s3c_pcm_pdata,
180 },
181};
182
183/* AC97 Controller platform devices */
184
185static int s5pv210_ac97_cfg_gpio(struct platform_device *pdev)
186{
187 return s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(4));
188}
189
190static struct resource s5pv210_ac97_resource[] = {
191 [0] = DEFINE_RES_MEM(S5PV210_PA_AC97, SZ_256),
192 [1] = DEFINE_RES_DMA(DMACH_AC97_PCMOUT),
193 [2] = DEFINE_RES_DMA(DMACH_AC97_PCMIN),
194 [3] = DEFINE_RES_DMA(DMACH_AC97_MICIN),
195 [4] = DEFINE_RES_IRQ(IRQ_AC97),
196};
197
198static struct s3c_audio_pdata s3c_ac97_pdata = {
199 .cfg_gpio = s5pv210_ac97_cfg_gpio,
200};
201
202static u64 s5pv210_ac97_dmamask = DMA_BIT_MASK(32);
203
204struct platform_device s5pv210_device_ac97 = {
205 .name = "samsung-ac97",
206 .id = -1,
207 .num_resources = ARRAY_SIZE(s5pv210_ac97_resource),
208 .resource = s5pv210_ac97_resource,
209 .dev = {
210 .platform_data = &s3c_ac97_pdata,
211 .dma_mask = &s5pv210_ac97_dmamask,
212 .coherent_dma_mask = DMA_BIT_MASK(32),
213 },
214};
215
216/* S/PDIF Controller platform_device */
217
218static int s5pv210_spdif_cfg_gpio(struct platform_device *pdev)
219{
220 s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 2, S3C_GPIO_SFN(3));
221
222 return 0;
223}
224
225static struct resource s5pv210_spdif_resource[] = {
226 [0] = DEFINE_RES_MEM(S5PV210_PA_SPDIF, SZ_256),
227 [1] = DEFINE_RES_DMA(DMACH_SPDIF),
228};
229
230static struct s3c_audio_pdata samsung_spdif_pdata = {
231 .cfg_gpio = s5pv210_spdif_cfg_gpio,
232};
233
234static u64 s5pv210_spdif_dmamask = DMA_BIT_MASK(32);
235
236struct platform_device s5pv210_device_spdif = {
237 .name = "samsung-spdif",
238 .id = -1,
239 .num_resources = ARRAY_SIZE(s5pv210_spdif_resource),
240 .resource = s5pv210_spdif_resource,
241 .dev = {
242 .platform_data = &samsung_spdif_pdata,
243 .dma_mask = &s5pv210_spdif_dmamask,
244 .coherent_dma_mask = DMA_BIT_MASK(32),
245 },
246};
diff --git a/arch/arm/mach-s5pv210/dma.c b/arch/arm/mach-s5pv210/dma.c
deleted file mode 100644
index b8337e248b09..000000000000
--- a/arch/arm/mach-s5pv210/dma.c
+++ /dev/null
@@ -1,130 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/dma.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (C) 2010 Samsung Electronics Co. Ltd.
7 * Jaswinder Singh <jassi.brar@samsung.com>
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 as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24#include <linux/dma-mapping.h>
25#include <linux/amba/bus.h>
26#include <linux/amba/pl330.h>
27
28#include <asm/irq.h>
29#include <plat/devs.h>
30#include <plat/irqs.h>
31
32#include <mach/map.h>
33#include <mach/irqs.h>
34#include <mach/dma.h>
35
36static u8 pdma0_peri[] = {
37 DMACH_UART0_RX,
38 DMACH_UART0_TX,
39 DMACH_UART1_RX,
40 DMACH_UART1_TX,
41 DMACH_UART2_RX,
42 DMACH_UART2_TX,
43 DMACH_UART3_RX,
44 DMACH_UART3_TX,
45 DMACH_MAX,
46 DMACH_I2S0_RX,
47 DMACH_I2S0_TX,
48 DMACH_I2S0S_TX,
49 DMACH_I2S1_RX,
50 DMACH_I2S1_TX,
51 DMACH_MAX,
52 DMACH_MAX,
53 DMACH_SPI0_RX,
54 DMACH_SPI0_TX,
55 DMACH_SPI1_RX,
56 DMACH_SPI1_TX,
57 DMACH_MAX,
58 DMACH_MAX,
59 DMACH_AC97_MICIN,
60 DMACH_AC97_PCMIN,
61 DMACH_AC97_PCMOUT,
62 DMACH_MAX,
63 DMACH_PWM,
64 DMACH_SPDIF,
65};
66
67static struct dma_pl330_platdata s5pv210_pdma0_pdata = {
68 .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
69 .peri_id = pdma0_peri,
70};
71
72static AMBA_AHB_DEVICE(s5pv210_pdma0, "dma-pl330.0", 0x00041330,
73 S5PV210_PA_PDMA0, {IRQ_PDMA0}, &s5pv210_pdma0_pdata);
74
75static u8 pdma1_peri[] = {
76 DMACH_UART0_RX,
77 DMACH_UART0_TX,
78 DMACH_UART1_RX,
79 DMACH_UART1_TX,
80 DMACH_UART2_RX,
81 DMACH_UART2_TX,
82 DMACH_UART3_RX,
83 DMACH_UART3_TX,
84 DMACH_MAX,
85 DMACH_I2S0_RX,
86 DMACH_I2S0_TX,
87 DMACH_I2S0S_TX,
88 DMACH_I2S1_RX,
89 DMACH_I2S1_TX,
90 DMACH_I2S2_RX,
91 DMACH_I2S2_TX,
92 DMACH_SPI0_RX,
93 DMACH_SPI0_TX,
94 DMACH_SPI1_RX,
95 DMACH_SPI1_TX,
96 DMACH_MAX,
97 DMACH_MAX,
98 DMACH_PCM0_RX,
99 DMACH_PCM0_TX,
100 DMACH_PCM1_RX,
101 DMACH_PCM1_TX,
102 DMACH_MSM_REQ0,
103 DMACH_MSM_REQ1,
104 DMACH_MSM_REQ2,
105 DMACH_MSM_REQ3,
106 DMACH_PCM2_RX,
107 DMACH_PCM2_TX,
108};
109
110static struct dma_pl330_platdata s5pv210_pdma1_pdata = {
111 .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
112 .peri_id = pdma1_peri,
113};
114
115static AMBA_AHB_DEVICE(s5pv210_pdma1, "dma-pl330.1", 0x00041330,
116 S5PV210_PA_PDMA1, {IRQ_PDMA1}, &s5pv210_pdma1_pdata);
117
118static int __init s5pv210_dma_init(void)
119{
120 dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask);
121 dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask);
122 amba_device_register(&s5pv210_pdma0_device, &iomem_resource);
123
124 dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask);
125 dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask);
126 amba_device_register(&s5pv210_pdma1_device, &iomem_resource);
127
128 return 0;
129}
130arch_initcall(s5pv210_dma_init);
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
deleted file mode 100644
index cc37edacda26..000000000000
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ /dev/null
@@ -1,687 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/mach-aquila.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15#include <linux/serial_s3c.h>
16#include <linux/fb.h>
17#include <linux/i2c.h>
18#include <linux/i2c-gpio.h>
19#include <linux/mfd/max8998.h>
20#include <linux/mfd/wm8994/pdata.h>
21#include <linux/regulator/fixed.h>
22#include <linux/gpio_keys.h>
23#include <linux/input.h>
24#include <linux/gpio.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/setup.h>
29#include <asm/mach-types.h>
30
31#include <video/samsung_fimd.h>
32#include <mach/map.h>
33#include <mach/regs-clock.h>
34
35#include <plat/gpio-cfg.h>
36#include <plat/devs.h>
37#include <plat/cpu.h>
38#include <plat/fb.h>
39#include <plat/fimc-core.h>
40#include <plat/sdhci.h>
41#include <plat/samsung-time.h>
42
43#include "common.h"
44
45/* Following are default values for UCON, ULCON and UFCON UART registers */
46#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
47 S3C2410_UCON_RXILEVEL | \
48 S3C2410_UCON_TXIRQMODE | \
49 S3C2410_UCON_RXIRQMODE | \
50 S3C2410_UCON_RXFIFO_TOI | \
51 S3C2443_UCON_RXERR_IRQEN)
52
53#define AQUILA_ULCON_DEFAULT S3C2410_LCON_CS8
54
55#define AQUILA_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
56
57static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
58 [0] = {
59 .hwport = 0,
60 .flags = 0,
61 .ucon = AQUILA_UCON_DEFAULT,
62 .ulcon = AQUILA_ULCON_DEFAULT,
63 /*
64 * Actually UART0 can support 256 bytes fifo, but aquila board
65 * supports 128 bytes fifo because of initial chip bug
66 */
67 .ufcon = AQUILA_UFCON_DEFAULT |
68 S5PV210_UFCON_TXTRIG128 | S5PV210_UFCON_RXTRIG128,
69 },
70 [1] = {
71 .hwport = 1,
72 .flags = 0,
73 .ucon = AQUILA_UCON_DEFAULT,
74 .ulcon = AQUILA_ULCON_DEFAULT,
75 .ufcon = AQUILA_UFCON_DEFAULT |
76 S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
77 },
78 [2] = {
79 .hwport = 2,
80 .flags = 0,
81 .ucon = AQUILA_UCON_DEFAULT,
82 .ulcon = AQUILA_ULCON_DEFAULT,
83 .ufcon = AQUILA_UFCON_DEFAULT |
84 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
85 },
86 [3] = {
87 .hwport = 3,
88 .flags = 0,
89 .ucon = AQUILA_UCON_DEFAULT,
90 .ulcon = AQUILA_ULCON_DEFAULT,
91 .ufcon = AQUILA_UFCON_DEFAULT |
92 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
93 },
94};
95
96/* Frame Buffer */
97static struct s3c_fb_pd_win aquila_fb_win0 = {
98 .max_bpp = 32,
99 .default_bpp = 16,
100 .xres = 480,
101 .yres = 800,
102};
103
104static struct s3c_fb_pd_win aquila_fb_win1 = {
105 .max_bpp = 32,
106 .default_bpp = 16,
107 .xres = 480,
108 .yres = 800,
109};
110
111static struct fb_videomode aquila_lcd_timing = {
112 .left_margin = 16,
113 .right_margin = 16,
114 .upper_margin = 3,
115 .lower_margin = 28,
116 .hsync_len = 2,
117 .vsync_len = 2,
118 .xres = 480,
119 .yres = 800,
120};
121
122static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
123 .win[0] = &aquila_fb_win0,
124 .win[1] = &aquila_fb_win1,
125 .vtiming = &aquila_lcd_timing,
126 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
127 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
128 VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
129 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
130};
131
132/* MAX8998 regulators */
133#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
134
135static struct regulator_init_data aquila_ldo2_data = {
136 .constraints = {
137 .name = "VALIVE_1.1V",
138 .min_uV = 1100000,
139 .max_uV = 1100000,
140 .apply_uV = 1,
141 .always_on = 1,
142 .state_mem = {
143 .enabled = 1,
144 },
145 },
146};
147
148static struct regulator_init_data aquila_ldo3_data = {
149 .constraints = {
150 .name = "VUSB+MIPI_1.1V",
151 .min_uV = 1100000,
152 .max_uV = 1100000,
153 .apply_uV = 1,
154 .always_on = 1,
155 },
156};
157
158static struct regulator_init_data aquila_ldo4_data = {
159 .constraints = {
160 .name = "VDAC_3.3V",
161 .min_uV = 3300000,
162 .max_uV = 3300000,
163 .apply_uV = 1,
164 },
165};
166
167static struct regulator_init_data aquila_ldo5_data = {
168 .constraints = {
169 .name = "VTF_2.8V",
170 .min_uV = 2800000,
171 .max_uV = 2800000,
172 .apply_uV = 1,
173 },
174};
175
176static struct regulator_init_data aquila_ldo6_data = {
177 .constraints = {
178 .name = "VCC_3.3V",
179 .min_uV = 3300000,
180 .max_uV = 3300000,
181 .apply_uV = 1,
182 },
183};
184
185static struct regulator_init_data aquila_ldo7_data = {
186 .constraints = {
187 .name = "VCC_3.0V",
188 .min_uV = 3000000,
189 .max_uV = 3000000,
190 .apply_uV = 1,
191 .boot_on = 1,
192 .always_on = 1,
193 },
194};
195
196static struct regulator_init_data aquila_ldo8_data = {
197 .constraints = {
198 .name = "VUSB+VADC_3.3V",
199 .min_uV = 3300000,
200 .max_uV = 3300000,
201 .apply_uV = 1,
202 .always_on = 1,
203 },
204};
205
206static struct regulator_init_data aquila_ldo9_data = {
207 .constraints = {
208 .name = "VCC+VCAM_2.8V",
209 .min_uV = 2800000,
210 .max_uV = 2800000,
211 .apply_uV = 1,
212 .always_on = 1,
213 },
214};
215
216static struct regulator_init_data aquila_ldo10_data = {
217 .constraints = {
218 .name = "VPLL_1.1V",
219 .min_uV = 1100000,
220 .max_uV = 1100000,
221 .apply_uV = 1,
222 .boot_on = 1,
223 },
224};
225
226static struct regulator_init_data aquila_ldo11_data = {
227 .constraints = {
228 .name = "CAM_IO_2.8V",
229 .min_uV = 2800000,
230 .max_uV = 2800000,
231 .apply_uV = 1,
232 .always_on = 1,
233 },
234};
235
236static struct regulator_init_data aquila_ldo12_data = {
237 .constraints = {
238 .name = "CAM_ISP_1.2V",
239 .min_uV = 1200000,
240 .max_uV = 1200000,
241 .apply_uV = 1,
242 .always_on = 1,
243 },
244};
245
246static struct regulator_init_data aquila_ldo13_data = {
247 .constraints = {
248 .name = "CAM_A_2.8V",
249 .min_uV = 2800000,
250 .max_uV = 2800000,
251 .apply_uV = 1,
252 .always_on = 1,
253 },
254};
255
256static struct regulator_init_data aquila_ldo14_data = {
257 .constraints = {
258 .name = "CAM_CIF_1.8V",
259 .min_uV = 1800000,
260 .max_uV = 1800000,
261 .apply_uV = 1,
262 .always_on = 1,
263 },
264};
265
266static struct regulator_init_data aquila_ldo15_data = {
267 .constraints = {
268 .name = "CAM_AF_3.3V",
269 .min_uV = 3300000,
270 .max_uV = 3300000,
271 .apply_uV = 1,
272 .always_on = 1,
273 },
274};
275
276static struct regulator_init_data aquila_ldo16_data = {
277 .constraints = {
278 .name = "VMIPI_1.8V",
279 .min_uV = 1800000,
280 .max_uV = 1800000,
281 .apply_uV = 1,
282 .always_on = 1,
283 },
284};
285
286static struct regulator_init_data aquila_ldo17_data = {
287 .constraints = {
288 .name = "CAM_8M_1.8V",
289 .min_uV = 1800000,
290 .max_uV = 1800000,
291 .apply_uV = 1,
292 .always_on = 1,
293 },
294};
295
296/* BUCK */
297static struct regulator_consumer_supply buck1_consumer =
298 REGULATOR_SUPPLY("vddarm", NULL);
299
300static struct regulator_consumer_supply buck2_consumer =
301 REGULATOR_SUPPLY("vddint", NULL);
302
303static struct regulator_init_data aquila_buck1_data = {
304 .constraints = {
305 .name = "VARM_1.2V",
306 .min_uV = 1200000,
307 .max_uV = 1200000,
308 .apply_uV = 1,
309 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
310 REGULATOR_CHANGE_STATUS,
311 },
312 .num_consumer_supplies = 1,
313 .consumer_supplies = &buck1_consumer,
314};
315
316static struct regulator_init_data aquila_buck2_data = {
317 .constraints = {
318 .name = "VINT_1.2V",
319 .min_uV = 1200000,
320 .max_uV = 1200000,
321 .apply_uV = 1,
322 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
323 REGULATOR_CHANGE_STATUS,
324 },
325 .num_consumer_supplies = 1,
326 .consumer_supplies = &buck2_consumer,
327};
328
329static struct regulator_init_data aquila_buck3_data = {
330 .constraints = {
331 .name = "VCC_1.8V",
332 .min_uV = 1800000,
333 .max_uV = 1800000,
334 .apply_uV = 1,
335 .state_mem = {
336 .enabled = 1,
337 },
338 },
339};
340
341static struct regulator_init_data aquila_buck4_data = {
342 .constraints = {
343 .name = "CAM_CORE_1.2V",
344 .min_uV = 1200000,
345 .max_uV = 1200000,
346 .apply_uV = 1,
347 .always_on = 1,
348 },
349};
350
351static struct max8998_regulator_data aquila_regulators[] = {
352 { MAX8998_LDO2, &aquila_ldo2_data },
353 { MAX8998_LDO3, &aquila_ldo3_data },
354 { MAX8998_LDO4, &aquila_ldo4_data },
355 { MAX8998_LDO5, &aquila_ldo5_data },
356 { MAX8998_LDO6, &aquila_ldo6_data },
357 { MAX8998_LDO7, &aquila_ldo7_data },
358 { MAX8998_LDO8, &aquila_ldo8_data },
359 { MAX8998_LDO9, &aquila_ldo9_data },
360 { MAX8998_LDO10, &aquila_ldo10_data },
361 { MAX8998_LDO11, &aquila_ldo11_data },
362 { MAX8998_LDO12, &aquila_ldo12_data },
363 { MAX8998_LDO13, &aquila_ldo13_data },
364 { MAX8998_LDO14, &aquila_ldo14_data },
365 { MAX8998_LDO15, &aquila_ldo15_data },
366 { MAX8998_LDO16, &aquila_ldo16_data },
367 { MAX8998_LDO17, &aquila_ldo17_data },
368 { MAX8998_BUCK1, &aquila_buck1_data },
369 { MAX8998_BUCK2, &aquila_buck2_data },
370 { MAX8998_BUCK3, &aquila_buck3_data },
371 { MAX8998_BUCK4, &aquila_buck4_data },
372};
373
374static struct max8998_platform_data aquila_max8998_pdata = {
375 .num_regulators = ARRAY_SIZE(aquila_regulators),
376 .regulators = aquila_regulators,
377 .buck1_set1 = S5PV210_GPH0(3),
378 .buck1_set2 = S5PV210_GPH0(4),
379 .buck2_set3 = S5PV210_GPH0(5),
380 .buck1_voltage = { 1200000, 1200000, 1200000, 1200000 },
381 .buck2_voltage = { 1200000, 1200000 },
382};
383#endif
384
385static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
386 REGULATOR_SUPPLY("DBVDD", "5-001a"),
387 REGULATOR_SUPPLY("AVDD2", "5-001a"),
388 REGULATOR_SUPPLY("CPVDD", "5-001a"),
389};
390
391static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
392 REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
393 REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
394};
395
396static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
397 .constraints = {
398 .always_on = 1,
399 },
400 .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies),
401 .consumer_supplies = wm8994_fixed_voltage0_supplies,
402};
403
404static struct regulator_init_data wm8994_fixed_voltage1_init_data = {
405 .constraints = {
406 .always_on = 1,
407 },
408 .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies),
409 .consumer_supplies = wm8994_fixed_voltage1_supplies,
410};
411
412static struct fixed_voltage_config wm8994_fixed_voltage0_config = {
413 .supply_name = "VCC_1.8V_PDA",
414 .microvolts = 1800000,
415 .gpio = -EINVAL,
416 .init_data = &wm8994_fixed_voltage0_init_data,
417};
418
419static struct fixed_voltage_config wm8994_fixed_voltage1_config = {
420 .supply_name = "V_BAT",
421 .microvolts = 3700000,
422 .gpio = -EINVAL,
423 .init_data = &wm8994_fixed_voltage1_init_data,
424};
425
426static struct platform_device wm8994_fixed_voltage0 = {
427 .name = "reg-fixed-voltage",
428 .id = 0,
429 .dev = {
430 .platform_data = &wm8994_fixed_voltage0_config,
431 },
432};
433
434static struct platform_device wm8994_fixed_voltage1 = {
435 .name = "reg-fixed-voltage",
436 .id = 1,
437 .dev = {
438 .platform_data = &wm8994_fixed_voltage1_config,
439 },
440};
441
442static struct regulator_consumer_supply wm8994_avdd1_supply =
443 REGULATOR_SUPPLY("AVDD1", "5-001a");
444
445static struct regulator_consumer_supply wm8994_dcvdd_supply =
446 REGULATOR_SUPPLY("DCVDD", "5-001a");
447
448static struct regulator_init_data wm8994_ldo1_data = {
449 .constraints = {
450 .name = "AVDD1_3.0V",
451 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
452 },
453 .num_consumer_supplies = 1,
454 .consumer_supplies = &wm8994_avdd1_supply,
455};
456
457static struct regulator_init_data wm8994_ldo2_data = {
458 .constraints = {
459 .name = "DCVDD_1.0V",
460 },
461 .num_consumer_supplies = 1,
462 .consumer_supplies = &wm8994_dcvdd_supply,
463};
464
465static struct wm8994_pdata wm8994_platform_data = {
466 /* configure gpio1 function: 0x0001(Logic level input/output) */
467 .gpio_defaults[0] = 0x0001,
468 /* configure gpio3/4/5/7 function for AIF2 voice */
469 .gpio_defaults[2] = 0x8100,
470 .gpio_defaults[3] = 0x8100,
471 .gpio_defaults[4] = 0x8100,
472 .gpio_defaults[6] = 0x0100,
473 /* configure gpio8/9/10/11 function for AIF3 BT */
474 .gpio_defaults[7] = 0x8100,
475 .gpio_defaults[8] = 0x0100,
476 .gpio_defaults[9] = 0x0100,
477 .gpio_defaults[10] = 0x0100,
478 .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */
479 .ldo[1] = { 0, &wm8994_ldo2_data },
480};
481
482/* GPIO I2C PMIC */
483#define AP_I2C_GPIO_PMIC_BUS_4 4
484static struct i2c_gpio_platform_data aquila_i2c_gpio_pmic_data = {
485 .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */
486 .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */
487};
488
489static struct platform_device aquila_i2c_gpio_pmic = {
490 .name = "i2c-gpio",
491 .id = AP_I2C_GPIO_PMIC_BUS_4,
492 .dev = {
493 .platform_data = &aquila_i2c_gpio_pmic_data,
494 },
495};
496
497static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = {
498#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
499 {
500 /* 0xCC when SRAD = 0 */
501 I2C_BOARD_INFO("max8998", 0xCC >> 1),
502 .platform_data = &aquila_max8998_pdata,
503 },
504#endif
505};
506
507/* GPIO I2C AP 1.8V */
508#define AP_I2C_GPIO_BUS_5 5
509static struct i2c_gpio_platform_data aquila_i2c_gpio5_data = {
510 .sda_pin = S5PV210_MP05(3), /* XM0ADDR_11 */
511 .scl_pin = S5PV210_MP05(2), /* XM0ADDR_10 */
512};
513
514static struct platform_device aquila_i2c_gpio5 = {
515 .name = "i2c-gpio",
516 .id = AP_I2C_GPIO_BUS_5,
517 .dev = {
518 .platform_data = &aquila_i2c_gpio5_data,
519 },
520};
521
522static struct i2c_board_info i2c_gpio5_devs[] __initdata = {
523 {
524 /* CS/ADDR = low 0x34 (FYI: high = 0x36) */
525 I2C_BOARD_INFO("wm8994", 0x1a),
526 .platform_data = &wm8994_platform_data,
527 },
528};
529
530/* PMIC Power button */
531static struct gpio_keys_button aquila_gpio_keys_table[] = {
532 {
533 .code = KEY_POWER,
534 .gpio = S5PV210_GPH2(6),
535 .desc = "gpio-keys: KEY_POWER",
536 .type = EV_KEY,
537 .active_low = 1,
538 .wakeup = 1,
539 .debounce_interval = 1,
540 },
541};
542
543static struct gpio_keys_platform_data aquila_gpio_keys_data = {
544 .buttons = aquila_gpio_keys_table,
545 .nbuttons = ARRAY_SIZE(aquila_gpio_keys_table),
546};
547
548static struct platform_device aquila_device_gpiokeys = {
549 .name = "gpio-keys",
550 .dev = {
551 .platform_data = &aquila_gpio_keys_data,
552 },
553};
554
555static void __init aquila_pmic_init(void)
556{
557 /* AP_PMIC_IRQ: EINT7 */
558 s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf));
559 s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP);
560
561 /* nPower: EINT22 */
562 s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf));
563 s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP);
564}
565
566/* MoviNAND */
567static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
568 .max_width = 4,
569 .cd_type = S3C_SDHCI_CD_PERMANENT,
570};
571
572/* Wireless LAN */
573static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
574 .max_width = 4,
575 .cd_type = S3C_SDHCI_CD_EXTERNAL,
576 /* ext_cd_{init,cleanup} callbacks will be added later */
577};
578
579/* External Flash */
580#define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
581#define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
582static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
583 .max_width = 4,
584 .cd_type = S3C_SDHCI_CD_GPIO,
585 .ext_cd_gpio = AQUILA_EXT_FLASH_CD,
586 .ext_cd_gpio_invert = 1,
587};
588
589static void aquila_setup_sdhci(void)
590{
591 gpio_request_one(AQUILA_EXT_FLASH_EN, GPIOF_OUT_INIT_HIGH, "FLASH_EN");
592
593 s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
594 s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
595 s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
596};
597
598/* Audio device */
599static struct platform_device aquila_device_audio = {
600 .name = "smdk-audio",
601 .id = -1,
602};
603
604static struct platform_device *aquila_devices[] __initdata = {
605 &aquila_i2c_gpio_pmic,
606 &aquila_i2c_gpio5,
607 &aquila_device_gpiokeys,
608 &aquila_device_audio,
609 &s3c_device_fb,
610 &s5p_device_onenand,
611 &s3c_device_hsmmc0,
612 &s3c_device_hsmmc1,
613 &s3c_device_hsmmc2,
614 &s5p_device_fimc0,
615 &s5p_device_fimc1,
616 &s5p_device_fimc2,
617 &s5p_device_fimc_md,
618 &s5pv210_device_iis0,
619 &wm8994_fixed_voltage0,
620 &wm8994_fixed_voltage1,
621};
622
623static void __init aquila_sound_init(void)
624{
625 unsigned int gpio;
626
627 /* CODEC_XTAL_EN
628 *
629 * The Aquila board have a oscillator which provide main clock
630 * to WM8994 codec. The oscillator provide 24MHz clock to WM8994
631 * clock. Set gpio setting of "CODEC_XTAL_EN" to enable a oscillator.
632 * */
633 gpio = S5PV210_GPH3(2); /* XEINT_26 */
634 gpio_request(gpio, "CODEC_XTAL_EN");
635 s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
636 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
637
638 /* Ths main clock of WM8994 codec uses the output of CLKOUT pin.
639 * The CLKOUT[9:8] set to 0x3(XUSBXTI) of 0xE010E000(OTHERS)
640 * because it needs 24MHz clock to operate WM8994 codec.
641 */
642 __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS);
643}
644
645static void __init aquila_map_io(void)
646{
647 s5pv210_init_io(NULL, 0);
648 s3c24xx_init_clocks(24000000);
649 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
650 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
651}
652
653static void __init aquila_machine_init(void)
654{
655 /* PMIC */
656 aquila_pmic_init();
657 i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
658 ARRAY_SIZE(i2c_gpio_pmic_devs));
659 /* SDHCI */
660 aquila_setup_sdhci();
661
662 s3c_fimc_setname(0, "s5p-fimc");
663 s3c_fimc_setname(1, "s5p-fimc");
664 s3c_fimc_setname(2, "s5p-fimc");
665
666 /* SOUND */
667 aquila_sound_init();
668 i2c_register_board_info(AP_I2C_GPIO_BUS_5, i2c_gpio5_devs,
669 ARRAY_SIZE(i2c_gpio5_devs));
670
671 /* FB */
672 s3c_fb_set_platdata(&aquila_lcd_pdata);
673
674 platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
675}
676
677MACHINE_START(AQUILA, "Aquila")
678 /* Maintainers:
679 Marek Szyprowski <m.szyprowski@samsung.com>
680 Kyungmin Park <kyungmin.park@samsung.com> */
681 .atag_offset = 0x100,
682 .init_irq = s5pv210_init_irq,
683 .map_io = aquila_map_io,
684 .init_machine = aquila_machine_init,
685 .init_time = samsung_timer_init,
686 .restart = s5pv210_restart,
687MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
deleted file mode 100644
index 315926f0b5d3..000000000000
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ /dev/null
@@ -1,915 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/mach-goni.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15#include <linux/serial_s3c.h>
16#include <linux/fb.h>
17#include <linux/i2c.h>
18#include <linux/i2c-gpio.h>
19#include <linux/i2c/atmel_mxt_ts.h>
20#include <linux/mfd/max8998.h>
21#include <linux/mfd/wm8994/pdata.h>
22#include <linux/regulator/fixed.h>
23#include <linux/spi/spi.h>
24#include <linux/spi/spi_gpio.h>
25#include <linux/lcd.h>
26#include <linux/gpio_keys.h>
27#include <linux/input.h>
28#include <linux/gpio.h>
29#include <linux/mmc/host.h>
30#include <linux/interrupt.h>
31#include <linux/platform_data/s3c-hsotg.h>
32
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/setup.h>
36#include <asm/mach-types.h>
37
38#include <video/samsung_fimd.h>
39#include <mach/map.h>
40#include <mach/regs-clock.h>
41
42#include <plat/gpio-cfg.h>
43#include <plat/devs.h>
44#include <plat/cpu.h>
45#include <plat/fb.h>
46#include <linux/platform_data/i2c-s3c2410.h>
47#include <plat/keypad.h>
48#include <plat/sdhci.h>
49#include <plat/samsung-time.h>
50#include <plat/mfc.h>
51
52#include "common.h"
53
54/* Following are default values for UCON, ULCON and UFCON UART registers */
55#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
56 S3C2410_UCON_RXILEVEL | \
57 S3C2410_UCON_TXIRQMODE | \
58 S3C2410_UCON_RXIRQMODE | \
59 S3C2410_UCON_RXFIFO_TOI | \
60 S3C2443_UCON_RXERR_IRQEN)
61
62#define GONI_ULCON_DEFAULT S3C2410_LCON_CS8
63
64#define GONI_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
65
66static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = {
67 [0] = {
68 .hwport = 0,
69 .flags = 0,
70 .ucon = GONI_UCON_DEFAULT,
71 .ulcon = GONI_ULCON_DEFAULT,
72 .ufcon = GONI_UFCON_DEFAULT |
73 S5PV210_UFCON_TXTRIG256 | S5PV210_UFCON_RXTRIG256,
74 },
75 [1] = {
76 .hwport = 1,
77 .flags = 0,
78 .ucon = GONI_UCON_DEFAULT,
79 .ulcon = GONI_ULCON_DEFAULT,
80 .ufcon = GONI_UFCON_DEFAULT |
81 S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
82 },
83 [2] = {
84 .hwport = 2,
85 .flags = 0,
86 .ucon = GONI_UCON_DEFAULT,
87 .ulcon = GONI_ULCON_DEFAULT,
88 .ufcon = GONI_UFCON_DEFAULT |
89 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
90 },
91 [3] = {
92 .hwport = 3,
93 .flags = 0,
94 .ucon = GONI_UCON_DEFAULT,
95 .ulcon = GONI_ULCON_DEFAULT,
96 .ufcon = GONI_UFCON_DEFAULT |
97 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
98 },
99};
100
101/* Frame Buffer */
102static struct s3c_fb_pd_win goni_fb_win0 = {
103 .max_bpp = 32,
104 .default_bpp = 16,
105 .xres = 480,
106 .yres = 800,
107 .virtual_x = 480,
108 .virtual_y = 2 * 800,
109};
110
111static struct fb_videomode goni_lcd_timing = {
112 .left_margin = 16,
113 .right_margin = 16,
114 .upper_margin = 2,
115 .lower_margin = 28,
116 .hsync_len = 2,
117 .vsync_len = 1,
118 .xres = 480,
119 .yres = 800,
120 .refresh = 55,
121};
122
123static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
124 .win[0] = &goni_fb_win0,
125 .vtiming = &goni_lcd_timing,
126 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
127 VIDCON0_CLKSEL_LCD,
128 .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
129 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
130 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
131};
132
133static int lcd_power_on(struct lcd_device *ld, int enable)
134{
135 return 1;
136}
137
138static int reset_lcd(struct lcd_device *ld)
139{
140 static unsigned int first = 1;
141 int reset_gpio = -1;
142
143 reset_gpio = S5PV210_MP05(5);
144
145 if (first) {
146 gpio_request(reset_gpio, "MLCD_RST");
147 first = 0;
148 }
149
150 gpio_direction_output(reset_gpio, 1);
151 return 1;
152}
153
154static struct lcd_platform_data goni_lcd_platform_data = {
155 .reset = reset_lcd,
156 .power_on = lcd_power_on,
157 .lcd_enabled = 0,
158 .reset_delay = 120, /* 120ms */
159 .power_on_delay = 25, /* 25ms */
160 .power_off_delay = 200, /* 200ms */
161};
162
163#define LCD_BUS_NUM 3
164static struct spi_board_info spi_board_info[] __initdata = {
165 {
166 .modalias = "s6e63m0",
167 .platform_data = &goni_lcd_platform_data,
168 .max_speed_hz = 1200000,
169 .bus_num = LCD_BUS_NUM,
170 .chip_select = 0,
171 .mode = SPI_MODE_3,
172 .controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */
173 },
174};
175
176static struct spi_gpio_platform_data lcd_spi_gpio_data = {
177 .sck = S5PV210_MP04(1), /* DISPLAY_CLK */
178 .mosi = S5PV210_MP04(3), /* DISPLAY_SI */
179 .miso = SPI_GPIO_NO_MISO,
180 .num_chipselect = 1,
181};
182
183static struct platform_device goni_spi_gpio = {
184 .name = "spi_gpio",
185 .id = LCD_BUS_NUM,
186 .dev = {
187 .parent = &s3c_device_fb.dev,
188 .platform_data = &lcd_spi_gpio_data,
189 },
190};
191
192/* KEYPAD */
193static uint32_t keymap[] __initdata = {
194 /* KEY(row, col, keycode) */
195 KEY(0, 1, KEY_MENU), /* Send */
196 KEY(0, 2, KEY_BACK), /* End */
197 KEY(1, 1, KEY_CONFIG), /* Half shot */
198 KEY(1, 2, KEY_VOLUMEUP),
199 KEY(2, 1, KEY_CAMERA), /* Full shot */
200 KEY(2, 2, KEY_VOLUMEDOWN),
201};
202
203static struct matrix_keymap_data keymap_data __initdata = {
204 .keymap = keymap,
205 .keymap_size = ARRAY_SIZE(keymap),
206};
207
208static struct samsung_keypad_platdata keypad_data __initdata = {
209 .keymap_data = &keymap_data,
210 .rows = 3,
211 .cols = 3,
212};
213
214/* Radio */
215static struct i2c_board_info i2c1_devs[] __initdata = {
216 {
217 I2C_BOARD_INFO("si470x", 0x10),
218 },
219};
220
221static void __init goni_radio_init(void)
222{
223 int gpio;
224
225 gpio = S5PV210_GPJ2(4); /* XMSMDATA_4 */
226 gpio_request(gpio, "FM_INT");
227 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
228 i2c1_devs[0].irq = gpio_to_irq(gpio);
229
230 gpio = S5PV210_GPJ2(5); /* XMSMDATA_5 */
231 gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "FM_RST");
232}
233
234/* TSP */
235static struct mxt_platform_data qt602240_platform_data = {
236 .irqflags = IRQF_TRIGGER_FALLING,
237};
238
239static struct s3c2410_platform_i2c i2c2_data __initdata = {
240 .flags = 0,
241 .bus_num = 2,
242 .slave_addr = 0x10,
243 .frequency = 400 * 1000,
244 .sda_delay = 100,
245};
246
247static struct i2c_board_info i2c2_devs[] __initdata = {
248 {
249 I2C_BOARD_INFO("qt602240_ts", 0x4a),
250 .platform_data = &qt602240_platform_data,
251 },
252};
253
254static void __init goni_tsp_init(void)
255{
256 int gpio;
257
258 gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */
259 gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "TSP_LDO_ON");
260 gpio_export(gpio, 0);
261
262 gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */
263 gpio_request(gpio, "TSP_INT");
264
265 s5p_register_gpio_interrupt(gpio);
266 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
267 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
268 i2c2_devs[0].irq = gpio_to_irq(gpio);
269}
270
271/* USB OTG */
272static struct s3c_hsotg_plat goni_hsotg_pdata;
273
274/* MAX8998 regulators */
275#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
276
277static struct regulator_consumer_supply goni_ldo3_consumers[] = {
278 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"),
279};
280
281static struct regulator_consumer_supply goni_ldo5_consumers[] = {
282 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
283};
284
285static struct regulator_consumer_supply goni_ldo8_consumers[] = {
286 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"),
287 REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"),
288};
289
290static struct regulator_consumer_supply goni_ldo11_consumers[] = {
291 REGULATOR_SUPPLY("vddio", "0-0030"), /* "CAM_IO_2.8V" */
292};
293
294static struct regulator_consumer_supply goni_ldo13_consumers[] = {
295 REGULATOR_SUPPLY("vdda", "0-0030"), /* "CAM_A_2.8V" */
296};
297
298static struct regulator_consumer_supply goni_ldo14_consumers[] = {
299 REGULATOR_SUPPLY("vdd_core", "0-0030"), /* "CAM_CIF_1.8V" */
300};
301
302static struct regulator_init_data goni_ldo2_data = {
303 .constraints = {
304 .name = "VALIVE_1.1V",
305 .min_uV = 1100000,
306 .max_uV = 1100000,
307 .apply_uV = 1,
308 .always_on = 1,
309 .state_mem = {
310 .enabled = 1,
311 },
312 },
313};
314
315static struct regulator_init_data goni_ldo3_data = {
316 .constraints = {
317 .name = "VUSB+MIPI_1.1V",
318 .min_uV = 1100000,
319 .max_uV = 1100000,
320 .apply_uV = 1,
321 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
322 },
323 .num_consumer_supplies = ARRAY_SIZE(goni_ldo3_consumers),
324 .consumer_supplies = goni_ldo3_consumers,
325};
326
327static struct regulator_init_data goni_ldo4_data = {
328 .constraints = {
329 .name = "VDAC_3.3V",
330 .min_uV = 3300000,
331 .max_uV = 3300000,
332 .apply_uV = 1,
333 },
334};
335
336static struct regulator_init_data goni_ldo5_data = {
337 .constraints = {
338 .name = "VTF_2.8V",
339 .min_uV = 2800000,
340 .max_uV = 2800000,
341 .apply_uV = 1,
342 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
343 },
344 .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers),
345 .consumer_supplies = goni_ldo5_consumers,
346};
347
348static struct regulator_init_data goni_ldo6_data = {
349 .constraints = {
350 .name = "VCC_3.3V",
351 .min_uV = 3300000,
352 .max_uV = 3300000,
353 .apply_uV = 1,
354 },
355};
356
357static struct regulator_init_data goni_ldo7_data = {
358 .constraints = {
359 .name = "VLCD_1.8V",
360 .min_uV = 1800000,
361 .max_uV = 1800000,
362 .apply_uV = 1,
363 .always_on = 1,
364 },
365};
366
367static struct regulator_init_data goni_ldo8_data = {
368 .constraints = {
369 .name = "VUSB+VADC_3.3V",
370 .min_uV = 3300000,
371 .max_uV = 3300000,
372 .apply_uV = 1,
373 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
374 },
375 .num_consumer_supplies = ARRAY_SIZE(goni_ldo8_consumers),
376 .consumer_supplies = goni_ldo8_consumers,
377};
378
379static struct regulator_init_data goni_ldo9_data = {
380 .constraints = {
381 .name = "VCC+VCAM_2.8V",
382 .min_uV = 2800000,
383 .max_uV = 2800000,
384 .apply_uV = 1,
385 },
386};
387
388static struct regulator_init_data goni_ldo10_data = {
389 .constraints = {
390 .name = "VPLL_1.1V",
391 .min_uV = 1100000,
392 .max_uV = 1100000,
393 .apply_uV = 1,
394 .boot_on = 1,
395 },
396};
397
398static struct regulator_init_data goni_ldo11_data = {
399 .constraints = {
400 .name = "CAM_IO_2.8V",
401 .min_uV = 2800000,
402 .max_uV = 2800000,
403 .apply_uV = 1,
404 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
405 },
406 .num_consumer_supplies = ARRAY_SIZE(goni_ldo11_consumers),
407 .consumer_supplies = goni_ldo11_consumers,
408};
409
410static struct regulator_init_data goni_ldo12_data = {
411 .constraints = {
412 .name = "CAM_ISP_1.2V",
413 .min_uV = 1200000,
414 .max_uV = 1200000,
415 .apply_uV = 1,
416 },
417};
418
419static struct regulator_init_data goni_ldo13_data = {
420 .constraints = {
421 .name = "CAM_A_2.8V",
422 .min_uV = 2800000,
423 .max_uV = 2800000,
424 .apply_uV = 1,
425 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
426 },
427 .num_consumer_supplies = ARRAY_SIZE(goni_ldo13_consumers),
428 .consumer_supplies = goni_ldo13_consumers,
429};
430
431static struct regulator_init_data goni_ldo14_data = {
432 .constraints = {
433 .name = "CAM_CIF_1.8V",
434 .min_uV = 1800000,
435 .max_uV = 1800000,
436 .apply_uV = 1,
437 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
438 },
439 .num_consumer_supplies = ARRAY_SIZE(goni_ldo14_consumers),
440 .consumer_supplies = goni_ldo14_consumers,
441};
442
443static struct regulator_init_data goni_ldo15_data = {
444 .constraints = {
445 .name = "CAM_AF_3.3V",
446 .min_uV = 3300000,
447 .max_uV = 3300000,
448 .apply_uV = 1,
449 },
450};
451
452static struct regulator_init_data goni_ldo16_data = {
453 .constraints = {
454 .name = "VMIPI_1.8V",
455 .min_uV = 1800000,
456 .max_uV = 1800000,
457 .apply_uV = 1,
458 },
459};
460
461static struct regulator_init_data goni_ldo17_data = {
462 .constraints = {
463 .name = "VCC_3.0V_LCD",
464 .min_uV = 3000000,
465 .max_uV = 3000000,
466 .apply_uV = 1,
467 .always_on = 1,
468 },
469};
470
471/* BUCK */
472static struct regulator_consumer_supply buck1_consumer =
473 REGULATOR_SUPPLY("vddarm", NULL);
474
475static struct regulator_consumer_supply buck2_consumer =
476 REGULATOR_SUPPLY("vddint", NULL);
477
478static struct regulator_consumer_supply buck3_consumer =
479 REGULATOR_SUPPLY("vdet", "s5p-sdo");
480
481
482static struct regulator_init_data goni_buck1_data = {
483 .constraints = {
484 .name = "VARM_1.2V",
485 .min_uV = 1200000,
486 .max_uV = 1200000,
487 .apply_uV = 1,
488 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
489 REGULATOR_CHANGE_STATUS,
490 },
491 .num_consumer_supplies = 1,
492 .consumer_supplies = &buck1_consumer,
493};
494
495static struct regulator_init_data goni_buck2_data = {
496 .constraints = {
497 .name = "VINT_1.2V",
498 .min_uV = 1200000,
499 .max_uV = 1200000,
500 .apply_uV = 1,
501 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
502 REGULATOR_CHANGE_STATUS,
503 },
504 .num_consumer_supplies = 1,
505 .consumer_supplies = &buck2_consumer,
506};
507
508static struct regulator_init_data goni_buck3_data = {
509 .constraints = {
510 .name = "VCC_1.8V",
511 .min_uV = 1800000,
512 .max_uV = 1800000,
513 .apply_uV = 1,
514 .state_mem = {
515 .enabled = 1,
516 },
517 },
518 .num_consumer_supplies = 1,
519 .consumer_supplies = &buck3_consumer,
520};
521
522static struct regulator_init_data goni_buck4_data = {
523 .constraints = {
524 .name = "CAM_CORE_1.2V",
525 .min_uV = 1200000,
526 .max_uV = 1200000,
527 .apply_uV = 1,
528 .always_on = 1,
529 },
530};
531
532static struct max8998_regulator_data goni_regulators[] = {
533 { MAX8998_LDO2, &goni_ldo2_data },
534 { MAX8998_LDO3, &goni_ldo3_data },
535 { MAX8998_LDO4, &goni_ldo4_data },
536 { MAX8998_LDO5, &goni_ldo5_data },
537 { MAX8998_LDO6, &goni_ldo6_data },
538 { MAX8998_LDO7, &goni_ldo7_data },
539 { MAX8998_LDO8, &goni_ldo8_data },
540 { MAX8998_LDO9, &goni_ldo9_data },
541 { MAX8998_LDO10, &goni_ldo10_data },
542 { MAX8998_LDO11, &goni_ldo11_data },
543 { MAX8998_LDO12, &goni_ldo12_data },
544 { MAX8998_LDO13, &goni_ldo13_data },
545 { MAX8998_LDO14, &goni_ldo14_data },
546 { MAX8998_LDO15, &goni_ldo15_data },
547 { MAX8998_LDO16, &goni_ldo16_data },
548 { MAX8998_LDO17, &goni_ldo17_data },
549 { MAX8998_BUCK1, &goni_buck1_data },
550 { MAX8998_BUCK2, &goni_buck2_data },
551 { MAX8998_BUCK3, &goni_buck3_data },
552 { MAX8998_BUCK4, &goni_buck4_data },
553};
554
555static struct max8998_platform_data goni_max8998_pdata = {
556 .num_regulators = ARRAY_SIZE(goni_regulators),
557 .regulators = goni_regulators,
558 .buck1_set1 = S5PV210_GPH0(3),
559 .buck1_set2 = S5PV210_GPH0(4),
560 .buck2_set3 = S5PV210_GPH0(5),
561 .buck1_voltage = { 1200000, 1200000, 1200000, 1200000 },
562 .buck2_voltage = { 1200000, 1200000 },
563};
564#endif
565
566static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
567 REGULATOR_SUPPLY("DBVDD", "5-001a"),
568 REGULATOR_SUPPLY("AVDD2", "5-001a"),
569 REGULATOR_SUPPLY("CPVDD", "5-001a"),
570};
571
572static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
573 REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
574 REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
575};
576
577static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
578 .constraints = {
579 .always_on = 1,
580 },
581 .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies),
582 .consumer_supplies = wm8994_fixed_voltage0_supplies,
583};
584
585static struct regulator_init_data wm8994_fixed_voltage1_init_data = {
586 .constraints = {
587 .always_on = 1,
588 },
589 .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies),
590 .consumer_supplies = wm8994_fixed_voltage1_supplies,
591};
592
593static struct fixed_voltage_config wm8994_fixed_voltage0_config = {
594 .supply_name = "VCC_1.8V_PDA",
595 .microvolts = 1800000,
596 .gpio = -EINVAL,
597 .init_data = &wm8994_fixed_voltage0_init_data,
598};
599
600static struct fixed_voltage_config wm8994_fixed_voltage1_config = {
601 .supply_name = "V_BAT",
602 .microvolts = 3700000,
603 .gpio = -EINVAL,
604 .init_data = &wm8994_fixed_voltage1_init_data,
605};
606
607static struct platform_device wm8994_fixed_voltage0 = {
608 .name = "reg-fixed-voltage",
609 .id = 0,
610 .dev = {
611 .platform_data = &wm8994_fixed_voltage0_config,
612 },
613};
614
615static struct platform_device wm8994_fixed_voltage1 = {
616 .name = "reg-fixed-voltage",
617 .id = 1,
618 .dev = {
619 .platform_data = &wm8994_fixed_voltage1_config,
620 },
621};
622
623static struct regulator_consumer_supply wm8994_avdd1_supply =
624 REGULATOR_SUPPLY("AVDD1", "5-001a");
625
626static struct regulator_consumer_supply wm8994_dcvdd_supply =
627 REGULATOR_SUPPLY("DCVDD", "5-001a");
628
629static struct regulator_init_data wm8994_ldo1_data = {
630 .constraints = {
631 .name = "AVDD1_3.0V",
632 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
633 },
634 .num_consumer_supplies = 1,
635 .consumer_supplies = &wm8994_avdd1_supply,
636};
637
638static struct regulator_init_data wm8994_ldo2_data = {
639 .constraints = {
640 .name = "DCVDD_1.0V",
641 },
642 .num_consumer_supplies = 1,
643 .consumer_supplies = &wm8994_dcvdd_supply,
644};
645
646static struct wm8994_pdata wm8994_platform_data = {
647 /* configure gpio1 function: 0x0001(Logic level input/output) */
648 .gpio_defaults[0] = 0x0001,
649 /* configure gpio3/4/5/7 function for AIF2 voice */
650 .gpio_defaults[2] = 0x8100,
651 .gpio_defaults[3] = 0x8100,
652 .gpio_defaults[4] = 0x8100,
653 .gpio_defaults[6] = 0x0100,
654 /* configure gpio8/9/10/11 function for AIF3 BT */
655 .gpio_defaults[7] = 0x8100,
656 .gpio_defaults[8] = 0x0100,
657 .gpio_defaults[9] = 0x0100,
658 .gpio_defaults[10] = 0x0100,
659 .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */
660 .ldo[1] = { 0, &wm8994_ldo2_data },
661};
662
663/* GPIO I2C PMIC */
664#define AP_I2C_GPIO_PMIC_BUS_4 4
665static struct i2c_gpio_platform_data goni_i2c_gpio_pmic_data = {
666 .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */
667 .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */
668};
669
670static struct platform_device goni_i2c_gpio_pmic = {
671 .name = "i2c-gpio",
672 .id = AP_I2C_GPIO_PMIC_BUS_4,
673 .dev = {
674 .platform_data = &goni_i2c_gpio_pmic_data,
675 },
676};
677
678static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = {
679#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
680 {
681 /* 0xCC when SRAD = 0 */
682 I2C_BOARD_INFO("max8998", 0xCC >> 1),
683 .platform_data = &goni_max8998_pdata,
684 },
685#endif
686};
687
688/* GPIO I2C AP 1.8V */
689#define AP_I2C_GPIO_BUS_5 5
690static struct i2c_gpio_platform_data goni_i2c_gpio5_data = {
691 .sda_pin = S5PV210_MP05(3), /* XM0ADDR_11 */
692 .scl_pin = S5PV210_MP05(2), /* XM0ADDR_10 */
693};
694
695static struct platform_device goni_i2c_gpio5 = {
696 .name = "i2c-gpio",
697 .id = AP_I2C_GPIO_BUS_5,
698 .dev = {
699 .platform_data = &goni_i2c_gpio5_data,
700 },
701};
702
703static struct i2c_board_info i2c_gpio5_devs[] __initdata = {
704 {
705 /* CS/ADDR = low 0x34 (FYI: high = 0x36) */
706 I2C_BOARD_INFO("wm8994", 0x1a),
707 .platform_data = &wm8994_platform_data,
708 },
709};
710
711/* PMIC Power button */
712static struct gpio_keys_button goni_gpio_keys_table[] = {
713 {
714 .code = KEY_POWER,
715 .gpio = S5PV210_GPH2(6),
716 .desc = "gpio-keys: KEY_POWER",
717 .type = EV_KEY,
718 .active_low = 1,
719 .wakeup = 1,
720 .debounce_interval = 1,
721 },
722};
723
724static struct gpio_keys_platform_data goni_gpio_keys_data = {
725 .buttons = goni_gpio_keys_table,
726 .nbuttons = ARRAY_SIZE(goni_gpio_keys_table),
727};
728
729static struct platform_device goni_device_gpiokeys = {
730 .name = "gpio-keys",
731 .dev = {
732 .platform_data = &goni_gpio_keys_data,
733 },
734};
735
736static void __init goni_pmic_init(void)
737{
738 /* AP_PMIC_IRQ: EINT7 */
739 s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf));
740 s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP);
741
742 /* nPower: EINT22 */
743 s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf));
744 s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP);
745}
746
747/* MoviNAND */
748static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = {
749 .max_width = 4,
750 .cd_type = S3C_SDHCI_CD_PERMANENT,
751};
752
753/* Wireless LAN */
754static struct s3c_sdhci_platdata goni_hsmmc1_data __initdata = {
755 .max_width = 4,
756 .cd_type = S3C_SDHCI_CD_EXTERNAL,
757 /* ext_cd_{init,cleanup} callbacks will be added later */
758};
759
760/* External Flash */
761#define GONI_EXT_FLASH_EN S5PV210_MP05(4)
762#define GONI_EXT_FLASH_CD S5PV210_GPH3(4)
763static struct s3c_sdhci_platdata goni_hsmmc2_data __initdata = {
764 .max_width = 4,
765 .cd_type = S3C_SDHCI_CD_GPIO,
766 .ext_cd_gpio = GONI_EXT_FLASH_CD,
767 .ext_cd_gpio_invert = 1,
768};
769
770static struct regulator_consumer_supply mmc2_supplies[] = {
771 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
772};
773
774static struct regulator_init_data mmc2_fixed_voltage_init_data = {
775 .constraints = {
776 .name = "V_TF_2.8V",
777 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
778 },
779 .num_consumer_supplies = ARRAY_SIZE(mmc2_supplies),
780 .consumer_supplies = mmc2_supplies,
781};
782
783static struct fixed_voltage_config mmc2_fixed_voltage_config = {
784 .supply_name = "EXT_FLASH_EN",
785 .microvolts = 2800000,
786 .gpio = GONI_EXT_FLASH_EN,
787 .enable_high = true,
788 .init_data = &mmc2_fixed_voltage_init_data,
789};
790
791static struct platform_device mmc2_fixed_voltage = {
792 .name = "reg-fixed-voltage",
793 .id = 2,
794 .dev = {
795 .platform_data = &mmc2_fixed_voltage_config,
796 },
797};
798
799static void goni_setup_sdhci(void)
800{
801 s3c_sdhci0_set_platdata(&goni_hsmmc0_data);
802 s3c_sdhci1_set_platdata(&goni_hsmmc1_data);
803 s3c_sdhci2_set_platdata(&goni_hsmmc2_data);
804};
805
806/* Audio device */
807static struct platform_device goni_device_audio = {
808 .name = "smdk-audio",
809 .id = -1,
810};
811
812static struct platform_device *goni_devices[] __initdata = {
813 &s3c_device_fb,
814 &s5p_device_onenand,
815 &goni_spi_gpio,
816 &goni_i2c_gpio_pmic,
817 &goni_i2c_gpio5,
818 &goni_device_audio,
819 &mmc2_fixed_voltage,
820 &goni_device_gpiokeys,
821 &s5p_device_mfc,
822 &s5p_device_mfc_l,
823 &s5p_device_mfc_r,
824 &s5p_device_mixer,
825 &s5p_device_sdo,
826 &s3c_device_i2c0,
827 &s3c_device_hsmmc0,
828 &s3c_device_hsmmc1,
829 &s3c_device_hsmmc2,
830 &s5pv210_device_iis0,
831 &s3c_device_usb_hsotg,
832 &samsung_device_keypad,
833 &s3c_device_i2c1,
834 &s3c_device_i2c2,
835 &wm8994_fixed_voltage0,
836 &wm8994_fixed_voltage1,
837};
838
839static void __init goni_sound_init(void)
840{
841 /* Ths main clock of WM8994 codec uses the output of CLKOUT pin.
842 * The CLKOUT[9:8] set to 0x3(XUSBXTI) of 0xE010E000(OTHERS)
843 * because it needs 24MHz clock to operate WM8994 codec.
844 */
845 __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS);
846}
847
848static void __init goni_map_io(void)
849{
850 s5pv210_init_io(NULL, 0);
851 s3c24xx_init_clocks(24000000);
852 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
853 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
854}
855
856static void __init goni_reserve(void)
857{
858 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
859}
860
861static void __init goni_machine_init(void)
862{
863 /* Radio: call before I2C 1 registeration */
864 goni_radio_init();
865
866 /* I2C0 */
867 s3c_i2c0_set_platdata(NULL);
868
869 /* I2C1 */
870 s3c_i2c1_set_platdata(NULL);
871 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
872
873 /* TSP: call before I2C 2 registeration */
874 goni_tsp_init();
875
876 /* I2C2 */
877 s3c_i2c2_set_platdata(&i2c2_data);
878 i2c_register_board_info(2, i2c2_devs, ARRAY_SIZE(i2c2_devs));
879
880 /* PMIC */
881 goni_pmic_init();
882 i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
883 ARRAY_SIZE(i2c_gpio_pmic_devs));
884 /* SDHCI */
885 goni_setup_sdhci();
886
887 /* SOUND */
888 goni_sound_init();
889 i2c_register_board_info(AP_I2C_GPIO_BUS_5, i2c_gpio5_devs,
890 ARRAY_SIZE(i2c_gpio5_devs));
891
892 /* FB */
893 s3c_fb_set_platdata(&goni_lcd_pdata);
894
895 s3c_hsotg_set_platdata(&goni_hsotg_pdata);
896
897 /* SPI */
898 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
899
900 /* KEYPAD */
901 samsung_keypad_set_platdata(&keypad_data);
902
903 platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
904}
905
906MACHINE_START(GONI, "GONI")
907 /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */
908 .atag_offset = 0x100,
909 .init_irq = s5pv210_init_irq,
910 .map_io = goni_map_io,
911 .init_machine = goni_machine_init,
912 .init_time = samsung_timer_init,
913 .reserve = &goni_reserve,
914 .restart = s5pv210_restart,
915MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
deleted file mode 100644
index 448e1d2eeed6..000000000000
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ /dev/null
@@ -1,159 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/mach-smdkc110.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15#include <linux/serial_s3c.h>
16#include <linux/i2c.h>
17#include <linux/device.h>
18
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21#include <asm/setup.h>
22#include <asm/mach-types.h>
23
24#include <mach/map.h>
25#include <mach/regs-clock.h>
26
27#include <plat/devs.h>
28#include <plat/cpu.h>
29#include <linux/platform_data/ata-samsung_cf.h>
30#include <linux/platform_data/i2c-s3c2410.h>
31#include <plat/pm.h>
32#include <plat/samsung-time.h>
33#include <plat/mfc.h>
34
35#include "common.h"
36
37/* Following are default values for UCON, ULCON and UFCON UART registers */
38#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
39 S3C2410_UCON_RXILEVEL | \
40 S3C2410_UCON_TXIRQMODE | \
41 S3C2410_UCON_RXIRQMODE | \
42 S3C2410_UCON_RXFIFO_TOI | \
43 S3C2443_UCON_RXERR_IRQEN)
44
45#define SMDKC110_ULCON_DEFAULT S3C2410_LCON_CS8
46
47#define SMDKC110_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
48 S5PV210_UFCON_TXTRIG4 | \
49 S5PV210_UFCON_RXTRIG4)
50
51static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
52 [0] = {
53 .hwport = 0,
54 .flags = 0,
55 .ucon = SMDKC110_UCON_DEFAULT,
56 .ulcon = SMDKC110_ULCON_DEFAULT,
57 .ufcon = SMDKC110_UFCON_DEFAULT,
58 },
59 [1] = {
60 .hwport = 1,
61 .flags = 0,
62 .ucon = SMDKC110_UCON_DEFAULT,
63 .ulcon = SMDKC110_ULCON_DEFAULT,
64 .ufcon = SMDKC110_UFCON_DEFAULT,
65 },
66 [2] = {
67 .hwport = 2,
68 .flags = 0,
69 .ucon = SMDKC110_UCON_DEFAULT,
70 .ulcon = SMDKC110_ULCON_DEFAULT,
71 .ufcon = SMDKC110_UFCON_DEFAULT,
72 },
73 [3] = {
74 .hwport = 3,
75 .flags = 0,
76 .ucon = SMDKC110_UCON_DEFAULT,
77 .ulcon = SMDKC110_ULCON_DEFAULT,
78 .ufcon = SMDKC110_UFCON_DEFAULT,
79 },
80};
81
82static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
83 .setup_gpio = s5pv210_ide_setup_gpio,
84};
85
86static struct platform_device *smdkc110_devices[] __initdata = {
87 &s5pv210_device_iis0,
88 &s5pv210_device_ac97,
89 &s5pv210_device_spdif,
90 &s3c_device_cfcon,
91 &s3c_device_i2c0,
92 &s3c_device_i2c1,
93 &s3c_device_i2c2,
94 &s3c_device_rtc,
95 &s3c_device_wdt,
96 &s5p_device_fimc0,
97 &s5p_device_fimc1,
98 &s5p_device_fimc2,
99 &s5p_device_fimc_md,
100 &s5p_device_mfc,
101 &s5p_device_mfc_l,
102 &s5p_device_mfc_r,
103};
104
105static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
106 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
107 { I2C_BOARD_INFO("wm8580", 0x1b), },
108};
109
110static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
111 /* To Be Updated */
112};
113
114static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
115 /* To Be Updated */
116};
117
118static void __init smdkc110_map_io(void)
119{
120 s5pv210_init_io(NULL, 0);
121 s3c24xx_init_clocks(24000000);
122 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
123 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
124}
125
126static void __init smdkc110_reserve(void)
127{
128 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
129}
130
131static void __init smdkc110_machine_init(void)
132{
133 s3c_pm_init();
134
135 s3c_i2c0_set_platdata(NULL);
136 s3c_i2c1_set_platdata(NULL);
137 s3c_i2c2_set_platdata(NULL);
138 i2c_register_board_info(0, smdkc110_i2c_devs0,
139 ARRAY_SIZE(smdkc110_i2c_devs0));
140 i2c_register_board_info(1, smdkc110_i2c_devs1,
141 ARRAY_SIZE(smdkc110_i2c_devs1));
142 i2c_register_board_info(2, smdkc110_i2c_devs2,
143 ARRAY_SIZE(smdkc110_i2c_devs2));
144
145 s3c_ide_set_platdata(&smdkc110_ide_pdata);
146
147 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
148}
149
150MACHINE_START(SMDKC110, "SMDKC110")
151 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
152 .atag_offset = 0x100,
153 .init_irq = s5pv210_init_irq,
154 .map_io = smdkc110_map_io,
155 .init_machine = smdkc110_machine_init,
156 .init_time = samsung_timer_init,
157 .restart = s5pv210_restart,
158 .reserve = &smdkc110_reserve,
159MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
deleted file mode 100644
index 6816ccdfd86c..000000000000
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ /dev/null
@@ -1,336 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/mach-smdkv210.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/i2c.h>
14#include <linux/init.h>
15#include <linux/serial_core.h>
16#include <linux/serial_s3c.h>
17#include <linux/device.h>
18#include <linux/dm9000.h>
19#include <linux/fb.h>
20#include <linux/gpio.h>
21#include <linux/delay.h>
22#include <linux/pwm_backlight.h>
23#include <linux/platform_data/s3c-hsotg.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/setup.h>
28#include <asm/mach-types.h>
29
30#include <video/platform_lcd.h>
31#include <video/samsung_fimd.h>
32
33#include <mach/map.h>
34#include <mach/regs-clock.h>
35
36#include <plat/regs-srom.h>
37#include <plat/gpio-cfg.h>
38#include <plat/devs.h>
39#include <plat/cpu.h>
40#include <plat/adc.h>
41#include <linux/platform_data/touchscreen-s3c2410.h>
42#include <linux/platform_data/ata-samsung_cf.h>
43#include <linux/platform_data/i2c-s3c2410.h>
44#include <plat/keypad.h>
45#include <plat/pm.h>
46#include <plat/fb.h>
47#include <plat/samsung-time.h>
48#include <plat/backlight.h>
49#include <plat/mfc.h>
50
51#include "common.h"
52
53/* Following are default values for UCON, ULCON and UFCON UART registers */
54#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
55 S3C2410_UCON_RXILEVEL | \
56 S3C2410_UCON_TXIRQMODE | \
57 S3C2410_UCON_RXIRQMODE | \
58 S3C2410_UCON_RXFIFO_TOI | \
59 S3C2443_UCON_RXERR_IRQEN)
60
61#define SMDKV210_ULCON_DEFAULT S3C2410_LCON_CS8
62
63#define SMDKV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
64 S5PV210_UFCON_TXTRIG4 | \
65 S5PV210_UFCON_RXTRIG4)
66
67static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
68 [0] = {
69 .hwport = 0,
70 .flags = 0,
71 .ucon = SMDKV210_UCON_DEFAULT,
72 .ulcon = SMDKV210_ULCON_DEFAULT,
73 .ufcon = SMDKV210_UFCON_DEFAULT,
74 },
75 [1] = {
76 .hwport = 1,
77 .flags = 0,
78 .ucon = SMDKV210_UCON_DEFAULT,
79 .ulcon = SMDKV210_ULCON_DEFAULT,
80 .ufcon = SMDKV210_UFCON_DEFAULT,
81 },
82 [2] = {
83 .hwport = 2,
84 .flags = 0,
85 .ucon = SMDKV210_UCON_DEFAULT,
86 .ulcon = SMDKV210_ULCON_DEFAULT,
87 .ufcon = SMDKV210_UFCON_DEFAULT,
88 },
89 [3] = {
90 .hwport = 3,
91 .flags = 0,
92 .ucon = SMDKV210_UCON_DEFAULT,
93 .ulcon = SMDKV210_ULCON_DEFAULT,
94 .ufcon = SMDKV210_UFCON_DEFAULT,
95 },
96};
97
98static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
99 .setup_gpio = s5pv210_ide_setup_gpio,
100};
101
102static uint32_t smdkv210_keymap[] __initdata = {
103 /* KEY(row, col, keycode) */
104 KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
105 KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
106 KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
107 KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
108};
109
110static struct matrix_keymap_data smdkv210_keymap_data __initdata = {
111 .keymap = smdkv210_keymap,
112 .keymap_size = ARRAY_SIZE(smdkv210_keymap),
113};
114
115static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = {
116 .keymap_data = &smdkv210_keymap_data,
117 .rows = 8,
118 .cols = 8,
119};
120
121static struct resource smdkv210_dm9000_resources[] = {
122 [0] = DEFINE_RES_MEM(S5PV210_PA_SROM_BANK5, 1),
123 [1] = DEFINE_RES_MEM(S5PV210_PA_SROM_BANK5 + 2, 1),
124 [2] = DEFINE_RES_NAMED(IRQ_EINT(9), 1, NULL, IORESOURCE_IRQ \
125 | IORESOURCE_IRQ_HIGHLEVEL),
126};
127
128static struct dm9000_plat_data smdkv210_dm9000_platdata = {
129 .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM,
130 .dev_addr = { 0x00, 0x09, 0xc0, 0xff, 0xec, 0x48 },
131};
132
133static struct platform_device smdkv210_dm9000 = {
134 .name = "dm9000",
135 .id = -1,
136 .num_resources = ARRAY_SIZE(smdkv210_dm9000_resources),
137 .resource = smdkv210_dm9000_resources,
138 .dev = {
139 .platform_data = &smdkv210_dm9000_platdata,
140 },
141};
142
143static void smdkv210_lte480wv_set_power(struct plat_lcd_data *pd,
144 unsigned int power)
145{
146 if (power) {
147#if !defined(CONFIG_BACKLIGHT_PWM)
148 gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_HIGH, "GPD0");
149 gpio_free(S5PV210_GPD0(3));
150#endif
151
152 /* fire nRESET on power up */
153 gpio_request_one(S5PV210_GPH0(6), GPIOF_OUT_INIT_HIGH, "GPH0");
154
155 gpio_set_value(S5PV210_GPH0(6), 0);
156 mdelay(10);
157
158 gpio_set_value(S5PV210_GPH0(6), 1);
159 mdelay(10);
160
161 gpio_free(S5PV210_GPH0(6));
162 } else {
163#if !defined(CONFIG_BACKLIGHT_PWM)
164 gpio_request_one(S5PV210_GPD0(3), GPIOF_OUT_INIT_LOW, "GPD0");
165 gpio_free(S5PV210_GPD0(3));
166#endif
167 }
168}
169
170static struct plat_lcd_data smdkv210_lcd_lte480wv_data = {
171 .set_power = smdkv210_lte480wv_set_power,
172};
173
174static struct platform_device smdkv210_lcd_lte480wv = {
175 .name = "platform-lcd",
176 .dev.parent = &s3c_device_fb.dev,
177 .dev.platform_data = &smdkv210_lcd_lte480wv_data,
178};
179
180static struct s3c_fb_pd_win smdkv210_fb_win0 = {
181 .max_bpp = 32,
182 .default_bpp = 24,
183 .xres = 800,
184 .yres = 480,
185};
186
187static struct fb_videomode smdkv210_lcd_timing = {
188 .left_margin = 13,
189 .right_margin = 8,
190 .upper_margin = 7,
191 .lower_margin = 5,
192 .hsync_len = 3,
193 .vsync_len = 1,
194 .xres = 800,
195 .yres = 480,
196};
197
198static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = {
199 .win[0] = &smdkv210_fb_win0,
200 .vtiming = &smdkv210_lcd_timing,
201 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
202 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
203 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
204};
205
206/* USB OTG */
207static struct s3c_hsotg_plat smdkv210_hsotg_pdata;
208
209static struct platform_device *smdkv210_devices[] __initdata = {
210 &s3c_device_adc,
211 &s3c_device_cfcon,
212 &s3c_device_fb,
213 &s3c_device_hsmmc0,
214 &s3c_device_hsmmc1,
215 &s3c_device_hsmmc2,
216 &s3c_device_hsmmc3,
217 &s3c_device_i2c0,
218 &s3c_device_i2c1,
219 &s3c_device_i2c2,
220 &samsung_device_pwm,
221 &s3c_device_rtc,
222 &s3c_device_ts,
223 &s3c_device_usb_hsotg,
224 &s3c_device_wdt,
225 &s5p_device_fimc0,
226 &s5p_device_fimc1,
227 &s5p_device_fimc2,
228 &s5p_device_fimc_md,
229 &s5p_device_jpeg,
230 &s5p_device_mfc,
231 &s5p_device_mfc_l,
232 &s5p_device_mfc_r,
233 &s5pv210_device_ac97,
234 &s5pv210_device_iis0,
235 &s5pv210_device_spdif,
236 &samsung_asoc_idma,
237 &samsung_device_keypad,
238 &smdkv210_dm9000,
239 &smdkv210_lcd_lte480wv,
240};
241
242static void __init smdkv210_dm9000_init(void)
243{
244 unsigned int tmp;
245
246 gpio_request(S5PV210_MP01(5), "nCS5");
247 s3c_gpio_cfgpin(S5PV210_MP01(5), S3C_GPIO_SFN(2));
248 gpio_free(S5PV210_MP01(5));
249
250 tmp = (5 << S5P_SROM_BCX__TACC__SHIFT);
251 __raw_writel(tmp, S5P_SROM_BC5);
252
253 tmp = __raw_readl(S5P_SROM_BW);
254 tmp &= (S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS5__SHIFT);
255 tmp |= (1 << S5P_SROM_BW__NCS5__SHIFT);
256 __raw_writel(tmp, S5P_SROM_BW);
257}
258
259static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
260 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
261 { I2C_BOARD_INFO("wm8580", 0x1b), },
262};
263
264static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
265 /* To Be Updated */
266};
267
268static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
269 /* To Be Updated */
270};
271
272/* LCD Backlight data */
273static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
274 .no = S5PV210_GPD0(3),
275 .func = S3C_GPIO_SFN(2),
276};
277
278static struct platform_pwm_backlight_data smdkv210_bl_data = {
279 .pwm_id = 3,
280 .pwm_period_ns = 1000,
281 .enable_gpio = -1,
282};
283
284static void __init smdkv210_map_io(void)
285{
286 s5pv210_init_io(NULL, 0);
287 s3c24xx_init_clocks(24000000);
288 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
289 samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4);
290}
291
292static void __init smdkv210_reserve(void)
293{
294 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
295}
296
297static void __init smdkv210_machine_init(void)
298{
299 s3c_pm_init();
300
301 smdkv210_dm9000_init();
302
303 samsung_keypad_set_platdata(&smdkv210_keypad_data);
304 s3c24xx_ts_set_platdata(NULL);
305
306 s3c_i2c0_set_platdata(NULL);
307 s3c_i2c1_set_platdata(NULL);
308 s3c_i2c2_set_platdata(NULL);
309 i2c_register_board_info(0, smdkv210_i2c_devs0,
310 ARRAY_SIZE(smdkv210_i2c_devs0));
311 i2c_register_board_info(1, smdkv210_i2c_devs1,
312 ARRAY_SIZE(smdkv210_i2c_devs1));
313 i2c_register_board_info(2, smdkv210_i2c_devs2,
314 ARRAY_SIZE(smdkv210_i2c_devs2));
315
316 s3c_ide_set_platdata(&smdkv210_ide_pdata);
317
318 s3c_fb_set_platdata(&smdkv210_lcd0_pdata);
319
320 s3c_hsotg_set_platdata(&smdkv210_hsotg_pdata);
321
322 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
323
324 samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data);
325}
326
327MACHINE_START(SMDKV210, "SMDKV210")
328 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
329 .atag_offset = 0x100,
330 .init_irq = s5pv210_init_irq,
331 .map_io = smdkv210_map_io,
332 .init_machine = smdkv210_machine_init,
333 .init_time = samsung_timer_init,
334 .restart = s5pv210_restart,
335 .reserve = &smdkv210_reserve,
336MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
deleted file mode 100644
index 157805529f26..000000000000
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ /dev/null
@@ -1,135 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/mach-torbreck.c
2 *
3 * Copyright (c) 2010 aESOP Community
4 * http://www.aesop.or.kr/
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#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/i2c.h>
14#include <linux/init.h>
15#include <linux/serial_core.h>
16#include <linux/serial_s3c.h>
17
18#include <asm/mach/arch.h>
19#include <asm/mach/map.h>
20#include <asm/setup.h>
21#include <asm/mach-types.h>
22
23#include <mach/map.h>
24#include <mach/regs-clock.h>
25
26#include <plat/devs.h>
27#include <plat/cpu.h>
28#include <linux/platform_data/i2c-s3c2410.h>
29#include <plat/samsung-time.h>
30
31#include "common.h"
32
33/* Following are default values for UCON, ULCON and UFCON UART registers */
34#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
35 S3C2410_UCON_RXILEVEL | \
36 S3C2410_UCON_TXIRQMODE | \
37 S3C2410_UCON_RXIRQMODE | \
38 S3C2410_UCON_RXFIFO_TOI | \
39 S3C2443_UCON_RXERR_IRQEN)
40
41#define TORBRECK_ULCON_DEFAULT S3C2410_LCON_CS8
42
43#define TORBRECK_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
44 S5PV210_UFCON_TXTRIG4 | \
45 S5PV210_UFCON_RXTRIG4)
46
47static struct s3c2410_uartcfg torbreck_uartcfgs[] __initdata = {
48 [0] = {
49 .hwport = 0,
50 .flags = 0,
51 .ucon = TORBRECK_UCON_DEFAULT,
52 .ulcon = TORBRECK_ULCON_DEFAULT,
53 .ufcon = TORBRECK_UFCON_DEFAULT,
54 },
55 [1] = {
56 .hwport = 1,
57 .flags = 0,
58 .ucon = TORBRECK_UCON_DEFAULT,
59 .ulcon = TORBRECK_ULCON_DEFAULT,
60 .ufcon = TORBRECK_UFCON_DEFAULT,
61 },
62 [2] = {
63 .hwport = 2,
64 .flags = 0,
65 .ucon = TORBRECK_UCON_DEFAULT,
66 .ulcon = TORBRECK_ULCON_DEFAULT,
67 .ufcon = TORBRECK_UFCON_DEFAULT,
68 },
69 [3] = {
70 .hwport = 3,
71 .flags = 0,
72 .ucon = TORBRECK_UCON_DEFAULT,
73 .ulcon = TORBRECK_ULCON_DEFAULT,
74 .ufcon = TORBRECK_UFCON_DEFAULT,
75 },
76};
77
78static struct platform_device *torbreck_devices[] __initdata = {
79 &s5pv210_device_iis0,
80 &s3c_device_cfcon,
81 &s3c_device_hsmmc0,
82 &s3c_device_hsmmc1,
83 &s3c_device_hsmmc2,
84 &s3c_device_hsmmc3,
85 &s3c_device_i2c0,
86 &s3c_device_i2c1,
87 &s3c_device_i2c2,
88 &s3c_device_rtc,
89 &s3c_device_wdt,
90};
91
92static struct i2c_board_info torbreck_i2c_devs0[] __initdata = {
93 /* To Be Updated */
94};
95
96static struct i2c_board_info torbreck_i2c_devs1[] __initdata = {
97 /* To Be Updated */
98};
99
100static struct i2c_board_info torbreck_i2c_devs2[] __initdata = {
101 /* To Be Updated */
102};
103
104static void __init torbreck_map_io(void)
105{
106 s5pv210_init_io(NULL, 0);
107 s3c24xx_init_clocks(24000000);
108 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs));
109 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
110}
111
112static void __init torbreck_machine_init(void)
113{
114 s3c_i2c0_set_platdata(NULL);
115 s3c_i2c1_set_platdata(NULL);
116 s3c_i2c2_set_platdata(NULL);
117 i2c_register_board_info(0, torbreck_i2c_devs0,
118 ARRAY_SIZE(torbreck_i2c_devs0));
119 i2c_register_board_info(1, torbreck_i2c_devs1,
120 ARRAY_SIZE(torbreck_i2c_devs1));
121 i2c_register_board_info(2, torbreck_i2c_devs2,
122 ARRAY_SIZE(torbreck_i2c_devs2));
123
124 platform_add_devices(torbreck_devices, ARRAY_SIZE(torbreck_devices));
125}
126
127MACHINE_START(TORBRECK, "TORBRECK")
128 /* Maintainer: Hyunchul Ko <ghcstop@gmail.com> */
129 .atag_offset = 0x100,
130 .init_irq = s5pv210_init_irq,
131 .map_io = torbreck_map_io,
132 .init_machine = torbreck_machine_init,
133 .init_time = samsung_timer_init,
134 .restart = s5pv210_restart,
135MACHINE_END
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index dd5bfec16b4f..00d1523284da 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -75,26 +75,6 @@ static void s5pv210_pm_prepare(void)
75 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); 75 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
76} 76}
77 77
78static int s5pv210_pm_add(struct device *dev, struct subsys_interface *sif)
79{
80 pm_cpu_prep = s5pv210_pm_prepare;
81 pm_cpu_sleep = s5pv210_cpu_suspend;
82
83 return 0;
84}
85
86static struct subsys_interface s5pv210_pm_interface = {
87 .name = "s5pv210_pm",
88 .subsys = &s5pv210_subsys,
89 .add_dev = s5pv210_pm_add,
90};
91
92static __init int s5pv210_pm_drvinit(void)
93{
94 return subsys_interface_register(&s5pv210_pm_interface);
95}
96arch_initcall(s5pv210_pm_drvinit);
97
98static void s5pv210_pm_resume(void) 78static void s5pv210_pm_resume(void)
99{ 79{
100 u32 tmp; 80 u32 tmp;
@@ -114,6 +94,10 @@ static struct syscore_ops s5pv210_pm_syscore_ops = {
114static __init int s5pv210_pm_syscore_init(void) 94static __init int s5pv210_pm_syscore_init(void)
115{ 95{
116 register_syscore_ops(&s5pv210_pm_syscore_ops); 96 register_syscore_ops(&s5pv210_pm_syscore_ops);
97
98 pm_cpu_prep = s5pv210_pm_prepare;
99 pm_cpu_sleep = s5pv210_cpu_suspend;
100
117 return 0; 101 return 0;
118} 102}
119arch_initcall(s5pv210_pm_syscore_init); 103arch_initcall(s5pv210_pm_syscore_init);
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
deleted file mode 100644
index 55103c8220b3..000000000000
--- a/arch/arm/mach-s5pv210/setup-fb-24bpp.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/* linux/arch/arm/plat-s5pv210/setup-fb-24bpp.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Base s5pv210 setup information for 24bpp LCD framebuffer
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/fb.h>
16#include <linux/gpio.h>
17
18#include <mach/map.h>
19#include <plat/fb.h>
20#include <mach/regs-clock.h>
21#include <plat/gpio-cfg.h>
22
23static void s5pv210_fb_cfg_gpios(unsigned int base, unsigned int nr)
24{
25 s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(2));
26
27 for (; nr > 0; nr--, base++)
28 s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
29}
30
31
32void s5pv210_fb_gpio_setup_24bpp(void)
33{
34 s5pv210_fb_cfg_gpios(S5PV210_GPF0(0), 8);
35 s5pv210_fb_cfg_gpios(S5PV210_GPF1(0), 8);
36 s5pv210_fb_cfg_gpios(S5PV210_GPF2(0), 8);
37 s5pv210_fb_cfg_gpios(S5PV210_GPF3(0), 4);
38
39 /* Set DISPLAY_CONTROL register for Display path selection.
40 *
41 * ouput | RGB | I80 | ITU
42 * -----------------------------------
43 * 00 | MIE | FIMD | FIMD
44 * 01 | MDNIE | MDNIE | FIMD
45 * 10 | FIMD | FIMD | FIMD
46 * 11 | FIMD | FIMD | FIMD
47 */
48 writel(0x2, S5P_MDNIE_SEL);
49}
diff --git a/arch/arm/mach-s5pv210/setup-fimc.c b/arch/arm/mach-s5pv210/setup-fimc.c
deleted file mode 100644
index 54cc5b11be0b..000000000000
--- a/arch/arm/mach-s5pv210/setup-fimc.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5PV210 camera interface GPIO configuration.
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#include <linux/gpio.h>
12#include <plat/gpio-cfg.h>
13#include <plat/camport.h>
14
15int s5pv210_fimc_setup_gpio(enum s5p_camport_id id)
16{
17 u32 gpio8, gpio5;
18 int ret;
19
20 switch (id) {
21 case S5P_CAMPORT_A:
22 gpio8 = S5PV210_GPE0(0);
23 gpio5 = S5PV210_GPE1(0);
24 break;
25
26 case S5P_CAMPORT_B:
27 gpio8 = S5PV210_GPJ0(0);
28 gpio5 = S5PV210_GPJ1(0);
29 break;
30
31 default:
32 WARN(1, "Wrong camport id: %d\n", id);
33 return -EINVAL;
34 }
35
36 ret = s3c_gpio_cfgall_range(gpio8, 8, S3C_GPIO_SFN(2),
37 S3C_GPIO_PULL_UP);
38 if (ret)
39 return ret;
40
41 return s3c_gpio_cfgall_range(gpio5, 5, S3C_GPIO_SFN(2),
42 S3C_GPIO_PULL_UP);
43}
diff --git a/arch/arm/mach-s5pv210/setup-i2c0.c b/arch/arm/mach-s5pv210/setup-i2c0.c
index 4a15849766c0..3658416134ec 100644
--- a/arch/arm/mach-s5pv210/setup-i2c0.c
+++ b/arch/arm/mach-s5pv210/setup-i2c0.c
@@ -23,6 +23,8 @@ struct platform_device; /* don't need the contents */
23 23
24void s3c_i2c0_cfg_gpio(struct platform_device *dev) 24void s3c_i2c0_cfg_gpio(struct platform_device *dev)
25{ 25{
26 s3c_gpio_cfgall_range(S5PV210_GPD1(0), 2, 26 /*
27 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); 27 * FIXME: Used only by legacy code that is not used anymore,
28 * but still compiled in, until all dependencies are removed.
29 */
28} 30}
diff --git a/arch/arm/mach-s5pv210/setup-i2c1.c b/arch/arm/mach-s5pv210/setup-i2c1.c
deleted file mode 100644
index 4777f6b97a92..000000000000
--- a/arch/arm/mach-s5pv210/setup-i2c1.c
+++ /dev/null
@@ -1,28 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/setup-i2c1.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * I2C1 GPIO configuration.
7 *
8 * Based on plat-s3c64xx/setup-i2c1.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/gpio.h>
18
19struct platform_device; /* don't need the contents */
20
21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h>
23
24void s3c_i2c1_cfg_gpio(struct platform_device *dev)
25{
26 s3c_gpio_cfgall_range(S5PV210_GPD1(2), 2,
27 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
28}
diff --git a/arch/arm/mach-s5pv210/setup-i2c2.c b/arch/arm/mach-s5pv210/setup-i2c2.c
deleted file mode 100644
index bbce6c74b915..000000000000
--- a/arch/arm/mach-s5pv210/setup-i2c2.c
+++ /dev/null
@@ -1,28 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/setup-i2c2.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * I2C2 GPIO configuration.
7 *
8 * Based on plat-s3c64xx/setup-i2c0.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/gpio.h>
18
19struct platform_device; /* don't need the contents */
20
21#include <linux/platform_data/i2c-s3c2410.h>
22#include <plat/gpio-cfg.h>
23
24void s3c_i2c2_cfg_gpio(struct platform_device *dev)
25{
26 s3c_gpio_cfgall_range(S5PV210_GPD1(4), 2,
27 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
28}
diff --git a/arch/arm/mach-s5pv210/setup-ide.c b/arch/arm/mach-s5pv210/setup-ide.c
deleted file mode 100644
index ea123d546bd2..000000000000
--- a/arch/arm/mach-s5pv210/setup-ide.c
+++ /dev/null
@@ -1,39 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/setup-ide.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV210 setup information for IDE
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/gpio.h>
15
16#include <plat/gpio-cfg.h>
17
18static void s5pv210_ide_cfg_gpios(unsigned int base, unsigned int nr)
19{
20 s3c_gpio_cfgrange_nopull(base, nr, S3C_GPIO_SFN(4));
21
22 for (; nr > 0; nr--, base++)
23 s5p_gpio_set_drvstr(base, S5P_GPIO_DRVSTR_LV4);
24}
25
26void s5pv210_ide_setup_gpio(void)
27{
28 /* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST, CF_DMACK */
29 s5pv210_ide_cfg_gpios(S5PV210_GPJ0(0), 8);
30
31 /* CF_Data[0 - 7] */
32 s5pv210_ide_cfg_gpios(S5PV210_GPJ2(0), 8);
33
34 /* CF_Data[8 - 15] */
35 s5pv210_ide_cfg_gpios(S5PV210_GPJ3(0), 8);
36
37 /* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */
38 s5pv210_ide_cfg_gpios(S5PV210_GPJ4(0), 4);
39}
diff --git a/arch/arm/mach-s5pv210/setup-keypad.c b/arch/arm/mach-s5pv210/setup-keypad.c
deleted file mode 100644
index c56420a52f48..000000000000
--- a/arch/arm/mach-s5pv210/setup-keypad.c
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * linux/arch/arm/mach-s5pv210/setup-keypad.c
3 *
4 * Copyright (C) 2010 Samsung Electronics Co.Ltd
5 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#include <linux/gpio.h>
15#include <plat/gpio-cfg.h>
16
17void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
18{
19 /* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */
20 s3c_gpio_cfgrange_nopull(S5PV210_GPH3(0), rows, S3C_GPIO_SFN(3));
21
22 /* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */
23 s3c_gpio_cfgrange_nopull(S5PV210_GPH2(0), cols, S3C_GPIO_SFN(3));
24}
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
deleted file mode 100644
index 0512ada00522..000000000000
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ /dev/null
@@ -1,103 +0,0 @@
1/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/platform_device.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
19#include <linux/mmc/host.h>
20#include <linux/mmc/card.h>
21
22#include <plat/gpio-cfg.h>
23#include <plat/sdhci.h>
24
25void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
26{
27 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
28
29 /* Set all the necessary GPG0/GPG1 pins to special-function 2 */
30 s3c_gpio_cfgrange_nopull(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2));
31
32 switch (width) {
33 case 8:
34 /* GPG1[3:6] special-function 3 */
35 s3c_gpio_cfgrange_nopull(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3));
36 case 4:
37 /* GPG0[3:6] special-function 2 */
38 s3c_gpio_cfgrange_nopull(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2));
39 default:
40 break;
41 }
42
43 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
44 s3c_gpio_setpull(S5PV210_GPG0(2), S3C_GPIO_PULL_UP);
45 s3c_gpio_cfgpin(S5PV210_GPG0(2), S3C_GPIO_SFN(2));
46 }
47}
48
49void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
50{
51 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
52
53 /* Set all the necessary GPG1[0:1] pins to special-function 2 */
54 s3c_gpio_cfgrange_nopull(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2));
55
56 /* Data pin GPG1[3:6] to special-function 2 */
57 s3c_gpio_cfgrange_nopull(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2));
58
59 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
60 s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
61 s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2));
62 }
63}
64
65void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
66{
67 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
68
69 /* Set all the necessary GPG2[0:1] pins to special-function 2 */
70 s3c_gpio_cfgrange_nopull(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2));
71
72 switch (width) {
73 case 8:
74 /* Data pin GPG3[3:6] to special-function 3 */
75 s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3));
76 case 4:
77 /* Data pin GPG2[3:6] to special-function 2 */
78 s3c_gpio_cfgrange_nopull(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2));
79 default:
80 break;
81 }
82
83 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
84 s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP);
85 s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2));
86 }
87}
88
89void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
90{
91 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
92
93 /* Set all the necessary GPG3[0:1] pins to special-function 2 */
94 s3c_gpio_cfgrange_nopull(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2));
95
96 /* Data pin GPG3[3:6] to special-function 2 */
97 s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2));
98
99 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
100 s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
101 s3c_gpio_cfgpin(S5PV210_GPG3(2), S3C_GPIO_SFN(2));
102 }
103}
diff --git a/arch/arm/mach-s5pv210/setup-spi.c b/arch/arm/mach-s5pv210/setup-spi.c
deleted file mode 100644
index 81aecc162f82..000000000000
--- a/arch/arm/mach-s5pv210/setup-spi.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/setup-spi.c
2 *
3 * Copyright (C) 2011 Samsung Electronics Ltd.
4 * http://www.samsung.com/
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#include <linux/gpio.h>
12#include <plat/gpio-cfg.h>
13
14#ifdef CONFIG_S3C64XX_DEV_SPI0
15int s3c64xx_spi0_cfg_gpio(void)
16{
17 s3c_gpio_cfgpin(S5PV210_GPB(0), S3C_GPIO_SFN(2));
18 s3c_gpio_setpull(S5PV210_GPB(0), S3C_GPIO_PULL_UP);
19 s3c_gpio_cfgall_range(S5PV210_GPB(2), 2,
20 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
21 return 0;
22}
23#endif
24
25#ifdef CONFIG_S3C64XX_DEV_SPI1
26int s3c64xx_spi1_cfg_gpio(void)
27{
28 s3c_gpio_cfgpin(S5PV210_GPB(4), S3C_GPIO_SFN(2));
29 s3c_gpio_setpull(S5PV210_GPB(4), S3C_GPIO_PULL_UP);
30 s3c_gpio_cfgall_range(S5PV210_GPB(6), 2,
31 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
32 return 0;
33}
34#endif
diff --git a/arch/arm/mach-s5pv210/setup-usb-phy.c b/arch/arm/mach-s5pv210/setup-usb-phy.c
deleted file mode 100644
index b2ee5333f89c..000000000000
--- a/arch/arm/mach-s5pv210/setup-usb-phy.c
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * Copyright (C) 2012 Samsung Electronics Co.Ltd
3 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundationr
8 */
9
10#include <linux/clk.h>
11#include <linux/delay.h>
12#include <linux/err.h>
13#include <linux/io.h>
14#include <linux/platform_device.h>
15
16#include <mach/map.h>
17
18#include <plat/cpu.h>
19#include <plat/regs-usb-hsotg-phy.h>
20#include <plat/usb-phy.h>
21
22#define S5PV210_USB_PHY_CON (S3C_VA_SYS + 0xE80C)
23#define S5PV210_USB_PHY0_EN (1 << 0)
24#define S5PV210_USB_PHY1_EN (1 << 1)
25
26static int s5pv210_usb_otgphy_init(struct platform_device *pdev)
27{
28 struct clk *xusbxti;
29 u32 phyclk;
30
31 writel(readl(S5PV210_USB_PHY_CON) | S5PV210_USB_PHY0_EN,
32 S5PV210_USB_PHY_CON);
33
34 /* set clock frequency for PLL */
35 phyclk = readl(S3C_PHYCLK) & ~S3C_PHYCLK_CLKSEL_MASK;
36
37 xusbxti = clk_get(&pdev->dev, "xusbxti");
38 if (xusbxti && !IS_ERR(xusbxti)) {
39 switch (clk_get_rate(xusbxti)) {
40 case 12 * MHZ:
41 phyclk |= S3C_PHYCLK_CLKSEL_12M;
42 break;
43 case 24 * MHZ:
44 phyclk |= S3C_PHYCLK_CLKSEL_24M;
45 break;
46 default:
47 case 48 * MHZ:
48 /* default reference clock */
49 break;
50 }
51 clk_put(xusbxti);
52 }
53
54 /* TODO: select external clock/oscillator */
55 writel(phyclk | S3C_PHYCLK_CLK_FORCE, S3C_PHYCLK);
56
57 /* set to normal OTG PHY */
58 writel((readl(S3C_PHYPWR) & ~S3C_PHYPWR_NORMAL_MASK), S3C_PHYPWR);
59 mdelay(1);
60
61 /* reset OTG PHY and Link */
62 writel(S3C_RSTCON_PHY | S3C_RSTCON_HCLK | S3C_RSTCON_PHYCLK,
63 S3C_RSTCON);
64 udelay(20); /* at-least 10uS */
65 writel(0, S3C_RSTCON);
66
67 return 0;
68}
69
70static int s5pv210_usb_otgphy_exit(struct platform_device *pdev)
71{
72 writel((readl(S3C_PHYPWR) | S3C_PHYPWR_ANALOG_POWERDOWN |
73 S3C_PHYPWR_OTG_DISABLE), S3C_PHYPWR);
74
75 writel(readl(S5PV210_USB_PHY_CON) & ~S5PV210_USB_PHY0_EN,
76 S5PV210_USB_PHY_CON);
77
78 return 0;
79}
80
81int s5p_usb_phy_init(struct platform_device *pdev, int type)
82{
83 if (type == USB_PHY_TYPE_DEVICE)
84 return s5pv210_usb_otgphy_init(pdev);
85
86 return -EINVAL;
87}
88
89int s5p_usb_phy_exit(struct platform_device *pdev, int type)
90{
91 if (type == USB_PHY_TYPE_DEVICE)
92 return s5pv210_usb_otgphy_exit(pdev);
93
94 return -EINVAL;
95}