blob: 16a12994fb5378c8bc77a0b4b73d3e7da453bcee [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/arm/mach-ixp4xx/gtwx5715-setup.c
3 *
Simon Arlott6cbdc8c2007-05-11 20:40:30 +01004 * Gemtek GTWX5715 (Linksys WRV54G) board setup
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#include <asm/types.h>
31#include <asm/setup.h>
32#include <asm/memory.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010033#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034#include <asm/irq.h>
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/flash.h>
Krzysztof HaƂasaa8b7b342009-11-16 23:24:57 +010038
39/* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch
40 and operate as an SPI type interface. The details of the interface
41 are available on Kendin/Micrel's web site. */
42
43#define GTWX5715_KSSPI_SELECT 5
44#define GTWX5715_KSSPI_TXD 6
45#define GTWX5715_KSSPI_CLOCK 7
46#define GTWX5715_KSSPI_RXD 12
47
48/* The "reset" button is wired to GPIO 3.
49 The GPIO is brought "low" when the button is pushed. */
50
51#define GTWX5715_BUTTON_GPIO 3
52
53/* Board Label Front Label
54 LED1 Power
55 LED2 Wireless-G
56 LED3 not populated but could be
57 LED4 Internet
58 LED5 - LED8 Controlled by KS8995M Switch
59 LED9 DMZ */
60
61#define GTWX5715_LED1_GPIO 2
62#define GTWX5715_LED2_GPIO 9
63#define GTWX5715_LED3_GPIO 8
64#define GTWX5715_LED4_GPIO 1
65#define GTWX5715_LED9_GPIO 4
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
67/*
68 * Xscale UART registers are 32 bits wide with only the least
69 * significant 8 bits having any meaning. From a configuration
70 * perspective, this means 2 things...
71 *
72 * Setting .regshift = 2 so that the standard 16550 registers
73 * line up on every 4th byte.
74 *
75 * Shifting the register start virtual address +3 bytes when
76 * compiled big-endian. Since register writes are done on a
77 * single byte basis, if the shift isn't done the driver will
78 * write the value into the most significant byte of the register,
79 * which is ignored, instead of the least significant.
80 */
81
82#ifdef __ARMEB__
83#define REG_OFFSET 3
84#else
85#define REG_OFFSET 0
86#endif
87
88/*
89 * Only the second or "console" uart is connected on the gtwx5715.
90 */
91
92static struct resource gtwx5715_uart_resources[] = {
93 {
94 .start = IXP4XX_UART2_BASE_PHYS,
95 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
96 .flags = IORESOURCE_MEM,
97 },
98 {
99 .start = IRQ_IXP4XX_UART2,
100 .end = IRQ_IXP4XX_UART2,
101 .flags = IORESOURCE_IRQ,
102 },
103 { },
104};
105
106
107static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
108 {
109 .mapbase = IXP4XX_UART2_BASE_PHYS,
110 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
111 .irq = IRQ_IXP4XX_UART2,
Deepak Saxena8c741ed2005-08-03 19:58:21 +0100112 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 .iotype = UPIO_MEM,
114 .regshift = 2,
115 .uartclk = IXP4XX_UART_XTAL,
116 },
117 { },
118};
119
120static struct platform_device gtwx5715_uart_device = {
121 .name = "serial8250",
Russell King6df29de2005-09-08 16:04:41 +0100122 .id = PLAT8250_DEV_PLATFORM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 .dev = {
124 .platform_data = gtwx5715_uart_platform_data,
125 },
126 .num_resources = 2,
127 .resource = gtwx5715_uart_resources,
128};
129
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130static struct flash_platform_data gtwx5715_flash_data = {
131 .map_name = "cfi_probe",
132 .width = 2,
133};
134
Martin Michlmayr4c756f42006-08-06 09:59:26 +0100135static struct resource gtwx5715_flash_resource = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 .flags = IORESOURCE_MEM,
Martin Michlmayr4c756f42006-08-06 09:59:26 +0100137};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138
139static struct platform_device gtwx5715_flash = {
140 .name = "IXP4XX-Flash",
141 .id = 0,
142 .dev = {
143 .platform_data = &gtwx5715_flash_data,
144 },
145 .num_resources = 1,
146 .resource = &gtwx5715_flash_resource,
147};
148
149static struct platform_device *gtwx5715_devices[] __initdata = {
150 &gtwx5715_uart_device,
151 &gtwx5715_flash,
152};
153
154static void __init gtwx5715_init(void)
155{
Deepak Saxena54e269e2006-01-05 20:59:29 +0000156 ixp4xx_sys_init();
157
Deepak Saxena54e269e2006-01-05 20:59:29 +0000158 gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
159 gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;
160
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
162}
163
164
165MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100166 /* Maintainer: George Joseph */
Deepak Saxenae605ecd2005-08-29 22:46:29 +0100167 .map_io = ixp4xx_map_io,
Rob Herringf4495882012-03-06 15:01:53 -0600168 .init_early = ixp4xx_init_early,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100169 .init_irq = ixp4xx_init_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700170 .init_time = ixp4xx_timer_init,
Nicolas Pitree022c722011-07-05 22:38:13 -0400171 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100172 .init_machine = gtwx5715_init,
Nicolas Pitre7553ee72011-07-05 22:28:09 -0400173#if defined(CONFIG_PCI)
174 .dma_zone_size = SZ_64M,
175#endif
Russell Kingd1b860f2011-11-05 12:10:55 +0000176 .restart = ixp4xx_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177MACHINE_END
178
179