Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH v4 05/12] mmc: sdhci: Disable HS200/HS400 mode if controller can't support 1.8v
Date: Thu, 26 Apr 2018 15:38:35 +0530	[thread overview]
Message-ID: <7b877764-22f3-e13b-a8da-1e0b997b4b74@ti.com> (raw)
In-Reply-To: <6bdf4feb-bc12-3779-3de6-e08af1d4f518@intel.com>

Hi Adrian,

On Thursday 26 April 2018 02:25 PM, Adrian Hunter wrote:
> On 25/04/18 15:09, Kishon Vijay Abraham I wrote:
>> Though MMC controller can indicate HS200/HS400 mode capability (by
>> using "mmc-hs200-1_8v"/"mmc-hs400-1_8v" dt property), if the IO lines
>> in the board is connected to 3.3v supply, HS200/HS400 mode cannot be
>> supported. Such boards have "no-1-8-v" property in their dts file.
>> Disable HS200/HS400 mode for boards which have "no-1-8-v" set.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> Acked-by: Tony Lindgren <tony@atomide.com>
>> ---
>>  drivers/mmc/host/sdhci.c | 1 +
>>  include/linux/mmc/host.h | 1 +
>>  2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 2ededa7f43df..b5f047b5f3ae 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -3672,6 +3672,7 @@ int sdhci_setup_host(struct sdhci_host *host)
>>  	if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) {
>>  		host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
>>  				 SDHCI_SUPPORT_DDR50);
>> +		mmc->caps2 &= ~MMC_CAP2_HSX00_1_8V;
> 
> Seems weird for sdhci to clear flags it never set.  Also couldn't we
> reasonably expect dt properties to be consistent?  Is this really about
> setting SDHCI_QUIRK2_NO_1_8_V in your driver and expecting it to override
> other dt properties?  Although that still begs the question why anyone would
> set dt properties that the hardware doesn't support?  I guess you should
> also clear MMC_CAP2_HS400_ES.

The SoC might support a specific mode like HS200. So the SoC specific dtsi file
might have dt properties for HS200 mode set. But the board which uses the SoC
might be modeled in a way a particular mode cannot be used (like IO lines not
connected to 1.8v). One option is to use /delete-property/ in the board dts
file. But since "no-1-8-v" property already indicates HS200 mode cannot be
supported, having a /delete-property/ might be redundant.

I can reset caps2 in sdhci-omap after invoking mmc_of_parse if you feel that
makes more sense.

Thanks
Kishon

  reply	other threads:[~2018-04-26 10:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 12:09 [PATCH v4 00/12] mmc: sdhci-omap: Add UHS/HS200 mode support Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 01/12] mmc: sdhci-omap: Fix when capabilities are obtained from SDHCI_CAPABILITIES reg Kishon Vijay Abraham I
2018-04-26  7:57   ` Adrian Hunter
2018-04-25 12:09 ` [PATCH v4 02/12] mmc: sdhci-omap: Remove setting ADMA capability in driver Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 03/12] mmc: sdhci-omap: Workaround for Errata i843 Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 04/12] mmc: sdhci-omap: Invoke sdhci_get_of_property to read sdhci dt properties Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 05/12] mmc: sdhci: Disable HS200/HS400 mode if controller can't support 1.8v Kishon Vijay Abraham I
2018-04-26  8:55   ` Adrian Hunter
2018-04-26 10:08     ` Kishon Vijay Abraham I [this message]
2018-04-26 10:40       ` Adrian Hunter
2018-04-25 12:09 ` [PATCH v4 06/12] mmc: sdhci: Add quirk to disable HW timeout Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 07/12] mmc: sdhci: Factor out target_timeout calculation Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 08/12] mmc: sdhci: Program a relatively accurate SW timeout value Kishon Vijay Abraham I
2018-04-26  7:52   ` Adrian Hunter
2018-04-25 12:09 ` [PATCH v4 09/12] mmc: sdhci-omap: Workaround for Errata i834 Kishon Vijay Abraham I
2018-04-26  7:53   ` Adrian Hunter
2018-04-25 12:09 ` [PATCH v4 10/12] dt-bindings: sdhci-omap: Add K2G specific binding Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 11/12] mmc: sdhci-omap: Add support for MMC/SD controller in k2g SoC Kishon Vijay Abraham I
2018-04-25 12:09 ` [PATCH v4 12/12] mmc: sdhci-omap: Add sdhci_omap specific ops for enable_sdio_irq Kishon Vijay Abraham I

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=7b877764-22f3-e13b-a8da-1e0b997b4b74@ti.com \
    --to=kishon@ti.com \
    --cc=adrian.hunter@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    /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