lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed,  5 Nov 2008 10:35:42 +0000
From:	Steve Glendinning <steve.glendinning@...c.com>
To:	netdev@...r.kernel.org
Cc:	catalin.marinas@....com, Bahadir.Balban@....com,
	dustin@...soria.com, bgat@...lgatliff.com,
	Ian Saturley <ian.saturley@...c.com>, g.liakhovetski@....de,
	Peter Korsgaard <jacmet@...site.dk>,
	Steve Glendinning <steve.glendinning@...c.com>
Subject: [PATCH 6/6] smsc911x: convert realview platforms to use smsc911x

Signed-off-by: Steve Glendinning <steve.glendinning@...c.com>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ