Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * arch/arm/mach-ixp4xx/coyote-setup.c | |
3 | * | |
4 | * Board setup for ADI Engineering and IXDGP425 boards | |
5 | * | |
6 | * Copyright (C) 2003-2005 MontaVista Software, Inc. | |
7 | * | |
8 | * Author: Deepak Saxena <dsaxena@plexity.net> | |
9 | */ | |
10 | ||
11 | #include <linux/kernel.h> | |
12 | #include <linux/init.h> | |
13 | #include <linux/device.h> | |
14 | #include <linux/serial.h> | |
15 | #include <linux/tty.h> | |
16 | #include <linux/serial_8250.h> | |
54e269ea | 17 | #include <linux/slab.h> |
1da177e4 LT |
18 | |
19 | #include <asm/types.h> | |
20 | #include <asm/setup.h> | |
21 | #include <asm/memory.h> | |
a09e64fb | 22 | #include <mach/hardware.h> |
1da177e4 LT |
23 | #include <asm/irq.h> |
24 | #include <asm/mach-types.h> | |
25 | #include <asm/mach/arch.h> | |
26 | #include <asm/mach/flash.h> | |
27 | ||
1da177e4 LT |
28 | static struct flash_platform_data coyote_flash_data = { |
29 | .map_name = "cfi_probe", | |
30 | .width = 2, | |
31 | }; | |
32 | ||
33 | static struct resource coyote_flash_resource = { | |
1da177e4 LT |
34 | .flags = IORESOURCE_MEM, |
35 | }; | |
36 | ||
37 | static struct platform_device coyote_flash = { | |
38 | .name = "IXP4XX-Flash", | |
39 | .id = 0, | |
40 | .dev = { | |
41 | .platform_data = &coyote_flash_data, | |
42 | }, | |
43 | .num_resources = 1, | |
44 | .resource = &coyote_flash_resource, | |
45 | }; | |
46 | ||
47 | static struct resource coyote_uart_resource = { | |
48 | .start = IXP4XX_UART2_BASE_PHYS, | |
49 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, | |
50 | .flags = IORESOURCE_MEM, | |
51 | }; | |
52 | ||
bcaafbe4 SS |
53 | static struct plat_serial8250_port coyote_uart_data[] = { |
54 | { | |
55 | .mapbase = IXP4XX_UART2_BASE_PHYS, | |
56 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | |
57 | .irq = IRQ_IXP4XX_UART2, | |
8c741ed7 | 58 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
bcaafbe4 SS |
59 | .iotype = UPIO_MEM, |
60 | .regshift = 2, | |
61 | .uartclk = IXP4XX_UART_XTAL, | |
62 | }, | |
63 | { }, | |
1da177e4 LT |
64 | }; |
65 | ||
66 | static struct platform_device coyote_uart = { | |
67 | .name = "serial8250", | |
6df29deb | 68 | .id = PLAT8250_DEV_PLATFORM, |
1da177e4 | 69 | .dev = { |
bcaafbe4 | 70 | .platform_data = coyote_uart_data, |
1da177e4 LT |
71 | }, |
72 | .num_resources = 1, | |
73 | .resource = &coyote_uart_resource, | |
74 | }; | |
75 | ||
76 | static struct platform_device *coyote_devices[] __initdata = { | |
77 | &coyote_flash, | |
78 | &coyote_uart | |
79 | }; | |
80 | ||
81 | static void __init coyote_init(void) | |
82 | { | |
54e269ea DS |
83 | ixp4xx_sys_init(); |
84 | ||
85 | coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); | |
86 | coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; | |
87 | ||
1da177e4 LT |
88 | *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; |
89 | *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; | |
90 | ||
91 | if (machine_is_ixdpg425()) { | |
bcaafbe4 | 92 | coyote_uart_data[0].membase = |
1da177e4 | 93 | (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET); |
bcaafbe4 SS |
94 | coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS; |
95 | coyote_uart_data[0].irq = IRQ_IXP4XX_UART1; | |
1da177e4 LT |
96 | } |
97 | ||
1da177e4 LT |
98 | platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices)); |
99 | } | |
100 | ||
101 | #ifdef CONFIG_ARCH_ADI_COYOTE | |
102 | MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") | |
e9dea0c6 | 103 | /* Maintainer: MontaVista Software, Inc. */ |
e9dea0c6 RK |
104 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
105 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, | |
e605ecd7 | 106 | .map_io = ixp4xx_map_io, |
e9dea0c6 | 107 | .init_irq = ixp4xx_init_irq, |
1da177e4 | 108 | .timer = &ixp4xx_timer, |
e9dea0c6 RK |
109 | .boot_params = 0x0100, |
110 | .init_machine = coyote_init, | |
1da177e4 LT |
111 | MACHINE_END |
112 | #endif | |
113 | ||
114 | /* | |
115 | * IXDPG425 is identical to Coyote except for which serial port | |
116 | * is connected. | |
117 | */ | |
118 | #ifdef CONFIG_MACH_IXDPG425 | |
119 | MACHINE_START(IXDPG425, "Intel IXDPG425") | |
e9dea0c6 | 120 | /* Maintainer: MontaVista Software, Inc. */ |
e9dea0c6 RK |
121 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
122 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, | |
e605ecd7 | 123 | .map_io = ixp4xx_map_io, |
e9dea0c6 | 124 | .init_irq = ixp4xx_init_irq, |
1da177e4 | 125 | .timer = &ixp4xx_timer, |
e9dea0c6 RK |
126 | .boot_params = 0x0100, |
127 | .init_machine = coyote_init, | |
1da177e4 LT |
128 | MACHINE_END |
129 | #endif | |
130 |