Path: blob/master/arch/arm/mach-ixp4xx/wg302v2-setup.c
10817 views
/*1* arch/arm/mach-ixp4xx/wg302-setup.c2*3* Board setup for the Netgear WG302 v2 and WAG302 v24*5* Copyright (C) 2007 Imre Kaloz <[email protected]>6*7* based on coyote-setup.c:8* Copyright (C) 2003-2005 MontaVista Software, Inc.9*10* Author: Imre Kaloz <[email protected]>11*12*/1314#include <linux/kernel.h>15#include <linux/init.h>16#include <linux/device.h>17#include <linux/serial.h>18#include <linux/tty.h>19#include <linux/serial_8250.h>2021#include <asm/types.h>22#include <asm/setup.h>23#include <asm/memory.h>24#include <mach/hardware.h>25#include <asm/irq.h>26#include <asm/mach-types.h>27#include <asm/mach/arch.h>28#include <asm/mach/flash.h>2930static struct flash_platform_data wg302v2_flash_data = {31.map_name = "cfi_probe",32.width = 2,33};3435static struct resource wg302v2_flash_resource = {36.flags = IORESOURCE_MEM,37};3839static struct platform_device wg302v2_flash = {40.name = "IXP4XX-Flash",41.id = 0,42.dev = {43.platform_data = &wg302v2_flash_data,44},45.num_resources = 1,46.resource = &wg302v2_flash_resource,47};4849static struct resource wg302v2_uart_resource = {50.start = IXP4XX_UART2_BASE_PHYS,51.end = IXP4XX_UART2_BASE_PHYS + 0x0fff,52.flags = IORESOURCE_MEM,53};5455static struct plat_serial8250_port wg302v2_uart_data[] = {56{57.mapbase = IXP4XX_UART2_BASE_PHYS,58.membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,59.irq = IRQ_IXP4XX_UART2,60.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,61.iotype = UPIO_MEM,62.regshift = 2,63.uartclk = IXP4XX_UART_XTAL,64},65{ },66};6768static struct platform_device wg302v2_uart = {69.name = "serial8250",70.id = PLAT8250_DEV_PLATFORM,71.dev = {72.platform_data = wg302v2_uart_data,73},74.num_resources = 1,75.resource = &wg302v2_uart_resource,76};7778static struct platform_device *wg302v2_devices[] __initdata = {79&wg302v2_flash,80&wg302v2_uart,81};8283static void __init wg302v2_init(void)84{85ixp4xx_sys_init();8687wg302v2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);88wg302v2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;8990*IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;91*IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;9293platform_add_devices(wg302v2_devices, ARRAY_SIZE(wg302v2_devices));94}9596#ifdef CONFIG_MACH_WG302V297MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")98/* Maintainer: Imre Kaloz <[email protected]> */99.map_io = ixp4xx_map_io,100.init_irq = ixp4xx_init_irq,101.timer = &ixp4xx_timer,102.boot_params = 0x0100,103.init_machine = wg302v2_init,104MACHINE_END105#endif106107108