All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH REPOST 0/6] convert arm platforms to smsc911x
@ 2009-01-20 13:28 Steve Glendinning
  2009-01-20 13:28 ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Steve Glendinning
  2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
  0 siblings, 2 replies; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

This patchset, intended for 2.6.30, converts in-tree arm platforms from 
smc911x to the actively maintained smsc911x driver.

The platform updates (3-4) depend on the driver updates (1-2) for 
correct operation, so David Miller is planning to take these via the 
net-2.6 tree.  Defconfig updates have been split out (5-6) for merging 
via the arm tree.

Stanley Miao is taking care of the OMAP platform separately.

Steve Glendinning (6):
  smsc911x: add support for platform-specific irq flags
  smsc911x: register isr as IRQF_SHARED
  arm: convert pcm037 platform to use smsc911x
  arm: convert realview platform to use smsc911x
  arm: update pcm037 defconfig to use smsc911x
  arm: update realview defconfigs to use smsc911x

 arch/arm/configs/pcm037_defconfig       |   23 ++++++++++++++++++++++-
 arch/arm/configs/realview-smp_defconfig |   24 ++++++++++++++++++++++--
 arch/arm/configs/realview_defconfig     |   24 ++++++++++++++++++++++--
 arch/arm/mach-mx3/pcm037.c              |   22 ++++++++++++----------
 arch/arm/mach-realview/core.c           |   17 +++++++++--------
 drivers/net/smsc911x.c                  |   19 ++++++++++++++-----
 6 files changed, 101 insertions(+), 28 deletions(-)


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 1/6] smsc911x: add support for platform-specific irq flags
  2009-01-20 13:28 [PATCH REPOST 0/6] convert arm platforms to smsc911x Steve Glendinning
@ 2009-01-20 13:28 ` Steve Glendinning
  2009-01-20 13:28   ` [PATCH 2/6] smsc911x: register isr as IRQF_SHARED Steve Glendinning
                     ` (2 more replies)
  2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
  1 sibling, 3 replies; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

this patch adds support for the platform_device's resources to indicate
additional flags to use when registering the irq, for example
IORESOURCE_IRQ_LOWLEVEL (which corresponds to IRQF_TRIGGER_LOW).  These
should be set in the irq resource flags field.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 drivers/net/smsc911x.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index f513bdf..3565df1 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1892,9 +1892,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	struct net_device *dev;
 	struct smsc911x_data *pdata;
 	struct smsc911x_platform_config *config = pdev->dev.platform_data;
-	struct resource *res;
+	struct resource *res, *irq_res;
 	unsigned int intcfg = 0;
-	int res_size;
+	int res_size, irq_flags;
 	int retval;
 	DECLARE_MAC_BUF(mac);
 
@@ -1919,6 +1919,14 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	}
 	res_size = res->end - res->start;
 
+	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+	if (!irq_res) {
+		pr_warning("%s: Could not allocate irq resource.\n",
+			SMSC_CHIPNAME);
+		retval = -ENODEV;
+		goto out_0;
+	}
+
 	if (!request_mem_region(res->start, res_size, SMSC_CHIPNAME)) {
 		retval = -EBUSY;
 		goto out_0;
@@ -1935,7 +1943,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 
 	pdata = netdev_priv(dev);
 
-	dev->irq = platform_get_irq(pdev, 0);
+	dev->irq = irq_res->start;
+	irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
 	pdata->ioaddr = ioremap_nocache(res->start, res_size);
 
 	/* copy config parameters across to pdata */
@@ -1968,8 +1977,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	smsc911x_reg_write(pdata, INT_EN, 0);
 	smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
 
-	retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED,
-			     dev->name, dev);
+	retval = request_irq(dev->irq, smsc911x_irqhandler,
+			     irq_flags | IRQF_DISABLED, dev->name, dev);
 	if (retval) {
 		SMSC_WARNING(PROBE,
 			"Unable to claim requested irq: %d", dev->irq);
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 2/6] smsc911x: register isr as IRQF_SHARED
  2009-01-20 13:28 ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Steve Glendinning
@ 2009-01-20 13:28   ` Steve Glendinning
  2009-01-20 13:28     ` [PATCH 3/6] arm: convert pcm037 platform to use smsc911x Steve Glendinning
  2009-01-20 14:55   ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Ben Dooks
  2009-01-26  1:45   ` David Miller
  2 siblings, 1 reply; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

The isr supports shared operation, so register it with the IRQF_SHARED
flag to indicate this.

This patch also removes the IRQF_DISABLED flag.  This driver doesn't
need it, and IRQF_DISABLED isn't guaranteed when using shared interrupts.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 drivers/net/smsc911x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 3565df1..f882fd5 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1978,7 +1978,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
 	smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
 
 	retval = request_irq(dev->irq, smsc911x_irqhandler,
-			     irq_flags | IRQF_DISABLED, dev->name, dev);
+			     irq_flags | IRQF_SHARED, dev->name, dev);
 	if (retval) {
 		SMSC_WARNING(PROBE,
 			"Unable to claim requested irq: %d", dev->irq);
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 3/6] arm: convert pcm037 platform to use smsc911x
  2009-01-20 13:28   ` [PATCH 2/6] smsc911x: register isr as IRQF_SHARED Steve Glendinning
@ 2009-01-20 13:28     ` Steve Glendinning
  2009-01-20 13:28       ` [PATCH 4/6] arm: convert realview " Steve Glendinning
  2009-01-20 15:29       ` [PATCH 3/6] arm: convert pcm037 " Sascha Hauer
  0 siblings, 2 replies; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 arch/arm/mach-mx3/pcm037.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index 8cea825..64a34f6 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -24,7 +24,7 @@
 #include <linux/mtd/plat-ram.h>
 #include <linux/memory.h>
 #include <linux/gpio.h>
-#include <linux/smc911x.h>
+#include <linux/smsc911x.h>
 #include <linux/interrupt.h>
 
 #include <mach/hardware.h>
@@ -64,7 +64,7 @@ static struct imxuart_platform_data uart_pdata = {
 	.flags = IMXUART_HAVE_RTSCTS,
 };
 
-static struct resource smc911x_resources[] = {
+static struct resource smsc911x_resources[] = {
 	[0] = {
 		.start		= CS1_BASE_ADDR + 0x300,
 		.end		= CS1_BASE_ADDR + 0x300 + SZ_64K - 1,
@@ -73,22 +73,24 @@ static struct resource smc911x_resources[] = {
 	[1] = {
 		.start		= IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
 		.end		= IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
-		.flags		= IORESOURCE_IRQ,
+		.flags		= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
 	},
 };
 
-static struct smc911x_platdata smc911x_info = {
-	.flags		= SMC911X_USE_32BIT,
-	.irq_flags	= IRQF_SHARED | IRQF_TRIGGER_LOW,
+static struct smsc911x_platform_config smsc911x_info = {
+	.flags		= SMSC911X_USE_32BIT,
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_type	= SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+	.phy_interface	= PHY_INTERFACE_MODE_MII,
 };
 
 static struct platform_device pcm037_eth = {
-	.name		= "smc911x",
+	.name		= "smsc911x",
 	.id		= -1,
-	.num_resources	= ARRAY_SIZE(smc911x_resources),
-	.resource	= smc911x_resources,
+	.num_resources	= ARRAY_SIZE(smsc911x_resources),
+	.resource	= smsc911x_resources,
 	.dev		= {
-		.platform_data = &smc911x_info,
+		.platform_data = &smsc911x_info,
 	},
 };
 
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 4/6] arm: convert realview platform to use smsc911x
  2009-01-20 13:28     ` [PATCH 3/6] arm: convert pcm037 platform to use smsc911x Steve Glendinning
@ 2009-01-20 13:28       ` Steve Glendinning
  2009-01-20 13:28         ` [PATCH 5/6] arm: update pcm037 defconfig " Steve Glendinning
  2009-01-20 13:44         ` [PATCH 4/6] arm: convert realview platform " Catalin Marinas
  2009-01-20 15:29       ` [PATCH 3/6] arm: convert pcm037 " Sascha Hauer
  1 sibling, 2 replies; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 arch/arm/mach-realview/core.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index bd2aa4f..820ec25 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -28,7 +28,7 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/io.h>
-#include <linux/smc911x.h>
+#include <linux/smsc911x.h>
 
 #include <asm/clkdev.h>
 #include <asm/system.h>
@@ -127,14 +127,15 @@ int realview_flash_register(struct resource *res, u32 num)
 	return platform_device_register(&realview_flash_device);
 }
 
-static struct smc911x_platdata realview_smc911x_platdata = {
-	.flags		= SMC911X_USE_32BIT,
-	.irq_flags	= IRQF_SHARED,
-	.irq_polarity	= 1,
+static struct smsc911x_platform_config smsc911x_config = {
+	.flags		= SMSC911X_USE_32BIT,
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_type	= SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+	.phy_interface	= PHY_INTERFACE_MODE_MII,
 };
 
 static struct platform_device realview_eth_device = {
-	.name		= "smc911x",
+	.name		= "smsc911x",
 	.id		= 0,
 	.num_resources	= 2,
 };
@@ -144,8 +145,8 @@ int realview_eth_register(const char *name, struct resource *res)
 	if (name)
 		realview_eth_device.name = name;
 	realview_eth_device.resource = res;
-	if (strcmp(realview_eth_device.name, "smc911x") == 0)
-		realview_eth_device.dev.platform_data = &realview_smc911x_platdata;
+	if (strcmp(realview_eth_device.name, "smsc911x") == 0)
+		realview_eth_device.dev.platform_data = &smsc911x_config;
 
 	return platform_device_register(&realview_eth_device);
 }
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 5/6] arm: update pcm037 defconfig to use smsc911x
  2009-01-20 13:28       ` [PATCH 4/6] arm: convert realview " Steve Glendinning
@ 2009-01-20 13:28         ` Steve Glendinning
  2009-01-20 13:28           ` [PATCH 6/6] arm: update realview defconfigs " Steve Glendinning
  2009-01-20 13:44         ` [PATCH 4/6] arm: convert realview platform " Catalin Marinas
  1 sibling, 1 reply; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 arch/arm/configs/pcm037_defconfig |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/pcm037_defconfig b/arch/arm/configs/pcm037_defconfig
index 6274745..6e37c77 100644
--- a/arch/arm/configs/pcm037_defconfig
+++ b/arch/arm/configs/pcm037_defconfig
@@ -465,12 +465,33 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_PHYLIB is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_AX88796 is not set
 CONFIG_SMC91X=y
 # CONFIG_DM9000 is not set
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 6/6] arm: update realview defconfigs to use smsc911x
  2009-01-20 13:28         ` [PATCH 5/6] arm: update pcm037 defconfig " Steve Glendinning
@ 2009-01-20 13:28           ` Steve Glendinning
  0 siblings, 0 replies; 23+ messages in thread
From: Steve Glendinning @ 2009-01-20 13:28 UTC (permalink / raw)
  To: linux-arm-kernel, netdev
  Cc: David Miller, Russell King, Stanley Miao, Ian Saturley,
	Steve Glendinning

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
 arch/arm/configs/realview-smp_defconfig |   24 ++++++++++++++++++++++--
 arch/arm/configs/realview_defconfig     |   24 ++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig
index cd29824..21db4b3 100644
--- a/arch/arm/configs/realview-smp_defconfig
+++ b/arch/arm/configs/realview-smp_defconfig
@@ -496,13 +496,33 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_PHYLIB is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_AX88796 is not set
 CONFIG_SMC91X=y
 # CONFIG_DM9000 is not set
-CONFIG_SMC911X=y
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig
index 7e253f5..9a75c30 100644
--- a/arch/arm/configs/realview_defconfig
+++ b/arch/arm/configs/realview_defconfig
@@ -490,13 +490,33 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_PHYLIB is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_AX88796 is not set
 CONFIG_SMC91X=y
 # CONFIG_DM9000 is not set
-CONFIG_SMC911X=y
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 4/6] arm: convert realview platform to use smsc911x
  2009-01-20 13:28       ` [PATCH 4/6] arm: convert realview " Steve Glendinning
  2009-01-20 13:28         ` [PATCH 5/6] arm: update pcm037 defconfig " Steve Glendinning
@ 2009-01-20 13:44         ` Catalin Marinas
  1 sibling, 0 replies; 23+ messages in thread
From: Catalin Marinas @ 2009-01-20 13:44 UTC (permalink / raw)
  To: Steve Glendinning
  Cc: linux-arm-kernel, netdev, David Miller, Russell King,
	Stanley Miao, Ian Saturley

On Tue, 2009-01-20 at 13:28 +0000, Steve Glendinning wrote:
> Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
> ---
>  arch/arm/mach-realview/core.c |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c

The RealView changes look fine but I'll need to test them in an ARM SMP
configuration. Last time I tried a version of this driver (though not
the latest), it didn't work properly with SMP enabled (but couldn't
figure why).

I'll give the latest driver a try sometime this week and let you know.

-- 
Catalin


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/6] smsc911x: add support for platform-specific irq flags
  2009-01-20 13:28 ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Steve Glendinning
  2009-01-20 13:28   ` [PATCH 2/6] smsc911x: register isr as IRQF_SHARED Steve Glendinning
@ 2009-01-20 14:55   ` Ben Dooks
  2009-01-21 15:54     ` Steve.Glendinning
  2009-01-26  1:45   ` David Miller
  2 siblings, 1 reply; 23+ messages in thread
From: Ben Dooks @ 2009-01-20 14:55 UTC (permalink / raw)
  To: Steve Glendinning
  Cc: linux-arm-kernel, netdev, David Miller, Russell King,
	Stanley Miao, Ian Saturley

On Tue, Jan 20, 2009 at 01:28:29PM +0000, Steve Glendinning wrote:
> this patch adds support for the platform_device's resources to indicate
> additional flags to use when registering the irq, for example
> IORESOURCE_IRQ_LOWLEVEL (which corresponds to IRQF_TRIGGER_LOW).  These
> should be set in the irq resource flags field.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
> ---
>  drivers/net/smsc911x.c |   19 ++++++++++++++-----
>  1 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
> index f513bdf..3565df1 100644
> --- a/drivers/net/smsc911x.c
> +++ b/drivers/net/smsc911x.c
> @@ -1892,9 +1892,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
>  	struct net_device *dev;
>  	struct smsc911x_data *pdata;
>  	struct smsc911x_platform_config *config = pdev->dev.platform_data;
> -	struct resource *res;
> +	struct resource *res, *irq_res;
>  	unsigned int intcfg = 0;
> -	int res_size;
> +	int res_size, irq_flags;
>  	int retval;
>  	DECLARE_MAC_BUF(mac);
>  
> @@ -1919,6 +1919,14 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
>  	}
>  	res_size = res->end - res->start;
>  
> +	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> +	if (!irq_res) {
> +		pr_warning("%s: Could not allocate irq resource.\n",
> +			SMSC_CHIPNAME);
> +		retval = -ENODEV;
> +		goto out_0;

-ENODEV is certainly not the right code to be returning here, it is
likely to get lost in the driver porbe process.

> +	}
> +
>  	if (!request_mem_region(res->start, res_size, SMSC_CHIPNAME)) {
>  		retval = -EBUSY;
>  		goto out_0;
> @@ -1935,7 +1943,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
>  
>  	pdata = netdev_priv(dev);
>  
> -	dev->irq = platform_get_irq(pdev, 0);
> +	dev->irq = irq_res->start;
> +	irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
>  	pdata->ioaddr = ioremap_nocache(res->start, res_size);
>  
>  	/* copy config parameters across to pdata */
> @@ -1968,8 +1977,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
>  	smsc911x_reg_write(pdata, INT_EN, 0);
>  	smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF);
>  
> -	retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED,
> -			     dev->name, dev);
> +	retval = request_irq(dev->irq, smsc911x_irqhandler,
> +			     irq_flags | IRQF_DISABLED, dev->name, dev);
>  	if (retval) {
>  		SMSC_WARNING(PROBE,
>  			"Unable to claim requested irq: %d", dev->irq);
> -- 
> 1.6.0.6
> 
> 
> -------------------------------------------------------------------
> List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 3/6] arm: convert pcm037 platform to use smsc911x
  2009-01-20 13:28     ` [PATCH 3/6] arm: convert pcm037 platform to use smsc911x Steve Glendinning
  2009-01-20 13:28       ` [PATCH 4/6] arm: convert realview " Steve Glendinning
@ 2009-01-20 15:29       ` Sascha Hauer
  2009-01-20 17:13         ` David Miller
  2009-01-21 10:58         ` Mark Brown
  1 sibling, 2 replies; 23+ messages in thread
From: Sascha Hauer @ 2009-01-20 15:29 UTC (permalink / raw)
  To: Steve Glendinning
  Cc: linux-arm-kernel, netdev, David Miller, Russell King,
	Stanley Miao, Ian Saturley

I just gave it a try on our pcm037 board and it turns out that it
doesn't work.

The reason for this is not the driver, it's just that the hardware
designers got the direction of the phy detect pin wrong. The pcm037 uses
an internal phy, but the detection pin is pulled high :(

The old driver worked around this by falling back to the internal phy
when no valid phy id is detected. The new driver lacks this fallback.

Instead of falling back we could also introduce a
SMSC911X_FORCE_INTERNAL_PHY flag.

What do you think?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 3/6] arm: convert pcm037 platform to use smsc911x
  2009-01-20 15:29       ` [PATCH 3/6] arm: convert pcm037 " Sascha Hauer
@ 2009-01-20 17:13         ` David Miller
  2009-01-21 10:58         ` Mark Brown
  1 sibling, 0 replies; 23+ messages in thread
From: David Miller @ 2009-01-20 17:13 UTC (permalink / raw)
  To: s.hauer
  Cc: steve.glendinning, linux-arm-kernel, netdev, linux, stanley.miao,
	ian.saturley

From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Tue, 20 Jan 2009 16:29:51 +0100

> I just gave it a try on our pcm037 board and it turns out that it
> doesn't work.
> 
> The reason for this is not the driver, it's just that the hardware
> designers got the direction of the phy detect pin wrong. The pcm037 uses
> an internal phy, but the detection pin is pulled high :(
> 
> The old driver worked around this by falling back to the internal phy
> when no valid phy id is detected. The new driver lacks this fallback.
> 
> Instead of falling back we could also introduce a
> SMSC911X_FORCE_INTERNAL_PHY flag.
> 
> What do you think?

You could pass this "invert detection pin" state in the platform
device private.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 7/8] arm: convert omap ldp platform to use smsc911x
  2009-01-20 13:28 [PATCH REPOST 0/6] convert arm platforms to smsc911x Steve Glendinning
  2009-01-20 13:28 ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Steve Glendinning
@ 2009-01-21  3:06 ` Stanley.Miao
  2009-01-21  3:06   ` [PATCH 8/8] arm: update omap_ldp defconfig " Stanley.Miao
                     ` (3 more replies)
  1 sibling, 4 replies; 23+ messages in thread
From: Stanley.Miao @ 2009-01-21  3:06 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, davem, netdev, steve.glendinning

from 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x,
will replace it. so convert omap_ldp to use smsc911x driver.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-ldp.c             |   49 ++++++++++++++++-----------
 arch/arm/plat-omap/include/mach/board-ldp.h |    6 +--
 2 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 6592d58..ea00f1b 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -23,6 +23,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/smsc911x.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -44,8 +45,6 @@
 
 #include "mmc-twl4030.h"
 
-
-#define SDP3430_SMC91X_CS	3
 #define CONFIG_DISABLE_HFCLK 1
 
 #define ENABLE_VAUX1_DEDICATED	0x03
@@ -53,10 +52,10 @@
 
 #define TWL4030_MSECURE_GPIO	22
 
-static struct resource ldp_smc911x_resources[] = {
+static struct resource ldp_smsc911x_resources[] = {
 	[0] = {
-		.start	= OMAP34XX_ETHR_START,
-		.end	= OMAP34XX_ETHR_START + SZ_4K,
+		.start	= 0,
+		.end	= 0,
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
@@ -66,11 +65,21 @@ static struct resource ldp_smc911x_resources[] = {
 	},
 };
 
-static struct platform_device ldp_smc911x_device = {
-	.name		= "smc911x",
+static struct smsc911x_platform_config ldp_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 ldp_smsc911x_device = {
+	.name		= "smsc911x",
 	.id		= -1,
-	.num_resources	= ARRAY_SIZE(ldp_smc911x_resources),
-	.resource	= ldp_smc911x_resources,
+	.num_resources	= ARRAY_SIZE(ldp_smsc911x_resources),
+	.resource	= ldp_smsc911x_resources,
+	.dev            = {
+		.platform_data = &ldp_smsc911x_config,
+	},
 };
 
 static int ldp_twl4030_keymap[] = {
@@ -308,34 +317,34 @@ static struct platform_device ldp_lcd_device = {
 };
 
 static struct platform_device *ldp_devices[] __initdata = {
-	&ldp_smc911x_device,
+	&ldp_smsc911x_device,
 	&ldp_lcd_device,
 	&ldp_gpio_keys_device,
 };
 
-static inline void __init ldp_init_smc911x(void)
+static inline void __init ldp_init_smsc911x(void)
 {
 	int eth_cs;
 	unsigned long cs_mem_base;
 	int eth_gpio = 0;
 
-	eth_cs = LDP_SMC911X_CS;
+	eth_cs = LDP_SMSC911X_CS;
 
 	if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
-		printk(KERN_ERR "Failed to request GPMC mem for smc911x\n");
+		printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
 		return;
 	}
 
-	ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
-	ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
+	ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
+	ldp_smsc911x_resources[0].end   = cs_mem_base + 0x100;
 	udelay(100);
 
-	eth_gpio = LDP_SMC911X_GPIO;
+	eth_gpio = LDP_SMSC911X_GPIO;
 
-	ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
+	ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
 
-	if (gpio_request(eth_gpio, "smc911x irq") < 0) {
-		printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
+	if (gpio_request(eth_gpio, "smsc911x irq") < 0) {
+		printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
 				eth_gpio);
 		return;
 	}
@@ -348,7 +357,7 @@ static void __init omap_ldp_init_irq(void)
 	omap2_init_common_hw(NULL);
 	omap_init_irq();
 	omap_gpio_init();
-	ldp_init_smc911x();
+	ldp_init_smsc911x();
 }
 
 static struct omap_uart_config ldp_uart_config __initdata = {
diff --git a/arch/arm/plat-omap/include/mach/board-ldp.h b/arch/arm/plat-omap/include/mach/board-ldp.h
index f233996..81ac2b8 100644
--- a/arch/arm/plat-omap/include/mach/board-ldp.h
+++ b/arch/arm/plat-omap/include/mach/board-ldp.h
@@ -32,8 +32,6 @@
 extern void twl4030_bci_battery_init(void);
 
 #define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
-#define LDP_SMC911X_CS         1
-#define LDP_SMC911X_GPIO       152
-#define DEBUG_BASE             0x08000000
-#define OMAP34XX_ETHR_START    DEBUG_BASE
+#define LDP_SMSC911X_CS		1
+#define LDP_SMSC911X_GPIO	152
 #endif /* __ASM_ARCH_OMAP_LDP_H */
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 8/8] arm: update omap_ldp defconfig to use smsc911x
  2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
@ 2009-01-21  3:06   ` Stanley.Miao
  2009-01-22 10:58   ` [PATCH 7/8] arm: convert omap ldp platform " Russell King - ARM Linux
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Stanley.Miao @ 2009-01-21  3:06 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, davem, netdev, steve.glendinning

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/configs/omap_ldp_defconfig |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig
index d88e6d7..64db3b1 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -489,14 +489,34 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_PHYLIB is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 # CONFIG_AX88796 is not set
 # CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
 # CONFIG_ENC28J60 is not set
-CONFIG_SMC911X=y
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 3/6] arm: convert pcm037 platform to use smsc911x
  2009-01-20 15:29       ` [PATCH 3/6] arm: convert pcm037 " Sascha Hauer
  2009-01-20 17:13         ` David Miller
@ 2009-01-21 10:58         ` Mark Brown
  2009-01-21 14:38           ` Sascha Hauer
  1 sibling, 1 reply; 23+ messages in thread
From: Mark Brown @ 2009-01-21 10:58 UTC (permalink / raw)
  To: Steve Glendinning, linux-arm-kernel, netdev, David Miller, Russell King

On Tue, Jan 20, 2009 at 04:29:51PM +0100, Sascha Hauer wrote:

> The reason for this is not the driver, it's just that the hardware
> designers got the direction of the phy detect pin wrong. The pcm037 uses
> an internal phy, but the detection pin is pulled high :(

A brief survey of boards I have here suggests that this failure is not
unique.

> The old driver worked around this by falling back to the internal phy
> when no valid phy id is detected. The new driver lacks this fallback.

> Instead of falling back we could also introduce a
> SMSC911X_FORCE_INTERNAL_PHY flag.

If we have the explicit flag in the platform data my concern would be
that it would get reported back to the hardware designers and they might
fix the board in subsequent revisions.  That'd cause issues if the
revision of the board weren't identifiable from software (which wouldn't
surprise me at all).

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 3/6] arm: convert pcm037 platform to use smsc911x
  2009-01-21 10:58         ` Mark Brown
@ 2009-01-21 14:38           ` Sascha Hauer
  0 siblings, 0 replies; 23+ messages in thread
From: Sascha Hauer @ 2009-01-21 14:38 UTC (permalink / raw)
  To: Mark Brown
  Cc: Steve Glendinning, linux-arm-kernel, netdev, David Miller,
	Russell King, Stanley Miao, Ian Saturley

On Wed, Jan 21, 2009 at 10:58:15AM +0000, Mark Brown wrote:
> On Tue, Jan 20, 2009 at 04:29:51PM +0100, Sascha Hauer wrote:
> 
> > The reason for this is not the driver, it's just that the hardware
> > designers got the direction of the phy detect pin wrong. The pcm037 uses
> > an internal phy, but the detection pin is pulled high :(
> 
> A brief survey of boards I have here suggests that this failure is not
> unique.
> 
> > The old driver worked around this by falling back to the internal phy
> > when no valid phy id is detected. The new driver lacks this fallback.
> 
> > Instead of falling back we could also introduce a
> > SMSC911X_FORCE_INTERNAL_PHY flag.
> 
> If we have the explicit flag in the platform data my concern would be
> that it would get reported back to the hardware designers and they might
> fix the board in subsequent revisions.  That'd cause issues if the
> revision of the board weren't identifiable from software (which wouldn't
> surprise me at all).

That's why I haven't told the hardware designers yet ;)

Anyway, a FORCE_INTERNAL_PHY flag would still do the right thing. At
least as long the hardware designers do not decide to put an external
phy in the next hardware revision.
If we decide to add such a flag we should add an FORCE_EXTERNAL_PHY
aswell for the sake of completeness.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/6] smsc911x: add support for platform-specific irq flags
  2009-01-20 14:55   ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Ben Dooks
@ 2009-01-21 15:54     ` Steve.Glendinning
  0 siblings, 0 replies; 23+ messages in thread
From: Steve.Glendinning @ 2009-01-21 15:54 UTC (permalink / raw)
  To: Ben Dooks
  Cc: David Miller, ian.saturley, Russell King, linux-arm-kernel,
	netdev, Stanley Miao

Hi Ben,

Ben Dooks <ben-linux@fluff.org> wrote on 20/01/2009 14:55:39:
> On Tue, Jan 20, 2009 at 01:28:29PM +0000, Steve Glendinning wrote:
> > @@ -1919,6 +1919,14 @@ static int __devinit 
> smsc911x_drv_probe(struct platform_device *pdev)
> >     }
> >     res_size = res->end - res->start;
> > 
> > +   irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> > +   if (!irq_res) {
> > +      pr_warning("%s: Could not allocate irq resource.\n",
> > +         SMSC_CHIPNAME);
> > +      retval = -ENODEV;
> > +      goto out_0;
> 
> -ENODEV is certainly not the right code to be returning here, it is
> likely to get lost in the driver porbe process.
> 

Thanks for spotting this.

This probe function also returns -ENODEV in two other places: if 
platform_data is null or if it fails to get it's IORESOURCE_MEM.  I guess 
these should all be fixed, which return code should the driver use to 
indicate "my platform_data is missing or incomplete"?

Steve

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/8] arm: convert omap ldp platform to use smsc911x
  2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
  2009-01-21  3:06   ` [PATCH 8/8] arm: update omap_ldp defconfig " Stanley.Miao
@ 2009-01-22 10:58   ` Russell King - ARM Linux
  2009-01-24  4:14     ` stanley.miao
  2009-01-23 17:07   ` Steve.Glendinning
  2009-01-24  3:38   ` [PATCHv2 " Stanley.Miao
  3 siblings, 1 reply; 23+ messages in thread
From: Russell King - ARM Linux @ 2009-01-22 10:58 UTC (permalink / raw)
  To: Stanley.Miao; +Cc: linux-arm-kernel, davem, netdev, steve.glendinning

On Wed, Jan 21, 2009 at 11:06:09AM +0800, Stanley.Miao wrote:
> -	ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
> -	ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
> +	ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
> +	ldp_smsc911x_resources[0].end   = cs_mem_base + 0x100;

This doesn't look right - 'end' is inclusive not exclusive.  So this
reserves 257 bytes, not 256 bytes.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/8] arm: convert omap ldp platform to use smsc911x
  2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
  2009-01-21  3:06   ` [PATCH 8/8] arm: update omap_ldp defconfig " Stanley.Miao
  2009-01-22 10:58   ` [PATCH 7/8] arm: convert omap ldp platform " Russell King - ARM Linux
@ 2009-01-23 17:07   ` Steve.Glendinning
  2009-01-24  4:16     ` stanley.miao
  2009-01-24  3:38   ` [PATCHv2 " Stanley.Miao
  3 siblings, 1 reply; 23+ messages in thread
From: Steve.Glendinning @ 2009-01-23 17:07 UTC (permalink / raw)
  To: Stanley.Miao; +Cc: davem, linux, linux-arm-kernel, netdev

"Stanley.Miao" <stanley.miao@windriver.com> wrote on 21/01/2009 03:06:09:

> from 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x,
> will replace it. so convert omap_ldp to use smsc911x driver.
> 
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>

Hi Stanley,

This platform patch doesn't apply to linus's tree, what's it based on?

Thanks,
Steve

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCHv2 7/8] arm: convert omap ldp platform to use smsc911x
  2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
                     ` (2 preceding siblings ...)
  2009-01-23 17:07   ` Steve.Glendinning
@ 2009-01-24  3:38   ` Stanley.Miao
  3 siblings, 0 replies; 23+ messages in thread
From: Stanley.Miao @ 2009-01-24  3:38 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, davem, netdev, steve.glendinning

from 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x,
will replace it. so convert omap_ldp to use smsc911x driver.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/board-ldp.c             |   47 +++++++++++++++------------
 arch/arm/plat-omap/include/mach/board-ldp.h |    6 +--
 2 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index aa69727..67c123a 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -22,6 +22,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl4030.h>
+#include <linux/smsc911x.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -41,55 +42,59 @@
 
 #include "mmc-twl4030.h"
 
-#define SDP3430_SMC91X_CS	3
-
-static struct resource ldp_smc911x_resources[] = {
+static struct resource ldp_smsc911x_resources[] = {
 	[0] = {
-		.start	= OMAP34XX_ETHR_START,
-		.end	= OMAP34XX_ETHR_START + SZ_4K,
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= 0,
-		.end	= 0,
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
 	},
 };
 
-static struct platform_device ldp_smc911x_device = {
-	.name		= "smc911x",
+static struct smsc911x_platform_config ldp_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 ldp_smsc911x_device = {
+	.name		= "smsc911x",
 	.id		= -1,
-	.num_resources	= ARRAY_SIZE(ldp_smc911x_resources),
-	.resource	= ldp_smc911x_resources,
+	.num_resources	= ARRAY_SIZE(ldp_smsc911x_resources),
+	.resource	= ldp_smsc911x_resources,
+	.dev            = {
+		.platform_data = &ldp_smsc911x_config,
+	},
 };
 
 static struct platform_device *ldp_devices[] __initdata = {
-	&ldp_smc911x_device,
+	&ldp_smsc911x_device,
 };
 
-static inline void __init ldp_init_smc911x(void)
+static inline void __init ldp_init_smsc911x(void)
 {
 	int eth_cs;
 	unsigned long cs_mem_base;
 	int eth_gpio = 0;
 
-	eth_cs = LDP_SMC911X_CS;
+	eth_cs = LDP_SMSC911X_CS;
 
 	if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
-		printk(KERN_ERR "Failed to request GPMC mem for smc911x\n");
+		printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
 		return;
 	}
 
-	ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
-	ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
+	ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
+	ldp_smsc911x_resources[0].end   = cs_mem_base + 0xff;
 	udelay(100);
 
-	eth_gpio = LDP_SMC911X_GPIO;
+	eth_gpio = LDP_SMSC911X_GPIO;
 
-	ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
+	ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
 
 	if (omap_request_gpio(eth_gpio) < 0) {
-		printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
+		printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
 				eth_gpio);
 		return;
 	}
@@ -101,7 +106,7 @@ static void __init omap_ldp_init_irq(void)
 	omap2_init_common_hw();
 	omap_init_irq();
 	omap_gpio_init();
-	ldp_init_smc911x();
+	ldp_init_smsc911x();
 }
 
 static struct omap_uart_config ldp_uart_config __initdata = {
diff --git a/arch/arm/plat-omap/include/mach/board-ldp.h b/arch/arm/plat-omap/include/mach/board-ldp.h
index f233996..81ac2b8 100644
--- a/arch/arm/plat-omap/include/mach/board-ldp.h
+++ b/arch/arm/plat-omap/include/mach/board-ldp.h
@@ -32,8 +32,6 @@
 extern void twl4030_bci_battery_init(void);
 
 #define TWL4030_IRQNUM		INT_34XX_SYS_NIRQ
-#define LDP_SMC911X_CS         1
-#define LDP_SMC911X_GPIO       152
-#define DEBUG_BASE             0x08000000
-#define OMAP34XX_ETHR_START    DEBUG_BASE
+#define LDP_SMSC911X_CS		1
+#define LDP_SMSC911X_GPIO	152
 #endif /* __ASM_ARCH_OMAP_LDP_H */
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/8] arm: convert omap ldp platform to use smsc911x
  2009-01-22 10:58   ` [PATCH 7/8] arm: convert omap ldp platform " Russell King - ARM Linux
@ 2009-01-24  4:14     ` stanley.miao
  0 siblings, 0 replies; 23+ messages in thread
From: stanley.miao @ 2009-01-24  4:14 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, davem, netdev, steve.glendinning

On Thu, 2009-01-22 at 10:58 +0000, Russell King - ARM Linux wrote:
> On Wed, Jan 21, 2009 at 11:06:09AM +0800, Stanley.Miao wrote:
> > -	ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
> > -	ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
> > +	ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
> > +	ldp_smsc911x_resources[0].end   = cs_mem_base + 0x100;
> 
> This doesn't look right - 'end' is inclusive not exclusive.  So this
> reserves 257 bytes, not 256 bytes.

Thanks for the review, correct it.

Stanley.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 7/8] arm: convert omap ldp platform to use smsc911x
  2009-01-23 17:07   ` Steve.Glendinning
@ 2009-01-24  4:16     ` stanley.miao
  0 siblings, 0 replies; 23+ messages in thread
From: stanley.miao @ 2009-01-24  4:16 UTC (permalink / raw)
  To: Steve.Glendinning; +Cc: davem, linux, linux-arm-kernel, netdev

On Fri, 2009-01-23 at 17:07 +0000, Steve.Glendinning@smsc.com wrote:
> "Stanley.Miao" <stanley.miao@windriver.com> wrote on 21/01/2009 03:06:09:
> 
> > from 2.6.29, smc911x isn't maintained anymore. A new driver, smsc911x,
> > will replace it. so convert omap_ldp to use smsc911x driver.
> > 
> > Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> 
> Hi Stanley,
> 
> This platform patch doesn't apply to linus's tree, what's it based on?

Sorry, I reworked it to base on linus's tree.

Stanley.

> 
> Thanks,
> Steve

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/6] smsc911x: add support for platform-specific irq flags
  2009-01-20 13:28 ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Steve Glendinning
  2009-01-20 13:28   ` [PATCH 2/6] smsc911x: register isr as IRQF_SHARED Steve Glendinning
  2009-01-20 14:55   ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Ben Dooks
@ 2009-01-26  1:45   ` David Miller
  2009-01-26  8:45     ` Steve.Glendinning
  2 siblings, 1 reply; 23+ messages in thread
From: David Miller @ 2009-01-26  1:45 UTC (permalink / raw)
  To: steve.glendinning
  Cc: linux-arm-kernel, netdev, linux, stanley.miao, ian.saturley


These platform conversion patches still seem to be in a state
of flux.

Steve could you resubmit this stuff and when doing so please clearly
indicate exactly which ones you think I should stick into the net-2.6
tree and which are to be added to the ARM tree.

Thanks.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/6] smsc911x: add support for platform-specific irq flags
  2009-01-26  1:45   ` David Miller
@ 2009-01-26  8:45     ` Steve.Glendinning
  0 siblings, 0 replies; 23+ messages in thread
From: Steve.Glendinning @ 2009-01-26  8:45 UTC (permalink / raw)
  To: David Miller
  Cc: ian.saturley, linux, linux-arm-kernel, netdev, stanley.miao,
	Sascha Hauer

David Miller <davem@davemloft.net> wrote on 26/01/2009 01:45:48:
> 
> These platform conversion patches still seem to be in a state
> of flux.
> 
> Steve could you resubmit this stuff and when doing so please clearly
> indicate exactly which ones you think I should stick into the net-2.6
> tree and which are to be added to the ARM tree.
> 
> Thanks.
> 

Thanks David,  I've also added two more minor initialisation workarounds
for hardware problems on in-tree boards.  The platform maintainers are
testing now.

I'll re-post the set when we're all happy, hopefully later this week.

Steve

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-01-26  8:47 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-20 13:28 [PATCH REPOST 0/6] convert arm platforms to smsc911x Steve Glendinning
2009-01-20 13:28 ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Steve Glendinning
2009-01-20 13:28   ` [PATCH 2/6] smsc911x: register isr as IRQF_SHARED Steve Glendinning
2009-01-20 13:28     ` [PATCH 3/6] arm: convert pcm037 platform to use smsc911x Steve Glendinning
2009-01-20 13:28       ` [PATCH 4/6] arm: convert realview " Steve Glendinning
2009-01-20 13:28         ` [PATCH 5/6] arm: update pcm037 defconfig " Steve Glendinning
2009-01-20 13:28           ` [PATCH 6/6] arm: update realview defconfigs " Steve Glendinning
2009-01-20 13:44         ` [PATCH 4/6] arm: convert realview platform " Catalin Marinas
2009-01-20 15:29       ` [PATCH 3/6] arm: convert pcm037 " Sascha Hauer
2009-01-20 17:13         ` David Miller
2009-01-21 10:58         ` Mark Brown
2009-01-21 14:38           ` Sascha Hauer
2009-01-20 14:55   ` [PATCH 1/6] smsc911x: add support for platform-specific irq flags Ben Dooks
2009-01-21 15:54     ` Steve.Glendinning
2009-01-26  1:45   ` David Miller
2009-01-26  8:45     ` Steve.Glendinning
2009-01-21  3:06 ` [PATCH 7/8] arm: convert omap ldp platform to use smsc911x Stanley.Miao
2009-01-21  3:06   ` [PATCH 8/8] arm: update omap_ldp defconfig " Stanley.Miao
2009-01-22 10:58   ` [PATCH 7/8] arm: convert omap ldp platform " Russell King - ARM Linux
2009-01-24  4:14     ` stanley.miao
2009-01-23 17:07   ` Steve.Glendinning
2009-01-24  4:16     ` stanley.miao
2009-01-24  3:38   ` [PATCHv2 " Stanley.Miao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.