[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1222034443-6732-1-git-send-email-cascardo@holoscopio.com>
Date: Sun, 21 Sep 2008 19:00:43 -0300
From: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
To: kernel@...tstofly.org, linux-arm-kernel@...ts.arm.linux.org.uk,
linux-kernel@...r.kernel.org
Cc: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
Subject: [PATCH] [ARM] ep93xx: add ethernet support for edb9302
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists