All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Warren <twarren.nvidia@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 4/4] Tegra: MMC: Add DT support to MMC driver for all T20 boards
Date: Wed, 20 Feb 2013 08:50:19 -0700	[thread overview]
Message-ID: <CA+m5__Lc2tyQj+UoO+6fKV8TJuLcy9ntc_3Ftoy4tF3XCxf8mA@mail.gmail.com> (raw)
In-Reply-To: <511D6F6A.7020200@wwwdotorg.org>

Stephen,

On Thu, Feb 14, 2013 at 4:12 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 02/14/2013 02:04 PM, Tom Warren wrote:
>> tegra_mmc_init() now parses the DT info for bus width, WP/CD GPIOs, etc.
>> Tested on Seaboard, fully functional.
>>
>> Tamonten boards (medcom-wide, plutux, and tec) use a different/new
>> dtsi file w/common settings.
>
>> diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
>
>> @@ -515,44 +483,47 @@ static int mmc_core_init(struct mmc *mmc)
>>  int tegra_mmc_getcd(struct mmc *mmc)
>>  {
>>       struct mmc_host *host = (struct mmc_host *)mmc->priv;
>> +     debug("%s called, host->cd_gpio = 0x%08X\n", __func__,
>> +             (unsigned)&host->cd_gpio);
>
> That last line should be:
>
> host->cd_gpio.gpio;
>
> The case is because it's a struct address, not the GPIO you want to print.

Actually, I did want to print the address of the cd_gpio struct, so I
could look at it from the cmd line w/md and/or w/JTAG.
But I'll just remove the debug printf entirely, since it was only
useful early on.

>
>> +static int do_mmc_init(int dev_index)
>
>> -     if (host->pwr_gpio >= 0) {
>> +     if (fdt_gpio_isvalid(&host->pwr_gpio)) {
>>               sprintf(gpusage, "SD/MMC%d PWR", dev_index);
>> -             gpio_request(host->pwr_gpio, gpusage);
>> -             gpio_direction_output(host->pwr_gpio, 1);
>> +             gpio_request(host->pwr_gpio.gpio, gpusage);
>> +             fdtdec_set_gpio(&host->pwr_gpio, 1);
>
> That change completely removes the call to gpio_direction_output;
> fdtdec_set_gpio() doesn't do that. This is the cause of the problem on
> PAZ00, and Harmony.
OK, cool. Good catch. I thought the fdtdec_xxx_gpio calls did it all,
but now I see that they don't.

>
>> -     if (host->cd_gpio >= 0) {
>> +     if (fdt_gpio_isvalid(&host->cd_gpio)) {
>>               sprintf(gpusage, "SD/MMC%d CD", dev_index);
>> -             gpio_request(host->cd_gpio, gpusage);
>> -             gpio_direction_input(host->cd_gpio);
>> +             gpio_request(host->cd_gpio.gpio, gpusage);
>> +             card_det = fdtdec_get_gpio(&host->cd_gpio);
>
> Similarly, this change removes the call to gpio_direction_input();
> fdtdec_get_gpio() just reads the GPIO's value and is pointless here.

No, not pointless - I was checking the CD pin state and printing it
out during debug. But it's not of much interest to anyone but me at
this point, so I'll remove the card_det lines.

>
> I'll go retest all the boards after fixing that...
Thanks

  parent reply	other threads:[~2013-02-20 15:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 21:03 [U-Boot] [PATCH v4 0/4] Tegra: MMC: Add DT support for MMC to T20 boards Tom Warren
2013-02-14 21:03 ` [U-Boot] [PATCH v4 1/4] fdt: Add dts/dtsi file include paths to DTC command line Tom Warren
2013-02-14 21:03 ` [U-Boot] [PATCH v4 2/4] Tegra: fdt: Add/enhance sdhci (mmc) nodes for all T20 DT files Tom Warren
2013-02-14 21:04 ` [U-Boot] [PATCH v4 3/4] Tegra: fdt: tamonten: Add common tamonten.dtsi file from linux Tom Warren
2013-02-14 21:04 ` [U-Boot] [PATCH v4 4/4] Tegra: MMC: Add DT support to MMC driver for all T20 boards Tom Warren
2013-02-14 23:12   ` Stephen Warren
2013-02-15 16:42     ` [U-Boot] [PATCH v4 4/4] Tegra: MMC: Add DT support to MMCdriver " Marc Dietrich
2013-02-20 15:51       ` Tom Warren
2013-02-20 15:50     ` Tom Warren [this message]
2013-02-18 23:10   ` [U-Boot] [PATCH v4 4/4] Tegra: MMC: Add DT support to MMC driver " Andy Fleming
2013-02-19 17:32     ` Stephen Warren
2013-02-20 16:04     ` Tom Warren
2013-02-14 22:48 ` [U-Boot] [PATCH v4 0/4] Tegra: MMC: Add DT support for MMC to " Marc Dietrich
2013-02-14 22:54   ` Tom Warren
2013-02-14 22:54   ` Stephen Warren
2013-02-15  0:06 ` Lucas Stach

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=CA+m5__Lc2tyQj+UoO+6fKV8TJuLcy9ntc_3Ftoy4tF3XCxf8mA@mail.gmail.com \
    --to=twarren.nvidia@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.