blob: 25bf5ad770eaa14c6213e27579bd0b912691bd69 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Deepak Saxena54e269e2006-01-05 20:59:29 +000017#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19#include <asm/types.h>
20#include <asm/setup.h>
21#include <asm/memory.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010022#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include <asm/irq.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/flash.h>
27
Krzysztof HaƂasaf89f4492009-11-16 15:57:41 +010028#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
29#define COYOTE_IDE_BASE_VIRT 0xFFFE1000
30#define COYOTE_IDE_REGION_SIZE 0x1000
31
32#define COYOTE_IDE_DATA_PORT 0xFFFE10E0
33#define COYOTE_IDE_CTRL_PORT 0xFFFE10FC
34#define COYOTE_IDE_ERROR_PORT 0xFFFE10E2
35#define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037static struct flash_platform_data coyote_flash_data = {
38 .map_name = "cfi_probe",
39 .width = 2,
40};
41
42static struct resource coyote_flash_resource = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 .flags = IORESOURCE_MEM,
44};
45
46static struct platform_device coyote_flash = {
47 .name = "IXP4XX-Flash",
48 .id = 0,
49 .dev = {
50 .platform_data = &coyote_flash_data,
51 },
52 .num_resources = 1,
53 .resource = &coyote_flash_resource,
54};
55
56static struct resource coyote_uart_resource = {
57 .start = IXP4XX_UART2_BASE_PHYS,
58 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
59 .flags = IORESOURCE_MEM,
60};
61
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010062static struct plat_serial8250_port coyote_uart_data[] = {
63 {
64 .mapbase = IXP4XX_UART2_BASE_PHYS,
65 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
66 .irq = IRQ_IXP4XX_UART2,
Deepak Saxena8c741ed2005-08-03 19:58:21 +010067 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010068 .iotype = UPIO_MEM,
69 .regshift = 2,
70 .uartclk = IXP4XX_UART_XTAL,
71 },
72 { },
Linus Torvalds1da177e2005-04-16 15:20:36 -070073};
74
75static struct platform_device coyote_uart = {
76 .name = "serial8250",
Russell King6df29de2005-09-08 16:04:41 +010077 .id = PLAT8250_DEV_PLATFORM,
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 .dev = {
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010079 .platform_data = coyote_uart_data,
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 },
81 .num_resources = 1,
82 .resource = &coyote_uart_resource,
83};
84
85static struct platform_device *coyote_devices[] __initdata = {
86 &coyote_flash,
87 &coyote_uart
88};
89
90static void __init coyote_init(void)
91{
Deepak Saxena54e269e2006-01-05 20:59:29 +000092 ixp4xx_sys_init();
93
94 coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
95 coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
96
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
98 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
99
100 if (machine_is_ixdpg425()) {
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +0100101 coyote_uart_data[0].membase =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +0100103 coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
104 coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 }
106
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
108}
109
110#ifdef CONFIG_ARCH_ADI_COYOTE
111MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100112 /* Maintainer: MontaVista Software, Inc. */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100113 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
114 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100115 .map_io = ixp4xx_map_io,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100116 .init_irq = ixp4xx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 .timer = &ixp4xx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100118 .boot_params = 0x0100,
119 .init_machine = coyote_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120MACHINE_END
121#endif
122
123/*
124 * IXDPG425 is identical to Coyote except for which serial port
125 * is connected.
126 */
127#ifdef CONFIG_MACH_IXDPG425
128MACHINE_START(IXDPG425, "Intel IXDPG425")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100129 /* Maintainer: MontaVista Software, Inc. */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100130 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
131 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100132 .map_io = ixp4xx_map_io,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100133 .init_irq = ixp4xx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 .timer = &ixp4xx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100135 .boot_params = 0x0100,
136 .init_machine = coyote_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137MACHINE_END
138#endif
139