lkml.org 
[lkml]   [2008]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [ARM] ep93xx: add ethernet support for edb9302
Date
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


\
 
 \ /
  Last update: 2008-09-22 00:25    [W:0.039 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site