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 <linux/slab.h>
31
32#include <asm/types.h>
33#include <asm/setup.h>
34#include <asm/memory.h>
35#include <mach/hardware.h>
36#include <asm/irq.h>
37#include <asm/mach-types.h>
38#include <asm/mach/arch.h>
39#include <asm/mach/flash.h>
40#include <mach/gtwx5715.h>
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57#ifdef __ARMEB__
58#define REG_OFFSET 3
59#else
60#define REG_OFFSET 0
61#endif
62
63
64
65
66
67static struct resource gtwx5715_uart_resources[] = {
68 {
69 .start = IXP4XX_UART2_BASE_PHYS,
70 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
71 .flags = IORESOURCE_MEM,
72 },
73 {
74 .start = IRQ_IXP4XX_UART2,
75 .end = IRQ_IXP4XX_UART2,
76 .flags = IORESOURCE_IRQ,
77 },
78 { },
79};
80
81
82static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
83 {
84 .mapbase = IXP4XX_UART2_BASE_PHYS,
85 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
86 .irq = IRQ_IXP4XX_UART2,
87 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
88 .iotype = UPIO_MEM,
89 .regshift = 2,
90 .uartclk = IXP4XX_UART_XTAL,
91 },
92 { },
93};
94
95static struct platform_device gtwx5715_uart_device = {
96 .name = "serial8250",
97 .id = PLAT8250_DEV_PLATFORM,
98 .dev = {
99 .platform_data = gtwx5715_uart_platform_data,
100 },
101 .num_resources = 2,
102 .resource = gtwx5715_uart_resources,
103};
104
105static struct flash_platform_data gtwx5715_flash_data = {
106 .map_name = "cfi_probe",
107 .width = 2,
108};
109
110static struct resource gtwx5715_flash_resource = {
111 .flags = IORESOURCE_MEM,
112};
113
114static struct platform_device gtwx5715_flash = {
115 .name = "IXP4XX-Flash",
116 .id = 0,
117 .dev = {
118 .platform_data = >wx5715_flash_data,
119 },
120 .num_resources = 1,
121 .resource = >wx5715_flash_resource,
122};
123
124static struct platform_device *gtwx5715_devices[] __initdata = {
125 >wx5715_uart_device,
126 >wx5715_flash,
127};
128
129static void __init gtwx5715_init(void)
130{
131 ixp4xx_sys_init();
132
133 gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
134 gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;
135
136 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
137}
138
139
140MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
141
142 .phys_io = IXP4XX_UART2_BASE_PHYS,
143 .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc,
144 .map_io = ixp4xx_map_io,
145 .init_irq = ixp4xx_init_irq,
146 .timer = &ixp4xx_timer,
147 .boot_params = 0x0100,
148 .init_machine = gtwx5715_init,
149MACHINE_END
150
151
152