aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
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-kirkwood
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-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/common.c35
-rw-r--r--arch/arm/mach-kirkwood/common.h2
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c11
3 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 85cad05d8c5b..0bb1fbd84ccb 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -16,6 +16,7 @@
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/ata_platform.h> 17#include <linux/ata_platform.h>
18#include <linux/spi/orion_spi.h> 18#include <linux/spi/orion_spi.h>
19#include <net/dsa.h>
19#include <asm/page.h> 20#include <asm/page.h>
20#include <asm/timex.h> 21#include <asm/timex.h>
21#include <asm/mach/map.h> 22#include <asm/mach/map.h>
@@ -152,6 +153,40 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
152 153
153 154
154/***************************************************************************** 155/*****************************************************************************
156 * Ethernet switch
157 ****************************************************************************/
158static struct resource kirkwood_switch_resources[] = {
159 {
160 .start = 0,
161 .end = 0,
162 .flags = IORESOURCE_IRQ,
163 },
164};
165
166static struct platform_device kirkwood_switch_device = {
167 .name = "dsa",
168 .id = 0,
169 .num_resources = 0,
170 .resource = kirkwood_switch_resources,
171};
172
173void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
174{
175 if (irq != NO_IRQ) {
176 kirkwood_switch_resources[0].start = irq;
177 kirkwood_switch_resources[0].end = irq;
178 kirkwood_switch_device.num_resources = 1;
179 }
180
181 d->mii_bus = &kirkwood_ge00_shared.dev;
182 d->netdev = &kirkwood_ge00.dev;
183 kirkwood_switch_device.dev.platform_data = d;
184
185 platform_device_register(&kirkwood_switch_device);
186}
187
188
189/*****************************************************************************
155 * SoC RTC 190 * SoC RTC
156 ****************************************************************************/ 191 ****************************************************************************/
157static struct resource kirkwood_rtc_resource = { 192static struct resource kirkwood_rtc_resource = {
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 8fa0f6a27635..5774632a67e3 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -11,6 +11,7 @@
11#ifndef __ARCH_KIRKWOOD_COMMON_H 11#ifndef __ARCH_KIRKWOOD_COMMON_H
12#define __ARCH_KIRKWOOD_COMMON_H 12#define __ARCH_KIRKWOOD_COMMON_H
13 13
14struct dsa_platform_data;
14struct mv643xx_eth_platform_data; 15struct mv643xx_eth_platform_data;
15struct mv_sata_platform_data; 16struct mv_sata_platform_data;
16 17
@@ -29,6 +30,7 @@ void kirkwood_pcie_id(u32 *dev, u32 *rev);
29 30
30void kirkwood_ehci_init(void); 31void kirkwood_ehci_init(void);
31void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); 32void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
33void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);
32void kirkwood_pcie_init(void); 34void kirkwood_pcie_init(void);
33void kirkwood_rtc_init(void); 35void kirkwood_rtc_init(void);
34void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); 36void kirkwood_sata_init(struct mv_sata_platform_data *sata_data);
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index f785093e433f..175054abd630 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -19,6 +19,7 @@
19#include <linux/ata_platform.h> 19#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 20#include <linux/mv643xx_eth.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/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/mach/pci.h> 25#include <asm/mach/pci.h>
@@ -74,6 +75,15 @@ static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
74 .duplex = DUPLEX_FULL, 75 .duplex = DUPLEX_FULL,
75}; 76};
76 77
78static struct dsa_platform_data rd88f6281_switch_data = {
79 .port_names[0] = "lan1",
80 .port_names[1] = "lan2",
81 .port_names[2] = "lan3",
82 .port_names[3] = "lan4",
83 .port_names[4] = "wan",
84 .port_names[5] = "cpu",
85};
86
77static struct mv_sata_platform_data rd88f6281_sata_data = { 87static struct mv_sata_platform_data rd88f6281_sata_data = {
78 .n_ports = 2, 88 .n_ports = 2,
79}; 89};
@@ -87,6 +97,7 @@ static void __init rd88f6281_init(void)
87 97
88 kirkwood_ehci_init(); 98 kirkwood_ehci_init();
89 kirkwood_ge00_init(&rd88f6281_ge00_data); 99 kirkwood_ge00_init(&rd88f6281_ge00_data);
100 kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ);
90 kirkwood_rtc_init(); 101 kirkwood_rtc_init();
91 kirkwood_sata_init(&rd88f6281_sata_data); 102 kirkwood_sata_init(&rd88f6281_sata_data);
92 kirkwood_uart0_init(); 103 kirkwood_uart0_init();