public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 0/4] Tegra: MMC: Add DT support for MMC to T20 boards
Date: Thu, 21 Feb 2013 10:11:13 +0100	[thread overview]
Message-ID: <20130221091113.GA7340@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <20130221090020.GB4637@avionic-0098.mockup.avionic-design.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 at 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;
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130221/05267202/attachment.pgp>

  reply	other threads:[~2013-02-21  9:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20 21:05 [U-Boot] [PATCH v5 0/4] Tegra: MMC: Add DT support for MMC to T20 boards Tom Warren
2013-02-20 21:05 ` [U-Boot] [PATCH v5 1/4] fdt: Add dts/dtsi arch & board include paths to DTS_CPPFLAGS Tom Warren
2013-02-20 21:05 ` [U-Boot] [PATCH v5 2/4] Tegra: fdt: tamonten: Add common tamonten.dtsi file from linux Tom Warren
2013-02-20 21:05 ` [U-Boot] [PATCH v5 3/4] Tegra: fdt: Add/enhance sdhci (mmc) nodes for all T20 DT files Tom Warren
2013-02-20 22:35   ` Stephen Warren
2013-02-20 23:01     ` Tom Warren
2013-02-21  0:15       ` Stephen Warren
2013-02-21 15:38         ` Tom Warren
2013-02-20 21:05 ` [U-Boot] [PATCH v5 4/4] Tegra: MMC: Add DT support to MMC driver for all T20 boards Tom Warren
2013-02-20 22:40 ` [U-Boot] [PATCH v5 0/4] Tegra: MMC: Add DT support for MMC to " Stephen Warren
2013-02-21  9:00 ` Thierry Reding
2013-02-21  9:11   ` Thierry Reding [this message]
2013-02-21 15:32   ` Tom Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130221091113.GA7340@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox