@@ -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);
@@ -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)
@@ -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[] = {
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.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(-)