Path: blob/master/arch/arm/mach-ixp4xx/gtwx5715-setup.c
10817 views
/*1* arch/arm/mach-ixp4xx/gtwx5715-setup.c2*3* Gemtek GTWX5715 (Linksys WRV54G) board setup4*5* Copyright (C) 2004 George T. Joseph6* Derived from Coyote7*8* This program is free software; you can redistribute it and/or9* modify it under the terms of the GNU General Public License10* as published by the Free Software Foundation; either version 211* of the License, or (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.21*22*/2324#include <linux/init.h>25#include <linux/device.h>26#include <linux/serial.h>27#include <linux/tty.h>28#include <linux/serial_8250.h>29#include <asm/types.h>30#include <asm/setup.h>31#include <asm/memory.h>32#include <mach/hardware.h>33#include <asm/irq.h>34#include <asm/mach-types.h>35#include <asm/mach/arch.h>36#include <asm/mach/flash.h>3738/* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch39and operate as an SPI type interface. The details of the interface40are available on Kendin/Micrel's web site. */4142#define GTWX5715_KSSPI_SELECT 543#define GTWX5715_KSSPI_TXD 644#define GTWX5715_KSSPI_CLOCK 745#define GTWX5715_KSSPI_RXD 124647/* The "reset" button is wired to GPIO 3.48The GPIO is brought "low" when the button is pushed. */4950#define GTWX5715_BUTTON_GPIO 35152/* Board Label Front Label53LED1 Power54LED2 Wireless-G55LED3 not populated but could be56LED4 Internet57LED5 - LED8 Controlled by KS8995M Switch58LED9 DMZ */5960#define GTWX5715_LED1_GPIO 261#define GTWX5715_LED2_GPIO 962#define GTWX5715_LED3_GPIO 863#define GTWX5715_LED4_GPIO 164#define GTWX5715_LED9_GPIO 46566/*67* Xscale UART registers are 32 bits wide with only the least68* significant 8 bits having any meaning. From a configuration69* perspective, this means 2 things...70*71* Setting .regshift = 2 so that the standard 16550 registers72* line up on every 4th byte.73*74* Shifting the register start virtual address +3 bytes when75* compiled big-endian. Since register writes are done on a76* single byte basis, if the shift isn't done the driver will77* write the value into the most significant byte of the register,78* which is ignored, instead of the least significant.79*/8081#ifdef __ARMEB__82#define REG_OFFSET 383#else84#define REG_OFFSET 085#endif8687/*88* Only the second or "console" uart is connected on the gtwx5715.89*/9091static struct resource gtwx5715_uart_resources[] = {92{93.start = IXP4XX_UART2_BASE_PHYS,94.end = IXP4XX_UART2_BASE_PHYS + 0x0fff,95.flags = IORESOURCE_MEM,96},97{98.start = IRQ_IXP4XX_UART2,99.end = IRQ_IXP4XX_UART2,100.flags = IORESOURCE_IRQ,101},102{ },103};104105106static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {107{108.mapbase = IXP4XX_UART2_BASE_PHYS,109.membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,110.irq = IRQ_IXP4XX_UART2,111.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,112.iotype = UPIO_MEM,113.regshift = 2,114.uartclk = IXP4XX_UART_XTAL,115},116{ },117};118119static struct platform_device gtwx5715_uart_device = {120.name = "serial8250",121.id = PLAT8250_DEV_PLATFORM,122.dev = {123.platform_data = gtwx5715_uart_platform_data,124},125.num_resources = 2,126.resource = gtwx5715_uart_resources,127};128129static struct flash_platform_data gtwx5715_flash_data = {130.map_name = "cfi_probe",131.width = 2,132};133134static struct resource gtwx5715_flash_resource = {135.flags = IORESOURCE_MEM,136};137138static struct platform_device gtwx5715_flash = {139.name = "IXP4XX-Flash",140.id = 0,141.dev = {142.platform_data = >wx5715_flash_data,143},144.num_resources = 1,145.resource = >wx5715_flash_resource,146};147148static struct platform_device *gtwx5715_devices[] __initdata = {149>wx5715_uart_device,150>wx5715_flash,151};152153static void __init gtwx5715_init(void)154{155ixp4xx_sys_init();156157gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);158gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;159160platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));161}162163164MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")165/* Maintainer: George Joseph */166.map_io = ixp4xx_map_io,167.init_irq = ixp4xx_init_irq,168.timer = &ixp4xx_timer,169.boot_params = 0x0100,170.init_machine = gtwx5715_init,171MACHINE_END172173174175176