blob: 411ea999619055a7b0e73bd3678ecd9ad8806989 [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>
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
27void __init coyote_map_io(void)
28{
29 ixp4xx_map_io();
30}
31
32static struct flash_platform_data coyote_flash_data = {
33 .map_name = "cfi_probe",
34 .width = 2,
35};
36
37static struct resource coyote_flash_resource = {
38 .start = COYOTE_FLASH_BASE,
Deepak Saxena1c9cf6f2005-08-26 18:34:11 -070039 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 .flags = IORESOURCE_MEM,
41};
42
43static struct platform_device coyote_flash = {
44 .name = "IXP4XX-Flash",
45 .id = 0,
46 .dev = {
47 .platform_data = &coyote_flash_data,
48 },
49 .num_resources = 1,
50 .resource = &coyote_flash_resource,
51};
52
53static struct resource coyote_uart_resource = {
54 .start = IXP4XX_UART2_BASE_PHYS,
55 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
56 .flags = IORESOURCE_MEM,
57};
58
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010059static struct plat_serial8250_port coyote_uart_data[] = {
60 {
61 .mapbase = IXP4XX_UART2_BASE_PHYS,
62 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
63 .irq = IRQ_IXP4XX_UART2,
Deepak Saxena8c741ed2005-08-03 19:58:21 +010064 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010065 .iotype = UPIO_MEM,
66 .regshift = 2,
67 .uartclk = IXP4XX_UART_XTAL,
68 },
69 { },
Linus Torvalds1da177e2005-04-16 15:20:36 -070070};
71
72static struct platform_device coyote_uart = {
73 .name = "serial8250",
74 .id = 0,
75 .dev = {
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010076 .platform_data = coyote_uart_data,
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 },
78 .num_resources = 1,
79 .resource = &coyote_uart_resource,
80};
81
82static struct platform_device *coyote_devices[] __initdata = {
83 &coyote_flash,
84 &coyote_uart
85};
86
87static void __init coyote_init(void)
88{
89 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
90 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
91
92 if (machine_is_ixdpg425()) {
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010093 coyote_uart_data[0].membase =
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
Stefan Sorensenbcaafbe2005-07-06 23:06:04 +010095 coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
96 coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 }
98
99
100 ixp4xx_sys_init();
101 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
102}
103
104#ifdef CONFIG_ARCH_ADI_COYOTE
105MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100106 /* Maintainer: MontaVista Software, Inc. */
107 .phys_ram = PHYS_OFFSET,
108 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
109 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
110 .map_io = coyote_map_io,
111 .init_irq = ixp4xx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 .timer = &ixp4xx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100113 .boot_params = 0x0100,
114 .init_machine = coyote_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115MACHINE_END
116#endif
117
118/*
119 * IXDPG425 is identical to Coyote except for which serial port
120 * is connected.
121 */
122#ifdef CONFIG_MACH_IXDPG425
123MACHINE_START(IXDPG425, "Intel IXDPG425")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100124 /* Maintainer: MontaVista Software, Inc. */
125 .phys_ram = PHYS_OFFSET,
126 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
127 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
128 .map_io = coyote_map_io,
129 .init_irq = ixp4xx_init_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 .timer = &ixp4xx_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100131 .boot_params = 0x0100,
132 .init_machine = coyote_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133MACHINE_END
134#endif
135