]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/arm/mach-ixp4xx/gtwx5715-setup.c
Merge master.kernel.org:/home/rmk/linux-2.6-serial
[mirror_ubuntu-bionic-kernel.git] / arch / arm / mach-ixp4xx / gtwx5715-setup.c
1 /*
2 * arch/arm/mach-ixp4xx/gtwx5715-setup.c
3 *
4 * Gemtek GTWX5715 (Linksys WRV54G) board settup
5 *
6 * Copyright (C) 2004 George T. Joseph
7 * Derived from Coyote
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
23 */
24
25 #include <linux/init.h>
26 #include <linux/device.h>
27 #include <linux/serial.h>
28 #include <linux/tty.h>
29 #include <linux/serial_8250.h>
30
31 #include <asm/types.h>
32 #include <asm/setup.h>
33 #include <asm/memory.h>
34 #include <asm/hardware.h>
35 #include <asm/irq.h>
36 #include <asm/mach-types.h>
37 #include <asm/mach/arch.h>
38 #include <asm/mach/flash.h>
39 #include <asm/arch/gtwx5715.h>
40
41 /*
42 * Xscale UART registers are 32 bits wide with only the least
43 * significant 8 bits having any meaning. From a configuration
44 * perspective, this means 2 things...
45 *
46 * Setting .regshift = 2 so that the standard 16550 registers
47 * line up on every 4th byte.
48 *
49 * Shifting the register start virtual address +3 bytes when
50 * compiled big-endian. Since register writes are done on a
51 * single byte basis, if the shift isn't done the driver will
52 * write the value into the most significant byte of the register,
53 * which is ignored, instead of the least significant.
54 */
55
56 #ifdef __ARMEB__
57 #define REG_OFFSET 3
58 #else
59 #define REG_OFFSET 0
60 #endif
61
62 /*
63 * Only the second or "console" uart is connected on the gtwx5715.
64 */
65
66 static struct resource gtwx5715_uart_resources[] = {
67 {
68 .start = IXP4XX_UART2_BASE_PHYS,
69 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
70 .flags = IORESOURCE_MEM,
71 },
72 {
73 .start = IRQ_IXP4XX_UART2,
74 .end = IRQ_IXP4XX_UART2,
75 .flags = IORESOURCE_IRQ,
76 },
77 { },
78 };
79
80
81 static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
82 {
83 .mapbase = IXP4XX_UART2_BASE_PHYS,
84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
85 .irq = IRQ_IXP4XX_UART2,
86 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
87 .iotype = UPIO_MEM,
88 .regshift = 2,
89 .uartclk = IXP4XX_UART_XTAL,
90 },
91 { },
92 };
93
94 static struct platform_device gtwx5715_uart_device = {
95 .name = "serial8250",
96 .id = PLAT8250_DEV_PLATFORM,
97 .dev = {
98 .platform_data = gtwx5715_uart_platform_data,
99 },
100 .num_resources = 2,
101 .resource = gtwx5715_uart_resources,
102 };
103
104 static struct flash_platform_data gtwx5715_flash_data = {
105 .map_name = "cfi_probe",
106 .width = 2,
107 };
108
109 static struct resource gtwx5715_flash_resource = {
110 .start = GTWX5715_FLASH_BASE,
111 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1,
112 .flags = IORESOURCE_MEM,
113 };
114
115 static struct platform_device gtwx5715_flash = {
116 .name = "IXP4XX-Flash",
117 .id = 0,
118 .dev = {
119 .platform_data = &gtwx5715_flash_data,
120 },
121 .num_resources = 1,
122 .resource = &gtwx5715_flash_resource,
123 };
124
125 static struct platform_device *gtwx5715_devices[] __initdata = {
126 &gtwx5715_uart_device,
127 &gtwx5715_flash,
128 };
129
130 static void __init gtwx5715_init(void)
131 {
132 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
133 }
134
135
136 MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
137 /* Maintainer: George Joseph */
138 .phys_ram = PHYS_OFFSET,
139 .phys_io = IXP4XX_UART2_BASE_PHYS,
140 .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc,
141 .map_io = ixp4xx_map_io,
142 .init_irq = ixp4xx_init_irq,
143 .timer = &ixp4xx_timer,
144 .boot_params = 0x0100,
145 .init_machine = gtwx5715_init,
146 MACHINE_END
147
148