From patchwork Fri Mar 13 22:44:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 11848 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2DMirnN024507 for ; Fri, 13 Mar 2009 22:44:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754196AbZCMWox (ORCPT ); Fri, 13 Mar 2009 18:44:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752899AbZCMWox (ORCPT ); Fri, 13 Mar 2009 18:44:53 -0400 Received: from mho-01-bos.mailhop.org ([63.208.196.178]:63206 "EHLO mho-01-bos.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752799AbZCMWow (ORCPT ); Fri, 13 Mar 2009 18:44:52 -0400 Received: from c-69-181-40-92.hsd1.ca.comcast.net ([69.181.40.92] helo=[127.0.0.1]) by mho-01-bos.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1LiG7W-000AWw-78; Fri, 13 Mar 2009 22:44:50 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 69.181.40.92 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19/fs2BmF7cfILOmp8RqVw2 Subject: [PATCH 1/4] ARM: OMAP3: Add SMSC911X support to Overo platform (V2) To: linux-arm-kernel@lists.arm.linux.org.uk From: Tony Lindgren Cc: linux-omap@vger.kernel.org, Steve Sakoman Date: Fri, 13 Mar 2009 15:44:53 -0700 Message-ID: <20090313224453.8810.41743.stgit@localhost> In-Reply-To: <20090313224259.8810.3283.stgit@localhost> References: <20090313224259.8810.3283.stgit@localhost> User-Agent: StGit/0.14.3.343.g0584 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Steve Sakoman 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 Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-overo.c | 65 +++++++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 + +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) &&