mmc: mmci: add hs200 support for stm32 sdmmc
authorYann Gautier <yann.gautier@foss.st.com>
Wed, 15 Dec 2021 14:17:27 +0000 (15:17 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 21 Dec 2021 12:06:15 +0000 (13:06 +0100)
Use feedback clock for HS200 mode, as for SDR104.
The HS200 mode can be enabled through DT by using mmc-hs200-1_8v.
It is possible to use it on STM32MP13, but not STM32MP15 platforms.

Signed-off-by: Ludovic Barre <ludovic.barre@foss.st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20211215141727.4901-5-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci_stm32_sdmmc.c

index a75d3dd34d18cb41f24f4f201613916a3110fb09..9c13f2c313658b5dd05ef23b7796b42a93c8117a 100644 (file)
@@ -241,11 +241,12 @@ static void mmci_sdmmc_set_clkreg(struct mmci_host *host, unsigned int desired)
 
        /*
         * SDMMC_FBCK is selected when an external Delay Block is needed
-        * with SDR104.
+        * with SDR104 or HS200.
         */
        if (host->mmc->ios.timing >= MMC_TIMING_UHS_SDR50) {
                clk |= MCI_STM32_CLK_BUSSPEED;
-               if (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) {
+               if (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104 ||
+                   host->mmc->ios.timing == MMC_TIMING_MMC_HS200) {
                        clk &= ~MCI_STM32_CLK_SEL_MSK;
                        clk |= MCI_STM32_CLK_SELFBCK;
                }