blob: 7e40fe70933bcf4190117aa29a8cbb6b9dbe138d [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * arch/arm/mach-ixp4xx/coyote-setup.c
4 *
5 * Board setup for ADI Engineering and IXDGP425 boards
6 *
7 * Copyright (C) 2003-2005 MontaVista Software, Inc.
8 *
9 * Author: Deepak Saxena <dsaxena@plexity.net>
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/device.h>
15#include <linux/serial.h>
16#include <linux/tty.h>
17#include <linux/serial_8250.h>
18
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. */
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100113 .map_io = ixp4xx_map_io,
Rob Herringf4495882012-03-06 15:01:53 -0600114 .init_early = ixp4xx_init_early,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100115 .init_irq = ixp4xx_init_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700116 .init_time = ixp4xx_timer_init,
Nicolas Pitree022c722011-07-05 22:38:13 -0400117 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100118 .init_machine = coyote_init,
Nicolas Pitre7553ee72011-07-05 22:28:09 -0400119#if defined(CONFIG_PCI)
120 .dma_zone_size = SZ_64M,
121#endif
Russell Kingd1b860f2011-11-05 12:10:55 +0000122 .restart = ixp4xx_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123MACHINE_END
124#endif
125
126/*
127 * IXDPG425 is identical to Coyote except for which serial port
128 * is connected.
129 */
130#ifdef CONFIG_MACH_IXDPG425
131MACHINE_START(IXDPG425, "Intel IXDPG425")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100132 /* Maintainer: MontaVista Software, Inc. */
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100133 .map_io = ixp4xx_map_io,
Rob Herringf4495882012-03-06 15:01:53 -0600134 .init_early = ixp4xx_init_early,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100135 .init_irq = ixp4xx_init_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700136 .init_time = ixp4xx_timer_init,
Nicolas Pitree022c722011-07-05 22:38:13 -0400137 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100138 .init_machine = coyote_init,
Russell Kingd1b860f2011-11-05 12:10:55 +0000139 .restart = ixp4xx_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140MACHINE_END
141#endif
142