From patchwork Mon Oct 20 19:56:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dinguyen@opensource.altera.com X-Patchwork-Id: 5107531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B01B49F30B for ; Mon, 20 Oct 2014 20:03:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3AB52011E for ; Mon, 20 Oct 2014 20:03:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC8412011D for ; Mon, 20 Oct 2014 20:03:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgJ8G-0002DM-FY; Mon, 20 Oct 2014 20:00:44 +0000 Received: from mail-bn1bon0077.outbound.protection.outlook.com ([157.56.111.77] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XgJ8B-00027y-1u for linux-arm-kernel@lists.infradead.org; Mon, 20 Oct 2014 20:00:40 +0000 Received: from [137.57.160.210] (64.129.157.38) by CY1PR0301MB1196.namprd03.prod.outlook.com (25.160.165.27) with Microsoft SMTP Server (TLS) id 15.0.1054.13; Mon, 20 Oct 2014 20:00:14 +0000 Message-ID: <544568EC.5010201@opensource.altera.com> Date: Mon, 20 Oct 2014 14:56:28 -0500 From: Dinh Nguyen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Doug Anderson Subject: Re: [PATCHv2 1/2] ARM: dts: socfpga: Fix SD card detect References: <1413819079-17120-1-git-send-email-dinguyen@opensource.altera.com> <1413819079-17120-2-git-send-email-dinguyen@opensource.altera.com> <544538FF.7090200@opensource.altera.com> In-Reply-To: X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BY1PR0201CA0018.namprd02.prod.outlook.com (25.160.191.156) To CY1PR0301MB1196.namprd03.prod.outlook.com (25.160.165.27) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1196; X-Forefront-PRVS: 03706074BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(51704005)(189002)(24454002)(199003)(479174003)(164054003)(377454003)(99396003)(110136001)(59896002)(40100003)(77096002)(83506001)(31966008)(97736003)(23676002)(85306004)(76482002)(120916001)(93886004)(122386002)(95666004)(87976001)(50466002)(47776003)(4396001)(86362001)(102836001)(92726001)(107046002)(33656002)(92566001)(106356001)(105586002)(21056001)(101416001)(19580395003)(80316001)(19580405001)(65956001)(46102003)(87266999)(85852003)(80022003)(20776003)(66066001)(42186005)(65806001)(54356999)(76176999)(50986999)(64706001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB1196; H:[137.57.160.210]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:0; LANG:en; X-OriginatorOrg: opensource.altera.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141020_130039_318774_4B3FFA40 X-CRM114-Status: GOOD ( 15.07 ) X-Spam-Score: -0.3 (/) Cc: Mark Rutland , "devicetree@vger.kernel.org" , Dinh Nguyen , Pawel Moll , Ian Campbell , "atull@opensource.altera.com" , Jaehoon Chung , Rob Herring , Kumar Gala , "s.trumtrar@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/20/2014 02:48 PM, Doug Anderson wrote: > Dinh, > > On Mon, Oct 20, 2014 at 12:30 PM, Doug Anderson wrote: >> Dinh, >> >> On Mon, Oct 20, 2014 at 9:31 AM, Dinh Nguyen >> wrote: >>>>> &mmc0 { >>>>> - cd-gpios = <&gpio1 18 0>; >>>>> + cd = <&gpio1 18 0>; >>>> >>>> This doesn't look right to me. What was the error that was passed back? >>>> >>>> I think your change has the same net effect as just deleting the >>>> "cd-gpios" line. ...or is there some code somewhere that is parsing >>>> the "cd" property. >>>> >>> >>> It just hangs here: >>> >>> dw_mmc ff704000.dwmmc0: Using PIO mode. >>> dw_mmc ff704000.dwmmc0: Version ID is 240a >>> dw_mmc ff704000.dwmmc0: DW MMC controller at irq 171, 32 bit host data >>> width, 1024 deep fifo >>> platform ff704000.dwmmc0: Driver dw_mmc requests probe deferral >>> >>> >>> Without this patch : >>> mmc_of_parse ret=-517 (EPROBE_DEFER) >> >> I think you need to dig more into this error. Why are you getting an >> -EPROBE_DEFER when you asked for this GPIO? >> >> The -EPROBE_DEFER tells the system that a resource is not available >> yet and that it should try to re-run the dw_mmc init later once the >> resource becomes available. I believe that some other bug is causing >> the resource to never become available. >> >> Guesses: >> >> * The GPIO specifier is wrong in the DTB and is pointing to a GPIO >> that would never exist. >> >> * Something is happening in the GPIO driver that is causing it to fail. >> >> >> ...so we need to dig in further. > > One odd thing is that it looks like the GPIO controller you're > referencing is disabled. On today's linuxnext, you can see the > "disabled": > > arch/arm/boot/dts/socfpga.dtsi: gpio@ff709000 { > arch/arm/boot/dts/socfpga.dtsi- #address-cells = <1>; > arch/arm/boot/dts/socfpga.dtsi- #size-cells = <0>; > arch/arm/boot/dts/socfpga.dtsi- compatible = "snps,dw-apb-gpio"; > arch/arm/boot/dts/socfpga.dtsi- reg = <0xff709000 0x1000>; > arch/arm/boot/dts/socfpga.dtsi- clocks = <&per_base_clk>; > arch/arm/boot/dts/socfpga.dtsi- status = "disabled"; > arch/arm/boot/dts/socfpga.dtsi- > arch/arm/boot/dts/socfpga.dtsi- gpio1: gpio-controller@0 { > arch/arm/boot/dts/socfpga.dtsi- compatible = > "snps,dw-apb-gpio-port"; > arch/arm/boot/dts/socfpga.dtsi- gpio-controller; > > I don't see anyone else referencing that node to enable it. ...to me > that means that you can't use GPIOs on GPIO1 (???). > > > ...or did I find something wrong? > Ah yes, yes! Thanks so much for find this Doug! With the following patch, boots fine with SD driver loading. --- a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts +++ b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts @@ -37,6 +37,12 @@ */ ethernet0 = &gmac1; }; + + soc { + gpio@ff709000 { + status = "okay"; + }; + }; Thanks, Dinh