diff mbox

[V2,04/19] mmc: mmci: Add DT bindings for signal direction

Message ID 1396279100-2920-5-git-send-email-ulf.hansson@linaro.org
State Superseded
Headers show

Commit Message

Ulf Hansson March 31, 2014, 3:18 p.m. UTC
Some variants have support for indicating the bus signal directions,
which currently are configured through platform data.

Add corresponding DT bindings to enable us to move away from using the
platform data.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 Documentation/devicetree/bindings/mmc/mmci.txt |   11 ++++++++++-
 drivers/mmc/host/mmci.c                        |   11 +++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

Comments

Linus Walleij April 3, 2014, 3:47 p.m. UTC | #1
On Mon, Mar 31, 2014 at 5:18 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:

> Some variants have support for indicating the bus signal directions,
> which currently are configured through platform data.
>
> Add corresponding DT bindings to enable us to move away from using the
> platform data.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring April 3, 2014, 8:05 p.m. UTC | #2
On Mon, Mar 31, 2014 at 10:18 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Some variants have support for indicating the bus signal directions,
> which currently are configured through platform data.
>
> Add corresponding DT bindings to enable us to move away from using the
> platform data.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  Documentation/devicetree/bindings/mmc/mmci.txt |   11 ++++++++++-
>  drivers/mmc/host/mmci.c                        |   11 +++++++++++
>  2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
> index ff233d1..9bd2ffa 100644
> --- a/Documentation/devicetree/bindings/mmc/mmci.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmci.txt
> @@ -4,7 +4,8 @@ The ARM PrimeCell MMCI PL180 and PL181 provides an interface for
>  reading and writing to MultiMedia and SD cards alike.
>
>  This file documents differences between the core properties described
> -by mmc.txt and the properties used by the mmci driver.
> +by mmc.txt and the properties used by the mmci driver. Using "st" as
> +the prefix for a property, indicates support by the ST Micro variant.
>
>  Required properties:
>  - compatible             : contains "arm,pl18x", "arm,primecell".
> @@ -18,6 +19,11 @@ Optional properties:
>  - mmc-cap-sd-highspeed   : indicates whether SD is high speed capable.
>  - vqmmc-supply           : phandle to the regulator device tree node, mentioned
>                             as the VCCQ/VDD_IO supply in the eMMC/SD specs.
> +- st,sig-dir-dat0        : bus signal direction pin used for DAT[0].
> +- st,sig-dir-dat2        : bus signal direction pin used for DAT[2].
> +- st,sig-dir-dat31       : bus signal direction pin used for DAT[3] and DAT[1].
> +- st,sig-dir-dat74       : bus signal direction pin used for DAT[4] to DAT[7].
> +- st,sig-dir-cmd         : cmd signal direction pin used for CMD.

What I'm still not clear on is when you set these properties and when
you don't. For example, is any combination valid and why wouldn't all
data signals be configured the same way?

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson April 4, 2014, 11:47 a.m. UTC | #3
On 3 April 2014 22:05, Rob Herring <robherring2@gmail.com> wrote:
> On Mon, Mar 31, 2014 at 10:18 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> Some variants have support for indicating the bus signal directions,
>> which currently are configured through platform data.
>>
>> Add corresponding DT bindings to enable us to move away from using the
>> platform data.
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> ---
>>  Documentation/devicetree/bindings/mmc/mmci.txt |   11 ++++++++++-
>>  drivers/mmc/host/mmci.c                        |   11 +++++++++++
>>  2 files changed, 21 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
>> index ff233d1..9bd2ffa 100644
>> --- a/Documentation/devicetree/bindings/mmc/mmci.txt
>> +++ b/Documentation/devicetree/bindings/mmc/mmci.txt
>> @@ -4,7 +4,8 @@ The ARM PrimeCell MMCI PL180 and PL181 provides an interface for
>>  reading and writing to MultiMedia and SD cards alike.
>>
>>  This file documents differences between the core properties described
>> -by mmc.txt and the properties used by the mmci driver.
>> +by mmc.txt and the properties used by the mmci driver. Using "st" as
>> +the prefix for a property, indicates support by the ST Micro variant.
>>
>>  Required properties:
>>  - compatible             : contains "arm,pl18x", "arm,primecell".
>> @@ -18,6 +19,11 @@ Optional properties:
>>  - mmc-cap-sd-highspeed   : indicates whether SD is high speed capable.
>>  - vqmmc-supply           : phandle to the regulator device tree node, mentioned
>>                             as the VCCQ/VDD_IO supply in the eMMC/SD specs.
>> +- st,sig-dir-dat0        : bus signal direction pin used for DAT[0].
>> +- st,sig-dir-dat2        : bus signal direction pin used for DAT[2].
>> +- st,sig-dir-dat31       : bus signal direction pin used for DAT[3] and DAT[1].
>> +- st,sig-dir-dat74       : bus signal direction pin used for DAT[4] to DAT[7].
>> +- st,sig-dir-cmd         : cmd signal direction pin used for CMD.
>
> What I'm still not clear on is when you set these properties and when
> you don't. For example, is any combination valid and why wouldn't all
> data signals be configured the same way?

Several combinations are possible.

This is a matter of configuring the internal logic of the primecell to
which signals it shall use. That will be depending on what signal
connectors there are available on the external voltage level shifter
circuit and how you have routed these to the primecell.

The signals are used to introduce a delta delay between the external
level shifter drive enable and internal IO drive enable. It's needed
to be able to cope with the electrical parts of the SD card
specification.

Hope this answers your questions. :-)

Kind regards
Ulf Hansson

>
> Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
index ff233d1..9bd2ffa 100644
--- a/Documentation/devicetree/bindings/mmc/mmci.txt
+++ b/Documentation/devicetree/bindings/mmc/mmci.txt
@@ -4,7 +4,8 @@  The ARM PrimeCell MMCI PL180 and PL181 provides an interface for
 reading and writing to MultiMedia and SD cards alike.
 
 This file documents differences between the core properties described
-by mmc.txt and the properties used by the mmci driver.
+by mmc.txt and the properties used by the mmci driver. Using "st" as
+the prefix for a property, indicates support by the ST Micro variant.
 
 Required properties:
 - compatible             : contains "arm,pl18x", "arm,primecell".
@@ -18,6 +19,11 @@  Optional properties:
 - mmc-cap-sd-highspeed   : indicates whether SD is high speed capable.
 - vqmmc-supply           : phandle to the regulator device tree node, mentioned
                            as the VCCQ/VDD_IO supply in the eMMC/SD specs.
+- st,sig-dir-dat0        : bus signal direction pin used for DAT[0].
+- st,sig-dir-dat2        : bus signal direction pin used for DAT[2].
+- st,sig-dir-dat31       : bus signal direction pin used for DAT[3] and DAT[1].
+- st,sig-dir-dat74       : bus signal direction pin used for DAT[4] to DAT[7].
+- st,sig-dir-cmd         : cmd signal direction pin used for CMD.
 
 Example:
 
@@ -38,6 +44,9 @@  sdi0_per1@80126000 {
 	mmc-cap-sd-highspeed;
 	mmc-cap-mmc-highspeed;
 	cd-gpios  = <&gpio2 31 0x4>; // 95
+	st,sig-dir-dat0;
+	st,sig-dir-dat2;
+	st,sig-dir-cmd;
 
 	vmmc-supply = <&ab8500_ldo_aux3_reg>;
 	vqmmc-supply = <&vmmci>;
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index d6f20ba..c99ec88 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1392,6 +1392,17 @@  static void mmci_dt_populate_generic_pdata(struct device_node *np,
 {
 	int bus_width = 0;
 
+	if (of_get_property(np, "st,sig-dir-dat0", NULL))
+		pdata->sigdir |= MCI_ST_DATA0DIREN;
+	if (of_get_property(np, "st,sig-dir-dat2", NULL))
+		pdata->sigdir |= MCI_ST_DATA2DIREN;
+	if (of_get_property(np, "st,sig-dir-dat31", NULL))
+		pdata->sigdir |= MCI_ST_DATA31DIREN;
+	if (of_get_property(np, "st,sig-dir-dat74", NULL))
+		pdata->sigdir |= MCI_ST_DATA74DIREN;
+	if (of_get_property(np, "st,sig-dir-cmd", NULL))
+		pdata->sigdir |= MCI_ST_CMDDIREN;
+
 	pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0);
 	pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0);