rockchip: sdhci: Add HS400 Enhanced Strobe support for RK3568
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Tue, 15 Mar 2022 17:46:28 +0000 (20:46 +0300)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 16 Mar 2022 09:10:41 +0000 (18:10 +0900)
commitc48021d184097ea4a1bb6bab8c24653de2477fde
treece271ed3f2ce5395e1c9650b4ba292759a8246c1
parentc35af783172563f6a8b55d45ba244cb2d2f09cce
rockchip: sdhci: Add HS400 Enhanced Strobe support for RK3568

On RK3568, a register bit must be set to enable Enhanced Strobe.
However, it appears that the address of this register may differ from
vendor to vendor and should be read from the underlying MMC IP. Let the
Rockchip SDHCI driver read this address and set the relevant bit when
Enhanced Strobe configuration is requested.

The IP uses a custom mode select value (0x7) for HS400, use that instead
of the common but non-standard SDHCI_CTRL_HS400 value (0x5). Also add
some necessary DLL_STRBIN and DLL_TXCLK configuration for HS400.

Additionally, a bit signifying that the connected hardware is an eMMC
chip must be set to enable Data Strobe for HS400 and HS400ES modes. Also
make the driver set this bit as appropriate.

This is partly ported from Linux's Synopsys DWC MSHC driver which
happens to be the underlying IP. (drivers/mmc/host/sdhci-of-dwcmshc.c in
Linux tree).

Co-developed-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mmc/rockchip_sdhci.c