diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-02 20:46:13 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-05 22:14:30 -0400 |
commit | 61c542bfda19c842e0bf12aa4cd1a5b23130f388 (patch) | |
tree | 927ef8e13e097136827ae89e8a52793a1cf9198e | |
parent | 6b6844dd54e4196dd9818bc63b319f93c37a08be (diff) |
ARM: S3C24XX: To merge s3c24xx devs.c files to one devs.c
This patch moves regarding s3c24xx dev files to one devs.c
file in plat-samsung directory and this is required to merge
to plat-samsung.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/fb.h | 75 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-qt2410.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-rx1950.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/dev-uart.c | 100 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 528 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/plat-samsung/devs.c | 431 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/fb-s3c2410.h | 72 |
9 files changed, 609 insertions, 604 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/fb.h b/arch/arm/mach-s3c2410/include/mach/fb.h index eee0654eb8fb..a957bc8ed44f 100644 --- a/arch/arm/mach-s3c2410/include/mach/fb.h +++ b/arch/arm/mach-s3c2410/include/mach/fb.h | |||
@@ -1,74 +1 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/fb.h | #include <plat/fb-s3c2410.h> | |
2 | * | ||
3 | * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
4 | * | ||
5 | * Inspired by pxafb.h | ||
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 | #ifndef __ASM_ARM_FB_H | ||
13 | #define __ASM_ARM_FB_H | ||
14 | |||
15 | #include <mach/regs-lcd.h> | ||
16 | |||
17 | struct s3c2410fb_hw { | ||
18 | unsigned long lcdcon1; | ||
19 | unsigned long lcdcon2; | ||
20 | unsigned long lcdcon3; | ||
21 | unsigned long lcdcon4; | ||
22 | unsigned long lcdcon5; | ||
23 | }; | ||
24 | |||
25 | /* LCD description */ | ||
26 | struct s3c2410fb_display { | ||
27 | /* LCD type */ | ||
28 | unsigned type; | ||
29 | |||
30 | /* Screen size */ | ||
31 | unsigned short width; | ||
32 | unsigned short height; | ||
33 | |||
34 | /* Screen info */ | ||
35 | unsigned short xres; | ||
36 | unsigned short yres; | ||
37 | unsigned short bpp; | ||
38 | |||
39 | unsigned pixclock; /* pixclock in picoseconds */ | ||
40 | unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */ | ||
41 | unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */ | ||
42 | unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */ | ||
43 | unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */ | ||
44 | unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */ | ||
45 | unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */ | ||
46 | |||
47 | /* lcd configuration registers */ | ||
48 | unsigned long lcdcon5; | ||
49 | }; | ||
50 | |||
51 | struct s3c2410fb_mach_info { | ||
52 | |||
53 | struct s3c2410fb_display *displays; /* attached diplays info */ | ||
54 | unsigned num_displays; /* number of defined displays */ | ||
55 | unsigned default_display; | ||
56 | |||
57 | /* GPIOs */ | ||
58 | |||
59 | unsigned long gpcup; | ||
60 | unsigned long gpcup_mask; | ||
61 | unsigned long gpccon; | ||
62 | unsigned long gpccon_mask; | ||
63 | unsigned long gpdup; | ||
64 | unsigned long gpdup_mask; | ||
65 | unsigned long gpdcon; | ||
66 | unsigned long gpdcon_mask; | ||
67 | |||
68 | /* lpc3600 control register */ | ||
69 | unsigned long lpcsel; | ||
70 | }; | ||
71 | |||
72 | extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *); | ||
73 | |||
74 | #endif /* __ASM_ARM_FB_H */ | ||
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c index f44f77531b1e..8ee6f43b40eb 100644 --- a/arch/arm/mach-s3c2410/mach-qt2410.c +++ b/arch/arm/mach-s3c2410/mach-qt2410.c | |||
@@ -49,6 +49,7 @@ | |||
49 | 49 | ||
50 | #include <mach/regs-gpio.h> | 50 | #include <mach/regs-gpio.h> |
51 | #include <mach/leds-gpio.h> | 51 | #include <mach/leds-gpio.h> |
52 | #include <mach/regs-lcd.h> | ||
52 | #include <plat/regs-serial.h> | 53 | #include <plat/regs-serial.h> |
53 | #include <mach/fb.h> | 54 | #include <mach/fb.h> |
54 | #include <plat/nand.h> | 55 | #include <plat/nand.h> |
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c index 27ea95096fe1..32102999628d 100644 --- a/arch/arm/mach-s3c2440/mach-rx1950.c +++ b/arch/arm/mach-s3c2440/mach-rx1950.c | |||
@@ -43,6 +43,7 @@ | |||
43 | 43 | ||
44 | #include <mach/regs-gpio.h> | 44 | #include <mach/regs-gpio.h> |
45 | #include <mach/regs-gpioj.h> | 45 | #include <mach/regs-gpioj.h> |
46 | #include <mach/regs-lcd.h> | ||
46 | #include <mach/h1940.h> | 47 | #include <mach/h1940.h> |
47 | #include <mach/fb.h> | 48 | #include <mach/fb.h> |
48 | 49 | ||
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile index e4f46495ed30..b2b01125de66 100644 --- a/arch/arm/plat-s3c24xx/Makefile +++ b/arch/arm/plat-s3c24xx/Makefile | |||
@@ -14,7 +14,7 @@ obj- := | |||
14 | 14 | ||
15 | obj-y += cpu.o | 15 | obj-y += cpu.o |
16 | obj-y += irq.o | 16 | obj-y += irq.o |
17 | obj-y += devs.o | 17 | obj-y += dev-uart.o |
18 | obj-y += clock.o | 18 | obj-y += clock.o |
19 | obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o | 19 | obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o |
20 | 20 | ||
diff --git a/arch/arm/plat-s3c24xx/dev-uart.c b/arch/arm/plat-s3c24xx/dev-uart.c new file mode 100644 index 000000000000..9ab22e662fff --- /dev/null +++ b/arch/arm/plat-s3c24xx/dev-uart.c | |||
@@ -0,0 +1,100 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/dev-uart.c | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Base S3C24XX UART resource and platform device definitions | ||
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/list.h> | ||
17 | #include <linux/serial_core.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <asm/mach/arch.h> | ||
21 | #include <asm/mach/map.h> | ||
22 | #include <asm/mach/irq.h> | ||
23 | #include <mach/hardware.h> | ||
24 | #include <mach/map.h> | ||
25 | |||
26 | #include <plat/devs.h> | ||
27 | #include <plat/regs-serial.h> | ||
28 | |||
29 | /* Serial port registrations */ | ||
30 | |||
31 | static struct resource s3c2410_uart0_resource[] = { | ||
32 | [0] = { | ||
33 | .start = S3C2410_PA_UART0, | ||
34 | .end = S3C2410_PA_UART0 + 0x3fff, | ||
35 | .flags = IORESOURCE_MEM, | ||
36 | }, | ||
37 | [1] = { | ||
38 | .start = IRQ_S3CUART_RX0, | ||
39 | .end = IRQ_S3CUART_ERR0, | ||
40 | .flags = IORESOURCE_IRQ, | ||
41 | } | ||
42 | }; | ||
43 | |||
44 | static struct resource s3c2410_uart1_resource[] = { | ||
45 | [0] = { | ||
46 | .start = S3C2410_PA_UART1, | ||
47 | .end = S3C2410_PA_UART1 + 0x3fff, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, | ||
50 | [1] = { | ||
51 | .start = IRQ_S3CUART_RX1, | ||
52 | .end = IRQ_S3CUART_ERR1, | ||
53 | .flags = IORESOURCE_IRQ, | ||
54 | } | ||
55 | }; | ||
56 | |||
57 | static struct resource s3c2410_uart2_resource[] = { | ||
58 | [0] = { | ||
59 | .start = S3C2410_PA_UART2, | ||
60 | .end = S3C2410_PA_UART2 + 0x3fff, | ||
61 | .flags = IORESOURCE_MEM, | ||
62 | }, | ||
63 | [1] = { | ||
64 | .start = IRQ_S3CUART_RX2, | ||
65 | .end = IRQ_S3CUART_ERR2, | ||
66 | .flags = IORESOURCE_IRQ, | ||
67 | } | ||
68 | }; | ||
69 | |||
70 | static struct resource s3c2410_uart3_resource[] = { | ||
71 | [0] = { | ||
72 | .start = S3C2443_PA_UART3, | ||
73 | .end = S3C2443_PA_UART3 + 0x3fff, | ||
74 | .flags = IORESOURCE_MEM, | ||
75 | }, | ||
76 | [1] = { | ||
77 | .start = IRQ_S3CUART_RX3, | ||
78 | .end = IRQ_S3CUART_ERR3, | ||
79 | .flags = IORESOURCE_IRQ, | ||
80 | }, | ||
81 | }; | ||
82 | |||
83 | struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { | ||
84 | [0] = { | ||
85 | .resources = s3c2410_uart0_resource, | ||
86 | .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource), | ||
87 | }, | ||
88 | [1] = { | ||
89 | .resources = s3c2410_uart1_resource, | ||
90 | .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource), | ||
91 | }, | ||
92 | [2] = { | ||
93 | .resources = s3c2410_uart2_resource, | ||
94 | .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource), | ||
95 | }, | ||
96 | [3] = { | ||
97 | .resources = s3c2410_uart3_resource, | ||
98 | .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource), | ||
99 | }, | ||
100 | }; | ||
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c deleted file mode 100644 index a76bf2df3333..000000000000 --- a/arch/arm/plat-s3c24xx/devs.c +++ /dev/null | |||
@@ -1,528 +0,0 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/devs.c | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Base S3C24XX platform device definitions | ||
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 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/timer.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/serial_core.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/slab.h> | ||
24 | #include <linux/string.h> | ||
25 | #include <linux/dma-mapping.h> | ||
26 | |||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/map.h> | ||
29 | #include <asm/mach/irq.h> | ||
30 | #include <mach/fb.h> | ||
31 | #include <mach/hardware.h> | ||
32 | #include <mach/dma.h> | ||
33 | #include <mach/irqs.h> | ||
34 | #include <asm/irq.h> | ||
35 | |||
36 | #include <plat/regs-serial.h> | ||
37 | #include <plat/udc.h> | ||
38 | #include <plat/mci.h> | ||
39 | |||
40 | #include <plat/devs.h> | ||
41 | #include <plat/cpu.h> | ||
42 | #include <plat/regs-spi.h> | ||
43 | #include <plat/ts.h> | ||
44 | |||
45 | /* Serial port registrations */ | ||
46 | |||
47 | static struct resource s3c2410_uart0_resource[] = { | ||
48 | [0] = { | ||
49 | .start = S3C2410_PA_UART0, | ||
50 | .end = S3C2410_PA_UART0 + 0x3fff, | ||
51 | .flags = IORESOURCE_MEM, | ||
52 | }, | ||
53 | [1] = { | ||
54 | .start = IRQ_S3CUART_RX0, | ||
55 | .end = IRQ_S3CUART_ERR0, | ||
56 | .flags = IORESOURCE_IRQ, | ||
57 | } | ||
58 | }; | ||
59 | |||
60 | static struct resource s3c2410_uart1_resource[] = { | ||
61 | [0] = { | ||
62 | .start = S3C2410_PA_UART1, | ||
63 | .end = S3C2410_PA_UART1 + 0x3fff, | ||
64 | .flags = IORESOURCE_MEM, | ||
65 | }, | ||
66 | [1] = { | ||
67 | .start = IRQ_S3CUART_RX1, | ||
68 | .end = IRQ_S3CUART_ERR1, | ||
69 | .flags = IORESOURCE_IRQ, | ||
70 | } | ||
71 | }; | ||
72 | |||
73 | static struct resource s3c2410_uart2_resource[] = { | ||
74 | [0] = { | ||
75 | .start = S3C2410_PA_UART2, | ||
76 | .end = S3C2410_PA_UART2 + 0x3fff, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, | ||
79 | [1] = { | ||
80 | .start = IRQ_S3CUART_RX2, | ||
81 | .end = IRQ_S3CUART_ERR2, | ||
82 | .flags = IORESOURCE_IRQ, | ||
83 | } | ||
84 | }; | ||
85 | |||
86 | static struct resource s3c2410_uart3_resource[] = { | ||
87 | [0] = { | ||
88 | .start = S3C2443_PA_UART3, | ||
89 | .end = S3C2443_PA_UART3 + 0x3fff, | ||
90 | .flags = IORESOURCE_MEM, | ||
91 | }, | ||
92 | [1] = { | ||
93 | .start = IRQ_S3CUART_RX3, | ||
94 | .end = IRQ_S3CUART_ERR3, | ||
95 | .flags = IORESOURCE_IRQ, | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { | ||
100 | [0] = { | ||
101 | .resources = s3c2410_uart0_resource, | ||
102 | .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource), | ||
103 | }, | ||
104 | [1] = { | ||
105 | .resources = s3c2410_uart1_resource, | ||
106 | .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource), | ||
107 | }, | ||
108 | [2] = { | ||
109 | .resources = s3c2410_uart2_resource, | ||
110 | .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource), | ||
111 | }, | ||
112 | [3] = { | ||
113 | .resources = s3c2410_uart3_resource, | ||
114 | .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource), | ||
115 | }, | ||
116 | }; | ||
117 | |||
118 | /* LCD Controller */ | ||
119 | |||
120 | static struct resource s3c_lcd_resource[] = { | ||
121 | [0] = { | ||
122 | .start = S3C24XX_PA_LCD, | ||
123 | .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, | ||
124 | .flags = IORESOURCE_MEM, | ||
125 | }, | ||
126 | [1] = { | ||
127 | .start = IRQ_LCD, | ||
128 | .end = IRQ_LCD, | ||
129 | .flags = IORESOURCE_IRQ, | ||
130 | } | ||
131 | |||
132 | }; | ||
133 | |||
134 | static u64 s3c_device_lcd_dmamask = 0xffffffffUL; | ||
135 | |||
136 | struct platform_device s3c_device_lcd = { | ||
137 | .name = "s3c2410-lcd", | ||
138 | .id = -1, | ||
139 | .num_resources = ARRAY_SIZE(s3c_lcd_resource), | ||
140 | .resource = s3c_lcd_resource, | ||
141 | .dev = { | ||
142 | .dma_mask = &s3c_device_lcd_dmamask, | ||
143 | .coherent_dma_mask = 0xffffffffUL | ||
144 | } | ||
145 | }; | ||
146 | |||
147 | EXPORT_SYMBOL(s3c_device_lcd); | ||
148 | |||
149 | void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | ||
150 | { | ||
151 | struct s3c2410fb_mach_info *npd; | ||
152 | |||
153 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd); | ||
154 | if (npd) { | ||
155 | npd->displays = kmemdup(pd->displays, | ||
156 | sizeof(struct s3c2410fb_display) * npd->num_displays, | ||
157 | GFP_KERNEL); | ||
158 | if (!npd->displays) | ||
159 | printk(KERN_ERR "no memory for LCD display data\n"); | ||
160 | } else { | ||
161 | printk(KERN_ERR "no memory for LCD platform data\n"); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | /* Touchscreen */ | ||
166 | |||
167 | static struct resource s3c_ts_resource[] = { | ||
168 | [0] = { | ||
169 | .start = S3C24XX_PA_ADC, | ||
170 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | ||
171 | .flags = IORESOURCE_MEM, | ||
172 | }, | ||
173 | [1] = { | ||
174 | .start = IRQ_TC, | ||
175 | .end = IRQ_TC, | ||
176 | .flags = IORESOURCE_IRQ, | ||
177 | }, | ||
178 | |||
179 | }; | ||
180 | |||
181 | struct platform_device s3c_device_ts = { | ||
182 | .name = "s3c2410-ts", | ||
183 | .id = -1, | ||
184 | .dev.parent = &s3c_device_adc.dev, | ||
185 | .num_resources = ARRAY_SIZE(s3c_ts_resource), | ||
186 | .resource = s3c_ts_resource, | ||
187 | }; | ||
188 | EXPORT_SYMBOL(s3c_device_ts); | ||
189 | |||
190 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) | ||
191 | { | ||
192 | s3c_set_platdata(hard_s3c2410ts_info, | ||
193 | sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts); | ||
194 | } | ||
195 | |||
196 | /* USB Device (Gadget)*/ | ||
197 | |||
198 | static struct resource s3c_usbgadget_resource[] = { | ||
199 | [0] = { | ||
200 | .start = S3C24XX_PA_USBDEV, | ||
201 | .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, | ||
202 | .flags = IORESOURCE_MEM, | ||
203 | }, | ||
204 | [1] = { | ||
205 | .start = IRQ_USBD, | ||
206 | .end = IRQ_USBD, | ||
207 | .flags = IORESOURCE_IRQ, | ||
208 | } | ||
209 | |||
210 | }; | ||
211 | |||
212 | struct platform_device s3c_device_usbgadget = { | ||
213 | .name = "s3c2410-usbgadget", | ||
214 | .id = -1, | ||
215 | .num_resources = ARRAY_SIZE(s3c_usbgadget_resource), | ||
216 | .resource = s3c_usbgadget_resource, | ||
217 | }; | ||
218 | |||
219 | EXPORT_SYMBOL(s3c_device_usbgadget); | ||
220 | |||
221 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | ||
222 | { | ||
223 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget); | ||
224 | } | ||
225 | |||
226 | /* USB High Speed 2.0 Device (Gadget) */ | ||
227 | static struct resource s3c_hsudc_resource[] = { | ||
228 | [0] = { | ||
229 | .start = S3C2416_PA_HSUDC, | ||
230 | .end = S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1, | ||
231 | .flags = IORESOURCE_MEM, | ||
232 | }, | ||
233 | [1] = { | ||
234 | .start = IRQ_USBD, | ||
235 | .end = IRQ_USBD, | ||
236 | .flags = IORESOURCE_IRQ, | ||
237 | } | ||
238 | }; | ||
239 | |||
240 | static u64 s3c_hsudc_dmamask = DMA_BIT_MASK(32); | ||
241 | |||
242 | struct platform_device s3c_device_usb_hsudc = { | ||
243 | .name = "s3c-hsudc", | ||
244 | .id = -1, | ||
245 | .num_resources = ARRAY_SIZE(s3c_hsudc_resource), | ||
246 | .resource = s3c_hsudc_resource, | ||
247 | .dev = { | ||
248 | .dma_mask = &s3c_hsudc_dmamask, | ||
249 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
250 | }, | ||
251 | }; | ||
252 | |||
253 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) | ||
254 | { | ||
255 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc); | ||
256 | } | ||
257 | |||
258 | /* IIS */ | ||
259 | |||
260 | static struct resource s3c_iis_resource[] = { | ||
261 | [0] = { | ||
262 | .start = S3C24XX_PA_IIS, | ||
263 | .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1, | ||
264 | .flags = IORESOURCE_MEM, | ||
265 | } | ||
266 | }; | ||
267 | |||
268 | static u64 s3c_device_iis_dmamask = 0xffffffffUL; | ||
269 | |||
270 | struct platform_device s3c_device_iis = { | ||
271 | .name = "s3c24xx-iis", | ||
272 | .id = -1, | ||
273 | .num_resources = ARRAY_SIZE(s3c_iis_resource), | ||
274 | .resource = s3c_iis_resource, | ||
275 | .dev = { | ||
276 | .dma_mask = &s3c_device_iis_dmamask, | ||
277 | .coherent_dma_mask = 0xffffffffUL | ||
278 | } | ||
279 | }; | ||
280 | |||
281 | EXPORT_SYMBOL(s3c_device_iis); | ||
282 | |||
283 | /* RTC */ | ||
284 | |||
285 | static struct resource s3c_rtc_resource[] = { | ||
286 | [0] = { | ||
287 | .start = S3C24XX_PA_RTC, | ||
288 | .end = S3C24XX_PA_RTC + 0xff, | ||
289 | .flags = IORESOURCE_MEM, | ||
290 | }, | ||
291 | [1] = { | ||
292 | .start = IRQ_RTC, | ||
293 | .end = IRQ_RTC, | ||
294 | .flags = IORESOURCE_IRQ, | ||
295 | }, | ||
296 | [2] = { | ||
297 | .start = IRQ_TICK, | ||
298 | .end = IRQ_TICK, | ||
299 | .flags = IORESOURCE_IRQ | ||
300 | } | ||
301 | }; | ||
302 | |||
303 | struct platform_device s3c_device_rtc = { | ||
304 | .name = "s3c2410-rtc", | ||
305 | .id = -1, | ||
306 | .num_resources = ARRAY_SIZE(s3c_rtc_resource), | ||
307 | .resource = s3c_rtc_resource, | ||
308 | }; | ||
309 | |||
310 | EXPORT_SYMBOL(s3c_device_rtc); | ||
311 | |||
312 | /* ADC */ | ||
313 | |||
314 | static struct resource s3c_adc_resource[] = { | ||
315 | [0] = { | ||
316 | .start = S3C24XX_PA_ADC, | ||
317 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | ||
318 | .flags = IORESOURCE_MEM, | ||
319 | }, | ||
320 | [1] = { | ||
321 | .start = IRQ_TC, | ||
322 | .end = IRQ_TC, | ||
323 | .flags = IORESOURCE_IRQ, | ||
324 | }, | ||
325 | [2] = { | ||
326 | .start = IRQ_ADC, | ||
327 | .end = IRQ_ADC, | ||
328 | .flags = IORESOURCE_IRQ, | ||
329 | } | ||
330 | |||
331 | }; | ||
332 | |||
333 | struct platform_device s3c_device_adc = { | ||
334 | .name = "s3c24xx-adc", | ||
335 | .id = -1, | ||
336 | .num_resources = ARRAY_SIZE(s3c_adc_resource), | ||
337 | .resource = s3c_adc_resource, | ||
338 | }; | ||
339 | |||
340 | /* SDI */ | ||
341 | |||
342 | static struct resource s3c_sdi_resource[] = { | ||
343 | [0] = { | ||
344 | .start = S3C24XX_PA_SDI, | ||
345 | .end = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1, | ||
346 | .flags = IORESOURCE_MEM, | ||
347 | }, | ||
348 | [1] = { | ||
349 | .start = IRQ_SDI, | ||
350 | .end = IRQ_SDI, | ||
351 | .flags = IORESOURCE_IRQ, | ||
352 | } | ||
353 | |||
354 | }; | ||
355 | |||
356 | struct platform_device s3c_device_sdi = { | ||
357 | .name = "s3c2410-sdi", | ||
358 | .id = -1, | ||
359 | .num_resources = ARRAY_SIZE(s3c_sdi_resource), | ||
360 | .resource = s3c_sdi_resource, | ||
361 | }; | ||
362 | |||
363 | EXPORT_SYMBOL(s3c_device_sdi); | ||
364 | |||
365 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) | ||
366 | { | ||
367 | s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata), | ||
368 | &s3c_device_sdi); | ||
369 | } | ||
370 | |||
371 | |||
372 | /* SPI (0) */ | ||
373 | |||
374 | static struct resource s3c_spi0_resource[] = { | ||
375 | [0] = { | ||
376 | .start = S3C24XX_PA_SPI, | ||
377 | .end = S3C24XX_PA_SPI + 0x1f, | ||
378 | .flags = IORESOURCE_MEM, | ||
379 | }, | ||
380 | [1] = { | ||
381 | .start = IRQ_SPI0, | ||
382 | .end = IRQ_SPI0, | ||
383 | .flags = IORESOURCE_IRQ, | ||
384 | } | ||
385 | |||
386 | }; | ||
387 | |||
388 | static u64 s3c_device_spi0_dmamask = 0xffffffffUL; | ||
389 | |||
390 | struct platform_device s3c_device_spi0 = { | ||
391 | .name = "s3c2410-spi", | ||
392 | .id = 0, | ||
393 | .num_resources = ARRAY_SIZE(s3c_spi0_resource), | ||
394 | .resource = s3c_spi0_resource, | ||
395 | .dev = { | ||
396 | .dma_mask = &s3c_device_spi0_dmamask, | ||
397 | .coherent_dma_mask = 0xffffffffUL | ||
398 | } | ||
399 | }; | ||
400 | |||
401 | EXPORT_SYMBOL(s3c_device_spi0); | ||
402 | |||
403 | /* SPI (1) */ | ||
404 | |||
405 | static struct resource s3c_spi1_resource[] = { | ||
406 | [0] = { | ||
407 | .start = S3C24XX_PA_SPI + S3C2410_SPI1, | ||
408 | .end = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f, | ||
409 | .flags = IORESOURCE_MEM, | ||
410 | }, | ||
411 | [1] = { | ||
412 | .start = IRQ_SPI1, | ||
413 | .end = IRQ_SPI1, | ||
414 | .flags = IORESOURCE_IRQ, | ||
415 | } | ||
416 | |||
417 | }; | ||
418 | |||
419 | static u64 s3c_device_spi1_dmamask = 0xffffffffUL; | ||
420 | |||
421 | struct platform_device s3c_device_spi1 = { | ||
422 | .name = "s3c2410-spi", | ||
423 | .id = 1, | ||
424 | .num_resources = ARRAY_SIZE(s3c_spi1_resource), | ||
425 | .resource = s3c_spi1_resource, | ||
426 | .dev = { | ||
427 | .dma_mask = &s3c_device_spi1_dmamask, | ||
428 | .coherent_dma_mask = 0xffffffffUL | ||
429 | } | ||
430 | }; | ||
431 | |||
432 | EXPORT_SYMBOL(s3c_device_spi1); | ||
433 | |||
434 | #ifdef CONFIG_CPU_S3C2440 | ||
435 | |||
436 | /* Camif Controller */ | ||
437 | |||
438 | static struct resource s3c_camif_resource[] = { | ||
439 | [0] = { | ||
440 | .start = S3C2440_PA_CAMIF, | ||
441 | .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1, | ||
442 | .flags = IORESOURCE_MEM, | ||
443 | }, | ||
444 | [1] = { | ||
445 | .start = IRQ_CAM, | ||
446 | .end = IRQ_CAM, | ||
447 | .flags = IORESOURCE_IRQ, | ||
448 | } | ||
449 | |||
450 | }; | ||
451 | |||
452 | static u64 s3c_device_camif_dmamask = 0xffffffffUL; | ||
453 | |||
454 | struct platform_device s3c_device_camif = { | ||
455 | .name = "s3c2440-camif", | ||
456 | .id = -1, | ||
457 | .num_resources = ARRAY_SIZE(s3c_camif_resource), | ||
458 | .resource = s3c_camif_resource, | ||
459 | .dev = { | ||
460 | .dma_mask = &s3c_device_camif_dmamask, | ||
461 | .coherent_dma_mask = 0xffffffffUL | ||
462 | } | ||
463 | }; | ||
464 | |||
465 | EXPORT_SYMBOL(s3c_device_camif); | ||
466 | |||
467 | /* AC97 */ | ||
468 | |||
469 | static struct resource s3c_ac97_resource[] = { | ||
470 | [0] = { | ||
471 | .start = S3C2440_PA_AC97, | ||
472 | .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1, | ||
473 | .flags = IORESOURCE_MEM, | ||
474 | }, | ||
475 | [1] = { | ||
476 | .start = IRQ_S3C244x_AC97, | ||
477 | .end = IRQ_S3C244x_AC97, | ||
478 | .flags = IORESOURCE_IRQ, | ||
479 | }, | ||
480 | [2] = { | ||
481 | .name = "PCM out", | ||
482 | .start = DMACH_PCM_OUT, | ||
483 | .end = DMACH_PCM_OUT, | ||
484 | .flags = IORESOURCE_DMA, | ||
485 | }, | ||
486 | [3] = { | ||
487 | .name = "PCM in", | ||
488 | .start = DMACH_PCM_IN, | ||
489 | .end = DMACH_PCM_IN, | ||
490 | .flags = IORESOURCE_DMA, | ||
491 | }, | ||
492 | [4] = { | ||
493 | .name = "Mic in", | ||
494 | .start = DMACH_MIC_IN, | ||
495 | .end = DMACH_MIC_IN, | ||
496 | .flags = IORESOURCE_DMA, | ||
497 | }, | ||
498 | }; | ||
499 | |||
500 | static u64 s3c_device_audio_dmamask = 0xffffffffUL; | ||
501 | |||
502 | struct platform_device s3c_device_ac97 = { | ||
503 | .name = "samsung-ac97", | ||
504 | .id = -1, | ||
505 | .num_resources = ARRAY_SIZE(s3c_ac97_resource), | ||
506 | .resource = s3c_ac97_resource, | ||
507 | .dev = { | ||
508 | .dma_mask = &s3c_device_audio_dmamask, | ||
509 | .coherent_dma_mask = 0xffffffffUL | ||
510 | } | ||
511 | }; | ||
512 | |||
513 | EXPORT_SYMBOL(s3c_device_ac97); | ||
514 | |||
515 | /* ASoC I2S */ | ||
516 | |||
517 | struct platform_device s3c2412_device_iis = { | ||
518 | .name = "s3c2412-iis", | ||
519 | .id = -1, | ||
520 | .dev = { | ||
521 | .dma_mask = &s3c_device_audio_dmamask, | ||
522 | .coherent_dma_mask = 0xffffffffUL | ||
523 | } | ||
524 | }; | ||
525 | |||
526 | EXPORT_SYMBOL(s3c2412_device_iis); | ||
527 | |||
528 | #endif // CONFIG_CPU_S32440 | ||
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 5a5435482595..410a090cf663 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # arch/arm/plat-s3c64xx/Makefile | 1 | # arch/arm/plat-samsung/Makefile |
2 | # | 2 | # |
3 | # Copyright 2009 Simtec Electronics | 3 | # Copyright 2009 Simtec Electronics |
4 | # | 4 | # |
@@ -30,6 +30,7 @@ obj-$(CONFIG_S3C_ADC) += adc.o | |||
30 | 30 | ||
31 | obj-y += platformdata.o | 31 | obj-y += platformdata.o |
32 | 32 | ||
33 | obj-y += devs.o | ||
33 | obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o | 34 | obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o |
34 | obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o | 35 | obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o |
35 | obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o | 36 | obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o |
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c new file mode 100644 index 000000000000..f87bc9845d95 --- /dev/null +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -0,0 +1,431 @@ | |||
1 | /* linux/arch/arm/plat-samsung/devs.c | ||
2 | * | ||
3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Base SAMSUNG platform device definitions | ||
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/list.h> | ||
17 | #include <linux/timer.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/serial_core.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/slab.h> | ||
23 | #include <linux/string.h> | ||
24 | #include <linux/dma-mapping.h> | ||
25 | |||
26 | #include <asm/irq.h> | ||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/map.h> | ||
29 | #include <asm/mach/irq.h> | ||
30 | |||
31 | #include <mach/hardware.h> | ||
32 | #include <mach/dma.h> | ||
33 | #include <mach/irqs.h> | ||
34 | #include <mach/map.h> | ||
35 | |||
36 | #include <plat/cpu.h> | ||
37 | #include <plat/devs.h> | ||
38 | #include <plat/fb.h> | ||
39 | #include <plat/fb-s3c2410.h> | ||
40 | #include <plat/mci.h> | ||
41 | #include <plat/ts.h> | ||
42 | #include <plat/udc.h> | ||
43 | #include <plat/regs-serial.h> | ||
44 | #include <plat/regs-spi.h> | ||
45 | |||
46 | static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); | ||
47 | |||
48 | /* AC97 */ | ||
49 | #ifdef CONFIG_CPU_S3C2440 | ||
50 | static struct resource s3c_ac97_resource[] = { | ||
51 | [0] = { | ||
52 | .start = S3C2440_PA_AC97, | ||
53 | .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 - 1, | ||
54 | .flags = IORESOURCE_MEM, | ||
55 | }, | ||
56 | [1] = { | ||
57 | .start = IRQ_S3C244x_AC97, | ||
58 | .end = IRQ_S3C244x_AC97, | ||
59 | .flags = IORESOURCE_IRQ, | ||
60 | }, | ||
61 | [2] = { | ||
62 | .name = "PCM out", | ||
63 | .start = DMACH_PCM_OUT, | ||
64 | .end = DMACH_PCM_OUT, | ||
65 | .flags = IORESOURCE_DMA, | ||
66 | }, | ||
67 | [3] = { | ||
68 | .name = "PCM in", | ||
69 | .start = DMACH_PCM_IN, | ||
70 | .end = DMACH_PCM_IN, | ||
71 | .flags = IORESOURCE_DMA, | ||
72 | }, | ||
73 | [4] = { | ||
74 | .name = "Mic in", | ||
75 | .start = DMACH_MIC_IN, | ||
76 | .end = DMACH_MIC_IN, | ||
77 | .flags = IORESOURCE_DMA, | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | struct platform_device s3c_device_ac97 = { | ||
82 | .name = "samsung-ac97", | ||
83 | .id = -1, | ||
84 | .num_resources = ARRAY_SIZE(s3c_ac97_resource), | ||
85 | .resource = s3c_ac97_resource, | ||
86 | .dev = { | ||
87 | .dma_mask = &samsung_device_dma_mask, | ||
88 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
89 | } | ||
90 | }; | ||
91 | #endif /* CONFIG_CPU_S3C2440 */ | ||
92 | |||
93 | /* ADC */ | ||
94 | |||
95 | #ifdef CONFIG_PLAT_S3C24XX | ||
96 | static struct resource s3c_adc_resource[] = { | ||
97 | [0] = { | ||
98 | .start = S3C24XX_PA_ADC, | ||
99 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | ||
100 | .flags = IORESOURCE_MEM, | ||
101 | }, | ||
102 | [1] = { | ||
103 | .start = IRQ_TC, | ||
104 | .end = IRQ_TC, | ||
105 | .flags = IORESOURCE_IRQ, | ||
106 | }, | ||
107 | [2] = { | ||
108 | .start = IRQ_ADC, | ||
109 | .end = IRQ_ADC, | ||
110 | .flags = IORESOURCE_IRQ, | ||
111 | } | ||
112 | }; | ||
113 | |||
114 | struct platform_device s3c_device_adc = { | ||
115 | .name = "s3c24xx-adc", | ||
116 | .id = -1, | ||
117 | .num_resources = ARRAY_SIZE(s3c_adc_resource), | ||
118 | .resource = s3c_adc_resource, | ||
119 | }; | ||
120 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
121 | |||
122 | /* Camif Controller */ | ||
123 | |||
124 | #ifdef CONFIG_CPU_S3C2440 | ||
125 | static struct resource s3c_camif_resource[] = { | ||
126 | [0] = { | ||
127 | .start = S3C2440_PA_CAMIF, | ||
128 | .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1, | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | }, | ||
131 | [1] = { | ||
132 | .start = IRQ_CAM, | ||
133 | .end = IRQ_CAM, | ||
134 | .flags = IORESOURCE_IRQ, | ||
135 | } | ||
136 | }; | ||
137 | |||
138 | struct platform_device s3c_device_camif = { | ||
139 | .name = "s3c2440-camif", | ||
140 | .id = -1, | ||
141 | .num_resources = ARRAY_SIZE(s3c_camif_resource), | ||
142 | .resource = s3c_camif_resource, | ||
143 | .dev = { | ||
144 | .dma_mask = &samsung_device_dma_mask, | ||
145 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
146 | } | ||
147 | }; | ||
148 | #endif /* CONFIG_CPU_S3C2440 */ | ||
149 | |||
150 | /* I2S */ | ||
151 | |||
152 | #ifdef CONFIG_PLAT_S3C24XX | ||
153 | static struct resource s3c_iis_resource[] = { | ||
154 | [0] = { | ||
155 | .start = S3C24XX_PA_IIS, | ||
156 | .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS - 1, | ||
157 | .flags = IORESOURCE_MEM, | ||
158 | } | ||
159 | }; | ||
160 | |||
161 | struct platform_device s3c_device_iis = { | ||
162 | .name = "s3c24xx-iis", | ||
163 | .id = -1, | ||
164 | .num_resources = ARRAY_SIZE(s3c_iis_resource), | ||
165 | .resource = s3c_iis_resource, | ||
166 | .dev = { | ||
167 | .dma_mask = &samsung_device_dma_mask, | ||
168 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
169 | } | ||
170 | }; | ||
171 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
172 | |||
173 | #ifdef CONFIG_CPU_S3C2440 | ||
174 | struct platform_device s3c2412_device_iis = { | ||
175 | .name = "s3c2412-iis", | ||
176 | .id = -1, | ||
177 | .dev = { | ||
178 | .dma_mask = &samsung_device_dma_mask, | ||
179 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
180 | } | ||
181 | }; | ||
182 | #endif /* CONFIG_CPU_S3C2440 */ | ||
183 | |||
184 | /* LCD Controller */ | ||
185 | |||
186 | #ifdef CONFIG_PLAT_S3C24XX | ||
187 | static struct resource s3c_lcd_resource[] = { | ||
188 | [0] = { | ||
189 | .start = S3C24XX_PA_LCD, | ||
190 | .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, | ||
191 | .flags = IORESOURCE_MEM, | ||
192 | }, | ||
193 | [1] = { | ||
194 | .start = IRQ_LCD, | ||
195 | .end = IRQ_LCD, | ||
196 | .flags = IORESOURCE_IRQ, | ||
197 | } | ||
198 | }; | ||
199 | |||
200 | struct platform_device s3c_device_lcd = { | ||
201 | .name = "s3c2410-lcd", | ||
202 | .id = -1, | ||
203 | .num_resources = ARRAY_SIZE(s3c_lcd_resource), | ||
204 | .resource = s3c_lcd_resource, | ||
205 | .dev = { | ||
206 | .dma_mask = &samsung_device_dma_mask, | ||
207 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
208 | } | ||
209 | }; | ||
210 | |||
211 | void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | ||
212 | { | ||
213 | struct s3c2410fb_mach_info *npd; | ||
214 | |||
215 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd); | ||
216 | if (npd) { | ||
217 | npd->displays = kmemdup(pd->displays, | ||
218 | sizeof(struct s3c2410fb_display) * npd->num_displays, | ||
219 | GFP_KERNEL); | ||
220 | if (!npd->displays) | ||
221 | printk(KERN_ERR "no memory for LCD display data\n"); | ||
222 | } else { | ||
223 | printk(KERN_ERR "no memory for LCD platform data\n"); | ||
224 | } | ||
225 | } | ||
226 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
227 | |||
228 | /* RTC */ | ||
229 | |||
230 | #ifdef CONFIG_PLAT_S3C24XX | ||
231 | static struct resource s3c_rtc_resource[] = { | ||
232 | [0] = { | ||
233 | .start = S3C24XX_PA_RTC, | ||
234 | .end = S3C24XX_PA_RTC + 0xff, | ||
235 | .flags = IORESOURCE_MEM, | ||
236 | }, | ||
237 | [1] = { | ||
238 | .start = IRQ_RTC, | ||
239 | .end = IRQ_RTC, | ||
240 | .flags = IORESOURCE_IRQ, | ||
241 | }, | ||
242 | [2] = { | ||
243 | .start = IRQ_TICK, | ||
244 | .end = IRQ_TICK, | ||
245 | .flags = IORESOURCE_IRQ | ||
246 | } | ||
247 | }; | ||
248 | |||
249 | struct platform_device s3c_device_rtc = { | ||
250 | .name = "s3c2410-rtc", | ||
251 | .id = -1, | ||
252 | .num_resources = ARRAY_SIZE(s3c_rtc_resource), | ||
253 | .resource = s3c_rtc_resource, | ||
254 | }; | ||
255 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
256 | |||
257 | /* SDI */ | ||
258 | |||
259 | #ifdef CONFIG_PLAT_S3C24XX | ||
260 | static struct resource s3c_sdi_resource[] = { | ||
261 | [0] = { | ||
262 | .start = S3C24XX_PA_SDI, | ||
263 | .end = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1, | ||
264 | .flags = IORESOURCE_MEM, | ||
265 | }, | ||
266 | [1] = { | ||
267 | .start = IRQ_SDI, | ||
268 | .end = IRQ_SDI, | ||
269 | .flags = IORESOURCE_IRQ, | ||
270 | } | ||
271 | }; | ||
272 | |||
273 | struct platform_device s3c_device_sdi = { | ||
274 | .name = "s3c2410-sdi", | ||
275 | .id = -1, | ||
276 | .num_resources = ARRAY_SIZE(s3c_sdi_resource), | ||
277 | .resource = s3c_sdi_resource, | ||
278 | }; | ||
279 | |||
280 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) | ||
281 | { | ||
282 | s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata), | ||
283 | &s3c_device_sdi); | ||
284 | } | ||
285 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
286 | |||
287 | /* SPI */ | ||
288 | |||
289 | #ifdef CONFIG_PLAT_S3C24XX | ||
290 | static struct resource s3c_spi0_resource[] = { | ||
291 | [0] = { | ||
292 | .start = S3C24XX_PA_SPI, | ||
293 | .end = S3C24XX_PA_SPI + 0x1f, | ||
294 | .flags = IORESOURCE_MEM, | ||
295 | }, | ||
296 | [1] = { | ||
297 | .start = IRQ_SPI0, | ||
298 | .end = IRQ_SPI0, | ||
299 | .flags = IORESOURCE_IRQ, | ||
300 | } | ||
301 | }; | ||
302 | |||
303 | struct platform_device s3c_device_spi0 = { | ||
304 | .name = "s3c2410-spi", | ||
305 | .id = 0, | ||
306 | .num_resources = ARRAY_SIZE(s3c_spi0_resource), | ||
307 | .resource = s3c_spi0_resource, | ||
308 | .dev = { | ||
309 | .dma_mask = &samsung_device_dma_mask, | ||
310 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
311 | } | ||
312 | }; | ||
313 | |||
314 | static struct resource s3c_spi1_resource[] = { | ||
315 | [0] = { | ||
316 | .start = S3C24XX_PA_SPI + S3C2410_SPI1, | ||
317 | .end = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f, | ||
318 | .flags = IORESOURCE_MEM, | ||
319 | }, | ||
320 | [1] = { | ||
321 | .start = IRQ_SPI1, | ||
322 | .end = IRQ_SPI1, | ||
323 | .flags = IORESOURCE_IRQ, | ||
324 | } | ||
325 | }; | ||
326 | |||
327 | struct platform_device s3c_device_spi1 = { | ||
328 | .name = "s3c2410-spi", | ||
329 | .id = 1, | ||
330 | .num_resources = ARRAY_SIZE(s3c_spi1_resource), | ||
331 | .resource = s3c_spi1_resource, | ||
332 | .dev = { | ||
333 | .dma_mask = &samsung_device_dma_mask, | ||
334 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
335 | } | ||
336 | }; | ||
337 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
338 | |||
339 | /* Touchscreen */ | ||
340 | |||
341 | #ifdef CONFIG_PLAT_S3C24XX | ||
342 | static struct resource s3c_ts_resource[] = { | ||
343 | [0] = { | ||
344 | .start = S3C24XX_PA_ADC, | ||
345 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | ||
346 | .flags = IORESOURCE_MEM, | ||
347 | }, | ||
348 | [1] = { | ||
349 | .start = IRQ_TC, | ||
350 | .end = IRQ_TC, | ||
351 | .flags = IORESOURCE_IRQ, | ||
352 | }, | ||
353 | |||
354 | }; | ||
355 | |||
356 | struct platform_device s3c_device_ts = { | ||
357 | .name = "s3c2410-ts", | ||
358 | .id = -1, | ||
359 | .dev.parent = &s3c_device_adc.dev, | ||
360 | .num_resources = ARRAY_SIZE(s3c_ts_resource), | ||
361 | .resource = s3c_ts_resource, | ||
362 | }; | ||
363 | |||
364 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) | ||
365 | { | ||
366 | s3c_set_platdata(hard_s3c2410ts_info, | ||
367 | sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts); | ||
368 | } | ||
369 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
370 | |||
371 | /* USB Device (Gadget) */ | ||
372 | |||
373 | #ifdef CONFIG_PLAT_S3C24XX | ||
374 | static struct resource s3c_usbgadget_resource[] = { | ||
375 | [0] = { | ||
376 | .start = S3C24XX_PA_USBDEV, | ||
377 | .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, | ||
378 | .flags = IORESOURCE_MEM, | ||
379 | }, | ||
380 | [1] = { | ||
381 | .start = IRQ_USBD, | ||
382 | .end = IRQ_USBD, | ||
383 | .flags = IORESOURCE_IRQ, | ||
384 | } | ||
385 | }; | ||
386 | |||
387 | struct platform_device s3c_device_usbgadget = { | ||
388 | .name = "s3c2410-usbgadget", | ||
389 | .id = -1, | ||
390 | .num_resources = ARRAY_SIZE(s3c_usbgadget_resource), | ||
391 | .resource = s3c_usbgadget_resource, | ||
392 | }; | ||
393 | |||
394 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | ||
395 | { | ||
396 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget); | ||
397 | } | ||
398 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
399 | |||
400 | /* USB High Spped 2.0 Device (Gadget) */ | ||
401 | |||
402 | #ifdef CONFIG_PLAT_S3C24XX | ||
403 | static struct resource s3c_hsudc_resource[] = { | ||
404 | [0] = { | ||
405 | .start = S3C2416_PA_HSUDC, | ||
406 | .end = S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1, | ||
407 | .flags = IORESOURCE_MEM, | ||
408 | }, | ||
409 | [1] = { | ||
410 | .start = IRQ_USBD, | ||
411 | .end = IRQ_USBD, | ||
412 | .flags = IORESOURCE_IRQ, | ||
413 | } | ||
414 | }; | ||
415 | |||
416 | struct platform_device s3c_device_usb_hsudc = { | ||
417 | .name = "s3c-hsudc", | ||
418 | .id = -1, | ||
419 | .num_resources = ARRAY_SIZE(s3c_hsudc_resource), | ||
420 | .resource = s3c_hsudc_resource, | ||
421 | .dev = { | ||
422 | .dma_mask = &samsung_device_dma_mask, | ||
423 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
424 | }, | ||
425 | }; | ||
426 | |||
427 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) | ||
428 | { | ||
429 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc); | ||
430 | } | ||
431 | #endif /* CONFIG_PLAT_S3C24XX */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/fb-s3c2410.h b/arch/arm/plat-samsung/include/plat/fb-s3c2410.h new file mode 100644 index 000000000000..4e5d9588b5ba --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/fb-s3c2410.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/fb-s3c2410.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
4 | * | ||
5 | * Inspired by pxafb.h | ||
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 | #ifndef __ASM_PLAT_FB_S3C2410_H | ||
13 | #define __ASM_PLAT_FB_S3C2410_H __FILE__ | ||
14 | |||
15 | struct s3c2410fb_hw { | ||
16 | unsigned long lcdcon1; | ||
17 | unsigned long lcdcon2; | ||
18 | unsigned long lcdcon3; | ||
19 | unsigned long lcdcon4; | ||
20 | unsigned long lcdcon5; | ||
21 | }; | ||
22 | |||
23 | /* LCD description */ | ||
24 | struct s3c2410fb_display { | ||
25 | /* LCD type */ | ||
26 | unsigned type; | ||
27 | |||
28 | /* Screen size */ | ||
29 | unsigned short width; | ||
30 | unsigned short height; | ||
31 | |||
32 | /* Screen info */ | ||
33 | unsigned short xres; | ||
34 | unsigned short yres; | ||
35 | unsigned short bpp; | ||
36 | |||
37 | unsigned pixclock; /* pixclock in picoseconds */ | ||
38 | unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */ | ||
39 | unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */ | ||
40 | unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */ | ||
41 | unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */ | ||
42 | unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */ | ||
43 | unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */ | ||
44 | |||
45 | /* lcd configuration registers */ | ||
46 | unsigned long lcdcon5; | ||
47 | }; | ||
48 | |||
49 | struct s3c2410fb_mach_info { | ||
50 | |||
51 | struct s3c2410fb_display *displays; /* attached diplays info */ | ||
52 | unsigned num_displays; /* number of defined displays */ | ||
53 | unsigned default_display; | ||
54 | |||
55 | /* GPIOs */ | ||
56 | |||
57 | unsigned long gpcup; | ||
58 | unsigned long gpcup_mask; | ||
59 | unsigned long gpccon; | ||
60 | unsigned long gpccon_mask; | ||
61 | unsigned long gpdup; | ||
62 | unsigned long gpdup_mask; | ||
63 | unsigned long gpdcon; | ||
64 | unsigned long gpdcon_mask; | ||
65 | |||
66 | /* lpc3600 control register */ | ||
67 | unsigned long lpcsel; | ||
68 | }; | ||
69 | |||
70 | extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *); | ||
71 | |||
72 | #endif /* __ASM_PLAT_FB_S3C2410_H */ | ||