From patchwork Fri May 21 20:15:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 101544 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4LKG2x5018627 for ; Fri, 21 May 2010 20:16:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487Ab0EUUQA (ORCPT ); Fri, 21 May 2010 16:16:00 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:57408 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294Ab0EUUQA (ORCPT ); Fri, 21 May 2010 16:16:00 -0400 Received: by vws9 with SMTP id 9so1217969vws.19 for ; Fri, 21 May 2010 13:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=bXptdTV03WLbO5SuiApiOEvruueAyJ7AAMqZP8jFSV0=; b=IYQe0jNf8w88u8PYPN5FrWYRCTrgZjO8D/bkN7V5CabyoPOBGQreNYaMSI0LljTO5r ScfuikNYCLBK26eviMyD9E+LrC6okcPMRnlKTY5vprNgQonlBwouR1u4PFKfnV7u21R+ 1GUBDM9fKIuBf8L42cfu3kIlYavlRDbmbrj6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=CZ9LdrJRR8wmyNmzfn8po7BtHJp3DmWflmgOV0+ywKL+Nma1wREzSJP5zhCQOBQ1D7 MX+78WYFnnpwmK5KX6ayu+/sRJ8Lojq5KfxSSCPiN4oIRq3U5wAmHdyrwu1nDsJzGi7I rdtNiikzOOyesAj98kZ/gl3iZwwYkhDdrS8vA= MIME-Version: 1.0 Received: by 10.229.217.144 with SMTP id hm16mr543715qcb.113.1274472958450; Fri, 21 May 2010 13:15:58 -0700 (PDT) Received: by 10.229.87.199 with HTTP; Fri, 21 May 2010 13:15:58 -0700 (PDT) In-Reply-To: <20100519182727.GG5818@atomide.com> References: <20100505192957.21568.19569.stgit@baageli.muru.com> <20100505193315.21568.55530.stgit@baageli.muru.com> <20100519182727.GG5818@atomide.com> Date: Fri, 21 May 2010 13:15:58 -0700 Message-ID: Subject: Re: [PATCH 14/18 FIX] omap: Overo: Add support for second ethernet port From: Steve Sakoman To: Tony Lindgren Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 21 May 2010 20:16:03 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 24b32d7..035eb35 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -166,9 +166,26 @@ static struct platform_device overo_smsc911x_device = { }, }; +static struct platform_device overo_smsc911x2_device = { + .name = "smsc911x", + .id = 1, + .num_resources = ARRAY_SIZE(overo_smsc911x2_resources), + .resource = overo_smsc911x2_resources, + .dev = { + .platform_data = &overo_smsc911x_config, + }, +}; + +static struct platform_device *smsc911x_devices[] = { + &overo_smsc911x_device, + &overo_smsc911x2_device, +}; + static inline void __init overo_init_smsc911x(void) { - unsigned long cs_mem_base; + unsigned long cs_mem_base, cs_mem_base2; + + /* set up first smsc911x chip */ if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); @@ -189,7 +206,28 @@ static inline void __init overo_init_smsc911x(void) overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); overo_smsc911x_resources[1].end = 0; - platform_device_register(&overo_smsc911x_device); + /* set up second smsc911x chip */ + + if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) { + printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n"); + return; + } + + overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0; + overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff; + + if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) && + (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) { + gpio_export(OVERO_SMSC911X2_GPIO, 0); + } else { + printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n"); + return; + } + + overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO); + overo_smsc911x2_resources[1].end = 0; + + platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices)); } #else