Thread (15 messages) 15 messages, 5 authors, 2008-11-23
STALE6424d

[PATCH 6/6] smsc911x: convert realview platforms to use smsc911x

From: Steve Glendinning <hidden>
Date: 2008-11-05 10:35:56
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

Signed-off-by: Steve Glendinning <redacted>
---
 arch/arm/mach-realview/realview_eb.c     |   16 +++++++++++++---
 arch/arm/mach-realview/realview_pb1176.c |   13 ++++++++++++-
 arch/arm/mach-realview/realview_pb11mp.c |   13 ++++++++++++-
 3 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index eb829eb..f461844 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -24,6 +24,7 @@
 #include <linux/sysdev.h>
 #include <linux/amba/bus.h>
 #include <linux/io.h>
+#include <linux/smsc911x.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -248,6 +249,13 @@ static struct platform_device realview_eb_eth_device = {
 	.resource	= realview_eb_eth_resources,
 };
 
+static struct smsc911x_platform_config smsc911x_config = {
+	.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+	.flags = SMSC911X_USE_32BIT,
+	.phy_interface = PHY_INTERFACE_MODE_MII,
+};
+
 /*
  * Detect and register the correct Ethernet device. RealView/EB rev D
  * platforms use the newer SMSC LAN9118 Ethernet chip
@@ -261,12 +269,14 @@ static int eth_device_register(void)
 		return -ENOMEM;
 
 	idrev = readl(eth_addr + 0x50);
-	if ((idrev & 0xFFFF0000) == 0x01180000)
+	if ((idrev & 0xFFFF0000) == 0x01180000) {
 		/* SMSC LAN9118 chip present */
-		realview_eb_eth_device.name = "smc911x";
-	else
+		realview_eb_eth_device.name = "smsc911x";
+		realview_eb_eth_device.dev.platform_data = &smsc911x_config;
+	} else {
 		/* SMSC 91C111 chip present */
 		realview_eb_eth_device.name = "smc91x";
+	}
 
 	iounmap(eth_addr);
 	return platform_device_register(&realview_eb_eth_device);
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index cccdb3e..718ab0c 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -24,6 +24,7 @@
 #include <linux/sysdev.h>
 #include <linux/amba/bus.h>
 #include <linux/io.h>
+#include <linux/smsc911x.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -222,11 +223,21 @@ static struct resource realview_pb1176_smsc911x_resources[] = {
 	},
 };
 
+static struct smsc911x_platform_config smsc911x_config = {
+	.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+	.flags = SMSC911X_USE_32BIT,
+	.phy_interface = PHY_INTERFACE_MODE_MII,
+};
+
 static struct platform_device realview_pb1176_smsc911x_device = {
-	.name		= "smc911x",
+	.name		= "smsc911x",
 	.id		= 0,
 	.num_resources	= ARRAY_SIZE(realview_pb1176_smsc911x_resources),
 	.resource	= realview_pb1176_smsc911x_resources,
+	.dev = {
+		.platform_data = &smsc911x_config,
+	},
 };
 
 static void __init gic_init_irq(void)
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 8b86314..dc042fa 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -24,6 +24,7 @@
 #include <linux/sysdev.h>
 #include <linux/amba/bus.h>
 #include <linux/io.h>
+#include <linux/smsc911x.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -230,11 +231,21 @@ static struct resource realview_pb11mp_smsc911x_resources[] = {
 	},
 };
 
+static struct smsc911x_platform_config smsc911x_config = {
+	.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+	.flags = SMSC911X_USE_32BIT,
+	.phy_interface = PHY_INTERFACE_MODE_MII,
+};
+
 static struct platform_device realview_pb11mp_smsc911x_device = {
-	.name		= "smc911x",
+	.name		= "smsc911x",
 	.id		= 0,
 	.num_resources	= ARRAY_SIZE(realview_pb11mp_smsc911x_resources),
 	.resource	= realview_pb11mp_smsc911x_resources,
+	.dev = {
+		.platform_data = &smsc911x_config,
+	},
 };
 
 struct resource realview_pb11mp_cf_resources[] = {
-- 
1.5.6.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help