mmc: stm32: sdmmc2: add hardware flow control support
authorPatrick Delaunay <patrick.delaunay@st.com>
Wed, 7 Feb 2018 16:19:58 +0000 (17:19 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 14 Mar 2018 01:45:37 +0000 (21:45 -0400)
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

index bd2200a05c478022d37f4198dbef29904cf4eeee..3e578359e02aadeef4cff05f7a5742eaf91843b1 100644 (file)
@@ -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;
 }