aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-w90x900/mach-w90p910evb.c
diff options
context:
space:
mode:
authorwanzongshun <mcuos.com@gmail.com>2009-08-21 02:07:46 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-02 06:22:23 -0400
commit35c9221acb133ecc9abd701a1fb6fa909d177a77 (patch)
treee2a283112398450001410b5f3fa9a471c34738a7 /arch/arm/mach-w90x900/mach-w90p910evb.c
parenta8bc4eadd936bbad9e99b89fe692679451ad75c9 (diff)
ARM: 5682/1: Add cpu.c and dev.c and modify some files of w90p910 platform
Add the cpu.c and dev.c and modify w90p910 platform to apply to use the common API(provided by cpu.c and dev.c) at the same time, I renamed all w90x900 to nuc900 in every c file of w90x900 platform and touchscreen's driver name. Signed-off-by: Wan ZongShun <mcuos.com@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-w90x900/mach-w90p910evb.c')
-rw-r--r--arch/arm/mach-w90x900/mach-w90p910evb.c407
1 files changed, 0 insertions, 407 deletions
diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c
deleted file mode 100644
index 117578aed681..000000000000
--- a/arch/arm/mach-w90x900/mach-w90p910evb.c
+++ /dev/null
@@ -1,407 +0,0 @@
1/*
2 * linux/arch/arm/mach-w90x900/mach-w90p910evb.c
3 *
4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
5 *
6 * Copyright (C) 2008 Nuvoton technology corporation.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation;version 2 of the License.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/interrupt.h>
19#include <linux/list.h>
20#include <linux/timer.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23
24#include <linux/mtd/physmap.h>
25#include <linux/mtd/mtd.h>
26#include <linux/mtd/partitions.h>
27
28#include <linux/spi/spi.h>
29#include <linux/spi/flash.h>
30
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33#include <asm/mach/irq.h>
34#include <asm/mach-types.h>
35
36#include <mach/regs-serial.h>
37#include <mach/map.h>
38
39#include "cpu.h"
40/*w90p910 evb norflash driver data */
41
42#define W90P910_FLASH_BASE 0xA0000000
43#define W90P910_FLASH_SIZE 0x400000
44#define SPIOFFSET 0x200
45#define SPIOREG_SIZE 0x100
46
47static struct mtd_partition w90p910_flash_partitions[] = {
48 {
49 .name = "NOR Partition 1 for kernel (960K)",
50 .size = 0xF0000,
51 .offset = 0x10000,
52 },
53 {
54 .name = "NOR Partition 2 for image (1M)",
55 .size = 0x100000,
56 .offset = 0x100000,
57 },
58 {
59 .name = "NOR Partition 3 for user (2M)",
60 .size = 0x200000,
61 .offset = 0x00200000,
62 }
63};
64
65static struct physmap_flash_data w90p910_flash_data = {
66 .width = 2,
67 .parts = w90p910_flash_partitions,
68 .nr_parts = ARRAY_SIZE(w90p910_flash_partitions),
69};
70
71static struct resource w90p910_flash_resources[] = {
72 {
73 .start = W90P910_FLASH_BASE,
74 .end = W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
75 .flags = IORESOURCE_MEM,
76 }
77};
78
79static struct platform_device w90p910_flash_device = {
80 .name = "physmap-flash",
81 .id = 0,
82 .dev = {
83 .platform_data = &w90p910_flash_data,
84 },
85 .resource = w90p910_flash_resources,
86 .num_resources = ARRAY_SIZE(w90p910_flash_resources),
87};
88
89/* USB EHCI Host Controller */
90
91static struct resource w90x900_usb_ehci_resource[] = {
92 [0] = {
93 .start = W90X900_PA_USBEHCIHOST,
94 .end = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
95 .flags = IORESOURCE_MEM,
96 },
97 [1] = {
98 .start = IRQ_USBH,
99 .end = IRQ_USBH,
100 .flags = IORESOURCE_IRQ,
101 }
102};
103
104static u64 w90x900_device_usb_ehci_dmamask = 0xffffffffUL;
105
106struct platform_device w90x900_device_usb_ehci = {
107 .name = "w90x900-ehci",
108 .id = -1,
109 .num_resources = ARRAY_SIZE(w90x900_usb_ehci_resource),
110 .resource = w90x900_usb_ehci_resource,
111 .dev = {
112 .dma_mask = &w90x900_device_usb_ehci_dmamask,
113 .coherent_dma_mask = 0xffffffffUL
114 }
115};
116EXPORT_SYMBOL(w90x900_device_usb_ehci);
117
118/* USB OHCI Host Controller */
119
120static struct resource w90x900_usb_ohci_resource[] = {
121 [0] = {
122 .start = W90X900_PA_USBOHCIHOST,
123 .end = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
124 .flags = IORESOURCE_MEM,
125 },
126 [1] = {
127 .start = IRQ_USBH,
128 .end = IRQ_USBH,
129 .flags = IORESOURCE_IRQ,
130 }
131};
132
133static u64 w90x900_device_usb_ohci_dmamask = 0xffffffffUL;
134struct platform_device w90x900_device_usb_ohci = {
135 .name = "w90x900-ohci",
136 .id = -1,
137 .num_resources = ARRAY_SIZE(w90x900_usb_ohci_resource),
138 .resource = w90x900_usb_ohci_resource,
139 .dev = {
140 .dma_mask = &w90x900_device_usb_ohci_dmamask,
141 .coherent_dma_mask = 0xffffffffUL
142 }
143};
144EXPORT_SYMBOL(w90x900_device_usb_ohci);
145
146/*TouchScreen controller*/
147
148static struct resource w90x900_ts_resource[] = {
149 [0] = {
150 .start = W90X900_PA_ADC,
151 .end = W90X900_PA_ADC + W90X900_SZ_ADC-1,
152 .flags = IORESOURCE_MEM,
153 },
154 [1] = {
155 .start = IRQ_ADC,
156 .end = IRQ_ADC,
157 .flags = IORESOURCE_IRQ,
158 },
159};
160
161struct platform_device w90x900_device_ts = {
162 .name = "w90x900-ts",
163 .id = -1,
164 .resource = w90x900_ts_resource,
165 .num_resources = ARRAY_SIZE(w90x900_ts_resource),
166};
167EXPORT_SYMBOL(w90x900_device_ts);
168
169/* RTC controller*/
170
171static struct resource w90x900_rtc_resource[] = {
172 [0] = {
173 .start = W90X900_PA_RTC,
174 .end = W90X900_PA_RTC + 0xff,
175 .flags = IORESOURCE_MEM,
176 },
177 [1] = {
178 .start = IRQ_RTC,
179 .end = IRQ_RTC,
180 .flags = IORESOURCE_IRQ,
181 },
182};
183
184struct platform_device w90x900_device_rtc = {
185 .name = "w90x900-rtc",
186 .id = -1,
187 .num_resources = ARRAY_SIZE(w90x900_rtc_resource),
188 .resource = w90x900_rtc_resource,
189};
190EXPORT_SYMBOL(w90x900_device_rtc);
191
192/* KPI controller*/
193
194static struct resource w90x900_kpi_resource[] = {
195 [0] = {
196 .start = W90X900_PA_KPI,
197 .end = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
198 .flags = IORESOURCE_MEM,
199 },
200 [1] = {
201 .start = IRQ_KPI,
202 .end = IRQ_KPI,
203 .flags = IORESOURCE_IRQ,
204 }
205
206};
207
208struct platform_device w90x900_device_kpi = {
209 .name = "w90x900-kpi",
210 .id = -1,
211 .num_resources = ARRAY_SIZE(w90x900_kpi_resource),
212 .resource = w90x900_kpi_resource,
213};
214EXPORT_SYMBOL(w90x900_device_kpi);
215
216/* USB Device (Gadget)*/
217
218static struct resource w90x900_usbgadget_resource[] = {
219 [0] = {
220 .start = W90X900_PA_USBDEV,
221 .end = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
222 .flags = IORESOURCE_MEM,
223 },
224 [1] = {
225 .start = IRQ_USBD,
226 .end = IRQ_USBD,
227 .flags = IORESOURCE_IRQ,
228 }
229};
230
231struct platform_device w90x900_device_usbgadget = {
232 .name = "w90x900-usbgadget",
233 .id = -1,
234 .num_resources = ARRAY_SIZE(w90x900_usbgadget_resource),
235 .resource = w90x900_usbgadget_resource,
236};
237EXPORT_SYMBOL(w90x900_device_usbgadget);
238
239/* FMI Device */
240
241static struct resource w90p910_fmi_resource[] = {
242 [0] = {
243 .start = W90X900_PA_FMI,
244 .end = W90X900_PA_FMI + W90X900_SZ_FMI - 1,
245 .flags = IORESOURCE_MEM,
246 },
247 [1] = {
248 .start = IRQ_FMI,
249 .end = IRQ_FMI,
250 .flags = IORESOURCE_IRQ,
251 }
252};
253
254static struct platform_device w90p910_device_fmi = {
255 .name = "w90p910-fmi",
256 .id = -1,
257 .num_resources = ARRAY_SIZE(w90p910_fmi_resource),
258 .resource = w90p910_fmi_resource,
259};
260
261/* MAC device */
262
263static struct resource w90x900_emc_resource[] = {
264 [0] = {
265 .start = W90X900_PA_EMC,
266 .end = W90X900_PA_EMC + W90X900_SZ_EMC - 1,
267 .flags = IORESOURCE_MEM,
268 },
269 [1] = {
270 .start = IRQ_EMCTX,
271 .end = IRQ_EMCTX,
272 .flags = IORESOURCE_IRQ,
273 },
274 [2] = {
275 .start = IRQ_EMCRX,
276 .end = IRQ_EMCRX,
277 .flags = IORESOURCE_IRQ,
278 }
279};
280
281static u64 w90x900_device_emc_dmamask = 0xffffffffUL;
282static struct platform_device w90p910_device_emc = {
283 .name = "w90p910-emc",
284 .id = -1,
285 .num_resources = ARRAY_SIZE(w90x900_emc_resource),
286 .resource = w90x900_emc_resource,
287 .dev = {
288 .dma_mask = &w90x900_device_emc_dmamask,
289 .coherent_dma_mask = 0xffffffffUL
290 }
291};
292
293/* SPI device */
294
295static struct resource w90p910_spi_resource[] = {
296 [0] = {
297 .start = W90X900_PA_I2C + SPIOFFSET,
298 .end = W90X900_PA_I2C + SPIOFFSET + SPIOREG_SIZE - 1,
299 .flags = IORESOURCE_MEM,
300 },
301 [1] = {
302 .start = IRQ_SSP,
303 .end = IRQ_SSP,
304 .flags = IORESOURCE_IRQ,
305 }
306};
307
308static struct platform_device w90p910_device_spi = {
309 .name = "w90p910-spi",
310 .id = -1,
311 .num_resources = ARRAY_SIZE(w90p910_spi_resource),
312 .resource = w90p910_spi_resource,
313};
314
315/* spi device, spi flash info */
316
317static struct mtd_partition w90p910_spi_flash_partitions[] = {
318 {
319 .name = "bootloader(spi)",
320 .size = 0x0100000,
321 .offset = 0,
322 },
323};
324
325static struct flash_platform_data w90p910_spi_flash_data = {
326 .name = "m25p80",
327 .parts = w90p910_spi_flash_partitions,
328 .nr_parts = ARRAY_SIZE(w90p910_spi_flash_partitions),
329 .type = "w25x16",
330};
331
332static struct spi_board_info w90p910_spi_board_info[] __initdata = {
333 {
334 .modalias = "m25p80",
335 .max_speed_hz = 20000000,
336 .bus_num = 0,
337 .chip_select = 1,
338 .platform_data = &w90p910_spi_flash_data,
339 .mode = SPI_MODE_0,
340 },
341};
342
343/* WDT Device */
344
345static struct resource w90p910_wdt_resource[] = {
346 [0] = {
347 .start = W90X900_PA_TIMER,
348 .end = W90X900_PA_TIMER + W90X900_SZ_TIMER - 1,
349 .flags = IORESOURCE_MEM,
350 },
351 [1] = {
352 .start = IRQ_WDT,
353 .end = IRQ_WDT,
354 .flags = IORESOURCE_IRQ,
355 }
356};
357
358static struct platform_device w90p910_device_wdt = {
359 .name = "w90p910-wdt",
360 .id = -1,
361 .num_resources = ARRAY_SIZE(w90p910_wdt_resource),
362 .resource = w90p910_wdt_resource,
363};
364
365static struct map_desc w90p910_iodesc[] __initdata = {
366};
367
368/*Here should be your evb resourse,such as LCD*/
369
370static struct platform_device *w90p910evb_dev[] __initdata = {
371 &w90p910_serial_device,
372 &w90p910_flash_device,
373 &w90x900_device_usb_ehci,
374 &w90x900_device_usb_ohci,
375 &w90x900_device_ts,
376 &w90x900_device_rtc,
377 &w90x900_device_kpi,
378 &w90x900_device_usbgadget,
379 &w90p910_device_fmi,
380 &w90p910_device_emc,
381 &w90p910_device_spi,
382 &w90p910_device_wdt,
383};
384
385static void __init w90p910evb_map_io(void)
386{
387 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
388 w90p910_init_clocks();
389}
390
391static void __init w90p910evb_init(void)
392{
393 platform_add_devices(w90p910evb_dev, ARRAY_SIZE(w90p910evb_dev));
394 spi_register_board_info(w90p910_spi_board_info,
395 ARRAY_SIZE(w90p910_spi_board_info));
396}
397
398MACHINE_START(W90P910EVB, "W90P910EVB")
399 /* Maintainer: Wan ZongShun */
400 .phys_io = W90X900_PA_UART,
401 .io_pg_offst = (((u32)W90X900_VA_UART) >> 18) & 0xfffc,
402 .boot_params = 0,
403 .map_io = w90p910evb_map_io,
404 .init_irq = w90x900_init_irq,
405 .init_machine = w90p910evb_init,
406 .timer = &w90x900_timer,
407MACHINE_END