diff options
| author | Tzachi Perelstein <tzachi@marvell.com> | 2007-10-31 06:42:41 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-26 10:03:51 -0500 |
| commit | e07c9d85726e57914608a4e66a5dbb35863cd8fb (patch) | |
| tree | f095aec54443d84107d70ec33693416473fec742 | |
| parent | ca26f7d3ed3c841e561613a9ea2f44ca899e27de (diff) | |
[ARM] Orion: common platform setup for Gigabit Ethernet port
The Orion Ethernet port is the same port used in the Discovery
family (MV643XX). This patch include the common platform_device
stuff according to the existing mv643xx_eth conventions.
Signed-off-by: Tzachi Perelstein <tzachi@marvell.com>
Reviewed-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-orion/common.c | 44 | ||||
| -rw-r--r-- | arch/arm/mach-orion/common.h | 8 |
2 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-orion/common.c b/arch/arm/mach-orion/common.c index ab1000eeaefe..12736fd60004 100644 --- a/arch/arm/mach-orion/common.c +++ b/arch/arm/mach-orion/common.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
| 17 | #include <linux/mv643xx_eth.h> | ||
| 17 | #include <asm/page.h> | 18 | #include <asm/page.h> |
| 18 | #include <asm/timex.h> | 19 | #include <asm/timex.h> |
| 19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
| @@ -169,6 +170,49 @@ static struct platform_device orion_ehci1 = { | |||
| 169 | }; | 170 | }; |
| 170 | 171 | ||
| 171 | /***************************************************************************** | 172 | /***************************************************************************** |
| 173 | * Gigabit Ethernet port | ||
| 174 | * (The Orion and Discovery (MV643xx) families use the same Ethernet driver) | ||
| 175 | ****************************************************************************/ | ||
| 176 | |||
| 177 | static struct resource orion_eth_shared_resources[] = { | ||
| 178 | { | ||
| 179 | .start = ORION_ETH_REG_BASE, | ||
| 180 | .end = ORION_ETH_REG_BASE + 0xffff, | ||
| 181 | .flags = IORESOURCE_MEM, | ||
| 182 | }, | ||
| 183 | }; | ||
| 184 | |||
| 185 | static struct platform_device orion_eth_shared = { | ||
| 186 | .name = MV643XX_ETH_SHARED_NAME, | ||
| 187 | .id = 0, | ||
| 188 | .num_resources = 1, | ||
| 189 | .resource = orion_eth_shared_resources, | ||
| 190 | }; | ||
| 191 | |||
| 192 | static struct resource orion_eth_resources[] = { | ||
| 193 | { | ||
| 194 | .name = "eth irq", | ||
| 195 | .start = IRQ_ORION_ETH_SUM, | ||
| 196 | .end = IRQ_ORION_ETH_SUM, | ||
| 197 | .flags = IORESOURCE_IRQ, | ||
| 198 | } | ||
| 199 | }; | ||
| 200 | |||
| 201 | static struct platform_device orion_eth = { | ||
| 202 | .name = MV643XX_ETH_NAME, | ||
| 203 | .id = 0, | ||
| 204 | .num_resources = 1, | ||
| 205 | .resource = orion_eth_resources, | ||
| 206 | }; | ||
| 207 | |||
| 208 | void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data) | ||
| 209 | { | ||
| 210 | orion_eth.dev.platform_data = eth_data; | ||
| 211 | platform_device_register(&orion_eth_shared); | ||
| 212 | platform_device_register(&orion_eth); | ||
| 213 | } | ||
| 214 | |||
| 215 | /***************************************************************************** | ||
| 172 | * General | 216 | * General |
| 173 | ****************************************************************************/ | 217 | ****************************************************************************/ |
| 174 | 218 | ||
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h index 2b452facadd1..06c10c06f03e 100644 --- a/arch/arm/mach-orion/common.h +++ b/arch/arm/mach-orion/common.h | |||
| @@ -67,4 +67,12 @@ void gpio_display(void); /* debug */ | |||
| 67 | */ | 67 | */ |
| 68 | extern struct sys_timer orion_timer; | 68 | extern struct sys_timer orion_timer; |
| 69 | 69 | ||
| 70 | /* | ||
| 71 | * Pull in Orion Ethernet platform_data, used by machine-setup | ||
| 72 | */ | ||
| 73 | |||
| 74 | struct mv643xx_eth_platform_data; | ||
| 75 | |||
| 76 | void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data); | ||
| 77 | |||
| 70 | #endif /* __ARCH_ORION_COMMON_H__ */ | 78 | #endif /* __ARCH_ORION_COMMON_H__ */ |
