Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: f-sdh30: Add support for non-removable media

To use F_SDH30 for non-removable meda like eMMC,
need to enable FORCE_CARD_INSERT bit to skip the delay for detection.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Link: https://lore.kernel.org/r/20221111081033.3813-6-hayashi.kunihiko@socionext.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Kunihiko Hayashi and committed by
Ulf Hansson
e2d2dcc8 5914a9b1

+10
+7
drivers/mmc/host/sdhci_f_sdh30.c
··· 77 77 ctl |= F_SDH30_CMD_DAT_DELAY; 78 78 sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL); 79 79 } 80 + 81 + if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) && 82 + !(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) { 83 + ctl = sdhci_readl(host, F_SDH30_TEST); 84 + ctl |= F_SDH30_FORCE_CARD_INSERT; 85 + sdhci_writel(host, ctl, F_SDH30_TEST); 86 + } 80 87 } 81 88 82 89 static const struct sdhci_ops sdhci_f_sdh30_ops = {
+3
drivers/mmc/host/sdhci_f_sdh30.h
··· 29 29 #define F_SDH30_CMD_DAT_DELAY BIT(9) 30 30 #define F_SDH30_EMMC_HS200 BIT(24) 31 31 32 + #define F_SDH30_TEST 0x158 33 + #define F_SDH30_FORCE_CARD_INSERT BIT(6) 34 + 32 35 #define F_SDH30_MIN_CLOCK 400000