From patchwork Thu Feb 21 09:11:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 222211 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5E93F2C0082 for ; Thu, 21 Feb 2013 20:11:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1651E4A103; Thu, 21 Feb 2013 10:11:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M18wjozErRgb; Thu, 21 Feb 2013 10:11:27 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4AF4D4A104; Thu, 21 Feb 2013 10:11:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B71E4A104 for ; Thu, 21 Feb 2013 10:11:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2l7k924bhh8s for ; Thu, 21 Feb 2013 10:11:22 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by theia.denx.de (Postfix) with ESMTPS id 24C5D4A103 for ; Thu, 21 Feb 2013 10:11:20 +0100 (CET) Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MVd8x-1UMwv62H1D-00Z20T; Thu, 21 Feb 2013 10:11:15 +0100 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id B56662A2815B; Thu, 21 Feb 2013 10:11:14 +0100 (CET) X-Virus-Scanned: amavisd-new at avionic-design.de Received: from mailbox.adnet.avionic-design.de ([127.0.0.1]) by localhost (mailbox.avionic-design.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MgUCKMC12IPz; Thu, 21 Feb 2013 10:11:13 +0100 (CET) Received: from mailman.adnet.avionic-design.de (mailman.adnet.avionic-design.de [172.20.31.172]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id 66A6E2A28070; Thu, 21 Feb 2013 10:11:13 +0100 (CET) Received: from localhost (avionic-0098.adnet.avionic-design.de [172.20.31.233]) by mailman.adnet.avionic-design.de (Postfix) with ESMTP id C64B3100038; Thu, 21 Feb 2013 10:11:08 +0100 (CET) Date: Thu, 21 Feb 2013 10:11:13 +0100 From: Thierry Reding To: Tom Warren Message-ID: <20130221091113.GA7340@avionic-0098.mockup.avionic-design.de> References: <1361394350-16585-1-git-send-email-twarren@nvidia.com> <20130221090020.GB4637@avionic-0098.mockup.avionic-design.de> MIME-Version: 1.0 In-Reply-To: <20130221090020.GB4637@avionic-0098.mockup.avionic-design.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V02:K0:tte233KNe7J4YGnUsnFZ7r7zaWs8lmAZCAYYq1j4qgW P9fhWTorDrtJSNYt2jk3qAFiQmzOVz5W7Yn5ntCezBowz+Risd Ovyit3HqPylKHLPhupwfZLQRI8ei9z8zgZffEBlBoZLvesN8nL 2mE05i0e0DcYKFrBbNymGxEJ5TsiGCPsVSR/KAmPgznN2jsy6x uzbUK2pIBXIlMNQUZ4qJEdCmfJO2Az1+rRbrey0lRYqVA8krC5 RFW8lBtIJHRbjyUcArDaxV4tbAU70UzspS3Q52/Fym5qj/gEWJ eczOfJ/pCKKqsqjkHE8feNbEh2EZcyehTW4GuBRhAxOmr2ZlL2 XfFXKbefZWXDXvZlFtZcBxZC85k8JyAiCBVh3p3aBuOdw4YK6w F4SdQfeAkJ6bGZDqEmS1eHQYaBU0IN39MdxKAtw85wzoO9djCK oEC8c Cc: u-boot@lists.denx.de, swarren@nvidia.com, afleming@freescale.com, Tom Warren Subject: Re: [U-Boot] [PATCH v5 0/4] Tegra: MMC: Add DT support for MMC to T20 boards X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On Thu, Feb 21, 2013 at 10:00:20AM +0100, Thierry Reding wrote: > On Wed, Feb 20, 2013 at 02:05:46PM -0700, Tom Warren wrote: > > This patchset adds device-tree support to the Tegra MMC driver. > > All device config is done via properties in the DT files instead > > of hard-coded config options/function arguments. > > > > I've tested this on my Seaboard and everything works fine, > > including card detect. For the other T20 boards, I've used > > the Linux kernel DTS files for the sdhci nodes where there > > wasn't one already, or expanded the info that was already > > there. Everything builds fine, but I haven't tested anything > > but Seaboard. > > > > v2: Changes as per Stephen's & Simon's review > > v3: Changes as per Stephen/Lucas/Thierry/Simon's feedback > > v4: Additional changes as per Stephen/Lucas/Thierry/Simon > > v5: Additional changes as per Stephen/Lucas/Andy > > Hi Tom, > > Joseph Lo posted some patches recently which make changes to the Linux > driver to use common MMC code. This results in the third cell of the > GPIO specifier to actually become meaningful. That is, boards now need > to define the CD GPIO as low-active in order for card-detection to work > properly. > > I wonder if we should be integrating similar changes into this patch > series. fdtdec_get_gpio() seems to already support that functionality, > so I think the only changes necessary would be to change the third cell > in the specifier and make tegra_mmc_getcd() return fdtdec_get_gpio() > instead of !fdtdec_get_gpio(). The below patch is what I used on top of your v5 series and verified that card-detection continues to work as expected. Thierry diff --git a/board/avionic-design/dts/tegra20-tamonten.dtsi b/board/avionic-design/dts/tegra20-tamonten.dtsi index 6296f77..d4c3293 100644 --- a/board/avionic-design/dts/tegra20-tamonten.dtsi +++ b/board/avionic-design/dts/tegra20-tamonten.dtsi @@ -476,7 +476,7 @@ }; sdhci@c8000600 { - cd-gpios = <&gpio 58 0>; /* gpio PH2 */ + cd-gpios = <&gpio 58 1>; /* gpio PH2 */ wp-gpios = <&gpio 59 0>; /* gpio PH3 */ bus-width = <4>; status = "okay"; diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c index 7e8f0b8..6063d08 100644 --- a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@ -490,7 +490,7 @@ int tegra_mmc_getcd(struct mmc *mmc) debug("tegra_mmc_getcd called\n"); if (fdt_gpio_isvalid(&host->cd_gpio)) - return !fdtdec_get_gpio(&host->cd_gpio); + return fdtdec_get_gpio(&host->cd_gpio); return 1; }