1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#include <linux/init.h>
26#include <linux/device.h>
27#include <linux/serial.h>
28#include <linux/tty.h>
29#include <linux/serial_8250.h>
30#include <asm/types.h>
31#include <asm/setup.h>
32#include <asm/memory.h>
33#include <mach/hardware.h>
34#include <asm/irq.h>
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/flash.h>
38
39
40
41
42
43#define GTWX5715_KSSPI_SELECT 5
44#define GTWX5715_KSSPI_TXD 6
45#define GTWX5715_KSSPI_CLOCK 7
46#define GTWX5715_KSSPI_RXD 12
47
48
49
50
51#define GTWX5715_BUTTON_GPIO 3
52
53
54
55
56
57
58
59
60
61#define GTWX5715_LED1_GPIO 2
62#define GTWX5715_LED2_GPIO 9
63#define GTWX5715_LED3_GPIO 8
64#define GTWX5715_LED4_GPIO 1
65#define GTWX5715_LED9_GPIO 4
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82#ifdef __ARMEB__
83#define REG_OFFSET 3
84#else
85#define REG_OFFSET 0
86#endif
87
88
89
90
91
92static struct resource gtwx5715_uart_resources[] = {
93 {
94 .start = IXP4XX_UART2_BASE_PHYS,
95 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
96 .flags = IORESOURCE_MEM,
97 },
98 {
99 .start = IRQ_IXP4XX_UART2,
100 .end = IRQ_IXP4XX_UART2,
101 .flags = IORESOURCE_IRQ,
102 },
103 { },
104};
105
106
107static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
108 {
109 .mapbase = IXP4XX_UART2_BASE_PHYS,
110 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
111 .irq = IRQ_IXP4XX_UART2,
112 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
113 .iotype = UPIO_MEM,
114 .regshift = 2,
115 .uartclk = IXP4XX_UART_XTAL,
116 },
117 { },
118};
119
120static struct platform_device gtwx5715_uart_device = {
121 .name = "serial8250",
122 .id = PLAT8250_DEV_PLATFORM,
123 .dev = {
124 .platform_data = gtwx5715_uart_platform_data,
125 },
126 .num_resources = 2,
127 .resource = gtwx5715_uart_resources,
128};
129
130static struct flash_platform_data gtwx5715_flash_data = {
131 .map_name = "cfi_probe",
132 .width = 2,
133};
134
135static struct resource gtwx5715_flash_resource = {
136 .flags = IORESOURCE_MEM,
137};
138
139static struct platform_device gtwx5715_flash = {
140 .name = "IXP4XX-Flash",
141 .id = 0,
142 .dev = {
143 .platform_data = >wx5715_flash_data,
144 },
145 .num_resources = 1,
146 .resource = >wx5715_flash_resource,
147};
148
149static struct platform_device *gtwx5715_devices[] __initdata = {
150 >wx5715_uart_device,
151 >wx5715_flash,
152};
153
154static void __init gtwx5715_init(void)
155{
156 ixp4xx_sys_init();
157
158 gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
159 gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;
160
161 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
162}
163
164
165MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
166
167 .map_io = ixp4xx_map_io,
168 .init_early = ixp4xx_init_early,
169 .init_irq = ixp4xx_init_irq,
170 .init_time = ixp4xx_timer_init,
171 .atag_offset = 0x100,
172 .init_machine = gtwx5715_init,
173#if defined(CONFIG_PCI)
174 .dma_zone_size = SZ_64M,
175#endif
176 .restart = ixp4xx_restart,
177MACHINE_END
178
179
180