All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property
@ 2017-11-06 15:29 Ard Biesheuvel
  2017-11-06 15:29 ` [PATCH v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute Ard Biesheuvel
  2017-11-07 13:23 ` [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Ulf Hansson
  0 siblings, 2 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2017-11-06 15:29 UTC (permalink / raw)
  To: ulf.hansson-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	adrian.hunter-ral2JQCrhuEAvxtiuMwx3w,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Ard Biesheuvel

Document a new boolean property of the sdhci-fujitsu binding that
indicates whether the CMD_DAT_DELAY bit needs to be set in the
F_SDH30_ESD_CONTROL register.

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
v3: added Rob's ack
v2: use vendor prefix

 Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt b/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt
index de2c53cff4f1..3ee9263adf73 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt
+++ b/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt
@@ -15,6 +15,8 @@ Required properties:
 Optional properties:
 - vqmmc-supply: phandle to the regulator device tree node, mentioned
   as the VCCQ/VDD_IO supply in the eMMC/SD specs.
+- fujitsu,cmd-dat-delay-select: boolean property indicating that this host
+  requires the CMD_DAT_DELAY control to be enabled.
 
 Example:
 
-- 
2.11.0

--
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] 5+ messages in thread

* [PATCH v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute
  2017-11-06 15:29 [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Ard Biesheuvel
@ 2017-11-06 15:29 ` Ard Biesheuvel
       [not found]   ` <20171106152923.32114-2-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2017-11-07 13:23 ` [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Ulf Hansson
  1 sibling, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2017-11-06 15:29 UTC (permalink / raw)
  To: ulf.hansson, robh+dt, mark.rutland, adrian.hunter, linux-mmc
  Cc: devicetree, Ard Biesheuvel

The Socionext SynQuacer SoC inherits this IP from Fujitsu, but
requires the F_SDH30_CMD_DAT_DELAY bit to be set in the
F_SDH30_ESD_CONTROL control register. So set this bit if the
DT node has the 'fujitsu,cmd-dat-delay-select' property.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
v3: don't reorder struct members to reduce padding
    remove pr_info() and simplify conditional assignment
v2: no change

 drivers/mmc/host/sdhci_f_sdh30.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index 111b66f5439b..04ca0d33a521 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -13,6 +13,7 @@
 #include <linux/err.h>
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/property.h>
 #include <linux/clk.h>
 
 #include "sdhci-pltfm.h"
@@ -47,6 +48,7 @@ struct f_sdhost_priv {
 	struct clk *clk;
 	u32 vendor_hs200;
 	struct device *dev;
+	bool enable_cmd_dat_delay;
 };
 
 static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
@@ -84,10 +86,19 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
 
 static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
 {
+	struct f_sdhost_priv *priv = sdhci_priv(host);
+	u32 ctl;
+
 	if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
 		sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
 
 	sdhci_reset(host, mask);
+
+	if (priv->enable_cmd_dat_delay) {
+		ctl = sdhci_readl(host, F_SDH30_ESD_CONTROL);
+		ctl |= F_SDH30_CMD_DAT_DELAY;
+		sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL);
+	}
 }
 
 static const struct sdhci_ops sdhci_f_sdh30_ops = {
@@ -126,6 +137,9 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
 	host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE |
 			SDHCI_QUIRK2_TUNING_WORK_AROUND;
 
+	priv->enable_cmd_dat_delay = device_property_read_bool(dev,
+						"fujitsu,cmd-dat-delay-select");
+
 	ret = mmc_of_parse(host->mmc);
 	if (ret)
 		goto err;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute
       [not found]   ` <20171106152923.32114-2-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2017-11-07  8:52     ` Adrian Hunter
  2017-11-07 13:23     ` Ulf Hansson
  1 sibling, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2017-11-07  8:52 UTC (permalink / raw)
  To: Ard Biesheuvel, ulf.hansson-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA

On 06/11/17 17:29, Ard Biesheuvel wrote:
> The Socionext SynQuacer SoC inherits this IP from Fujitsu, but
> requires the F_SDH30_CMD_DAT_DELAY bit to be set in the
> F_SDH30_ESD_CONTROL control register. So set this bit if the
> DT node has the 'fujitsu,cmd-dat-delay-select' property.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Acked-by: Adrian Hunter <adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

> ---
> v3: don't reorder struct members to reduce padding
>     remove pr_info() and simplify conditional assignment
> v2: no change
> 
>  drivers/mmc/host/sdhci_f_sdh30.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
> index 111b66f5439b..04ca0d33a521 100644
> --- a/drivers/mmc/host/sdhci_f_sdh30.c
> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
> @@ -13,6 +13,7 @@
>  #include <linux/err.h>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> +#include <linux/property.h>
>  #include <linux/clk.h>
>  
>  #include "sdhci-pltfm.h"
> @@ -47,6 +48,7 @@ struct f_sdhost_priv {
>  	struct clk *clk;
>  	u32 vendor_hs200;
>  	struct device *dev;
> +	bool enable_cmd_dat_delay;
>  };
>  
>  static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
> @@ -84,10 +86,19 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
>  
>  static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
>  {
> +	struct f_sdhost_priv *priv = sdhci_priv(host);
> +	u32 ctl;
> +
>  	if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
>  		sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
>  
>  	sdhci_reset(host, mask);
> +
> +	if (priv->enable_cmd_dat_delay) {
> +		ctl = sdhci_readl(host, F_SDH30_ESD_CONTROL);
> +		ctl |= F_SDH30_CMD_DAT_DELAY;
> +		sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL);
> +	}
>  }
>  
>  static const struct sdhci_ops sdhci_f_sdh30_ops = {
> @@ -126,6 +137,9 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
>  	host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE |
>  			SDHCI_QUIRK2_TUNING_WORK_AROUND;
>  
> +	priv->enable_cmd_dat_delay = device_property_read_bool(dev,
> +						"fujitsu,cmd-dat-delay-select");
> +
>  	ret = mmc_of_parse(host->mmc);
>  	if (ret)
>  		goto err;
> 

--
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	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property
  2017-11-06 15:29 [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Ard Biesheuvel
  2017-11-06 15:29 ` [PATCH v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute Ard Biesheuvel
@ 2017-11-07 13:23 ` Ulf Hansson
  1 sibling, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2017-11-07 13:23 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Rob Herring, Mark Rutland, Adrian Hunter, linux-mmc, devicetree

On 6 November 2017 at 16:29, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> Document a new boolean property of the sdhci-fujitsu binding that
> indicates whether the CMD_DAT_DELAY bit needs to be set in the
> F_SDH30_ESD_CONTROL register.
>
> Acked-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
> v3: added Rob's ack
> v2: use vendor prefix
>
>  Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt b/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt
> index de2c53cff4f1..3ee9263adf73 100644
> --- a/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt
> +++ b/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt
> @@ -15,6 +15,8 @@ Required properties:
>  Optional properties:
>  - vqmmc-supply: phandle to the regulator device tree node, mentioned
>    as the VCCQ/VDD_IO supply in the eMMC/SD specs.
> +- fujitsu,cmd-dat-delay-select: boolean property indicating that this host
> +  requires the CMD_DAT_DELAY control to be enabled.
>
>  Example:
>
> --
> 2.11.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute
       [not found]   ` <20171106152923.32114-2-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  2017-11-07  8:52     ` Adrian Hunter
@ 2017-11-07 13:23     ` Ulf Hansson
  1 sibling, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2017-11-07 13:23 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Rob Herring, Mark Rutland, Adrian Hunter,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On 6 November 2017 at 16:29, Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> The Socionext SynQuacer SoC inherits this IP from Fujitsu, but
> requires the F_SDH30_CMD_DAT_DELAY bit to be set in the
> F_SDH30_ESD_CONTROL control register. So set this bit if the
> DT node has the 'fujitsu,cmd-dat-delay-select' property.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
> v3: don't reorder struct members to reduce padding
>     remove pr_info() and simplify conditional assignment
> v2: no change
>
>  drivers/mmc/host/sdhci_f_sdh30.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
> index 111b66f5439b..04ca0d33a521 100644
> --- a/drivers/mmc/host/sdhci_f_sdh30.c
> +++ b/drivers/mmc/host/sdhci_f_sdh30.c
> @@ -13,6 +13,7 @@
>  #include <linux/err.h>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> +#include <linux/property.h>
>  #include <linux/clk.h>
>
>  #include "sdhci-pltfm.h"
> @@ -47,6 +48,7 @@ struct f_sdhost_priv {
>         struct clk *clk;
>         u32 vendor_hs200;
>         struct device *dev;
> +       bool enable_cmd_dat_delay;
>  };
>
>  static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
> @@ -84,10 +86,19 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
>
>  static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
>  {
> +       struct f_sdhost_priv *priv = sdhci_priv(host);
> +       u32 ctl;
> +
>         if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
>                 sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
>
>         sdhci_reset(host, mask);
> +
> +       if (priv->enable_cmd_dat_delay) {
> +               ctl = sdhci_readl(host, F_SDH30_ESD_CONTROL);
> +               ctl |= F_SDH30_CMD_DAT_DELAY;
> +               sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL);
> +       }
>  }
>
>  static const struct sdhci_ops sdhci_f_sdh30_ops = {
> @@ -126,6 +137,9 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
>         host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE |
>                         SDHCI_QUIRK2_TUNING_WORK_AROUND;
>
> +       priv->enable_cmd_dat_delay = device_property_read_bool(dev,
> +                                               "fujitsu,cmd-dat-delay-select");
> +
>         ret = mmc_of_parse(host->mmc);
>         if (ret)
>                 goto err;
> --
> 2.11.0
>
--
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	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-07 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 15:29 [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Ard Biesheuvel
2017-11-06 15:29 ` [PATCH v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute Ard Biesheuvel
     [not found]   ` <20171106152923.32114-2-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-11-07  8:52     ` Adrian Hunter
2017-11-07 13:23     ` Ulf Hansson
2017-11-07 13:23 ` [PATCH v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Ulf Hansson

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.