* [PATCH 0/2] Add device tree property and quirk for supporting sdhci
@ 2016-10-18 15:37 Zach Brown
2016-10-18 15:37 ` [PATCH 1/2] sdhci: Add device tree property broken-highspeed Zach Brown
[not found] ` <1476805026-677-1-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>
0 siblings, 2 replies; 3+ messages in thread
From: Zach Brown @ 2016-10-18 15:37 UTC (permalink / raw)
To: ulf.hansson
Cc: adrian.hunter, robh+dt, mark.rutland, linux-mmc, devicetree,
linux-kernel, zach.brown
Some board configurations can not support sd highspeed mode due to the distance
between the card slot and the controller. The card and controller report that
they are capable of highspeed however, so we need a mechanism for specifying
that the setup is incapable of supporting highspeed mode.
The first patch adds documentation about a new devicetree property
broken-highspeed.
The second patch keeps the sd controller and card from going into highspeed
mode when the property is set.
Zach Brown (2):
sdhci: Add device tree property broken-highspeed
sdhci: Prevent SD from doing high-speed timing when broken-highspeed
property is set
Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
drivers/mmc/host/sdhci.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] sdhci: Add device tree property broken-highspeed
2016-10-18 15:37 [PATCH 0/2] Add device tree property and quirk for supporting sdhci Zach Brown
@ 2016-10-18 15:37 ` Zach Brown
[not found] ` <1476805026-677-1-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>
1 sibling, 0 replies; 3+ messages in thread
From: Zach Brown @ 2016-10-18 15:37 UTC (permalink / raw)
To: ulf.hansson
Cc: adrian.hunter, robh+dt, mark.rutland, linux-mmc, devicetree,
linux-kernel, zach.brown
Certain board configurations can make highspeed malfuction due to timing
issues. In these cases a way is needed to force the controller and card
into standard speed even if they otherwise appear to be capable of
highspeed.
The broken-highspeed property will let the sdhci driver know that
highspeed will not work.
Signed-off-by: Zach Brown <zach.brown@ni.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 8a37782..a2b298c 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -52,6 +52,8 @@ Optional properties:
- no-sdio: controller is limited to send sdio cmd during initialization
- no-sd: controller is limited to send sd cmd during initialization
- no-mmc: controller is limited to send mmc cmd during initialization
+- broken-highspeed: Highspeed is broken, even if the controller and card
+ themselves claim they support highspeed.
*NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
polarity properties, we have to fix the meaning of the "normal" and "inverted"
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <1476805026-677-1-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>]
* [PATCH 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set
[not found] ` <1476805026-677-1-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>
@ 2016-10-18 15:37 ` Zach Brown
0 siblings, 0 replies; 3+ messages in thread
From: Zach Brown @ 2016-10-18 15:37 UTC (permalink / raw)
To: ulf.hansson-QSEj5FYQhm4dnm+yROfE0A
Cc: adrian.hunter-ral2JQCrhuEAvxtiuMwx3w,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, zach.brown-acOepvfBmUk
When the broken-highspeed property is set the sdhci driver will not
go into highspeed mode even if the controller and card appear to
otherwise support highspeed mode.
This is useful in cases where the controller and card support highspeed,
but the board configuration or some other issue make highspeed
impossible. For example, we send the SDIO lines through a fpga so we
need the data to change on the falling edge of the clock or there will
be issues with hold time.
Signed-off-by: Zach Brown <zach.brown-acOepvfBmUk@public.gmane.org>
Acked-by: Adrian Hunter <adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/mmc/host/sdhci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1e25b01..4ec44fd 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -22,6 +22,7 @@
#include <linux/scatterlist.h>
#include <linux/regulator/consumer.h>
#include <linux/pm_runtime.h>
+#include <linux/of.h>
#include <linux/leds.h>
@@ -3269,7 +3270,8 @@ int sdhci_setup_host(struct sdhci_host *host)
if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23)
mmc->caps &= ~MMC_CAP_CMD23;
- if (host->caps & SDHCI_CAN_DO_HISPD)
+ if ((host->caps & SDHCI_CAN_DO_HISPD) &&
+ !(of_property_read_bool(mmc_dev(mmc)->of_node, "broken-highspeed")))
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-18 15:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 15:37 [PATCH 0/2] Add device tree property and quirk for supporting sdhci Zach Brown
2016-10-18 15:37 ` [PATCH 1/2] sdhci: Add device tree property broken-highspeed Zach Brown
[not found] ` <1476805026-677-1-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>
2016-10-18 15:37 ` [PATCH 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set Zach Brown
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).