From patchwork Wed Apr 17 13:42:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 2453881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 1DEE8DF23A for ; Wed, 17 Apr 2013 13:43:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1USSdf-0007sw-BO; Wed, 17 Apr 2013 13:43:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1USSdb-0004zS-Uz; Wed, 17 Apr 2013 13:43:03 +0000 Received: from mail-ie0-x233.google.com ([2607:f8b0:4001:c03::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1USSdY-0004z8-DX for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2013 13:43:01 +0000 Received: by mail-ie0-f179.google.com with SMTP id 16so1897352iea.10 for ; Wed, 17 Apr 2013 06:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=zwXfh9rq56vpsZmCZKSrCrMBo5jfDn7eIk5ZsbPFUx0=; b=w9RbVk6BbXxSq9MUtXoy4OI2LJHfOI/aGnVAyeMlaDEtxZumt75vQfcZZLm7+Q6zsJ Rq7niYyiRzHLzF0uJfc7Upudi1a13+IwrxddacD42S8t0E8fO6U/icmjYhd5Y4TRyDuM CwwZXVR6rNzZ7w7J3ww23rNmqDuWzSKiHph4syQqFWzCMog7DV4q2UtcvuQFlwxCa0Xb f0vQR959Pp69WdEV35SH9sHk+b58q7USN4Lg0ai/w4bt2ut8gWddMY6uI4bqdI+TYoq7 Nyw5jrTbcJpzh2jXgzQ/vgNnGruESswgncTHQ7oDMkrV4X2g0AMMbeuZIhd/CNxanmtB AWzQ== X-Received: by 10.42.176.68 with SMTP id bd4mr3259898icb.4.1366206179198; Wed, 17 Apr 2013 06:42:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.71.2 with HTTP; Wed, 17 Apr 2013 06:42:39 -0700 (PDT) In-Reply-To: <516EA2B1.3070201@ti.com> References: <1329321854-24490-1-git-send-email-b-cousson@ti.com> <5155C902.7080207@wwwdotorg.org> <5165CB9D.1090202@wwwdotorg.org> <51671D7B.5060303@wwwdotorg.org> <51673D70.3010503@wwwdotorg.org> <516C31C3.9040505@wwwdotorg.org> <516C7C43.3040105@wwwdotorg.org> <516C8760.2050500@ti.com> <516D9B05.1000501@wwwdotorg.org> <516DA60A.5070000@ti.com> <516DCCA8.3070108@wwwdotorg.org> <516DDB4D.9020500@ti.com> <516E022F.5050708@ti.com> <516EA2B1.3070201@ti.com> From: Javier Martinez Canillas Date: Wed, 17 Apr 2013 15:42:39 +0200 Message-ID: Subject: Re: [PATCH 3/5] gpio/omap: Add DT support to GPIO driver To: Jon Hunter X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130417_094300_602093_A667E931 X-CRM114-Status: GOOD ( 33.02 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (martinez.javier[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Stephen Warren , Stephen Warren , Kevin Hilman , Linus Walleij , Grant Likely , Alexandre Courbot , "linux-omap@vger.kernel.org" , "devicetree-discuss@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, Apr 17, 2013 at 3:25 PM, Jon Hunter wrote: > > On 04/17/2013 02:55 AM, Javier Martinez Canillas wrote: > > ... > >> There are so many patches flying around in this thread that I missed it :-) >> >> Sorry about that... > > No problem. > >>> I was trying to see if we could find a common solution that everyone >>> could use as it seems that ideally we should all be requesting the gpio. >>> >>> Cheers >>> Jon >>> >>> [1] http://marc.info/?l=linux-arm-kernel&m=136606204823845&w=1 >> >> btw, I shared the latest patch with only build testing it, but today I >> gave a try and I found a problem with this approach. The .xlate >> function is being called twice for each GPIO-IRQ so the first time >> gpio_request_one() succeeds but the second time it fails returning >> -EBUSY. > > I tried it and I did not see that. I don't see the below warning either. > weird, I wonder what's different here. I'll try tonight to test using another branch based on your omap-daily-testing branch. >> This raises a warning on drivers/of/platform.c >> (WARN_ON(of_irq_to_resource_table(np, res, num_irq) != num_irq)): >> >> 0.285308] ------------[ cut here ]------------ >> [ 0.285369] WARNING: at drivers/of/platform.c:171 >> of_device_alloc+0x154/0x168() >> [ 0.285430] Modules linked in: >> [ 0.285491] [] (unwind_backtrace+0x0/0xf0) from >> [] (warn_slowpath_common+0x4c/0x68) >> [ 0.285552] [] (warn_slowpath_common+0x4c/0x68) from >> [] (warn_slowpath_null+0x1c/0x24) >> [ 0.285614] [] (warn_slowpath_null+0x1c/0x24) from >> [] (of_device_alloc+0x154/0x168) >> [ 0.285675] [] (of_device_alloc+0x154/0x168) from >> [] (of_platform_device_create_pdata+0x34/0x80) >> [ 0.285736] [] >> (of_platform_device_create_pdata+0x34/0x80) from [] >> (gpmc_probe_generic_child+0x180/0x240) >> [ 0.285827] [] (gpmc_probe_generic_child+0x180/0x240) >> from [] (gpmc_probe+0x4b4/0x614) >> [ 0.285888] [] (gpmc_probe+0x4b4/0x614) from [] >> (platform_drv_probe+0x18/0x1c) >> [ 0.285949] [] (platform_drv_probe+0x18/0x1c) from >> [] (driver_probe_device+0x108/0x21c) > > Any chance you have still have some additional code in your dts to > request the gpio? I recall you made some hacks to make this work before. > Yes, but I remove all those hacks from my DT and gpmc driver. Is the first thing I thought and I already doble checked that. >> I probably won't have time to dig further on this until later this >> week but I wanted to share with you in case you know why is being >> calling twice and if you thought about a solution. > > Care to post your dts file? > I'm using the following patch to add smsc ethernet support to my board + adding 'ranges = <5 0 0x2c000000 0x1000000>;' to the gpmc device node on omap3.dtsi: From 4fe26a40229e6e97c2ab3b80865c9f24e8ff3424 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Wed, 27 Feb 2013 02:59:29 +0100 Subject: [PATCH 2/2] ARM: dts: omap3-igep0020: Add SMSC911x LAN chip support The IGEPv2 board has an SMSC LAN9221i ethernet chip connected to the OMAP3 processor though the General-Purpose Memory Controller. This patch adds a device node for the ethernet chip as a GPMC child and all its requirements (regulators, GPIO and pin muxs). Signed-off-by: Javier Martinez Canillas --- arch/arm/boot/dts/omap3-igep.dtsi | 6 ++++ arch/arm/boot/dts/omap3-igep0020.dts | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi index f8fe3b7..d5cd504 100644 --- a/arch/arm/boot/dts/omap3-igep.dtsi +++ b/arch/arm/boot/dts/omap3-igep.dtsi @@ -62,6 +62,12 @@ 0x126 0x0100 /* sdmmc1_dat7.sdmmc1_dat7 INPUT | MODE 0 */ >; }; + + smsc911x_pins: pinmux_smsc911x_pins { + pinctrl-single,pins = < + 0x1a2 0x0104 /* mcspi1_cs2.gpio_176 INPUT | MODE4 */ + >; + }; }; &i2c1 { diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index e2b9849..32a59df 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts @@ -40,6 +40,18 @@ gpios = <&twl_gpio 19 1>; }; }; + + vddvario: regulator-vddvario { + compatible = "regulator-fixed"; + regulator-name = "vddvario"; + regulator-always-on; + }; + + vdd33a: regulator-vdd33a { + compatible = "regulator-fixed"; + regulator-name = "vdd33a"; + regulator-always-on; + }; }; &i2c3 { @@ -54,3 +66,43 @@ reg = <0x50>; }; }; + +&gpmc { + ethernet@5,0 { + pinctrl-names = "default"; + pinctrl-0 = <&smsc911x_pins>; + compatible = "smsc,lan9221", "smsc,lan9115"; + reg = <5 0 0xff>; + bank-width = <2>; + + gpmc,mux-add-data; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <186>; + gpmc,cs-wr-off-ns = <186>; + gpmc,adv-on-ns = <12>; + gpmc,adv-rd-off-ns = <48>; + gpmc,adv-wr-off-ns = <48>; + gpmc,oe-on-ns = <54>; + gpmc,oe-off-ns = <168>; + gpmc,we-on-ns = <54>; + gpmc,we-off-ns = <168>; + gpmc,rd-cycle-ns = <186>; + gpmc,wr-cycle-ns = <186>; + gpmc,access-ns = <114>; + gpmc,page-burst-access-ns = <6>; + gpmc,bus-turnaround-ns = <12>; + gpmc,cycle2cycle-delay-ns = <18>; + gpmc,wr-data-mux-bus-ns = <90>; + gpmc,wr-access-ns = <186>; + gpmc,cycle2cycle-samecsen; + gpmc,cycle2cycle-diffcsen; + + interrupt-parent = <&gpio6>; + interrupts = <16 8>; + vmmc-supply = <&vddvario>; + vmmc_aux-supply = <&vdd33a>; + reg-io-width = <4>; + + smsc,save-mac-address; + }; +};