]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - arch/arm/mach-ixp4xx/coyote-setup.c
Merge tag 'powerpc-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[mirror_ubuntu-hirsute-kernel.git] / arch / arm / mach-ixp4xx / coyote-setup.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
1da177e4
LT
2/*
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>
a09e64fb 22#include <mach/hardware.h>
1da177e4
LT
23#include <asm/irq.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/mach/flash.h>
27
dc8ef8cd
LW
28#include "irqs.h"
29
f89f4490
KH
30#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
31#define COYOTE_IDE_BASE_VIRT 0xFFFE1000
32#define COYOTE_IDE_REGION_SIZE 0x1000
33
34#define COYOTE_IDE_DATA_PORT 0xFFFE10E0
35#define COYOTE_IDE_CTRL_PORT 0xFFFE10FC
36#define COYOTE_IDE_ERROR_PORT 0xFFFE10E2
37#define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5
38
1da177e4
LT
39static struct flash_platform_data coyote_flash_data = {
40 .map_name = "cfi_probe",
41 .width = 2,
42};
43
44static struct resource coyote_flash_resource = {
1da177e4
LT
45 .flags = IORESOURCE_MEM,
46};
47
48static struct platform_device coyote_flash = {
49 .name = "IXP4XX-Flash",
50 .id = 0,
51 .dev = {
52 .platform_data = &coyote_flash_data,
53 },
54 .num_resources = 1,
55 .resource = &coyote_flash_resource,
56};
57
58static struct resource coyote_uart_resource = {
59 .start = IXP4XX_UART2_BASE_PHYS,
60 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
61 .flags = IORESOURCE_MEM,
62};
63
bcaafbe4
SS
64static struct plat_serial8250_port coyote_uart_data[] = {
65 {
66 .mapbase = IXP4XX_UART2_BASE_PHYS,
67 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
68 .irq = IRQ_IXP4XX_UART2,
8c741ed7 69 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
bcaafbe4
SS
70 .iotype = UPIO_MEM,
71 .regshift = 2,
72 .uartclk = IXP4XX_UART_XTAL,
73 },
74 { },
1da177e4
LT
75};
76
77static struct platform_device coyote_uart = {
78 .name = "serial8250",
6df29deb 79 .id = PLAT8250_DEV_PLATFORM,
1da177e4 80 .dev = {
bcaafbe4 81 .platform_data = coyote_uart_data,
1da177e4
LT
82 },
83 .num_resources = 1,
84 .resource = &coyote_uart_resource,
85};
86
87static struct platform_device *coyote_devices[] __initdata = {
88 &coyote_flash,
89 &coyote_uart
90};
91
92static void __init coyote_init(void)
93{
54e269ea
DS
94 ixp4xx_sys_init();
95
96 coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
97 coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
98
1da177e4
LT
99 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
100 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
101
102 if (machine_is_ixdpg425()) {
bcaafbe4 103 coyote_uart_data[0].membase =
1da177e4 104 (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET);
bcaafbe4
SS
105 coyote_uart_data[0].mapbase = IXP4XX_UART1_BASE_PHYS;
106 coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
1da177e4
LT
107 }
108
1da177e4
LT
109 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
110}
111
112#ifdef CONFIG_ARCH_ADI_COYOTE
113MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
e9dea0c6 114 /* Maintainer: MontaVista Software, Inc. */
e605ecd7 115 .map_io = ixp4xx_map_io,
f449588c 116 .init_early = ixp4xx_init_early,
e9dea0c6 117 .init_irq = ixp4xx_init_irq,
6bb27d73 118 .init_time = ixp4xx_timer_init,
e022c729 119 .atag_offset = 0x100,
e9dea0c6 120 .init_machine = coyote_init,
7553ee77
NP
121#if defined(CONFIG_PCI)
122 .dma_zone_size = SZ_64M,
123#endif
d1b860fb 124 .restart = ixp4xx_restart,
1da177e4
LT
125MACHINE_END
126#endif
127
128/*
129 * IXDPG425 is identical to Coyote except for which serial port
130 * is connected.
131 */
132#ifdef CONFIG_MACH_IXDPG425
133MACHINE_START(IXDPG425, "Intel IXDPG425")
e9dea0c6 134 /* Maintainer: MontaVista Software, Inc. */
e605ecd7 135 .map_io = ixp4xx_map_io,
f449588c 136 .init_early = ixp4xx_init_early,
e9dea0c6 137 .init_irq = ixp4xx_init_irq,
6bb27d73 138 .init_time = ixp4xx_timer_init,
e022c729 139 .atag_offset = 0x100,
e9dea0c6 140 .init_machine = coyote_init,
d1b860fb 141 .restart = ixp4xx_restart,
1da177e4
LT
142MACHINE_END
143#endif
144