u-boot/drivers/mmc
Haibo Chen 925f6900c8 mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON when necessary
After commit f132aab403 ("Revert "mmc: fsl_esdhc_imx: use
VENDORSPEC_FRC_SDCLK_ON to control card clock output""), it
involve issue in mmc_switch_voltage(), because of the special
design of usdhc.

For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN,
these are reserved bits(Though RM contain the definition of these bits,
but actually internal IC logic do not implement, already confirm with
IC team). Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the card
clock output. Here is the definition of this bit in RM:

[8] FRC_SDCLK_ON
Force CLK output active
Do not set this bit to 1 unless it is necessary. Also, make sure that
this bit is cleared when uSDHC’s clock is about to be changed (frequency
change, clock source change, or delay chain tuning).
0b - CLK active or inactive is fully controlled by the hardware.
1b - Force CLK active

In default, the FRC_SDCLK_ON is 0. This means, when there is no command
or data transfer on bus, hardware will gate off the card clock. But in
some case, we need the card clock keep on. Take IO voltage 1.8v switch
as example, after IO voltage change to 1.8v, spec require gate off the
card clock for 5ms, and gate on the clock back, once detect the card
clock on, then the card will draw the dat0 to high immediately. If there
is not clock gate off/on behavior, some card will keep the dat0 to low
level. This is the reason we fail in mmc_switch_voltage().

To fix this issue, and concern that this is only the fsl usdhc hardware
design limitation, set the bit FRC_SDCLK_ON in the beginning of the
wait_dat0() and clear it in the end. To make sure the 1.8v IO voltage
switch process align with SD specification.

For standard tuning process, usdhc specification also require the card
clock keep on, so also add these behavior in fsl_esdhc_execute_tuning().

Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-03-16 16:40:56 +09:00
..
am654_sdhci.c mmc: sdhci_am654: Read ti, strobe-sel property from device tree 2021-07-27 10:56:09 +05:30
arm_pl180_mmci.c mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCI 2021-10-29 18:22:32 +09:00
arm_pl180_mmci.h mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCI 2021-10-29 18:22:32 +09:00
aspeed_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
atmel_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
bcm2835_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
bcm2835_sdhost.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
bcmstb_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
ca_dw_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
davinci_mmc.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
dw_mmc.c mmc: dwmmc: return a proper error code when busy 2022-01-12 09:56:40 +09:00
exynos_dw_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
f_sdh30.c mmc: synquacer: Add SynQuacer F_SDH30 SDHCI driver 2021-07-06 14:07:36 -04:00
fsl_esdhc.c drivers: mmc: Add wait_dat0 support for Freescale eSDHC driver 2021-10-29 18:22:32 +09:00
fsl_esdhc_imx.c mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON when necessary 2022-03-16 16:40:56 +09:00
fsl_esdhc_spl.c mmc: fsl_esdhc_spl: remove superfluous free() 2021-01-18 15:23:06 -05:00
ftsdc010_mci.c clk: Rename clk_get_by_driver_info() 2021-09-25 09:46:15 -06:00
ftsdc010_mci.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gen_atmel_mci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
hi6220_dw_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
iproc_sdhci.c drivers: mmc: iproc_sdhci: enable HS200 mode 2021-03-02 13:53:37 +01:00
jz_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
Kconfig mmc: actions: add MMC driver for Actions OWL S700/S900 2022-01-18 12:48:17 -05:00
kona_sdhci.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
Makefile mmc: actions: add MMC driver for Actions OWL S700/S900 2022-01-18 12:48:17 -05:00
meson_gx_mmc.c mmc: meson_gx_mmc: use mmc_pwrseq instead of meson_mmc_pwrseq 2021-02-19 15:10:46 +08:00
meson_gx_mmc.h dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mmc-pwrseq.c mmc: pwrseq: add mmc-pwrseq file to provide a generic interface 2021-02-19 15:10:41 +08:00
mmc-uclass.c mmc: Allow for children other than the block device 2021-11-28 16:51:51 -07:00
mmc.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
mmc_boot.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
mmc_legacy.c Move eSDHC adapter card identification to board files 2020-07-27 14:16:28 +05:30
mmc_private.h doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
mmc_spi.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
mmc_write.c dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
msm_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mtk-sd.c mmc: mtk-sd: implement waiting for DAT0 line state 2021-11-17 17:04:59 -05:00
mv_sdhci.c arm: Remove aspenite board 2021-10-01 12:10:09 -04:00
mvebu_mmc.c mmc: mvebu: convert to driver model 2021-04-08 08:50:52 +02:00
mxcmmc.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
mxsmmc.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
nexell_dw_mmc.c mmc: dwmmc: Change designware MMC 'clksel' callback function to return status 2021-01-15 17:48:36 +08:00
octeontx_hsmmc.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
octeontx_hsmmc.h mmc: Add MMC controller driver for OcteonTX / TX2 2020-08-25 08:01:16 +02:00
omap_hsmmc.c ti: keystone: Move away from CONFIG_SOC_KEYSTONE 2021-09-27 21:38:34 -04:00
owl_mmc.c mmc: actions: add MMC driver for Actions OWL S700/S900 2022-01-18 12:48:17 -05:00
pci_mmc.c mmc: pci_mmc: Set up the card detect 2021-03-27 13:59:37 +13:00
pic32_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
piton_mmc.c mmc: openpiton: add piton_mmc driver 2021-07-06 13:50:56 +08:00
pxa_mmc_gen.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
renesas-sdhi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
rockchip_dw_mmc.c clk: Rename clk_get_by_driver_info() 2021-09-25 09:46:15 -06:00
rockchip_sdhci.c rockchip: sdhci: Fix RK3399 eMMC PHY power cycling 2022-03-14 12:44:51 -04:00
rpmb.c mmc: rpmb: Fix driver routing memory alignment with tmp buffer 2021-07-30 17:12:15 +08:00
s5p_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sandbox_mmc.c sandbox: mmc: Support a backing file 2021-11-28 16:51:51 -07:00
sdhci-adma.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
sdhci-cadence.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sdhci.c drivers: mmc: Add wait_dat0 support for sdhci driver 2021-10-29 18:22:32 +09:00
sh_mmcif.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sh_mmcif.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sh_sdhi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
snps_dw_mmc.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
socfpga_dw_mmc.c mmc: dwmmc: socfpga: Get "fifo-mode" property from DT 2021-06-22 12:02:32 +08:00
sti_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
stm32_sdmmc2.c mmc: stm32_sdmmc2: Add support for probing bus voltage level translator 2021-11-30 16:43:28 +01:00
sunxi_mmc.c mmc: sunxi: Use DM_GPIO flags to set pull-up 2022-01-30 01:25:00 +00:00
tangier_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
tegra_mmc.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
tmio-common.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
tmio-common.h mmc: tmio: sdhi: Configure internal DMA bus width 2021-01-31 14:08:45 +01:00
uniphier-sd.c dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
xenon_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
zynq_sdhci.c mmc: zynq_sdhci: Add xilinx_pm_request weak function 2021-10-21 08:50:59 +02:00