diff mbox series

[U-Boot,1/2] mmc: stm32: sdmmc2: add hardware flow control support

Message ID 1518020399-17059-2-git-send-email-patrice.chotard@st.com
State Accepted
Commit a72dd8ed95992be67a03073dd28dad27618e5a39
Delegated to: Tom Rini
Headers show
Series stm32_sdmmc2 driver update | expand

Commit Message

Patrice CHOTARD Feb. 7, 2018, 4:19 p.m. UTC
From: Patrick Delaunay <patrick.delaunay@st.com>

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.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 drivers/mmc/stm32_sdmmc2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Tom Rini March 14, 2018, 2:08 p.m. UTC | #1
On Wed, Feb 07, 2018 at 05:19:58PM +0100, patrice.chotard@st.com wrote:

> From: Patrick Delaunay <patrick.delaunay@st.com>
> 
> 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.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
index f3b77f512e85..0fe6808e5dc8 100644
--- a/drivers/mmc/stm32_sdmmc2.c
+++ b/drivers/mmc/stm32_sdmmc2.c
@@ -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;
 }