All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org, Steve Sakoman <steve@sakoman.com>
Subject: [PATCH 1/4] ARM: OMAP3: Add SMSC911X support to Overo platform (V2)
Date: Fri, 13 Mar 2009 15:44:53 -0700	[thread overview]
Message-ID: <20090313224453.8810.41743.stgit@localhost> (raw)
In-Reply-To: <20090313224259.8810.3283.stgit@localhost>

From: Steve Sakoman <sakoman@gmail.com>

Gumstix will soon be shipping a variant of their Summit board that
includes an SMSC LAN9221 ethernet interface.  This patch provides
support via the smsc911x driver when enabled in kernel config.

The Overo defconfig is not updated since the LAN9221 is an option
not present on all systems.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-overo.c |   65 +++++++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index d785aa8..fbe1ce0 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -52,6 +52,70 @@
 #define GPMC_CS0_BASE  0x60
 #define GPMC_CS_SIZE   0x30
 
+#define OVERO_SMSC911X_CS	5
+#define OVERO_SMSC911X_GPIO	176
+
+#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
+
+#include <linux/smsc911x.h>
+
+static struct resource overo_smsc911x_resources[] = {
+	{
+		.name	= "smsc911x-memory",
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+	},
+};
+
+static struct smsc911x_platform_config overo_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 overo_smsc911x_device = {
+	.name		= "smsc911x",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(overo_smsc911x_resources),
+	.resource	= &overo_smsc911x_resources,
+	.dev		= {
+		.platform_data = &overo_smsc911x_config,
+	},
+};
+
+static inline void __init overo_init_smsc911x(void)
+{
+	unsigned long cs_mem_base;
+
+	if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
+		printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
+		return;
+	}
+
+	overo_smsc911x_resources[0].start = cs_mem_base + 0x0;
+	overo_smsc911x_resources[0].end   = cs_mem_base + 0xff;
+
+	if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
+	    (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) {
+		gpio_export(OVERO_SMSC911X_GPIO, 0);
+	} else {
+		printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n");
+		return;
+	}
+
+	overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
+	overo_smsc911x_resources[1].end	  = 0;
+
+	platform_device_register(&overo_smsc911x_device);
+}
+
+#else
+static inline void __init overo_init_smsc911x(void) { return; }
+#endif
+
 static struct mtd_partition overo_nand_partitions[] = {
 	{
 		.name           = "xloader",
@@ -225,6 +289,7 @@ static void __init overo_init(void)
 	twl4030_mmc_init(mmc);
 	overo_flash_init();
 	usb_musb_init();
+	overo_init_smsc911x();
 
 	if ((gpio_request(OVERO_GPIO_W2W_NRESET,
 			  "OVERO_GPIO_W2W_NRESET") == 0) &&


  reply	other threads:[~2009-03-13 22:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13 22:43 [PATCH 0/4] Omap board updates for merge window after 2.6.29 Tony Lindgren
2009-03-13 22:44 ` Tony Lindgren [this message]
2009-03-15 15:38   ` [PATCH 1/4] ARM: OMAP3: Add SMSC911X support to Overo platform (V2) Russell King - ARM Linux
2009-03-15 16:36     ` Steve Sakoman
2009-03-15 17:00       ` Russell King - ARM Linux
2009-03-15 17:13         ` Steve Sakoman
2009-03-15 17:37           ` Russell King - ARM Linux
2009-03-16 18:08             ` Tony Lindgren
2009-03-17  8:18               ` Steve.Glendinning
2009-03-13 22:46 ` [PATCH 2/4] ARM: OMAP3: Add ADS7846 touchscreen support to Overo platform Tony Lindgren
2009-03-16 20:38   ` [PATCH 2/4] ARM: OMAP3: Add ADS7846 touchscreen support to Overo platform, v2 Tony Lindgren
2009-03-16 21:57     ` Felipe Balbi
2009-03-24  3:54       ` [PATCH 2/4] ARM: OMAP3: Add ADS7846 touchscreen support to Overo platform, v3 Tony Lindgren
2009-03-13 22:47 ` [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP Tony Lindgren
2009-03-15 15:47   ` Russell King - ARM Linux
2009-03-15 15:48     ` Russell King - ARM Linux
2009-03-16 18:14       ` [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP, v2 Tony Lindgren
2009-03-16 18:22         ` [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP, v3 Tony Lindgren
2009-03-23 19:05           ` [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP, v4 Tony Lindgren
2009-03-31 11:42           ` [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP, v3 Gadiyar, Anand
2009-03-31 13:37             ` Gadiyar, Anand
2009-03-31 14:50               ` Tony Lindgren
2009-03-31 18:48             ` Russell King - ARM Linux
2009-04-01  8:25               ` Gadiyar, Anand
2009-04-01  8:47                 ` Syed Mohammed, Khasim
2009-04-01 19:04                   ` Paul Walmsley
2009-04-01 22:07                     ` Tony Lindgren
2009-04-01 23:18                       ` Kevin Hilman
2009-04-02  0:00                         ` [PATCH] ARM: Do early I/O mapping if spinlock debugging is enabled (Re: [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP, v3) Tony Lindgren
2009-04-02  7:38                           ` Russell King - ARM Linux
2009-04-02 14:54                             ` Tony Lindgren
2009-04-02  4:33                         ` [PATCH 3/4] ARM: OMAP3: Add support for 3430 SDP, v3 Pandita, Vikram
2009-04-02 20:01                           ` Pandita, Vikram
2009-04-03 19:14                     ` Paul Walmsley
2009-04-03 19:25                       ` Gadiyar, Anand
2009-04-04 11:18                         ` Gadiyar, Anand
2009-04-03 23:12                       ` Kevin Hilman
2009-04-03 23:29                         ` Paul Walmsley
2009-03-13 22:48 ` [PATCH 4/4] ARM OMAP3: Initial support for Nokia RX-51 Tony Lindgren
2009-03-15 15:47   ` Russell King - ARM Linux
2009-03-16 18:21     ` [PATCH 4/4] ARM OMAP3: Initial support for Nokia RX-51, v2 Tony Lindgren
2009-03-24  2:52 ` [PATCH 0/4] Omap board updates for merge window after 2.6.29 Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090313224453.8810.41743.stgit@localhost \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=steve@sakoman.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.