aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-09-25 10:23:48 -0400
committerNicolas Pitre <nico@cam.org>2008-10-19 14:29:05 -0400
commitdcf1cece143d95b48676cf607a21ee0805daa55a (patch)
tree4527b626549892cd882fb700dbaddb60c00e044f /arch/arm/mach-orion5x
parent04185fc67c0f8ec84ce9dd9ef33c9825b41453c6 (diff)
[ARM] Orion: instantiate the dsa switch driver
This adds DSA switch instantiation hooks to the orion5x and the kirkwood ARM SoC platform code, and instantiates the DSA switch driver on the 88F5181L FXO RD, the 88F5181L GE RD, the 6183 AP GE RD, the Linksys WRT350n v2, and the 88F6281 RD boards. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Tested-by: Nicolas Pitre <nico@marvell.com> Tested-by: Peter van Valderen <linux@ddcrew.com> Tested-by: Dirk Teurlings <dirk@upexia.nl> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-orion5x')
-rw-r--r--arch/arm/mach-orion5x/common.c35
-rw-r--r--arch/arm/mach-orion5x/common.h2
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c11
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c11
-rw-r--r--arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c11
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c11
6 files changed, 81 insertions, 0 deletions
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 9625ef5975d0..a2f917e0a307 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -19,6 +19,7 @@
19#include <linux/mv643xx_i2c.h> 19#include <linux/mv643xx_i2c.h>
20#include <linux/ata_platform.h> 20#include <linux/ata_platform.h>
21#include <linux/spi/orion_spi.h> 21#include <linux/spi/orion_spi.h>
22#include <net/dsa.h>
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/timex.h> 25#include <asm/timex.h>
@@ -198,6 +199,40 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
198 199
199 200
200/***************************************************************************** 201/*****************************************************************************
202 * Ethernet switch
203 ****************************************************************************/
204static struct resource orion5x_switch_resources[] = {
205 {
206 .start = 0,
207 .end = 0,
208 .flags = IORESOURCE_IRQ,
209 },
210};
211
212static struct platform_device orion5x_switch_device = {
213 .name = "dsa",
214 .id = 0,
215 .num_resources = 0,
216 .resource = orion5x_switch_resources,
217};
218
219void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
220{
221 if (irq != NO_IRQ) {
222 orion5x_switch_resources[0].start = irq;
223 orion5x_switch_resources[0].end = irq;
224 orion5x_switch_device.num_resources = 1;
225 }
226
227 d->mii_bus = &orion5x_eth_shared.dev;
228 d->netdev = &orion5x_eth.dev;
229 orion5x_switch_device.dev.platform_data = d;
230
231 platform_device_register(&orion5x_switch_device);
232}
233
234
235/*****************************************************************************
201 * I2C 236 * I2C
202 ****************************************************************************/ 237 ****************************************************************************/
203static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = { 238static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = {
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 1f8b2da676a5..a000c7c6ee96 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -1,6 +1,7 @@
1#ifndef __ARCH_ORION5X_COMMON_H 1#ifndef __ARCH_ORION5X_COMMON_H
2#define __ARCH_ORION5X_COMMON_H 2#define __ARCH_ORION5X_COMMON_H
3 3
4struct dsa_platform_data;
4struct mv643xx_eth_platform_data; 5struct mv643xx_eth_platform_data;
5struct mv_sata_platform_data; 6struct mv_sata_platform_data;
6 7
@@ -29,6 +30,7 @@ void orion5x_setup_pcie_wa_win(u32 base, u32 size);
29void orion5x_ehci0_init(void); 30void orion5x_ehci0_init(void);
30void orion5x_ehci1_init(void); 31void orion5x_ehci1_init(void);
31void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data); 32void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
33void orion5x_eth_switch_init(struct dsa_platform_data *d, int irq);
32void orion5x_i2c_init(void); 34void orion5x_i2c_init(void);
33void orion5x_sata_init(struct mv_sata_platform_data *sata_data); 35void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
34void orion5x_spi_init(void); 36void orion5x_spi_init(void);
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index 500cdadaf09c..15f53235ee30 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -16,6 +16,7 @@
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
17#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
18#include <linux/ethtool.h> 18#include <linux/ethtool.h>
19#include <net/dsa.h>
19#include <asm/mach-types.h> 20#include <asm/mach-types.h>
20#include <asm/gpio.h> 21#include <asm/gpio.h>
21#include <asm/leds.h> 22#include <asm/leds.h>
@@ -93,6 +94,15 @@ static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = {
93 .duplex = DUPLEX_FULL, 94 .duplex = DUPLEX_FULL,
94}; 95};
95 96
97static struct dsa_platform_data rd88f5181l_fxo_switch_data = {
98 .port_names[0] = "lan2",
99 .port_names[1] = "lan1",
100 .port_names[2] = "wan",
101 .port_names[3] = "cpu",
102 .port_names[5] = "lan4",
103 .port_names[7] = "lan3",
104};
105
96static void __init rd88f5181l_fxo_init(void) 106static void __init rd88f5181l_fxo_init(void)
97{ 107{
98 /* 108 /*
@@ -107,6 +117,7 @@ static void __init rd88f5181l_fxo_init(void)
107 */ 117 */
108 orion5x_ehci0_init(); 118 orion5x_ehci0_init();
109 orion5x_eth_init(&rd88f5181l_fxo_eth_data); 119 orion5x_eth_init(&rd88f5181l_fxo_eth_data);
120 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_data, NO_IRQ);
110 orion5x_uart0_init(); 121 orion5x_uart0_init();
111 122
112 orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE, 123 orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE,
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index ebde81416499..8ad3934399d4 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -17,6 +17,7 @@
17#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
18#include <linux/ethtool.h> 18#include <linux/ethtool.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <net/dsa.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/gpio.h> 22#include <asm/gpio.h>
22#include <asm/leds.h> 23#include <asm/leds.h>
@@ -94,6 +95,15 @@ static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = {
94 .duplex = DUPLEX_FULL, 95 .duplex = DUPLEX_FULL,
95}; 96};
96 97
98static struct dsa_platform_data rd88f5181l_ge_switch_data = {
99 .port_names[0] = "lan2",
100 .port_names[1] = "lan1",
101 .port_names[2] = "wan",
102 .port_names[3] = "cpu",
103 .port_names[5] = "lan4",
104 .port_names[7] = "lan3",
105};
106
97static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = { 107static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = {
98 I2C_BOARD_INFO("ds1338", 0x68), 108 I2C_BOARD_INFO("ds1338", 0x68),
99}; 109};
@@ -112,6 +122,7 @@ static void __init rd88f5181l_ge_init(void)
112 */ 122 */
113 orion5x_ehci0_init(); 123 orion5x_ehci0_init();
114 orion5x_eth_init(&rd88f5181l_ge_eth_data); 124 orion5x_eth_init(&rd88f5181l_ge_eth_data);
125 orion5x_eth_switch_init(&rd88f5181l_ge_switch_data, gpio_to_irq(8));
115 orion5x_i2c_init(); 126 orion5x_i2c_init();
116 orion5x_uart0_init(); 127 orion5x_uart0_init();
117 128
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 40e049539091..262e25e4dace 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -19,6 +19,7 @@
19#include <linux/spi/orion_spi.h> 19#include <linux/spi/orion_spi.h>
20#include <linux/spi/flash.h> 20#include <linux/spi/flash.h>
21#include <linux/ethtool.h> 21#include <linux/ethtool.h>
22#include <net/dsa.h>
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/gpio.h> 24#include <asm/gpio.h>
24#include <asm/leds.h> 25#include <asm/leds.h>
@@ -34,6 +35,15 @@ static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
34 .duplex = DUPLEX_FULL, 35 .duplex = DUPLEX_FULL,
35}; 36};
36 37
38static struct dsa_platform_data rd88f6183ap_ge_switch_data = {
39 .port_names[0] = "lan1",
40 .port_names[1] = "lan2",
41 .port_names[2] = "lan3",
42 .port_names[3] = "lan4",
43 .port_names[4] = "wan",
44 .port_names[5] = "cpu",
45};
46
37static struct mtd_partition rd88f6183ap_ge_partitions[] = { 47static struct mtd_partition rd88f6183ap_ge_partitions[] = {
38 { 48 {
39 .name = "kernel", 49 .name = "kernel",
@@ -79,6 +89,7 @@ static void __init rd88f6183ap_ge_init(void)
79 */ 89 */
80 orion5x_ehci0_init(); 90 orion5x_ehci0_init();
81 orion5x_eth_init(&rd88f6183ap_ge_eth_data); 91 orion5x_eth_init(&rd88f6183ap_ge_eth_data);
92 orion5x_eth_switch_init(&rd88f6183ap_ge_switch_data, gpio_to_irq(3));
82 spi_register_board_info(rd88f6183ap_ge_spi_slave_info, 93 spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
83 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info)); 94 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
84 orion5x_spi_init(); 95 orion5x_spi_init();
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 9a4fd5256462..cc8f89200865 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -15,6 +15,7 @@
15#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/ethtool.h> 17#include <linux/ethtool.h>
18#include <net/dsa.h>
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/gpio.h> 20#include <asm/gpio.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
@@ -105,6 +106,15 @@ static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = {
105 .duplex = DUPLEX_FULL, 106 .duplex = DUPLEX_FULL,
106}; 107};
107 108
109static struct dsa_platform_data wrt350n_v2_switch_data = {
110 .port_names[0] = "lan2",
111 .port_names[1] = "lan1",
112 .port_names[2] = "wan",
113 .port_names[3] = "cpu",
114 .port_names[5] = "lan3",
115 .port_names[7] = "lan4",
116};
117
108static void __init wrt350n_v2_init(void) 118static void __init wrt350n_v2_init(void)
109{ 119{
110 /* 120 /*
@@ -119,6 +129,7 @@ static void __init wrt350n_v2_init(void)
119 */ 129 */
120 orion5x_ehci0_init(); 130 orion5x_ehci0_init();
121 orion5x_eth_init(&wrt350n_v2_eth_data); 131 orion5x_eth_init(&wrt350n_v2_eth_data);
132 orion5x_eth_switch_init(&wrt350n_v2_switch_data, NO_IRQ);
122 orion5x_uart0_init(); 133 orion5x_uart0_init();
123 134
124 orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE, 135 orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE,