Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-ixp4xx/ixdp425-setup.c |
| 3 | * |
| 4 | * IXDP425/IXCDP1100 board-setup |
| 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> |
Deepak Saxena | 54e269e | 2006-01-05 20:59:29 +0000 | [diff] [blame^] | 17 | #include <linux/slab.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
| 19 | #include <asm/types.h> |
| 20 | #include <asm/setup.h> |
| 21 | #include <asm/memory.h> |
| 22 | #include <asm/hardware.h> |
| 23 | #include <asm/mach-types.h> |
| 24 | #include <asm/irq.h> |
| 25 | #include <asm/mach/arch.h> |
| 26 | #include <asm/mach/flash.h> |
| 27 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | static struct flash_platform_data ixdp425_flash_data = { |
| 29 | .map_name = "cfi_probe", |
| 30 | .width = 2, |
| 31 | }; |
| 32 | |
| 33 | static struct resource ixdp425_flash_resource = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | .flags = IORESOURCE_MEM, |
| 35 | }; |
| 36 | |
| 37 | static struct platform_device ixdp425_flash = { |
| 38 | .name = "IXP4XX-Flash", |
| 39 | .id = 0, |
| 40 | .dev = { |
| 41 | .platform_data = &ixdp425_flash_data, |
| 42 | }, |
| 43 | .num_resources = 1, |
| 44 | .resource = &ixdp425_flash_resource, |
| 45 | }; |
| 46 | |
| 47 | static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = { |
| 48 | .sda_pin = IXDP425_SDA_PIN, |
| 49 | .scl_pin = IXDP425_SCL_PIN, |
| 50 | }; |
| 51 | |
| 52 | static struct platform_device ixdp425_i2c_controller = { |
| 53 | .name = "IXP4XX-I2C", |
| 54 | .id = 0, |
| 55 | .dev = { |
| 56 | .platform_data = &ixdp425_i2c_gpio_pins, |
| 57 | }, |
| 58 | .num_resources = 0 |
| 59 | }; |
| 60 | |
| 61 | static struct resource ixdp425_uart_resources[] = { |
| 62 | { |
| 63 | .start = IXP4XX_UART1_BASE_PHYS, |
| 64 | .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, |
| 65 | .flags = IORESOURCE_MEM |
| 66 | }, |
| 67 | { |
| 68 | .start = IXP4XX_UART2_BASE_PHYS, |
| 69 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, |
| 70 | .flags = IORESOURCE_MEM |
| 71 | } |
| 72 | }; |
| 73 | |
| 74 | static struct plat_serial8250_port ixdp425_uart_data[] = { |
| 75 | { |
| 76 | .mapbase = IXP4XX_UART1_BASE_PHYS, |
| 77 | .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, |
| 78 | .irq = IRQ_IXP4XX_UART1, |
Deepak Saxena | 8c741ed | 2005-08-03 19:58:21 +0100 | [diff] [blame] | 79 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | .iotype = UPIO_MEM, |
| 81 | .regshift = 2, |
| 82 | .uartclk = IXP4XX_UART_XTAL, |
| 83 | }, |
| 84 | { |
| 85 | .mapbase = IXP4XX_UART2_BASE_PHYS, |
| 86 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, |
Jeff Hansen | a35d6c9 | 2005-12-01 15:50:35 +0000 | [diff] [blame] | 87 | .irq = IRQ_IXP4XX_UART2, |
Deepak Saxena | 8c741ed | 2005-08-03 19:58:21 +0100 | [diff] [blame] | 88 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | .iotype = UPIO_MEM, |
| 90 | .regshift = 2, |
| 91 | .uartclk = IXP4XX_UART_XTAL, |
Stefan Sorensen | bcaafbe | 2005-07-06 23:06:04 +0100 | [diff] [blame] | 92 | }, |
| 93 | { }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | static struct platform_device ixdp425_uart = { |
| 97 | .name = "serial8250", |
Russell King | 6df29de | 2005-09-08 16:04:41 +0100 | [diff] [blame] | 98 | .id = PLAT8250_DEV_PLATFORM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | .dev.platform_data = ixdp425_uart_data, |
| 100 | .num_resources = 2, |
| 101 | .resource = ixdp425_uart_resources |
| 102 | }; |
| 103 | |
| 104 | static struct platform_device *ixdp425_devices[] __initdata = { |
| 105 | &ixdp425_i2c_controller, |
| 106 | &ixdp425_flash, |
| 107 | &ixdp425_uart |
| 108 | }; |
| 109 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | static void __init ixdp425_init(void) |
| 111 | { |
| 112 | ixp4xx_sys_init(); |
| 113 | |
Deepak Saxena | 54e269e | 2006-01-05 20:59:29 +0000 | [diff] [blame^] | 114 | ixdp425_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); |
| 115 | ixdp425_flash_resource.end = |
| 116 | IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | |
| 118 | platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); |
| 119 | } |
| 120 | |
Deepak Saxena | b38708f | 2005-09-28 18:07:01 -0700 | [diff] [blame] | 121 | #ifdef CONFIG_ARCH_IXDP425 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 123 | /* Maintainer: MontaVista Software, Inc. */ |
| 124 | .phys_ram = PHYS_OFFSET, |
| 125 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
| 126 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, |
Deepak Saxena | e605ecd | 2005-08-29 22:46:29 +0100 | [diff] [blame] | 127 | .map_io = ixp4xx_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 128 | .init_irq = ixp4xx_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | .timer = &ixp4xx_timer, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 130 | .boot_params = 0x0100, |
| 131 | .init_machine = ixdp425_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | MACHINE_END |
Deepak Saxena | e0a2008 | 2005-09-18 21:11:56 +0100 | [diff] [blame] | 133 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | |
Deepak Saxena | e0a2008 | 2005-09-18 21:11:56 +0100 | [diff] [blame] | 135 | #ifdef CONFIG_MACH_IXDP465 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 137 | /* Maintainer: MontaVista Software, Inc. */ |
| 138 | .phys_ram = PHYS_OFFSET, |
| 139 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
| 140 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, |
Deepak Saxena | e605ecd | 2005-08-29 22:46:29 +0100 | [diff] [blame] | 141 | .map_io = ixp4xx_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 142 | .init_irq = ixp4xx_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | .timer = &ixp4xx_timer, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 144 | .boot_params = 0x0100, |
| 145 | .init_machine = ixdp425_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | MACHINE_END |
Deepak Saxena | e0a2008 | 2005-09-18 21:11:56 +0100 | [diff] [blame] | 147 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | |
Deepak Saxena | e0a2008 | 2005-09-18 21:11:56 +0100 | [diff] [blame] | 149 | #ifdef CONFIG_ARCH_PRPMC1100 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 151 | /* Maintainer: MontaVista Software, Inc. */ |
| 152 | .phys_ram = PHYS_OFFSET, |
| 153 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
| 154 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, |
Deepak Saxena | e605ecd | 2005-08-29 22:46:29 +0100 | [diff] [blame] | 155 | .map_io = ixp4xx_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 156 | .init_irq = ixp4xx_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | .timer = &ixp4xx_timer, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 158 | .boot_params = 0x0100, |
| 159 | .init_machine = ixdp425_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | MACHINE_END |
Deepak Saxena | e0a2008 | 2005-09-18 21:11:56 +0100 | [diff] [blame] | 161 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | |
| 163 | /* |
| 164 | * Avila is functionally equivalent to IXDP425 except that it adds |
| 165 | * a CF IDE slot hanging off the expansion bus. When we have a |
| 166 | * driver for IXP4xx CF IDE with driver model support we'll move |
| 167 | * Avila to it's own setup file. |
| 168 | */ |
| 169 | #ifdef CONFIG_ARCH_AVILA |
| 170 | MACHINE_START(AVILA, "Gateworks Avila Network Platform") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 171 | /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */ |
| 172 | .phys_ram = PHYS_OFFSET, |
| 173 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
| 174 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, |
Deepak Saxena | e605ecd | 2005-08-29 22:46:29 +0100 | [diff] [blame] | 175 | .map_io = ixp4xx_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 176 | .init_irq = ixp4xx_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | .timer = &ixp4xx_timer, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 178 | .boot_params = 0x0100, |
| 179 | .init_machine = ixdp425_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | MACHINE_END |
| 181 | #endif |
| 182 | |