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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c

Version: ~ [ linux-5.8 ] ~ [ linux-5.7.12 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.55 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.136 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.191 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.232 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.232 ] ~ [ 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.85 ] ~ [ 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-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-orion5x/rd88f6183-ap-ge-setup.c
  3  *
  4  * Marvell Orion-1-90 AP GE Reference Design Setup
  5  *
  6  * This file is licensed under the terms of the GNU General Public
  7  * License version 2.  This program is licensed "as is" without any
  8  * warranty of any kind, whether express or implied.
  9  */
 10 #include <linux/gpio.h>
 11 #include <linux/kernel.h>
 12 #include <linux/init.h>
 13 #include <linux/platform_device.h>
 14 #include <linux/pci.h>
 15 #include <linux/irq.h>
 16 #include <linux/mtd/physmap.h>
 17 #include <linux/mv643xx_eth.h>
 18 #include <linux/spi/spi.h>
 19 #include <linux/spi/flash.h>
 20 #include <linux/ethtool.h>
 21 #include <net/dsa.h>
 22 #include <asm/mach-types.h>
 23 #include <asm/mach/arch.h>
 24 #include <asm/mach/pci.h>
 25 #include <mach/orion5x.h>
 26 #include "common.h"
 27 
 28 static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
 29         .phy_addr       = -1,
 30         .speed          = SPEED_1000,
 31         .duplex         = DUPLEX_FULL,
 32 };
 33 
 34 static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
 35         .port_names[0]  = "lan1",
 36         .port_names[1]  = "lan2",
 37         .port_names[2]  = "lan3",
 38         .port_names[3]  = "lan4",
 39         .port_names[4]  = "wan",
 40         .port_names[5]  = "cpu",
 41 };
 42 
 43 static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
 44         .nr_chips       = 1,
 45         .chip           = &rd88f6183ap_ge_switch_chip_data,
 46 };
 47 
 48 static struct mtd_partition rd88f6183ap_ge_partitions[] = {
 49         {
 50                 .name   = "kernel",
 51                 .offset = 0x00000000,
 52                 .size   = 0x00200000,
 53         }, {
 54                 .name   = "rootfs",
 55                 .offset = 0x00200000,
 56                 .size   = 0x00500000,
 57         }, {
 58                 .name   = "nvram",
 59                 .offset = 0x00700000,
 60                 .size   = 0x00080000,
 61         },
 62 };
 63 
 64 static struct flash_platform_data rd88f6183ap_ge_spi_slave_data = {
 65         .type           = "m25p64",
 66         .nr_parts       = ARRAY_SIZE(rd88f6183ap_ge_partitions),
 67         .parts          = rd88f6183ap_ge_partitions,
 68 };
 69 
 70 static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
 71         {
 72                 .modalias       = "m25p80",
 73                 .platform_data  = &rd88f6183ap_ge_spi_slave_data,
 74                 .irq            = NO_IRQ,
 75                 .max_speed_hz   = 20000000,
 76                 .bus_num        = 0,
 77                 .chip_select    = 0,
 78         },
 79 };
 80 
 81 static void __init rd88f6183ap_ge_init(void)
 82 {
 83         /*
 84          * Setup basic Orion functions. Need to be called early.
 85          */
 86         orion5x_init();
 87 
 88         /*
 89          * Configure peripherals.
 90          */
 91         orion5x_ehci0_init();
 92         orion5x_eth_init(&rd88f6183ap_ge_eth_data);
 93         orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
 94                                 gpio_to_irq(3));
 95         spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
 96                                 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
 97         orion5x_spi_init();
 98         orion5x_uart0_init();
 99 }
100 
101 static struct hw_pci rd88f6183ap_ge_pci __initdata = {
102         .nr_controllers = 2,
103         .setup          = orion5x_pci_sys_setup,
104         .scan           = orion5x_pci_sys_scan_bus,
105         .map_irq        = orion5x_pci_map_irq,
106 };
107 
108 static int __init rd88f6183ap_ge_pci_init(void)
109 {
110         if (machine_is_rd88f6183ap_ge()) {
111                 orion5x_pci_disable();
112                 pci_common_init(&rd88f6183ap_ge_pci);
113         }
114 
115         return 0;
116 }
117 subsys_initcall(rd88f6183ap_ge_pci_init);
118 
119 MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
120         /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
121         .atag_offset    = 0x100,
122         .init_machine   = rd88f6183ap_ge_init,
123         .map_io         = orion5x_map_io,
124         .init_early     = orion5x_init_early,
125         .init_irq       = orion5x_init_irq,
126         .init_time      = orion5x_timer_init,
127         .fixup          = tag_fixup_mem32,
128         .restart        = orion5x_restart,
129 MACHINE_END
130 

~ [ 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