2 * linux/arch/arm/mach-w90x900/mach-w90p910evb.c
4 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
6 * Copyright (C) 2008 Nuvoton technology corporation.
8 * Wan ZongShun <mcuos.com@gmail.com>
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.
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 #include <linux/mtd/physmap.h>
25 #include <asm/mach/arch.h>
26 #include <asm/mach/map.h>
27 #include <asm/mach/irq.h>
28 #include <asm/mach-types.h>
30 #include <mach/regs-serial.h>
34 /*w90p910 evb norflash driver data */
36 #define W90P910_FLASH_BASE 0xA0000000
37 #define W90P910_FLASH_SIZE 0x400000
39 static struct mtd_partition w90p910_flash_partitions
[] = {
41 .name
= "NOR Partition 1 for kernel (960K)",
46 .name
= "NOR Partition 2 for image (1M)",
51 .name
= "NOR Partition 3 for user (2M)",
57 static struct physmap_flash_data w90p910_flash_data
= {
59 .parts
= w90p910_flash_partitions
,
60 .nr_parts
= ARRAY_SIZE(w90p910_flash_partitions
),
63 static struct resource w90p910_flash_resources
[] = {
65 .start
= W90P910_FLASH_BASE
,
66 .end
= W90P910_FLASH_BASE
+ W90P910_FLASH_SIZE
- 1,
67 .flags
= IORESOURCE_MEM
,
71 static struct platform_device w90p910_flash_device
= {
72 .name
= "physmap-flash",
75 .platform_data
= &w90p910_flash_data
,
77 .resource
= w90p910_flash_resources
,
78 .num_resources
= ARRAY_SIZE(w90p910_flash_resources
),
81 /* USB EHCI Host Controller */
83 static struct resource w90x900_usb_ehci_resource
[] = {
85 .start
= W90X900_PA_USBEHCIHOST
,
86 .end
= W90X900_PA_USBEHCIHOST
+ W90X900_SZ_USBEHCIHOST
- 1,
87 .flags
= IORESOURCE_MEM
,
92 .flags
= IORESOURCE_IRQ
,
96 static u64 w90x900_device_usb_ehci_dmamask
= 0xffffffffUL
;
98 struct platform_device w90x900_device_usb_ehci
= {
99 .name
= "w90x900-ehci",
101 .num_resources
= ARRAY_SIZE(w90x900_usb_ehci_resource
),
102 .resource
= w90x900_usb_ehci_resource
,
104 .dma_mask
= &w90x900_device_usb_ehci_dmamask
,
105 .coherent_dma_mask
= 0xffffffffUL
108 EXPORT_SYMBOL(w90x900_device_usb_ehci
);
110 /* USB OHCI Host Controller */
112 static struct resource w90x900_usb_ohci_resource
[] = {
114 .start
= W90X900_PA_USBOHCIHOST
,
115 .end
= W90X900_PA_USBOHCIHOST
+ W90X900_SZ_USBOHCIHOST
- 1,
116 .flags
= IORESOURCE_MEM
,
121 .flags
= IORESOURCE_IRQ
,
125 static u64 w90x900_device_usb_ohci_dmamask
= 0xffffffffUL
;
126 struct platform_device w90x900_device_usb_ohci
= {
127 .name
= "w90x900-ohci",
129 .num_resources
= ARRAY_SIZE(w90x900_usb_ohci_resource
),
130 .resource
= w90x900_usb_ohci_resource
,
132 .dma_mask
= &w90x900_device_usb_ohci_dmamask
,
133 .coherent_dma_mask
= 0xffffffffUL
136 EXPORT_SYMBOL(w90x900_device_usb_ohci
);
138 /*TouchScreen controller*/
140 static struct resource w90x900_ts_resource
[] = {
142 .start
= W90X900_PA_ADC
,
143 .end
= W90X900_PA_ADC
+ W90X900_SZ_ADC
-1,
144 .flags
= IORESOURCE_MEM
,
149 .flags
= IORESOURCE_IRQ
,
153 struct platform_device w90x900_device_ts
= {
154 .name
= "w90x900-ts",
156 .resource
= w90x900_ts_resource
,
157 .num_resources
= ARRAY_SIZE(w90x900_ts_resource
),
159 EXPORT_SYMBOL(w90x900_device_ts
);
163 static struct resource w90x900_rtc_resource
[] = {
165 .start
= W90X900_PA_RTC
,
166 .end
= W90X900_PA_RTC
+ 0xff,
167 .flags
= IORESOURCE_MEM
,
172 .flags
= IORESOURCE_IRQ
,
176 struct platform_device w90x900_device_rtc
= {
177 .name
= "w90x900-rtc",
179 .num_resources
= ARRAY_SIZE(w90x900_rtc_resource
),
180 .resource
= w90x900_rtc_resource
,
182 EXPORT_SYMBOL(w90x900_device_rtc
);
186 static struct resource w90x900_kpi_resource
[] = {
188 .start
= W90X900_PA_KPI
,
189 .end
= W90X900_PA_KPI
+ W90X900_SZ_KPI
- 1,
190 .flags
= IORESOURCE_MEM
,
195 .flags
= IORESOURCE_IRQ
,
200 struct platform_device w90x900_device_kpi
= {
201 .name
= "w90x900-kpi",
203 .num_resources
= ARRAY_SIZE(w90x900_kpi_resource
),
204 .resource
= w90x900_kpi_resource
,
206 EXPORT_SYMBOL(w90x900_device_kpi
);
208 /* USB Device (Gadget)*/
210 static struct resource w90x900_usbgadget_resource
[] = {
212 .start
= W90X900_PA_USBDEV
,
213 .end
= W90X900_PA_USBDEV
+ W90X900_SZ_USBDEV
- 1,
214 .flags
= IORESOURCE_MEM
,
219 .flags
= IORESOURCE_IRQ
,
223 struct platform_device w90x900_device_usbgadget
= {
224 .name
= "w90x900-usbgadget",
226 .num_resources
= ARRAY_SIZE(w90x900_usbgadget_resource
),
227 .resource
= w90x900_usbgadget_resource
,
229 EXPORT_SYMBOL(w90x900_device_usbgadget
);
231 static struct map_desc w90p910_iodesc
[] __initdata
= {
234 /*Here should be your evb resourse,such as LCD*/
236 static struct platform_device
*w90p910evb_dev
[] __initdata
= {
237 &w90p910_serial_device
,
238 &w90p910_flash_device
,
239 &w90x900_device_usb_ehci
,
240 &w90x900_device_usb_ohci
,
244 &w90x900_device_usbgadget
,
247 static void __init
w90p910evb_map_io(void)
249 w90p910_map_io(w90p910_iodesc
, ARRAY_SIZE(w90p910_iodesc
));
250 w90p910_init_clocks();
253 static void __init
w90p910evb_init(void)
255 platform_add_devices(w90p910evb_dev
, ARRAY_SIZE(w90p910evb_dev
));
258 MACHINE_START(W90P910EVB
, "W90P910EVB")
259 /* Maintainer: Wan ZongShun */
260 .phys_io
= W90X900_PA_UART
,
261 .io_pg_offst
= (((u32
)W90X900_VA_UART
) >> 18) & 0xfffc,
263 .map_io
= w90p910evb_map_io
,
264 .init_irq
= w90x900_init_irq
,
265 .init_machine
= w90p910evb_init
,
266 .timer
= &w90x900_timer
,