Special voltages that can be support by eSDHC of T4 in esdhc node.
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
Documentation/devicetree/bindings/mmc/fsl-esdhc.txt | 3 +++
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 1 +
2 files changed, 4 insertions(+)
@@ -19,6 +19,8 @@ Optional properties: "bus-width = <1>" property. - sdhci,auto-cmd12: specifies that a controller can only handle auto CMD12.+ - 3300 3300: specifies that eSDHC controller can support voltages ranges+ from 3300 to 3300. This is an optional. Example:
Add voltage-range support in esdhc of T4, So we can choose
to read voltages from dts file as one optional.
If we can get a valid voltage-range from device node, we use
this voltage as the final voltage support. Else we still read
from capacity or from other provider.
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/mmc/host/sdhci-of-esdhc.c | 31 +++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 3 +++
include/linux/mmc/sdhci.h | 1 +
3 files changed, 35 insertions(+)
@@ -262,6 +262,35 @@ static int esdhc_pltfm_bus_width(struct sdhci_host *host, int width)return0;}+staticvoidesdhc_get_voltage(structsdhci_host*host,+structplatform_device*pdev)+{+constu32*voltage_ranges;+intnum_ranges,i;+structdevice_node*np;+np=pdev->dev.of_node;++voltage_ranges=of_get_property(np,"voltage-ranges",&num_ranges);+num_ranges=num_ranges/sizeof(*voltage_ranges)/2;+if(!voltage_ranges||!num_ranges){+dev_info(&pdev->dev,"OF: voltage-ranges unspecified\n");+return;+}++for(i=0;i<num_ranges;i++){+constintj=i*2;+u32mask;+mask=mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),+be32_to_cpu(voltage_ranges[j+1]));+if(!mask){+dev_info(&pdev->dev,+"OF: false voltage-ranges specified\n");+return;+}+host->ocr_mask|=mask;+}+}+staticconststructsdhci_opssdhci_esdhc_ops={.read_l=esdhc_readl,.read_w=esdhc_readw,
@@ -317,6 +346,8 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)/* call to generic mmc_of_parse to support additional capabilities */mmc_of_parse(host->mmc);+esdhc_get_voltage(host,pdev);+ret=sdhci_add_host(host);if(ret)sdhci_pltfm_free(pdev);
@@ -171,6 +171,7 @@ struct sdhci_host {unsignedintocr_avail_sdio;/* OCR bit masks */unsignedintocr_avail_sd;unsignedintocr_avail_mmc;+u32ocr_mask;/* available voltages */wait_queue_head_tbuf_ready_int;/* Waitqueue for Buffer Read Ready interrupt */unsignedinttuning_done;/* Condition flag set when CMD19 succeeds */
Subject: [PATCH 1/2] Powerpc: Add voltage ranges support for T4
=20
Special voltages that can be support by eSDHC of T4 in esdhc node.
=20
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
@@ -19,6 +19,8 @@ Optional properties: "bus-width =3D <1>" property. - sdhci,auto-cmd12: specifies that a controller can only handle auto CMD12.+ - 3300 3300: specifies that eSDHC controller can support voltages
This is IMHO incorrect and potentially dangerous.
The T4 silicon will only support 1.8V on SDHC pins per hardware specificati=
on.
The Freescale T4240QDS reference board has extra voltage shifters added to =
allow 3.3V operation, but that is _not_ a silicon feature. It is a specific=
board feature that may or may not translate to other boards, depending on =
how SD spec conformant a board builder wants to be.
If the intent is to state that a physical SDHC interface on a board has to =
be built to support 3.3V operation to be SD spec conformant for off-the-she=
lf cards because a reset would change the signal voltage to 3.3V, then I am=
not sure that putting this down as silicon "feature" without further expla=
nation about the background anywhere is the right way to go.
IMHO silicon features are really just silicon features and not technically =
optional external circuitry additions implied by common use.
Best regards,
Heinz
From: Kumar Gala <hidden> Date: 2013-07-22 14:40:21
On Jul 22, 2013, at 4:47 AM, Wrobel Heinz-R39252 wrote:
quoted
Subject: [PATCH 1/2] Powerpc: Add voltage ranges support for T4
=20
Special voltages that can be support by eSDHC of T4 in esdhc node.
=20
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
=20
This is IMHO incorrect and potentially dangerous.
The T4 silicon will only support 1.8V on SDHC pins per hardware =
specification.
The Freescale T4240QDS reference board has extra voltage shifters =
added to allow 3.3V operation, but that is _not_ a silicon feature. It =
is a specific board feature that may or may not translate to other =
boards, depending on how SD spec conformant a board builder wants to be.
=20
If the intent is to state that a physical SDHC interface on a board =
has to be built to support 3.3V operation to be SD spec conformant for =
off-the-shelf cards because a reset would change the signal voltage to =
3.3V, then I am not sure that putting this down as silicon "feature" =
without further explanation about the background anywhere is the right =
way to go.
IMHO silicon features are really just silicon features and not =
technically optional external circuitry additions implied by common use.
=20
Best regards,
=20
Heinz
I'd say that the t4240si-post.dtsi should be:
voltage-ranges =3D <1800 1800>;
Than have the t4240qds.dts do:
voltage-ranges =3D <1800 1800 3300 3300>;
As the 3.3V sounds like a board specific feature.
[ send this as 2 patches, on for the t4240si-post.dtsi and another for =
the t4240qds.dts ]
- k
=09=
From: Scott Wood <hidden> Date: 2013-07-22 17:41:03
On 07/22/2013 02:53:56 AM, Haijun Zhang wrote:
quoted hunk
Add voltage-range support in esdhc of T4, So we can choose
to read voltages from dts file as one optional.
If we can get a valid voltage-range from device node, we use
this voltage as the final voltage support. Else we still read
from capacity or from other provider.
=20
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/mmc/host/sdhci-of-esdhc.c | 31 =20
+++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 3 +++
include/linux/mmc/sdhci.h | 1 +
3 files changed, 35 insertions(+)
=20
Don't duplicate this code. Move it somewhere common and share it.
Why did you remove the range index from the error string, and why did =20
you change it from dev_err to dev_info?
-Scott=
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: Monday, July 22, 2013 10:40 PM
To: Wrobel Heinz-R39252
Cc: Zhang Haijun-B42677; linux-mmc@vger.kernel.org; linuxppc-
dev@lists.ozlabs.org; Wood Scott-B07421; cjb@laptop.org; Fleming Andy-
AFLEMING; cbouatmailru@gmail.com
Subject: Re: [PATCH 1/2] Powerpc: Add voltage ranges support for T4
=20
=20
On Jul 22, 2013, at 4:47 AM, Wrobel Heinz-R39252 wrote:
=20
quoted
quoted
Subject: [PATCH 1/2] Powerpc: Add voltage ranges support for T4
Special voltages that can be support by eSDHC of T4 in esdhc node.
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
@@ -19,6 +19,8 @@ Optional properties: "bus-width =3D <1>" property. - sdhci,auto-cmd12: specifies that a controller can only handle auto CMD12.+ - 3300 3300: specifies that eSDHC controller can support voltages
This is IMHO incorrect and potentially dangerous.
The T4 silicon will only support 1.8V on SDHC pins per hardware
specification.
quoted
The Freescale T4240QDS reference board has extra voltage shifters added
to allow 3.3V operation, but that is _not_ a silicon feature. It is a
specific board feature that may or may not translate to other boards,
depending on how SD spec conformant a board builder wants to be.
quoted
If the intent is to state that a physical SDHC interface on a board has
to be built to support 3.3V operation to be SD spec conformant for off-
the-shelf cards because a reset would change the signal voltage to 3.3V,
then I am not sure that putting this down as silicon "feature" without
further explanation about the background anywhere is the right way to go.
quoted
IMHO silicon features are really just silicon features and not
technically optional external circuitry additions implied by common use.
quoted
Best regards,
Heinz
=20
I'd say that the t4240si-post.dtsi should be:
=20
voltage-ranges =3D <1800 1800>;
=20
Than have the t4240qds.dts do:
=20
voltage-ranges =3D <1800 1800 3300 3300>;
=20
As the 3.3V sounds like a board specific feature.
=20
[ send this as 2 patches, on for the t4240si-post.dtsi and another for
the t4240qds.dts ]
-----Original Message-----
From: Wood Scott-B07421
Sent: Tuesday, July 23, 2013 1:41 AM
To: Zhang Haijun-B42677
Cc: linux-mmc@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
cbouatmailru@gmail.com; cjb@laptop.org; Fleming Andy-AFLEMING; Zhang
Haijun-B42677; Zhang Haijun-B42677
Subject: Re: [PATCH 2/2] mmc: esdhc: get voltage from dts file
=20
On 07/22/2013 02:53:56 AM, Haijun Zhang wrote:
quoted
Add voltage-range support in esdhc of T4, So we can choose to read
voltages from dts file as one optional.
If we can get a valid voltage-range from device node, we use this
voltage as the final voltage support. Else we still read from capacity
or from other provider.
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/mmc/host/sdhci-of-esdhc.c | 31
+++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 3 +++
include/linux/mmc/sdhci.h | 1 +
3 files changed, 35 insertions(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
b/drivers/mmc/host/sdhci-of-esdhc.c
index 15039e2..8b4b27a 100644
From: Scott Wood <hidden> Date: 2013-07-23 02:42:09
On 07/22/2013 09:38:33 PM, Zhang Haijun-B42677 wrote:
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Tuesday, July 23, 2013 1:41 AM
To: Zhang Haijun-B42677
Cc: linux-mmc@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
cbouatmailru@gmail.com; cjb@laptop.org; Fleming Andy-AFLEMING; Zhang
Haijun-B42677; Zhang Haijun-B42677
Subject: Re: [PATCH 2/2] mmc: esdhc: get voltage from dts file
On 07/22/2013 02:53:56 AM, Haijun Zhang wrote:
quoted
Add voltage-range support in esdhc of T4, So we can choose to read
voltages from dts file as one optional.
If we can get a valid voltage-range from device node, we use this
voltage as the final voltage support. Else we still read from =20
capacity
quoted
quoted
or from other provider.
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/mmc/host/sdhci-of-esdhc.c | 31
+++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 3 +++
include/linux/mmc/sdhci.h | 1 +
3 files changed, 35 insertions(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
b/drivers/mmc/host/sdhci-of-esdhc.c
index 15039e2..8b4b27a 100644
-----Original Message-----
From: Wood Scott-B07421
Sent: Tuesday, July 23, 2013 10:42 AM
To: Zhang Haijun-B42677
Cc: Wood Scott-B07421; linux-mmc@vger.kernel.org; linuxppc-
dev@lists.ozlabs.org; cbouatmailru@gmail.com; cjb@laptop.org; Fleming
Andy-AFLEMING
Subject: Re: [PATCH 2/2] mmc: esdhc: get voltage from dts file
=20
On 07/22/2013 09:38:33 PM, Zhang Haijun-B42677 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Tuesday, July 23, 2013 1:41 AM
To: Zhang Haijun-B42677
Cc: linux-mmc@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
cbouatmailru@gmail.com; cjb@laptop.org; Fleming Andy-AFLEMING; Zhang
Haijun-B42677; Zhang Haijun-B42677
Subject: Re: [PATCH 2/2] mmc: esdhc: get voltage from dts file
On 07/22/2013 02:53:56 AM, Haijun Zhang wrote:
quoted
Add voltage-range support in esdhc of T4, So we can choose to read
voltages from dts file as one optional.
If we can get a valid voltage-range from device node, we use this
voltage as the final voltage support. Else we still read from
capacity
quoted
quoted
or from other provider.
Signed-off-by: Haijun Zhang <redacted>
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/mmc/host/sdhci-of-esdhc.c | 31
+++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 3 +++
include/linux/mmc/sdhci.h | 1 +
3 files changed, 35 insertions(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
b/drivers/mmc/host/sdhci-of-esdhc.c
index 15039e2..8b4b27a 100644
Don't duplicate this code. Move it somewhere common and share it.
[Haijun Wrote:] So, move it drivers/mmc/host/sdhci-pltfm.c and
share it as
Sdhc_get_voltage()....?
I'll let the MMC maintainer say what the appropriate place would
be... Don't capitalize the function name, though. :-)
Somewhere in drivers/mmc/core/core.c, near mmc_vddrange_to_ocrmask() would
be most appropriate, IMO. #ifdef CONFIG_OF would be needed, though.
Thanks,
Anton