]> Pileus Git - ~andy/linux/blob - arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
Merge tag 'stmp-dev' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[~andy/linux] / arch / arm / mach-orion5x / rd88f6183ap-ge-setup.c
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/leds.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/pci.h>
26 #include <mach/orion5x.h>
27 #include "common.h"
28
29 static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
30         .phy_addr       = -1,
31         .speed          = SPEED_1000,
32         .duplex         = DUPLEX_FULL,
33 };
34
35 static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
36         .port_names[0]  = "lan1",
37         .port_names[1]  = "lan2",
38         .port_names[2]  = "lan3",
39         .port_names[3]  = "lan4",
40         .port_names[4]  = "wan",
41         .port_names[5]  = "cpu",
42 };
43
44 static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
45         .nr_chips       = 1,
46         .chip           = &rd88f6183ap_ge_switch_chip_data,
47 };
48
49 static struct mtd_partition rd88f6183ap_ge_partitions[] = {
50         {
51                 .name   = "kernel",
52                 .offset = 0x00000000,
53                 .size   = 0x00200000,
54         }, {
55                 .name   = "rootfs",
56                 .offset = 0x00200000,
57                 .size   = 0x00500000,
58         }, {
59                 .name   = "nvram",
60                 .offset = 0x00700000,
61                 .size   = 0x00080000,
62         },
63 };
64
65 static struct flash_platform_data rd88f6183ap_ge_spi_slave_data = {
66         .type           = "m25p64",
67         .nr_parts       = ARRAY_SIZE(rd88f6183ap_ge_partitions),
68         .parts          = rd88f6183ap_ge_partitions,
69 };
70
71 static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
72         {
73                 .modalias       = "m25p80",
74                 .platform_data  = &rd88f6183ap_ge_spi_slave_data,
75                 .irq            = NO_IRQ,
76                 .max_speed_hz   = 20000000,
77                 .bus_num        = 0,
78                 .chip_select    = 0,
79         },
80 };
81
82 static void __init rd88f6183ap_ge_init(void)
83 {
84         /*
85          * Setup basic Orion functions. Need to be called early.
86          */
87         orion5x_init();
88
89         /*
90          * Configure peripherals.
91          */
92         orion5x_ehci0_init();
93         orion5x_eth_init(&rd88f6183ap_ge_eth_data);
94         orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
95                                 gpio_to_irq(3));
96         spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
97                                 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
98         orion5x_spi_init();
99         orion5x_uart0_init();
100 }
101
102 static struct hw_pci rd88f6183ap_ge_pci __initdata = {
103         .nr_controllers = 2,
104         .setup          = orion5x_pci_sys_setup,
105         .scan           = orion5x_pci_sys_scan_bus,
106         .map_irq        = orion5x_pci_map_irq,
107 };
108
109 static int __init rd88f6183ap_ge_pci_init(void)
110 {
111         if (machine_is_rd88f6183ap_ge()) {
112                 orion5x_pci_disable();
113                 pci_common_init(&rd88f6183ap_ge_pci);
114         }
115
116         return 0;
117 }
118 subsys_initcall(rd88f6183ap_ge_pci_init);
119
120 MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
121         /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
122         .atag_offset    = 0x100,
123         .init_machine   = rd88f6183ap_ge_init,
124         .map_io         = orion5x_map_io,
125         .init_early     = orion5x_init_early,
126         .init_irq       = orion5x_init_irq,
127         .timer          = &orion5x_timer,
128         .fixup          = tag_fixup_mem32,
129         .restart        = orion5x_restart,
130 MACHINE_END