From cfacc0c7ef257b1880691e0ece53aa9002422996 Mon Sep 17 00:00:00 2001 From: Tzachi Perelstein Date: Wed, 31 Oct 2007 12:42:41 +0200 Subject: [PATCH] --- yaml --- r: 77523 b: refs/heads/master c: e07c9d85726e57914608a4e66a5dbb35863cd8fb h: refs/heads/master i: 77521: 01e7953b57c497372c89f919941a420cf3439e2d 77519: 15c2f008b486eee0bc51b33dd143b7b4b293d302 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-orion/common.c | 44 ++++++++++++++++++++++++++++++ trunk/arch/arm/mach-orion/common.h | 8 ++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index a730f2b7e46c..dae7008f8792 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ca26f7d3ed3c841e561613a9ea2f44ca899e27de +refs/heads/master: e07c9d85726e57914608a4e66a5dbb35863cd8fb diff --git a/trunk/arch/arm/mach-orion/common.c b/trunk/arch/arm/mach-orion/common.c index ab1000eeaefe..12736fd60004 100644 --- a/trunk/arch/arm/mach-orion/common.c +++ b/trunk/arch/arm/mach-orion/common.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -168,6 +169,49 @@ static struct platform_device orion_ehci1 = { .num_resources = ARRAY_SIZE(orion_ehci1_resources), }; +/***************************************************************************** + * Gigabit Ethernet port + * (The Orion and Discovery (MV643xx) families use the same Ethernet driver) + ****************************************************************************/ + +static struct resource orion_eth_shared_resources[] = { + { + .start = ORION_ETH_REG_BASE, + .end = ORION_ETH_REG_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device orion_eth_shared = { + .name = MV643XX_ETH_SHARED_NAME, + .id = 0, + .num_resources = 1, + .resource = orion_eth_shared_resources, +}; + +static struct resource orion_eth_resources[] = { + { + .name = "eth irq", + .start = IRQ_ORION_ETH_SUM, + .end = IRQ_ORION_ETH_SUM, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device orion_eth = { + .name = MV643XX_ETH_NAME, + .id = 0, + .num_resources = 1, + .resource = orion_eth_resources, +}; + +void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data) +{ + orion_eth.dev.platform_data = eth_data; + platform_device_register(&orion_eth_shared); + platform_device_register(&orion_eth); +} + /***************************************************************************** * General ****************************************************************************/ diff --git a/trunk/arch/arm/mach-orion/common.h b/trunk/arch/arm/mach-orion/common.h index 2b452facadd1..06c10c06f03e 100644 --- a/trunk/arch/arm/mach-orion/common.h +++ b/trunk/arch/arm/mach-orion/common.h @@ -67,4 +67,12 @@ void gpio_display(void); /* debug */ */ extern struct sys_timer orion_timer; +/* + * Pull in Orion Ethernet platform_data, used by machine-setup + */ + +struct mv643xx_eth_platform_data; + +void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data); + #endif /* __ARCH_ORION_COMMON_H__ */