~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-ixp4xx/wg302v2-setup.c

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/arm/mach-ixp4xx/wg302-setup.c
  3  *
  4  * Board setup for the Netgear WG302 v2 and WAG302 v2
  5  *
  6  * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
  7  *
  8  * based on coyote-setup.c:
  9  *      Copyright (C) 2003-2005 MontaVista Software, Inc.
 10  *
 11  * Author: Imre Kaloz <kaloz@openwrt.org>
 12  *
 13  */
 14 
 15 #include <linux/kernel.h>
 16 #include <linux/init.h>
 17 #include <linux/device.h>
 18 #include <linux/serial.h>
 19 #include <linux/tty.h>
 20 #include <linux/serial_8250.h>
 21 
 22 #include <asm/types.h>
 23 #include <asm/setup.h>
 24 #include <asm/memory.h>
 25 #include <mach/hardware.h>
 26 #include <asm/irq.h>
 27 #include <asm/mach-types.h>
 28 #include <asm/mach/arch.h>
 29 #include <asm/mach/flash.h>
 30 
 31 static struct flash_platform_data wg302v2_flash_data = {
 32         .map_name       = "cfi_probe",
 33         .width          = 2,
 34 };
 35 
 36 static struct resource wg302v2_flash_resource = {
 37         .flags          = IORESOURCE_MEM,
 38 };
 39 
 40 static struct platform_device wg302v2_flash = {
 41         .name           = "IXP4XX-Flash",
 42         .id             = 0,
 43         .dev            = {
 44                 .platform_data = &wg302v2_flash_data,
 45         },
 46         .num_resources  = 1,
 47         .resource       = &wg302v2_flash_resource,
 48 };
 49 
 50 static struct resource wg302v2_uart_resource = {
 51         .start  = IXP4XX_UART2_BASE_PHYS,
 52         .end    = IXP4XX_UART2_BASE_PHYS + 0x0fff,
 53         .flags  = IORESOURCE_MEM,
 54 };
 55 
 56 static struct plat_serial8250_port wg302v2_uart_data[] = {
 57         {
 58                 .mapbase        = IXP4XX_UART2_BASE_PHYS,
 59                 .membase        = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
 60                 .irq            = IRQ_IXP4XX_UART2,
 61                 .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
 62                 .iotype         = UPIO_MEM,
 63                 .regshift       = 2,
 64                 .uartclk        = IXP4XX_UART_XTAL,
 65         },
 66         { },
 67 };
 68 
 69 static struct platform_device wg302v2_uart = {
 70         .name           = "serial8250",
 71         .id             = PLAT8250_DEV_PLATFORM,
 72         .dev                    = {
 73                 .platform_data  = wg302v2_uart_data,
 74         },
 75         .num_resources  = 1,
 76         .resource       = &wg302v2_uart_resource,
 77 };
 78 
 79 static struct platform_device *wg302v2_devices[] __initdata = {
 80         &wg302v2_flash,
 81         &wg302v2_uart,
 82 };
 83 
 84 static void __init wg302v2_init(void)
 85 {
 86         ixp4xx_sys_init();
 87 
 88         wg302v2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
 89         wg302v2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
 90 
 91         *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
 92         *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
 93 
 94         platform_add_devices(wg302v2_devices, ARRAY_SIZE(wg302v2_devices));
 95 }
 96 
 97 #ifdef CONFIG_MACH_WG302V2
 98 MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
 99         /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
100         .map_io         = ixp4xx_map_io,
101         .init_early     = ixp4xx_init_early,
102         .init_irq       = ixp4xx_init_irq,
103         .init_time      = ixp4xx_timer_init,
104         .atag_offset    = 0x100,
105         .init_machine   = wg302v2_init,
106 #if defined(CONFIG_PCI)
107         .dma_zone_size  = SZ_64M,
108 #endif
109         .restart        = ixp4xx_restart,
110 MACHINE_END
111 #endif
112 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp