mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [ARM] ep93xx: add ethernet support for edb9302
@ 2008-09-21 22:00 Thadeu Lima de Souza Cascardo
  2008-09-22 11:17 ` Lennert Buytenhek
  0 siblings, 1 reply; 2+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2008-09-21 22:00 UTC (permalink / raw)
  To: kernel, linux-arm-kernel, linux-kernel; +Cc: Thadeu Lima de Souza Cascardo

EDB9302 board use EP9302 controller, which include an ethernet device.
Register the platform device to enable it.

Using edb9302a won't work for these boards because they do not include
the chip ID. Ethernet wouldn't work without this patch and it seems
there is no edb9302 board without ethernet. So, this is the correct fix.
---
 arch/arm/mach-ep93xx/edb9302.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ep93xx/edb9302.c b/arch/arm/mach-ep93xx/edb9302.c
index 97550c0..fb34289 100644
--- a/arch/arm/mach-ep93xx/edb9302.c
+++ b/arch/arm/mach-ep93xx/edb9302.c
@@ -43,10 +43,40 @@ static struct platform_device edb9302_flash = {
 	.resource	= &edb9302_flash_resource,
 };
 
+static struct ep93xx_eth_data edb9302_eth_data = {
+	.phy_id			= 1,
+};
+
+static struct resource edb9302_eth_resource[] = {
+	{
+		.start	= EP93XX_ETHERNET_PHYS_BASE,
+		.end	= EP93XX_ETHERNET_PHYS_BASE + 0xffff,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= IRQ_EP93XX_ETHERNET,
+		.end	= IRQ_EP93XX_ETHERNET,
+		.flags	= IORESOURCE_IRQ,
+	}
+};
+
+static struct platform_device edb9302_eth_device = {
+	.name		= "ep93xx-eth",
+	.id		= -1,
+	.dev		= {
+		.platform_data	= &edb9302_eth_data,
+	},
+	.num_resources	= 2,
+	.resource	= edb9302_eth_resource,
+};
+
 static void __init edb9302_init_machine(void)
 {
 	ep93xx_init_devices();
 	platform_device_register(&edb9302_flash);
+
+	memcpy(edb9302_eth_data.dev_addr,
+		(void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
+	platform_device_register(&edb9302_eth_device);
 }
 
 MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
-- 
1.5.6.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [ARM] ep93xx: add ethernet support for edb9302
  2008-09-21 22:00 [PATCH] [ARM] ep93xx: add ethernet support for edb9302 Thadeu Lima de Souza Cascardo
@ 2008-09-22 11:17 ` Lennert Buytenhek
  0 siblings, 0 replies; 2+ messages in thread
From: Lennert Buytenhek @ 2008-09-22 11:17 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo; +Cc: linux-arm-kernel, linux-kernel

On Sun, Sep 21, 2008 at 07:00:43PM -0300, Thadeu Lima de Souza Cascardo wrote:

> EDB9302 board use EP9302 controller, which include an ethernet device.
> Register the platform device to enable it.
> 
> Using edb9302a won't work for these boards because they do not include
> the chip ID. Ethernet wouldn't work without this patch and it seems
> there is no edb9302 board without ethernet. So, this is the correct fix.
> ---
>  arch/arm/mach-ep93xx/edb9302.c |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>

Please submit to the ARM Linux patch tracker.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-22 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-21 22:00 [PATCH] [ARM] ep93xx: add ethernet support for edb9302 Thadeu Lima de Souza Cascardo
2008-09-22 11:17 ` Lennert Buytenhek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®