Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499883 > unrolled thread

[RFC v2 0/2] Add device tree property and driver behavior for supporting sdhci configurations with broken highspeed.

Started byZach Brown <zach.brown@ni.com>
First post2016-10-12 20:50 +0200
Last post2016-10-17 09:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RFC v2 0/2] Add device tree property and driver behavior for supporting sdhci configurations with broken highspeed. Zach Brown <zach.brown@ni.com> - 2016-10-12 20:50 +0200
    [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set Zach Brown <zach.brown@ni.com> - 2016-10-12 20:50 +0200
      Re: [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when  broken-highspeed property is set Adrian Hunter <adrian.hunter@intel.com> - 2016-10-17 09:10 +0200

#1499883 — [RFC v2 0/2] Add device tree property and driver behavior for supporting sdhci configurations with broken highspeed.

FromZach Brown <zach.brown@ni.com>
Date2016-10-12 20:50 +0200
Subject[RFC v2 0/2] Add device tree property and driver behavior for supporting sdhci configurations with broken highspeed.
Message-ID<srwLf-8fi-1@gated-at.bofh.it>
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
sd-broken-highspeed.

The second patch keeps the sd controller and card from going into highspeed
mode when the property is set.

v2:
 * changed sd-broken-highspeed to broken-highspeed
 * Removed new quirk, instead read of property when would've checked quirk

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

[toc] | [next] | [standalone]


#1499885 — [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set

FromZach Brown <zach.brown@ni.com>
Date2016-10-12 20:50 +0200
Subject[RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set
Message-ID<srwLg-8fi-15@gated-at.bofh.it>
In reply to#1499883
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@ni.com>
---
 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 4805566..17e6c50 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>
 
@@ -3274,7 +3275,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

[toc] | [prev] | [next] | [standalone]


#1501638 — Re: [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-10-17 09:10 +0200
SubjectRe: [RFC v2 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set
Message-ID<stadz-j1-1@gated-at.bofh.it>
In reply to#1499885
On 12/10/16 21:40, Zach Brown wrote:
> 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@ni.com>

Assuming the DT property is accepted:

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  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 4805566..17e6c50 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>
>  
> @@ -3274,7 +3275,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) &&
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web