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