Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
| 17 | |
| 18 | #include <asm/types.h> |
| 19 | #include <asm/setup.h> |
| 20 | #include <asm/memory.h> |
| 21 | #include <asm/hardware.h> |
| 22 | #include <asm/irq.h> |
| 23 | #include <asm/mach-types.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 coyote_flash_data = { |
| 28 | .map_name = "cfi_probe", |
| 29 | .width = 2, |
| 30 | }; |
| 31 | |
| 32 | static struct resource coyote_flash_resource = { |
| 33 | .start = COYOTE_FLASH_BASE, |
Deepak Saxena | 1c9cf6f | 2005-08-26 18:34:11 -0700 | [diff] [blame] | 34 | .end = COYOTE_FLASH_BASE + COYOTE_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 coyote_flash = { |
| 39 | .name = "IXP4XX-Flash", |
| 40 | .id = 0, |
| 41 | .dev = { |
| 42 | .platform_data = &coyote_flash_data, |
| 43 | }, |
| 44 | .num_resources = 1, |
| 45 | .resource = &coyote_flash_resource, |
| 46 | }; |
| 47 | |
| 48 | static struct resource coyote_uart_resource = { |
| 49 | .start = IXP4XX_UART2_BASE_PHYS, |
| 50 | .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, |
| 51 | .flags = IORESOURCE_MEM, |
| 52 | }; |
| 53 | |
Stefan Sorensen | bcaafbe | 2005-07-06 23:06:04 +0100 | [diff] [blame] | 54 | static struct plat_serial8250_port coyote_uart_data[] = { |
| 55 | { |
| 56 | .mapbase = IXP4XX_UART2_BASE_PHYS, |
| 57 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, |
| 58 | .irq = IRQ_IXP4XX_UART2, |
Deepak Saxena | 8c741ed | 2005-08-03 19:58:21 +0100 | [diff] [blame] | 59 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
Stefan Sorensen | bcaafbe | 2005-07-06 23:06:04 +0100 | [diff] [blame] | 60 | .iotype = UPIO_MEM, |
| 61 | .regshift = 2, |
| 62 | .uartclk = IXP4XX_UART_XTAL, |
| 63 | }, |
| 64 | { }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | static struct platform_device coyote_uart = { |
| 68 | .name = "serial8250", |
| 69 | .id = 0, |
| 70 | .dev = { |
Stefan Sorensen | bcaafbe | 2005-07-06 23:06:04 +0100 | [diff] [blame] | 71 | .platform_data = coyote_uart_data, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | }, |
| 73 | .num_resources = 1, |
| 74 | .resource = &coyote_uart_resource, |
| 75 | }; |
| 76 | |
| 77 | static struct platform_device *coyote_devices[] __initdata = { |
| 78 | &coyote_flash, |
| 79 | &coyote_uart |
| 80 | }; |
| 81 | |
| 82 | static void __init coyote_init(void) |
| 83 | { |
| 84 | *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; |
| 85 | *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; |
| 86 | |
| 87 | if (machine_is_ixdpg425()) { |
Stefan Sorensen | bcaafbe | 2005-07-06 23:06:04 +0100 | [diff] [blame] | 88 | coyote_uart_data[0].membase = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET); |
Stefan Sorensen | bcaafbe | 2005-07-06 23:06:04 +0100 | [diff] [blame] | 90 | coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS; |
| 91 | coyote_uart_data[0].irq = IRQ_IXP4XX_UART1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | |
| 95 | ixp4xx_sys_init(); |
| 96 | platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices)); |
| 97 | } |
| 98 | |
| 99 | #ifdef CONFIG_ARCH_ADI_COYOTE |
| 100 | MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 101 | /* Maintainer: MontaVista Software, Inc. */ |
| 102 | .phys_ram = PHYS_OFFSET, |
| 103 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
| 104 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, |
Deepak Saxena | e605ecd | 2005-08-29 22:46:29 +0100 | [diff] [blame^] | 105 | .map_io = ixp4xx_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 106 | .init_irq = ixp4xx_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | .timer = &ixp4xx_timer, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 108 | .boot_params = 0x0100, |
| 109 | .init_machine = coyote_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | MACHINE_END |
| 111 | #endif |
| 112 | |
| 113 | /* |
| 114 | * IXDPG425 is identical to Coyote except for which serial port |
| 115 | * is connected. |
| 116 | */ |
| 117 | #ifdef CONFIG_MACH_IXDPG425 |
| 118 | MACHINE_START(IXDPG425, "Intel IXDPG425") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 119 | /* Maintainer: MontaVista Software, Inc. */ |
| 120 | .phys_ram = PHYS_OFFSET, |
| 121 | .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, |
| 122 | .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, |
Deepak Saxena | e605ecd | 2005-08-29 22:46:29 +0100 | [diff] [blame^] | 123 | .map_io = ixp4xx_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 124 | .init_irq = ixp4xx_init_irq, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | .timer = &ixp4xx_timer, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 126 | .boot_params = 0x0100, |
| 127 | .init_machine = coyote_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | MACHINE_END |
| 129 | #endif |
| 130 | |