Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6.git] / arch / arm / mach-w90x900 / mach-w90p910evb.c
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  * All rights reserved.
8  *
9  * Wan ZongShun <mcuos.com@gmail.com>
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License as
13  * published by the Free Software Foundation; either version 2 of
14  * the License, or (at your option) any later version.
15  *
16  */
17
18 #include <linux/kernel.h>
19 #include <linux/types.h>
20 #include <linux/interrupt.h>
21 #include <linux/list.h>
22 #include <linux/timer.h>
23 #include <linux/init.h>
24 #include <linux/platform_device.h>
25 #include <linux/mtd/physmap.h>
26
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/irq.h>
30 #include <asm/mach-types.h>
31
32 #include <mach/regs-serial.h>
33 #include <mach/map.h>
34
35 #include "cpu.h"
36 /*w90p910 evb norflash driver data */
37
38 #define W90P910_FLASH_BASE      0xA0000000
39 #define W90P910_FLASH_SIZE      0x400000
40
41 static struct mtd_partition w90p910_flash_partitions[] = {
42         {
43                 .name   =       "NOR Partition 1 for kernel (960K)",
44                 .size   =       0xF0000,
45                 .offset =       0x10000,
46         },
47         {
48                 .name   =       "NOR Partition 2 for image (1M)",
49                 .size   =       0x100000,
50                 .offset =       0x100000,
51         },
52         {
53                 .name   =       "NOR Partition 3 for user (2M)",
54                 .size   =       0x200000,
55                 .offset =       0x00200000,
56         }
57 };
58
59 static struct physmap_flash_data w90p910_flash_data = {
60         .width          =       2,
61         .parts          =       w90p910_flash_partitions,
62         .nr_parts       =       ARRAY_SIZE(w90p910_flash_partitions),
63 };
64
65 static struct resource w90p910_flash_resources[] = {
66         {
67                 .start  =       W90P910_FLASH_BASE,
68                 .end    =       W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
69                 .flags  =       IORESOURCE_MEM,
70         }
71 };
72
73 static struct platform_device w90p910_flash_device = {
74         .name           =       "physmap-flash",
75         .id             =       0,
76         .dev            = {
77                                 .platform_data = &w90p910_flash_data,
78                         },
79         .resource       =       w90p910_flash_resources,
80         .num_resources  =       ARRAY_SIZE(w90p910_flash_resources),
81 };
82
83 static struct map_desc w90p910_iodesc[] __initdata = {
84 };
85
86 /*Here should be your evb resourse,such as LCD*/
87
88 static struct platform_device *w90p910evb_dev[] __initdata = {
89         &w90p910_serial_device,
90         &w90p910_flash_device,
91 };
92
93 static void __init w90p910evb_map_io(void)
94 {
95         w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
96         w90p910_init_clocks(0);
97 }
98
99 static void __init w90p910evb_init(void)
100 {
101         platform_add_devices(w90p910evb_dev, ARRAY_SIZE(w90p910evb_dev));
102 }
103
104 MACHINE_START(W90P910EVB, "W90P910EVB")
105         /* Maintainer: Wan ZongShun */
106         .phys_io        = W90X900_PA_UART,
107         .io_pg_offst    = (((u32)W90X900_VA_UART) >> 18) & 0xfffc,
108         .boot_params    = 0,
109         .map_io         = w90p910evb_map_io,
110         .init_irq       = w90x900_init_irq,
111         .init_machine   = w90p910evb_init,
112         .timer          = &w90x900_timer,
113 MACHINE_END