Skip to contentSkip to conversation

Add SD UHS-I and eMMC HS200 support for eSDHC

PATCH Superseded Yangbo Lu 2 participants 12 messages Mar 3, 2017 – Mar 27, 2017

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Yangbo Lu

author
#0 lore raw

v2 cover Add SD UHS-I and eMMC HS200 support for eSDHC

It's complicated to support SD UHS-I and eMMC HS200 for eSDHC because there're many differences between eSDHC and SD/eMMC spec. Several differences as below must be considered:
1. Peripheral clock must be used instead of platform clock.
- eSDHC could select peripheral clock or platform clock as its clock source. According to RM, UHS-I/HS200 must use peripheral clock since it supports higher frequency than platform clock.
- Patch 1 and patch 6 is to support this.
2. Signal voltage switching requires a control circuit out of eSDHC.
- eSDHC supports signal voltage switch from 3.3v to 1.8v by eSDHC_PROCTL[VOLT_SEL] bit. This bit changes the value of output signal SDHC_VS, and there must be a control circuit out of eSDHC to change the signal voltage according to SDHC_VS output signal.
- Patch 2 is to support this.
3. eSDHC uses tuning block for tuning procedure.
- Tuning clock control register must be configured before tuning.
- Patch 3 is to support this.
4. Delay is needed between tuning cycles for HS200 tuning.
- Once a patch removed mdelay between tuning cycles.
But eSDHC needs it.
- Patch 4 and patch 5 is to support this.
5. UHS-I/HS200 modes could be enabled in dts node.
- Patch 7 is to support this.

Please review and merge these patches on mmc git tree if no changes are required.

Yangbo Lu (7):
mmc: sdhci-of-esdhc: add peripheral clock support
mmc: sdhci-of-esdhc: add support for signal voltage switch
mmc: sdhci-of-esdhc: add tuning support
mmc: sdhci: add a quirk to restore delay in tuning
mmc: sdhci-of-esdhc: add delay between tuning cycles
arm64: dts: ls1046a: add clocks property and compatible for eSDHC node
arm64: dts: ls1046ardb: add MMC HS200/UHS-1 modes support

 arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts |   8 ++
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi    |   3 +-
 drivers/mmc/host/sdhci-esdhc.h                    |   7 +
 drivers/mmc/host/sdhci-of-esdhc.c                 | 167 +++++++++++++++++++++-
 drivers/mmc/host/sdhci.c                          |   3 +-
 drivers/mmc/host/sdhci.h                          |   2 +
 6 files changed, 186 insertions(+), 4 deletions(-)
Signature · 1 line
2.1.0.27.g96db324
author
#1 lore raw

PATCH v2 1/7 mmc: sdhci-of-esdhc: add peripheral clock support

eSDHC could select peripheral clock or platform clock as clock source by the PCS bit of eSDHC Control Register, and this bit couldn't be reset by software reset for all. In default, the platform clock is used. But we have to use peripheral clock since it has a higher frequency to support eMMC HS200 mode and SD UHS-I mode. This patch is to add peripheral clock support and use it instead of platform clock if it's declared in eSDHC dts node.

---
Changes for v2:
- None

---
 drivers/mmc/host/sdhci-esdhc.h    |  1 +
 drivers/mmc/host/sdhci-of-esdhc.c | 70 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 69 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-esdhc.h +1 -0
index ece8b37..5343fc0 100644
@@ -54,6 +54,7 @@
 
 /* Control Register for DMA transfer */
 #define ESDHC_DMA_SYSCTL		0x40c
+#define ESDHC_PERIPHERAL_CLK_SEL	0x00080000
 #define ESDHC_DMA_SNOOP			0x00000040
 
 #endif /* _DRIVERS_MMC_SDHCI_ESDHC_H */
drivers/mmc/host/sdhci-of-esdhc.c +68 -2

113 lines not on this page · raw message

Signature · 1 line
2.1.0.27.g96db324
author
#2 lore raw

PATCH v2 2/7 mmc: sdhci-of-esdhc: add support for signal voltage switch

In reply to Yangbo Lu

eSDHC supports signal voltage switch from 3.3v to 1.8v by eSDHC_PROCTL[VOLT_SEL] bit. This bit changes the value of output signal SDHC_VS, and there must be a control circuit out of eSDHC to change the signal voltage according to SDHC_VS output signal.

---
Changes for v2:

	- Used Adrain's method to support voltage switching:
          host->mmc_host_ops.start_signal_voltage_switch =
                     esdhc_signal_voltage_switch;
---
 drivers/mmc/host/sdhci-esdhc.h    |  1 +
 drivers/mmc/host/sdhci-of-esdhc.c | 74 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)
drivers/mmc/host/sdhci-esdhc.h +1 -0
index 5343fc0..6869567 100644
@@ -37,6 +37,7 @@
 
 /* Protocol Control Register */
 #define ESDHC_PROCTL			0x28
+#define ESDHC_VOLT_SEL			0x00000400
 #define ESDHC_CTRL_4BITBUS		(0x1 << 1)
 #define ESDHC_CTRL_8BITBUS		(0x2 << 1)
 #define ESDHC_CTRL_BUSWIDTH_MASK	(0x3 << 1)
drivers/mmc/host/sdhci-of-esdhc.c +74 -0

92 lines not on this page · raw message

Signature · 1 line
2.1.0.27.g96db324
author
#3 lore raw

PATCH v2 3/7 mmc: sdhci-of-esdhc: add tuning support

In reply to Yangbo Lu

eSDHC uses tuning block for tuning procedure. So the tuning block control register must be configured properly before tuning.

---
Changes for v3:
- Replaced old function for mmc_host_ops.execute_tuning with esdhc_execute_tuning to support eSDHC tuning.

---
 drivers/mmc/host/sdhci-esdhc.h    |  5 +++++
 drivers/mmc/host/sdhci-of-esdhc.c | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+)
drivers/mmc/host/sdhci-esdhc.h +5 -0
index 6869567..c4bbd74 100644
@@ -53,9 +53,14 @@
 #define ESDHC_CLOCK_HCKEN		0x00000002
 #define ESDHC_CLOCK_IPGEN		0x00000001
 
+/* Tuning Block Control Register */
+#define ESDHC_TBCTL			0x120
+#define ESDHC_TB_EN			0x00000004
+
 /* Control Register for DMA transfer */
 #define ESDHC_DMA_SYSCTL		0x40c
 #define ESDHC_PERIPHERAL_CLK_SEL	0x00080000
+#define ESDHC_FLUSH_ASYNC_FIFO		0x00040000
 #define ESDHC_DMA_SNOOP			0x00000040
 
 #endif /* _DRIVERS_MMC_SDHCI_ESDHC_H */
drivers/mmc/host/sdhci-of-esdhc.c +21 -0
index 9ab6943..8007188 100644
@@ -630,6 +630,25 @@ static int esdhc_signal_voltage_switch(struct mmc_host *mmc,
 	}
 }
 
+static int esdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
+{
+	struct sdhci_host *host = mmc_priv(mmc);
+	u32 val;
+
+	/* Use tuning block for tuning procedure */
+	esdhc_clock_enable(host, false);
+	val = sdhci_readl(host, ESDHC_DMA_SYSCTL);
+	val |= ESDHC_FLUSH_ASYNC_FIFO;
+	sdhci_writel(host, val, ESDHC_DMA_SYSCTL);
+
+	val = sdhci_readl(host, ESDHC_TBCTL);
+	val |= ESDHC_TB_EN;
+	sdhci_writel(host, val, ESDHC_TBCTL);
+	esdhc_clock_enable(host, true);
+
+	return sdhci_execute_tuning(mmc, opcode);
+}
+
 #ifdef CONFIG_PM_SLEEP
 static u32 esdhc_proctl;
 static int esdhc_of_suspend(struct device *dev)
@@ -782,6 +801,8 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
 	host->mmc_host_ops.start_signal_voltage_switch =
 		esdhc_signal_voltage_switch;
 
+	host->mmc_host_ops.execute_tuning = esdhc_execute_tuning;
+
 	if (IS_ERR(host))
 		return PTR_ERR(host);
 
Signature · 1 line
2.1.0.27.g96db324
author
#4 lore raw

PATCH v2 4/7 mmc: sdhci: add a quirk to restore delay in tuning

In reply to Yangbo Lu

There was a mdelay between tuning cycles which is removed since eMMC spec didn't require that. However it's observed that eSDHC needed this delay for HS200 successful tuning. Maybe it's also needed for some other controllers. This patch is to add a quirk to fix it.

Fixes 197160d52e85 ("mmc: sdhci: remove mdelay in eMMC tuning")

---
Changes for v2:
- None

---
 drivers/mmc/host/sdhci.c | 3 ++-
 drivers/mmc/host/sdhci.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +2 -1
index 6fdd7a7..5d204d7 100644
@@ -2094,7 +2094,8 @@ static void __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode,
 		}
 
 		/* eMMC spec does not require a delay between tuning cycles */
-		if (opcode == MMC_SEND_TUNING_BLOCK)
+		if ((opcode == MMC_SEND_TUNING_BLOCK) ||
+		    (host->quirks2 & SDHCI_QUIRK2_DELAY_BETWEEN_TUNING_CYCLES))
 			mdelay(1);
 	}
 
drivers/mmc/host/sdhci.h +2 -0
index edf3adf..b89589c 100644
@@ -427,6 +427,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK2_ACMD23_BROKEN			(1<<14)
 /* Broken Clock divider zero in controller */
 #define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN		(1<<15)
+/* Delay is needed between tuning cycles */
+#define SDHCI_QUIRK2_DELAY_BETWEEN_TUNING_CYCLES	(1<<16)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
Signature · 1 line
2.1.0.27.g96db324
maintainer
#5 lore raw

PATCH v2 4/7 mmc: sdhci: add a quirk to restore delay in tuning

Quoted 9 lines · Yangbo Lu

There was a mdelay between tuning cycles which is removed since eMMC spec didn't require that. However it's observed that eSDHC needed this delay for HS200 successful tuning. Maybe it's also needed for some other controllers. This patch is to add a quirk to fix it.

Fixes 197160d52e85 ("mmc: sdhci: remove mdelay in eMMC tuning")

---

I would prefer to do something like this:

---
From: Adrian Hunter <[email protected]>
Date: Thu, 23 Mar 2017 08:54:06 +0200
Subject: [PATCH] mmc: sdhci: Control the delay between tuning commands

The delay between tuning commands for SD cards is not part of the specification. A driver that needs it probably needs it for eMMC too, whereas most drivers would probably like to set it to 0. Make it a host member (host->tuning_delay) that defaults to the existing behaviour. Drivers can set it to zero to eliminate the delay, or set it to a positive value to always have a delay.

---
 drivers/mmc/host/sdhci.c | 11 ++++++++---
 drivers/mmc/host/sdhci.h |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci.c +8 -3
index a33102fc800b..2fc33485df1d 100644
@@ -2100,9 +2100,9 @@ static void __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
 			break;
 		}
 
-		/* eMMC spec does not require a delay between tuning cycles */
-		if (opcode == MMC_SEND_TUNING_BLOCK)
-			mdelay(1);
+		/* Spec does not require a delay between tuning cycles */
+		if (host->tuning_delay > 0)
+			mdelay(host->tuning_delay);
 	}
 
 	pr_info("%s: Tuning failed, falling back to fixed sampling clock\n",
@@ -2164,6 +2164,9 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 
 	host->mmc->retune_period = tuning_count;
 
+	if (host->tuning_delay < 0)
+		host->tuning_delay = opcode == MMC_SEND_TUNING_BLOCK;
+
 	sdhci_start_tuning(host);
 
 	__sdhci_execute_tuning(host, opcode);
@@ -3108,6 +3111,8 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
 	host->cqe_ier     = SDHCI_CQE_INT_MASK;
 	host->cqe_err_ier = SDHCI_CQE_INT_ERR_MASK;
 
+	host->tuning_delay = -1;
+
 	return host;
 }
 
drivers/mmc/host/sdhci.h +1 -0
index 35b41da0a636..b0f416fc9548 100644
@@ -538,6 +538,7 @@ struct sdhci_host {
 #define SDHCI_TUNING_MODE_1	0
 #define SDHCI_TUNING_MODE_2	1
 #define SDHCI_TUNING_MODE_3	2
+	int			tuning_delay;	/* Delay (ms) between tuning commands */
 
 	unsigned long private[0] ____cacheline_aligned;
 };
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH v2 4/7 mmc: sdhci: add a quirk to restore delay in tuning

Hi Adrian,

Thanks a lot for your suggestion.
I have sent out the new version patch-set.

Please help to review :)

Best regards,
Yangbo Lu

Quoted 95 lines

-----Original Message-----
From: Adrian Hunter [mailto:adrian.hunter at intel.com]
Sent: Thursday, March 23, 2017 3:04 PM
To: Y.B. Lu; linux-mmc at vger.kernel.org; ulf.hansson at linaro.org; Rob Herring; Mark Rutland; Catalin Marinas; Will Deacon
Cc: devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; Xiaobo Xie
Subject: Re: [v2, 4/7] mmc: sdhci: add a quirk to restore delay in tuning

Quoted 8 lines · Yangbo Lu

There was a mdelay between tuning cycles which is removed since eMMC spec didn't require that. However it's observed that eSDHC needed this delay for HS200 successful tuning. Maybe it's also needed for some other controllers. This patch is to add a quirk to fix it.

Fixes 197160d52e85 ("mmc: sdhci: remove mdelay in eMMC tuning")

---

I would prefer to do something like this:

---
From: Adrian Hunter <[email protected]>
Date: Thu, 23 Mar 2017 08:54:06 +0200
Subject: [PATCH] mmc: sdhci: Control the delay between tuning commands

The delay between tuning commands for SD cards is not part of the specification. A driver that needs it probably needs it for eMMC too, whereas most drivers would probably like to set it to 0. Make it a host member (host->tuning_delay) that defaults to the existing behaviour. Drivers can set it to zero to eliminate the delay, or set it to a positive value to always have a delay.

---
 drivers/mmc/host/sdhci.c | 11 ++++++++---  drivers/mmc/host/sdhci.h |  1
(quoted diff) +1 -0
+
 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci.c index renamed from drivers/mmc/host/sdhci.c +0 -0

a33102fc800b..2fc33485df1d 100644

drivers/mmc/host/sdhci.c +3 -3
@@ -2100,9 +2100,9 @@ static void __sdhci_execute_tuning(struct
 sdhci_host *host, u32 opcode)
 			break;
 		}
 
-		/* eMMC spec does not require a delay between tuning cycles
 */
-		if (opcode == MMC_SEND_TUNING_BLOCK)
-			mdelay(1);
+		/* Spec does not require a delay between tuning cycles */
+		if (host->tuning_delay > 0)
+			mdelay(host->tuning_delay);
 	}
drivers/mmc/host/sdhci.c +3 -0
 	pr_info("%s: Tuning failed, falling back to fixed sampling clock\n",
@@ -2164,6 +2164,9 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32
 opcode)
 
 	host->mmc->retune_period = tuning_count;
 
+	if (host->tuning_delay < 0)
+		host->tuning_delay = opcode == MMC_SEND_TUNING_BLOCK;
+
 	sdhci_start_tuning(host);
 
drivers/mmc/host/sdhci.c +2 -0
 	__sdhci_execute_tuning(host, opcode);
@@ -3108,6 +3111,8 @@ struct sdhci_host *sdhci_alloc_host(struct device
 *dev,
 	host->cqe_ier     = SDHCI_CQE_INT_MASK;
 	host->cqe_err_ier = SDHCI_CQE_INT_ERR_MASK;
 
+	host->tuning_delay = -1;
+
 	return host;
 }
drivers/mmc/host/sdhci.h index renamed from drivers/mmc/host/sdhci.h +0 -0

35b41da0a636..b0f416fc9548 100644

drivers/mmc/host/sdhci.h +1 -0
@@ -538,6 +538,7 @@ struct sdhci_host {
 #define SDHCI_TUNING_MODE_1	0
 #define SDHCI_TUNING_MODE_2	1
 #define SDHCI_TUNING_MODE_3	2
+	int			tuning_delay;	/* Delay (ms) between tuning

commands */

unsigned long private[0] ____cacheline_aligned; };
--
1.9.1

author
#7 lore raw

PATCH v2 5/7 mmc: sdhci-of-esdhc: add delay between tuning cycles

In reply to Yangbo Lu

It's observed that eSDHC needed delay between tuning cycles for HS200 successful tuning. This patch is to add the quirk SDHCI_QUIRK2_DELAY_BETWEEN_TUNING_CYCLES to fix it.

---
Changes for v2:
- None

---
 drivers/mmc/host/sdhci-of-esdhc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/host/sdhci-of-esdhc.c +2 -0
index 8007188..7c4d8e8 100644
@@ -836,6 +836,8 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
 		host->quirks2 |= SDHCI_QUIRK2_BROKEN_HOST_CONTROL;
 	}
 
+	host->quirks2 |= SDHCI_QUIRK2_DELAY_BETWEEN_TUNING_CYCLES;
+
 	/* call to generic mmc_of_parse to support additional capabilities */
 	ret = mmc_of_parse(host->mmc);
 	if (ret)
Signature · 1 line
2.1.0.27.g96db324
author
#8 lore raw

PATCH v2 6/7 arm64: dts: ls1046a: add clocks property and compatible for eSDHC node

In reply to Yangbo Lu

The eSDHC could select peripheral clock or platform clock as clock source. In default, we use platform clock. This patch is to add clocks property describing peripheral clock for eSDHC node. The driver could use common clk APIs to get peripheral clock. Also add a compatible for ls1046a eSDHC node.

---
Changes for v2:
- None

---
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +2 -1
index 4a164b8..141a513 100644
@@ -209,10 +209,11 @@
 		};
 
 		esdhc: esdhc at 1560000 {
-			compatible = "fsl,esdhc";
+			compatible = "fsl,ls1046a-esdhc", "fsl,esdhc";
 			reg = <0x0 0x1560000 0x0 0x10000>;
 			interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
 			clock-frequency = <0>;
+			clocks = <&clockgen 2 1>;
 			voltage-ranges = <1800 1800 3300 3300>;
 			sdhci,auto-cmd12;
 			big-endian;
Signature · 1 line
2.1.0.27.g96db324
author
#9 lore raw

PATCH v2 7/7 arm64: dts: ls1046ardb: add MMC HS200/UHS-1 modes support

In reply to Yangbo Lu

Add HS200/UHS-1 properties in eSDHC node to support these speed modes in driver.

---
Changes for v2:
- None

---
 arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts +8 -0
index d1ccc00..08528c2 100644
@@ -64,6 +64,14 @@
 	};
 };
 
+&esdhc {
+	mmc-hs200-1_8v;
+	sd-uhs-sdr104;
+	sd-uhs-sdr50;
+	sd-uhs-sdr25;
+	sd-uhs-sdr12;
+};
+
 &duart0 {
 	status = "okay";
 };
Signature · 1 line
2.1.0.27.g96db324
author
#10 lore raw

v2 cover Add SD UHS-I and eMMC HS200 support for eSDHC

In reply to Yangbo Lu

Any comments on this patchset ?
Thanks :)

Best regards,
Yangbo Lu

Quoted 57 lines

-----Original Message-----
From: Yangbo Lu [mailto:yangbo.lu at nxp.com]
Sent: Friday, March 03, 2017 4:19 PM
To: linux-mmc at vger.kernel.org; ulf.hansson at linaro.org; Adrian Hunter; Rob Herring; Mark Rutland; Catalin Marinas; Will Deacon
Cc: devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; Xiaobo Xie; Y.B. Lu
Subject: [v2, 0/7] Add SD UHS-I and eMMC HS200 support for eSDHC

It's complicated to support SD UHS-I and eMMC HS200 for eSDHC because there're many differences between eSDHC and SD/eMMC spec. Several differences as below must be considered:
1. Peripheral clock must be used instead of platform clock.
- eSDHC could select peripheral clock or platform clock as its clock source. According to RM, UHS-I/HS200 must use peripheral clock
since
it supports higher frequency than platform clock.
- Patch 1 and patch 6 is to support this.
2. Signal voltage switching requires a control circuit out of eSDHC.
- eSDHC supports signal voltage switch from 3.3v to 1.8v by eSDHC_PROCTL[VOLT_SEL] bit. This bit changes the value of output signal SDHC_VS, and there must be a control circuit out of eSDHC to change the signal voltage according to SDHC_VS output signal.
- Patch 2 is to support this.
3. eSDHC uses tuning block for tuning procedure.
- Tuning clock control register must be configured before tuning.
- Patch 3 is to support this.
4. Delay is needed between tuning cycles for HS200 tuning.
- Once a patch removed mdelay between tuning cycles.
But eSDHC needs it.
- Patch 4 and patch 5 is to support this.
5. UHS-I/HS200 modes could be enabled in dts node.
- Patch 7 is to support this.

Please review and merge these patches on mmc git tree if no changes are required.

Yangbo Lu (7):
mmc: sdhci-of-esdhc: add peripheral clock support
mmc: sdhci-of-esdhc: add support for signal voltage switch
mmc: sdhci-of-esdhc: add tuning support
mmc: sdhci: add a quirk to restore delay in tuning
mmc: sdhci-of-esdhc: add delay between tuning cycles
arm64: dts: ls1046a: add clocks property and compatible for eSDHC node
arm64: dts: ls1046ardb: add MMC HS200/UHS-1 modes support

 arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts |   8 ++
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi    |   3 +-
 drivers/mmc/host/sdhci-esdhc.h                    |   7 +
 drivers/mmc/host/sdhci-of-esdhc.c                 | 167
+++++++++++++++++++++-
 drivers/mmc/host/sdhci.c                          |   3 +-
 drivers/mmc/host/sdhci.h                          |   2 +
 6 files changed, 186 insertions(+), 4 deletions(-)

--
2.1.0.27.g96db324

author
#11 lore raw

v2 cover Add SD UHS-I and eMMC HS200 support for eSDHC

Hi Adrian,

Could you help to review the new version patch-set? Thanks a lot.

Best regards,
Yangbo Lu

Quoted 75 lines

-----Original Message-----
From: Y.B. Lu
Sent: Thursday, March 09, 2017 10:23 AM
To: linux-mmc at vger.kernel.org; ulf.hansson at linaro.org; Adrian Hunter; Rob Herring; Mark Rutland; Catalin Marinas; Will Deacon
Cc: devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; Xiaobo Xie
Subject: RE: [v2, 0/7] Add SD UHS-I and eMMC HS200 support for eSDHC

Any comments on this patchset ?
Thanks :)

Best regards,
Yangbo Lu

Quoted 9 lines

-----Original Message-----
From: Yangbo Lu [mailto:yangbo.lu at nxp.com]
Sent: Friday, March 03, 2017 4:19 PM
To: linux-mmc at vger.kernel.org; ulf.hansson at linaro.org; Adrian Hunter; Rob Herring; Mark Rutland; Catalin Marinas; Will Deacon
Cc: devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; Xiaobo Xie; Y.B. Lu
Subject: [v2, 0/7] Add SD UHS-I and eMMC HS200 support for eSDHC

Quoted 5 lines

It's complicated to support SD UHS-I and eMMC HS200 for eSDHC because there're many differences between eSDHC and SD/eMMC spec. Several differences as below must be considered:
1. Peripheral clock must be used instead of platform clock.
- eSDHC could select peripheral clock or platform clock as its

clock

Quoted 23 lines

source. According to RM, UHS-I/HS200 must use peripheral clock
since
it supports higher frequency than platform clock.
- Patch 1 and patch 6 is to support this.
2. Signal voltage switching requires a control circuit out of eSDHC.
- eSDHC supports signal voltage switch from 3.3v to 1.8v by eSDHC_PROCTL[VOLT_SEL] bit. This bit changes the value of output signal SDHC_VS, and there must be a control circuit out of eSDHC to change the signal voltage according to SDHC_VS output signal.
- Patch 2 is to support this.
3. eSDHC uses tuning block for tuning procedure.
- Tuning clock control register must be configured before tuning.
- Patch 3 is to support this.
4. Delay is needed between tuning cycles for HS200 tuning.
- Once a patch removed mdelay between tuning cycles. But eSDHC needs it.
- Patch 4 and patch 5 is to support this.
5. UHS-I/HS200 modes could be enabled in dts node.
- Patch 7 is to support this.

Please review and merge these patches on mmc git tree if no changes are required.

Quoted 7 lines

Yangbo Lu (7):
mmc: sdhci-of-esdhc: add peripheral clock support
mmc: sdhci-of-esdhc: add support for signal voltage switch
mmc: sdhci-of-esdhc: add tuning support
mmc: sdhci: add a quirk to restore delay in tuning
mmc: sdhci-of-esdhc: add delay between tuning cycles
arm64: dts: ls1046a: add clocks property and compatible for eSDHC

node

Quoted 13 lines

arm64: dts: ls1046ardb: add MMC HS200/UHS-1 modes support

 arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts |   8 ++
 arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi    |   3 +-
 drivers/mmc/host/sdhci-esdhc.h                    |   7 +
 drivers/mmc/host/sdhci-of-esdhc.c                 | 167
+++++++++++++++++++++-
 drivers/mmc/host/sdhci.c                          |   3 +-
 drivers/mmc/host/sdhci.h                          |   2 +
 6 files changed, 186 insertions(+), 4 deletions(-)

--
2.1.0.27.g96db324