blob: 31a47f6a8939d8fc1bc0ce7c0e78db0495e5b5df [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>
17
18#include <asm/types.h>
19#include <asm/setup.h>
20#include <asm/memory.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010021#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <asm/irq.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/flash.h>
26
Krzysztof HaƂasaf89f4492009-11-16 15:57:41 +010027#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
28#define COYOTE_IDE_BASE_VIRT 0xFFFE1000
29#define COYOTE_IDE_REGION_SIZE 0x1000
30
31#define COYOTE_IDE_DATA_PORT 0xFFFE10E0
32#define COYOTE_IDE_CTRL_PORT 0xFFFE10FC
33#define COYOTE_IDE_ERROR_PORT 0xFFFE10E2
34#define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036static struct flash_platform_data coyote_flash_data = {
37 .map_name = "cfi_probe",
38 .width = 2,
39};
40
41static struct resource coyote_flash_resource = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 .flags = IORESOURCE_MEM,
43};
44
45static struct platform_device coyote_flash = {
46 .name = "IXP4XX-Flash",
47 .id = 0,
48 .dev = {
49 .platform_data = &coyote_flash_data,
50 },
51 .num_resources = 1,
52 .resource = &coyote_flash_resource,
53};
54
55static struct resource coyote_uart_resource = {
56 .start = IXP4XX_UART2_BASE_PHYS,
57 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
58 .flags = IORESOURCE_MEM,
59};
60
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010061static struct plat_serial8250_port coyote_uart_data[] = {
62 {
63 .mapbase = IXP4XX_UART2_BASE_PHYS,
64 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
65 .irq = IRQ_IXP4XX_UART2,
Deepak Saxena8c741ed2005-08-03 19:58:21 +010066 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010067 .iotype = UPIO_MEM,
68 .regshift = 2,
69 .uartclk = IXP4XX_UART_XTAL,
70 },
71 { },
Linus Torvalds1da177e2005-04-16 15:20:36 -070072};
73
74static struct platform_device coyote_uart = {
75 .name = "serial8250",
Russell King6df29de2005-09-08 16:04:41 +010076 .id = PLAT8250_DEV_PLATFORM,
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 .dev = {
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010078 .platform_data = coyote_uart_data,
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 },
80 .num_resources = 1,
81 .resource = &coyote_uart_resource,
82};
83
84static struct platform_device *coyote_devices[] __initdata = {
85 &coyote_flash,
86 &coyote_uart
87};
88
89static void __init coyote_init(void)
90{
Deepak Saxena54e269e2006-01-05 20:59:29 +000091 ixp4xx_sys_init();
92
93 coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
94 coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
95
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
97 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
98
99 if (machine_is_ixdpg425()) {
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +0100100 coyote_uart_data[0].membase =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +0100102 coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
103 coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 }
105
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
107}
108
109#ifdef CONFIG_ARCH_ADI_COYOTE
110MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100111 /* Maintainer: MontaVista Software, Inc. */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100112 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
113 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100114 .map_io = ixp4xx_map_io,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100115 .init_irq = ixp4xx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 .timer = &ixp4xx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100117 .boot_params = 0x0100,
118 .init_machine = coyote_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119MACHINE_END
120#endif
121
122/*
123 * IXDPG425 is identical to Coyote except for which serial port
124 * is connected.
125 */
126#ifdef CONFIG_MACH_IXDPG425
127MACHINE_START(IXDPG425, "Intel IXDPG425")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100128 /* Maintainer: MontaVista Software, Inc. */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100129 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
130 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100131 .map_io = ixp4xx_map_io,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100132 .init_irq = ixp4xx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 .timer = &ixp4xx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100134 .boot_params = 0x0100,
135 .init_machine = coyote_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136MACHINE_END
137#endif
138