mmc: mmci: stm32: manage block gap hardware flow control
authorYann Gautier <yann.gautier@foss.st.com>
Mon, 19 Jun 2023 11:51:18 +0000 (13:51 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jun 2023 09:44:40 +0000 (11:44 +0200)
commit27bdc37c390af01af72ad3750cafe19b459bdf93
tree74dd09bc34530862de37efd86c8d17ada695e219
parentea9ca04119734c2b84691276fef2c018e9fd68ae
mmc: mmci: stm32: manage block gap hardware flow control

In stm32 sdmmc variant revision v3.0, a block gap hardware flow control
should be used with bus speed modes SDR104 and HS200.
It is enabled by writing a non-null value to the new added register
MMCI_STM32_FIFOTHRR.
The threshold will be 2^(N-1) bytes, so we can use the ffs() function to
compute the value N to be written to the register. The threshold used
should be the data block size, but must not be bigger than the FIFO size.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Link: https://lore.kernel.org/r/20230619115120.64474-5-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci.h
drivers/mmc/host/mmci_stm32_sdmmc.c