devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: P L Sai Krishna <lakshmi.sai.krishna.potthuri@xilinx.com>
To: Michal Simek <michal.simek@xilinx.com>,
	Soren Brinkmann <soren.brinkmann@xilinx.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Kevin Hao <haokexin@gmail.com>, Emil Lenchak <emill@xilinx.com>,
	Tobias Klauser <tklauser@distanz.ch>,
	Sudeep Holla <Sudeep.Holla@arm.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jisheng Zhang <jszhang@marvell.com>,
	"Ivan T. Ivanov" <ivan.ivanov@linaro.org>,
	Scott Branden <sbranden@broadcom.com>,
	Vincent Yang <vincent.yang.fujitsu@gmail.com>,
	Haibo Chen <haibo.chen@freescale.com>,
	Marek Vasut <marex@denx.de>,
	"ludovic.desroches@atmel.com" <ludovic.desroches@atmel.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Suman Tripathi <stripathi@apm.com>,
	Shawn Lin <shawn.lin@rock-chips.com>
Cc: devicetree@vger.kernel.org, Harini Katakam <harinik@xilinx.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	P L Sai Krishna <lakshmis@xilinx.com>,
	Anirudha Sarangi <anirudh@xilinx.com>,
	Punnaiah Choudary Kalluri <punnaia@xilinx.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [LINUX PATCH 3/5] mmc: host: Added DT support to use SDIO in standard speed.
Date: Tue, 19 Jan 2016 19:47:33 +0530	[thread overview]
Message-ID: <1453213055-35563-3-git-send-email-lakshmis@xilinx.com> (raw)
In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com>

If the controller is used in High Speed Mode (Zynq-7000 data output on
rising edge of the clock) the hold time requirement for the
JEDEC/MMC 4.41 Specification is NOT met.
In Standard Speed Mode (Zynq-7000 data output on falling edge of the clock)
an extra half clock period is added to the clock to out delay meeting the
hold time requirement.
This patch adds device tree property 'broken-mmc-highspeed' to sdhci node
to force the controller to use in standard speed as a workaround.

Signed-off-by: Emil Lenchak <emill@xilinx.com>
Signed-off-by: P L Sai Krishna <lakshmis@xilinx.com>
---
 drivers/mmc/host/sdhci-pltfm.c | 3 +++
 drivers/mmc/host/sdhci.c       | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 223c5eb..37df5cb 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -102,6 +102,9 @@ void sdhci_get_of_property(struct platform_device *pdev)
 	    of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
+	if (of_get_property(np, "broken-mmc-highspeed", NULL))
+		host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
+
 	of_property_read_u32(np, "clock-frequency", &pltfm_host->clock);
 
 	if (of_find_property(np, "keep-power-in-suspend", NULL))
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 8b064cd..5cc07d6 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3114,7 +3114,8 @@ int sdhci_add_host(struct sdhci_host *host)
 	if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
 		mmc->caps &= ~MMC_CAP_CMD23;
 
-	if (caps[0] & SDHCI_CAN_DO_HISPD)
+	if ((caps[0] & SDHCI_CAN_DO_HISPD) &&
+		!(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT))
 		mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
 	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
-- 
2.1.2

  parent reply	other threads:[~2016-01-19 14:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 14:17 [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode P L Sai Krishna
2016-01-19 14:17 ` [LINUX PATCH 2/5] Documentation: mmc: Updated the binding doc for Arasan SDHCI P L Sai Krishna
     [not found]   ` <1453213055-35563-2-git-send-email-lakshmis-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2016-01-19 16:50     ` Sören Brinkmann
2016-01-19 17:19   ` Rob Herring
2016-01-19 19:03     ` Michal Simek
2016-01-19 14:17 ` P L Sai Krishna [this message]
2016-01-19 14:17 ` [LINUX PATCH 4/5] " P L Sai Krishna
2016-01-19 17:16   ` Rob Herring
2016-01-20  5:51     ` Lakshmi Sai Krishna Potthuri
2016-01-20 15:05       ` Rob Herring
2016-01-19 14:17 ` [LINUX PATCH 5/5] mmc: host: Update the quirks for this controller P L Sai Krishna
2016-01-19 16:05   ` Holger Schurig
     [not found] ` <1453213055-35563-1-git-send-email-lakshmis-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2016-01-19 15:01   ` [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode Chen-Yu Tsai
     [not found]     ` <CAGb2v655SF-CUbZKKTif0toHqJ61Z4P4_QzQacfQL9EN0Y0zZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-20  5:21       ` Lakshmi Sai Krishna Potthuri
2016-01-19 17:57 ` Russell King - ARM Linux
2016-01-20  6:02   ` Lakshmi Sai Krishna Potthuri

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=1453213055-35563-3-git-send-email-lakshmis@xilinx.com \
    --to=lakshmi.sai.krishna.potthuri@xilinx.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=adrian.hunter@intel.com \
    --cc=anirudh@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=emill@xilinx.com \
    --cc=galak@codeaurora.org \
    --cc=haibo.chen@freescale.com \
    --cc=haokexin@gmail.com \
    --cc=harinik@xilinx.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=ivan.ivanov@linaro.org \
    --cc=jszhang@marvell.com \
    --cc=lakshmis@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=marex@denx.de \
    --cc=mark.rutland@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=pawel.moll@arm.com \
    --cc=punnaia@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=stripathi@apm.com \
    --cc=tklauser@distanz.ch \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.yang.fujitsu@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).