diff options
Diffstat (limited to 'arch/arm/mach-ixp2000/ixdp2x01.c')
-rw-r--r-- | arch/arm/mach-ixp2000/ixdp2x01.c | 98 |
1 files changed, 77 insertions, 21 deletions
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c index 150519fb38ec..66915282a463 100644 --- a/arch/arm/mach-ixp2000/ixdp2x01.c +++ b/arch/arm/mach-ixp2000/ixdp2x01.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/tty.h> | 30 | #include <linux/tty.h> |
31 | #include <linux/serial_core.h> | 31 | #include <linux/serial_core.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <linux/serial_8250.h> | ||
33 | 34 | ||
34 | #include <asm/io.h> | 35 | #include <asm/io.h> |
35 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
@@ -132,7 +133,7 @@ void __init ixdp2x01_init_irq(void) | |||
132 | 133 | ||
133 | 134 | ||
134 | /************************************************************************* | 135 | /************************************************************************* |
135 | * IXDP2x01 memory map and serial ports | 136 | * IXDP2x01 memory map |
136 | *************************************************************************/ | 137 | *************************************************************************/ |
137 | static struct map_desc ixdp2x01_io_desc __initdata = { | 138 | static struct map_desc ixdp2x01_io_desc __initdata = { |
138 | .virtual = IXDP2X01_VIRT_CPLD_BASE, | 139 | .virtual = IXDP2X01_VIRT_CPLD_BASE, |
@@ -141,40 +142,78 @@ static struct map_desc ixdp2x01_io_desc __initdata = { | |||
141 | .type = MT_DEVICE | 142 | .type = MT_DEVICE |
142 | }; | 143 | }; |
143 | 144 | ||
144 | static struct uart_port ixdp2x01_serial_ports[2] = { | 145 | static void __init ixdp2x01_map_io(void) |
146 | { | ||
147 | ixp2000_map_io(); | ||
148 | iotable_init(&ixdp2x01_io_desc, 1); | ||
149 | } | ||
150 | |||
151 | |||
152 | /************************************************************************* | ||
153 | * IXDP2x01 serial ports | ||
154 | *************************************************************************/ | ||
155 | static struct plat_serial8250_port ixdp2x01_serial_port1[] = { | ||
145 | { | 156 | { |
146 | .membase = (char *)(IXDP2X01_UART1_VIRT_BASE), | ||
147 | .mapbase = (unsigned long)IXDP2X01_UART1_PHYS_BASE, | 157 | .mapbase = (unsigned long)IXDP2X01_UART1_PHYS_BASE, |
158 | .membase = (char *)IXDP2X01_UART1_VIRT_BASE, | ||
148 | .irq = IRQ_IXDP2X01_UART1, | 159 | .irq = IRQ_IXDP2X01_UART1, |
149 | .flags = UPF_SKIP_TEST, | 160 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
150 | .iotype = UPIO_MEM32, | 161 | .iotype = UPIO_MEM32, |
151 | .regshift = 2, | 162 | .regshift = 2, |
152 | .uartclk = IXDP2X01_UART_CLK, | 163 | .uartclk = IXDP2X01_UART_CLK, |
153 | .line = 1, | 164 | }, |
154 | .type = PORT_16550A, | 165 | { } |
155 | .fifosize = 16 | 166 | }; |
156 | }, { | 167 | |
157 | .membase = (char *)(IXDP2X01_UART2_VIRT_BASE), | 168 | static struct resource ixdp2x01_uart_resource1 = { |
169 | .start = IXDP2X01_UART1_PHYS_BASE, | ||
170 | .end = IXDP2X01_UART1_PHYS_BASE + 0xffff, | ||
171 | .flags = IORESOURCE_MEM, | ||
172 | }; | ||
173 | |||
174 | static struct platform_device ixdp2x01_serial_device1 = { | ||
175 | .name = "serial8250", | ||
176 | .id = PLAT8250_DEV_PLATFORM1, | ||
177 | .dev = { | ||
178 | .platform_data = ixdp2x01_serial_port1, | ||
179 | }, | ||
180 | .num_resources = 1, | ||
181 | .resource = &ixdp2x01_uart_resource1, | ||
182 | }; | ||
183 | |||
184 | static struct plat_serial8250_port ixdp2x01_serial_port2[] = { | ||
185 | { | ||
158 | .mapbase = (unsigned long)IXDP2X01_UART2_PHYS_BASE, | 186 | .mapbase = (unsigned long)IXDP2X01_UART2_PHYS_BASE, |
187 | .membase = (char *)IXDP2X01_UART2_VIRT_BASE, | ||
159 | .irq = IRQ_IXDP2X01_UART2, | 188 | .irq = IRQ_IXDP2X01_UART2, |
160 | .flags = UPF_SKIP_TEST, | 189 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
161 | .iotype = UPIO_MEM32, | 190 | .iotype = UPIO_MEM32, |
162 | .regshift = 2, | 191 | .regshift = 2, |
163 | .uartclk = IXDP2X01_UART_CLK, | 192 | .uartclk = IXDP2X01_UART_CLK, |
164 | .line = 2, | ||
165 | .type = PORT_16550A, | ||
166 | .fifosize = 16 | ||
167 | }, | 193 | }, |
194 | { } | ||
168 | }; | 195 | }; |
169 | 196 | ||
170 | static void __init ixdp2x01_map_io(void) | 197 | static struct resource ixdp2x01_uart_resource2 = { |
171 | { | 198 | .start = IXDP2X01_UART2_PHYS_BASE, |
172 | ixp2000_map_io(); | 199 | .end = IXDP2X01_UART2_PHYS_BASE + 0xffff, |
200 | .flags = IORESOURCE_MEM, | ||
201 | }; | ||
173 | 202 | ||
174 | iotable_init(&ixdp2x01_io_desc, 1); | 203 | static struct platform_device ixdp2x01_serial_device2 = { |
204 | .name = "serial8250", | ||
205 | .id = PLAT8250_DEV_PLATFORM2, | ||
206 | .dev = { | ||
207 | .platform_data = ixdp2x01_serial_port2, | ||
208 | }, | ||
209 | .num_resources = 1, | ||
210 | .resource = &ixdp2x01_uart_resource2, | ||
211 | }; | ||
175 | 212 | ||
176 | early_serial_setup(&ixdp2x01_serial_ports[0]); | 213 | static void ixdp2x01_uart_init(void) |
177 | early_serial_setup(&ixdp2x01_serial_ports[1]); | 214 | { |
215 | platform_device_register(&ixdp2x01_serial_device1); | ||
216 | platform_device_register(&ixdp2x01_serial_device2); | ||
178 | } | 217 | } |
179 | 218 | ||
180 | 219 | ||
@@ -284,7 +323,7 @@ static int ixdp2x01_pci_setup(int nr, struct pci_sys_data *sys) | |||
284 | { | 323 | { |
285 | sys->mem_offset = 0xe0000000; | 324 | sys->mem_offset = 0xe0000000; |
286 | 325 | ||
287 | if (machine_is_ixdp2801()) | 326 | if (machine_is_ixdp2801() || machine_is_ixdp28x5()) |
288 | sys->mem_offset -= ((*IXP2000_PCI_ADDR_EXT & 0xE000) << 16); | 327 | sys->mem_offset -= ((*IXP2000_PCI_ADDR_EXT & 0xE000) << 16); |
289 | 328 | ||
290 | return ixp2000_pci_setup(nr, sys); | 329 | return ixp2000_pci_setup(nr, sys); |
@@ -300,7 +339,8 @@ struct hw_pci ixdp2x01_pci __initdata = { | |||
300 | 339 | ||
301 | int __init ixdp2x01_pci_init(void) | 340 | int __init ixdp2x01_pci_init(void) |
302 | { | 341 | { |
303 | if (machine_is_ixdp2401() || machine_is_ixdp2801()) | 342 | if (machine_is_ixdp2401() || machine_is_ixdp2801() ||\ |
343 | machine_is_ixdp28x5()) | ||
304 | pci_common_init(&ixdp2x01_pci); | 344 | pci_common_init(&ixdp2x01_pci); |
305 | 345 | ||
306 | return 0; | 346 | return 0; |
@@ -373,6 +413,7 @@ static void __init ixdp2x01_init_machine(void) | |||
373 | 413 | ||
374 | platform_add_devices(ixdp2x01_devices, ARRAY_SIZE(ixdp2x01_devices)); | 414 | platform_add_devices(ixdp2x01_devices, ARRAY_SIZE(ixdp2x01_devices)); |
375 | ixp2000_uart_init(); | 415 | ixp2000_uart_init(); |
416 | ixdp2x01_uart_init(); | ||
376 | } | 417 | } |
377 | 418 | ||
378 | 419 | ||
@@ -400,6 +441,21 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform") | |||
400 | .timer = &ixdp2x01_timer, | 441 | .timer = &ixdp2x01_timer, |
401 | .init_machine = ixdp2x01_init_machine, | 442 | .init_machine = ixdp2x01_init_machine, |
402 | MACHINE_END | 443 | MACHINE_END |
444 | |||
445 | /* | ||
446 | * IXDP28x5 is basically an IXDP2801 with a different CPU but Intel | ||
447 | * changed the machine ID in the bootloader | ||
448 | */ | ||
449 | MACHINE_START(IXDP28X5, "Intel IXDP2805/2855 Development Platform") | ||
450 | /* Maintainer: MontaVista Software, Inc. */ | ||
451 | .phys_io = IXP2000_UART_PHYS_BASE, | ||
452 | .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc, | ||
453 | .boot_params = 0x00000100, | ||
454 | .map_io = ixdp2x01_map_io, | ||
455 | .init_irq = ixdp2x01_init_irq, | ||
456 | .timer = &ixdp2x01_timer, | ||
457 | .init_machine = ixdp2x01_init_machine, | ||
458 | MACHINE_END | ||
403 | #endif | 459 | #endif |
404 | 460 | ||
405 | 461 | ||