summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/Kconfig66
-rw-r--r--drivers/mmc/dw_mmc.c4
-rw-r--r--drivers/mmc/mtk-sd.c21
3 files changed, 44 insertions, 47 deletions
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index f4fdf15242c..4827834b4aa 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -3,7 +3,8 @@ menu "MMC Host controller Support"
config MMC
bool "MMC/SD/SDIO card support"
default ARM || PPC || SANDBOX
- select DM_MMC if DM
+ select BLK
+ select DM_MMC
help
This selects MultiMediaCard, Secure Digital and Secure
Digital I/O support.
@@ -39,14 +40,14 @@ config MMC_BROKEN_CD
If card detection feature is broken, just poll to detect.
config DM_MMC
- bool "Enable MMC controllers using Driver Model"
+ bool
depends on DM
help
- This enables the MultiMediaCard (MMC) uclass which supports MMC and
- Secure Digital I/O (SDIO) cards. Both removable (SD, micro-SD, etc.)
- and non-removable (e.g. eMMC chip) devices are supported. These
- appear as block devices in U-Boot and can support filesystems such
- as EXT4 and FAT.
+ This enables the MultiMediaCard (MMC) driver model uclass which
+ supports MMC and Secure Digital I/O (SDIO) cards. Both removable (SD,
+ micro-SD, etc.) and non-removable (e.g. eMMC chip) devices are
+ supported. These appear as block devices in U-Boot and can support
+ filesystems such as EXT4 and FAT.
config SPL_DM_MMC
bool "Enable MMC controllers using Driver Model in SPL"
@@ -79,7 +80,7 @@ config MMC_SDHCI_ADMA_HELPERS
config MMC_SPI
bool "Support for SPI-based MMC controller"
- depends on DM_MMC && DM_SPI
+ depends on DM_SPI
help
This selects SPI-based MMC controllers.
If you have an MMC controller on a SPI bus, say Y here.
@@ -97,7 +98,6 @@ config MMC_SPI_CRC_ON
config ARM_PL180_MMCI
bool "ARM AMBA Multimedia Card Interface and compatible support"
- depends on DM_MMC
help
This selects the ARM(R) AMBA(R) PrimeCell Multimedia Card
Interface (PL180, PL181 and compatible) support.
@@ -258,7 +258,6 @@ config MMC_DW
config MMC_DW_CORTINA
bool "Cortina specific extensions for Synopsys DW Memory Card Interface"
- depends on DM_MMC
depends on MMC_DW
help
This selects support for Cortina SoC specific extensions to the
@@ -285,7 +284,7 @@ config MMC_DW_K3
config MMC_DW_ROCKCHIP
bool "Rockchip SD/MMC controller support"
- depends on DM_MMC && OF_CONTROL
+ depends on OF_CONTROL
depends on MMC_DW
help
This enables support for the Rockchip SD/MMM controller, which is
@@ -306,7 +305,6 @@ config MMC_DW_SOCFPGA
config MMC_DW_SNPS
bool "Extensions for DW Memory Card Interface used in Synopsys ARC devboards"
depends on MMC_DW
- depends on DM_MMC
depends on OF_CONTROL
depends on CLK
help
@@ -317,13 +315,12 @@ config NEXELL_DWMMC
bool "Nexell SD/MMC controller support"
depends on ARCH_NEXELL
depends on MMC_DW
- depends on DM_MMC
depends on PINCTRL_NEXELL
default y
config MMC_MESON_GX
bool "Meson GX EMMC controller support"
- depends on DM_MMC && ARCH_MESON
+ depends on ARCH_MESON
help
Support for EMMC host controller on Meson GX ARM SoCs platform (S905)
@@ -338,7 +335,7 @@ config MMC_MXC
config MMC_OWL
bool "Actions OWL Multimedia Card Interface support"
- depends on ARCH_OWL && DM_MMC && BLK
+ depends on ARCH_OWL
help
This selects the OWL SD/MMC host controller found on board
based on Actions S700/S900 SoC.
@@ -366,7 +363,6 @@ config MMC_PCI
config MMC_OCTEONTX
bool "Marvell Octeon Multimedia Card Interface support"
depends on (ARCH_OCTEON || ARCH_OCTEONTX || ARCH_OCTEONTX2)
- depends on DM_MMC
select MMC_SUPPORTS_TUNING if ARCH_OCTEONTX2
help
This selects the Octeon Multimedia card Interface.
@@ -377,7 +373,7 @@ config MMC_OCTEONTX
config MVEBU_MMC
bool "Kirkwood MMC controller support"
- depends on DM_MMC && ARCH_KIRKWOOD
+ depends on ARCH_KIRKWOOD
help
Support for MMC host controller on Kirkwood SoCs.
If you are on a Kirkwood architecture, say Y here.
@@ -386,8 +382,7 @@ config MVEBU_MMC
config MMC_OMAP_HS
bool "TI OMAP High Speed Multimedia Card Interface support"
- select DM_REGULATOR_PBIAS if DM_MMC && DM_REGULATOR
- select DM_REGULATOR_PBIAS if DM_MMC && DM_REGULATOR
+ select DM_REGULATOR_PBIAS if DM_REGULATOR
help
This selects the TI OMAP High Speed Multimedia card Interface.
If you have an omap2plus board with a Multimedia Card slot,
@@ -430,7 +425,6 @@ config SH_MMCIF
config MMC_UNIPHIER
bool "UniPhier SD/MMC Host Controller support"
depends on ARCH_UNIPHIER
- depends on DM_MMC
depends on OF_CONTROL
help
This selects support for the Matsushita SD/MMC Host Controller on
@@ -439,7 +433,6 @@ config MMC_UNIPHIER
config RENESAS_SDHI
bool "Renesas R-Car SD/MMC Host Controller support"
depends on ARCH_RENESAS
- depends on DM_MMC
depends on OF_CONTROL
select BOUNCE_BUFFER
help
@@ -449,7 +442,6 @@ config RENESAS_SDHI
config MMC_BCM2835
bool "BCM2835 family custom SD/MMC Host Controller support"
depends on ARCH_BCM283X
- depends on DM_MMC
depends on OF_CONTROL
default y
help
@@ -469,7 +461,7 @@ config JZ47XX_MMC
config MMC_SANDBOX
bool "Sandbox MMC support"
depends on SANDBOX
- depends on DM_MMC && OF_CONTROL
+ depends on OF_CONTROL
help
This select a dummy sandbox MMC driver. At present this does nothing
other than allow sandbox to be build with MMC support. This
@@ -559,7 +551,6 @@ config FIXED_SDHCI_ALIGNED_BUFFER
config MMC_SDHCI_ASPEED
bool "Aspeed SDHCI controller"
depends on ARCH_ASPEED
- depends on DM_MMC
depends on MMC_SDHCI
select MISC
help
@@ -571,7 +562,7 @@ config MMC_SDHCI_ASPEED
config MMC_SDHCI_ATMEL
bool "Atmel SDHCI controller support"
depends on ARCH_AT91
- depends on DM_MMC && ARCH_AT91
+ depends on ARCH_AT91
depends on MMC_SDHCI
help
This enables support for the Atmel SDHCI controller, which supports
@@ -606,7 +597,6 @@ config MMC_SDHCI_BCMSTB
config MMC_SDHCI_CADENCE
bool "SDHCI support for the Cadence SD/SDIO/eMMC controller"
- depends on DM_MMC
depends on MMC_SDHCI
depends on OF_CONTROL
help
@@ -618,7 +608,6 @@ config MMC_SDHCI_CADENCE
config MMC_SDHCI_CV1800B
bool "SDHCI support for the CV1800B SD/SDIO/eMMC controller"
- depends on DM_MMC
depends on MMC_SDHCI
depends on OF_CONTROL
help
@@ -633,7 +622,7 @@ config MMC_SDHCI_AM654
bool "SDHCI Controller on TI's Am654 devices"
depends on ARCH_K3
depends on MMC_SDHCI
- depends on DM_MMC && OF_CONTROL && BLK
+ depends on OF_CONTROL
depends on REGMAP
select MMC_SDHCI_IO_ACCESSORS
help
@@ -653,7 +642,6 @@ config MMC_SDHCI_IPROC
config MMC_SDHCI_F_SDH30
bool "SDHCI support for Fujitsu Semiconductor/Socionext F_SDH30"
- depends on DM_MMC
depends on MMC_SDHCI
help
This selects the Secure Digital Host Controller Interface (SDHCI)
@@ -673,7 +661,6 @@ config MMC_SDHCI_KONA
config MMC_SDHCI_MSM
bool "Qualcomm SDHCI controller"
- depends on DM_MMC
depends on MMC_SDHCI
help
Enables support for SDHCI 2.0 controller present on some Qualcomm
@@ -685,7 +672,6 @@ config MMC_SDHCI_MV
bool "SDHCI support on Marvell platform"
depends on ARCH_MVEBU
depends on MMC_SDHCI
- depends on DM_MMC
help
This selects the Secure Digital Host Controller Interface on
Marvell platform.
@@ -697,7 +683,6 @@ config MMC_SDHCI_MV
config MMC_SDHCI_NPCM
bool "SDHCI support on Nuvoton NPCM device"
depends on MMC_SDHCI
- depends on DM_MMC
help
This selects the Secure Digital Host Controller Interface (SDHCI)
on Nuvoton NPCM device.
@@ -708,7 +693,7 @@ config MMC_SDHCI_NPCM
config MMC_SDHCI_PIC32
bool "Microchip PIC32 on-chip SDHCI support"
- depends on DM_MMC && MACH_PIC32
+ depends on MACH_PIC32
depends on MMC_SDHCI
help
Support for Microchip PIC32 SDHCI controller.
@@ -716,7 +701,6 @@ config MMC_SDHCI_PIC32
config MMC_SDHCI_ROCKCHIP
bool "Arasan SDHCI controller for Rockchip support"
depends on ARCH_ROCKCHIP
- depends on DM_MMC && BLK
depends on MMC_SDHCI
help
Support for Arasan SDHCI host controller on Rockchip ARM SoCs platform
@@ -735,7 +719,6 @@ config MMC_SDHCI_S5P
config MMC_SDHCI_SNPS
bool "Synopsys DesignWare SDHCI controller"
depends on MMC_SDHCI
- depends on DM_MMC
help
Support for DesignWare SDHCI host controller on Alibaba TH1520 SoC.
This is a highly configurable and programmable, high performance
@@ -753,7 +736,7 @@ config MMC_SDHCI_STI
config MMC_SDHCI_XENON
bool "SDHCI support for the Xenon SDHCI controller"
- depends on MMC_SDHCI && DM_MMC && OF_CONTROL
+ depends on MMC_SDHCI && OF_CONTROL
help
Support for Xenon SDHCI host controller on Marvell Armada 3700
7k/8k ARM SoCs platforms
@@ -764,7 +747,6 @@ config MMC_SDHCI_XENON
config MMC_SDHCI_TANGIER
bool "Tangier SDHCI controller support"
- depends on DM_MMC && BLK
depends on MMC_SDHCI
help
This selects support for SDHCI controller on Tanginer
@@ -800,7 +782,7 @@ config TEGRA124_MMC_DISABLE_EXT_LOOPBACK
config MMC_SDHCI_ZYNQ
bool "Arasan SDHCI controller support"
- depends on DM_MMC && OF_CONTROL && BLK
+ depends on OF_CONTROL
depends on MMC_SDHCI
help
Support for Arasan SDHCI host controller on Zynq/ZynqMP ARM SoCs platform
@@ -842,7 +824,6 @@ config MMC_SUNXI_HAS_MODE_SWITCH
config MMC_PITON
bool "MMC support for OpenPiton SoC"
- depends on DM_MMC && BLK
help
This selects support for the SD host controller on OpenPiton SoC.
Note that this SD controller directly exposes the contents of the
@@ -851,7 +832,7 @@ config MMC_PITON
config GENERIC_ATMEL_MCI
bool "Atmel Multimedia Card Interface support"
- depends on DM_MMC && ARCH_AT91
+ depends on ARCH_AT91
help
This enables support for Atmel High Speed Multimedia Card Interface
(HSMCI), which supports the MultiMedia Card (MMC) Specification V4.3,
@@ -860,7 +841,7 @@ config GENERIC_ATMEL_MCI
config STM32_SDMMC2
bool "STMicroelectronics STM32H7 SD/MMC Host Controller support"
- depends on DM_MMC && OF_CONTROL
+ depends on OF_CONTROL
help
This selects support for the SD/MMC controller on STM32H7 SoCs.
If you have a board based on such a SoC and with a SD/MMC slot,
@@ -880,7 +861,6 @@ config FTSDC010_SDIO
config MMC_MTK
bool "MediaTek SD/MMC Card Interface support"
depends on ARCH_MEDIATEK || ARCH_MTMIPS
- depends on DM_MMC
depends on OF_CONTROL
help
This selects the MediaTek(R) Secure digital and Multimedia card Interface.
@@ -911,7 +891,7 @@ config FSL_ESDHC_SUPPORT_ADMA2
config FSL_ESDHC_33V_IO_RELIABILITY_WORKAROUND
bool "enable eSDHC workaround for 3.3v IO reliability issue"
- depends on FSL_ESDHC && DM_MMC
+ depends on FSL_ESDHC
help
When eSDHC operates at 3.3v, damage can accumulate in an internal
level shifter at a higher than expected rate. The faster the interface
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index e1110cace89..a51494380ce 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -724,7 +724,7 @@ static int dwmci_init(struct mmc *mmc)
return 0;
}
-#ifdef CONFIG_DM_MMC
+#if CONFIG_IS_ENABLED(DM_MMC)
int dwmci_probe(struct udevice *dev)
{
struct mmc *mmc = mmc_get_mmc_dev(dev);
@@ -749,7 +749,7 @@ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
u32 max_clk, u32 min_clk)
{
cfg->name = host->name;
-#ifndef CONFIG_DM_MMC
+#if !CONFIG_IS_ENABLED(DM_MMC)
cfg->ops = &dwmci_ops;
#endif
cfg->f_min = min_clk;
diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c
index d676cf9e314..2bc700b0d05 100644
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -329,6 +329,7 @@ struct msdc_compatible {
u8 clk_div_bits;
bool pad_tune0;
bool async_fifo;
+ bool async_fifo_crcsts;
bool data_tune;
bool busy_check;
bool stop_clk_fix;
@@ -1553,8 +1554,12 @@ static void msdc_init_hw(struct msdc_host *host)
/* use async fifo to avoid tune internal delay */
clrbits_le32(&host->base->patch_bit2,
MSDC_PB2_CFGRESP);
- clrbits_le32(&host->base->patch_bit2,
- MSDC_PB2_CFGCRCSTS);
+ if (host->dev_comp->async_fifo_crcsts)
+ setbits_le32(&host->base->patch_bit2,
+ MSDC_PB2_CFGCRCSTS);
+ else
+ clrbits_le32(&host->base->patch_bit2,
+ MSDC_PB2_CFGCRCSTS);
}
if (host->dev_comp->data_tune) {
@@ -1844,6 +1849,17 @@ static const struct msdc_compatible mt7986_compat = {
.enhance_rx = true,
};
+static const struct msdc_compatible mt7987_compat = {
+ .clk_div_bits = 12,
+ .pad_tune0 = true,
+ .async_fifo = true,
+ .async_fifo_crcsts = true,
+ .data_tune = true,
+ .busy_check = true,
+ .stop_clk_fix = true,
+ .enhance_rx = true,
+};
+
static const struct msdc_compatible mt7981_compat = {
.clk_div_bits = 12,
.pad_tune0 = true,
@@ -1886,6 +1902,7 @@ static const struct udevice_id msdc_ids[] = {
{ .compatible = "mediatek,mt7622-mmc", .data = (ulong)&mt7622_compat },
{ .compatible = "mediatek,mt7623-mmc", .data = (ulong)&mt7623_compat },
{ .compatible = "mediatek,mt7986-mmc", .data = (ulong)&mt7986_compat },
+ { .compatible = "mediatek,mt7987-mmc", .data = (ulong)&mt7987_compat },
{ .compatible = "mediatek,mt7981-mmc", .data = (ulong)&mt7981_compat },
{ .compatible = "mediatek,mt8512-mmc", .data = (ulong)&mt8512_compat },
{ .compatible = "mediatek,mt8516-mmc", .data = (ulong)&mt8516_compat },