Skip to contentSkip to conversation

stm32_sdmmc2 driver update

PATCH New patrice.chotard at st.com 2 participants 5 messages Feb 7, 2018 – Mar 14, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover stm32_sdmmc2 driver update

From: Patrice Chotard <[email protected]>

This series adds the following stm32_sdmmc2 driver update :
_ Enable hardware flow control
_ Add support for st,pin-ckinsdmmc_ckin to select "ckin" clock input to sample received data.

Patrick Delaunay (2):
mmc: stm32: sdmmc2: add hardware flow control support
mmc: stm32: sdmmc2: add support for st,pin-ckinsdmmc_ckin

 drivers/mmc/stm32_sdmmc2.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 mmc: stm32: sdmmc2: add hardware flow control support

From: Patrick Delaunay <[email protected]>

The hardware flow control functionality is used to avoid FIFO underrun (TX mode) and overrun (RX mode) errors. The behavior is to stop SDMMC_CK during data transfer and freeze the SDMMC state machines.

---
 drivers/mmc/stm32_sdmmc2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/stm32_sdmmc2.c +2 -1
index f3b77f512e85..0fe6808e5dc8 100644
@@ -495,7 +495,8 @@ static int stm32_sdmmc2_set_ios(struct udevice *dev)
 	if (mmc->bus_width == 8)
 		clk |= SDMMC_CLKCR_WIDBUS_8;
 
-	writel(clk | priv->clk_reg_msk, priv->base + SDMMC_CLKCR);
+	writel(clk | priv->clk_reg_msk | SDMMC_CLKCR_HWFC_EN,
+	       priv->base + SDMMC_CLKCR);
 
 	return 0;
 }
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/2 mmc: stm32: sdmmc2: add hardware flow control support

Quoted 9 lines · patrice.chotard at st.com

From: Patrick Delaunay <[email protected]>

The hardware flow control functionality is used to avoid FIFO underrun (TX mode) and overrun (RX mode) errors. The behavior is to stop SDMMC_CK during data transfer and freeze the SDMMC state machines.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180314/a7e6c0de/attachment.sig>
#3 lore raw

PATCH 2/2 mmc: stm32: sdmmc2: add support for st, pin-ckinsdmmc_ckin

In reply to patrice.chotard at st.com

From: Patrick Delaunay <[email protected]>

This patch adds "st,pin-ckin" support to activate sdmmc_ckin feature. When using an external driver (a voltage switch transceiver), it's advised to select SDMMC_CKIN feedback clock input to sample the received data.

---
 drivers/mmc/stm32_sdmmc2.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mmc/stm32_sdmmc2.c +6 -1
index 0fe6808e5dc8..05b421ddd112 100644
@@ -72,7 +72,10 @@ struct stm32_sdmmc2_ctx {
 #define SDMMC_CLKCR_HWFC_EN		BIT(17)
 #define SDMMC_CLKCR_DDR			BIT(18)
 #define SDMMC_CLKCR_BUSSPEED		BIT(19)
-#define SDMMC_CLKCR_SELCLKRX		GENMASK(21, 20)
+#define SDMMC_CLKCR_SELCLKRX_MASK	GENMASK(21, 20)
+#define SDMMC_CLKCR_SELCLKRX_CK		0
+#define SDMMC_CLKCR_SELCLKRX_CKIN	BIT(20)
+#define SDMMC_CLKCR_SELCLKRX_FBCK	BIT(21)
 
 /* SDMMC_CMD register */
 #define SDMMC_CMD_CMDINDEX		GENMASK(5, 0)
@@ -535,6 +538,8 @@ static int stm32_sdmmc2_probe(struct udevice *dev)
 		priv->clk_reg_msk |= SDMMC_CLKCR_NEGEDGE;
 	if (dev_read_bool(dev, "st,dirpol"))
 		priv->pwr_reg_msk |= SDMMC_POWER_DIRPOL;
+	if (dev_read_bool(dev, "st,pin-ckin"))
+		priv->clk_reg_msk |= SDMMC_CLKCR_SELCLKRX_CKIN;
 
 	ret = clk_get_by_index(dev, 0, &priv->clk);
 	if (ret)
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/2 mmc: stm32: sdmmc2: add support for st, pin-ckinsdmmc_ckin

Quoted 9 lines · patrice.chotard at st.com

From: Patrick Delaunay <[email protected]>

This patch adds "st,pin-ckin" support to activate sdmmc_ckin feature. When using an external driver (a voltage switch transceiver), it's advised to select SDMMC_CKIN feedback clock input to sample the received data.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180314/84ad469e/attachment.sig>