From e83d61a57d8abcbf68b81a81dd468149a2a250b0 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Fri, 14 Apr 2017 19:50:01 +0200 Subject: include: config: am335x: disable DM_MMC_OPS if DM_MMC is disabled Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 51c3d49..b6b14d3 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -291,6 +291,8 @@ * DM support in SPL */ #ifdef CONFIG_SPL_BUILD +#undef CONFIG_DM_MMC +#undef CONFIG_DM_MMC_OPS #undef CONFIG_TIMER #undef CONFIG_DM_USB #endif diff --git a/include/configs/am335x_shc.h b/include/configs/am335x_shc.h index bc0943f..247679e 100644 --- a/include/configs/am335x_shc.h +++ b/include/configs/am335x_shc.h @@ -262,6 +262,7 @@ */ #ifdef CONFIG_SPL_BUILD #undef CONFIG_DM_MMC +#undef CONFIG_DM_MMC_OPS #undef CONFIG_TIMER #endif diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h index f515db0..20168b2 100644 --- a/include/configs/chiliboard.h +++ b/include/configs/chiliboard.h @@ -188,6 +188,7 @@ */ #ifdef CONFIG_SPL_BUILD #undef CONFIG_DM_MMC +#undef CONFIG_DM_MMC_OPS #undef CONFIG_TIMER #undef CONFIG_DM_USB #endif -- cgit v0.10.2 From b5511d6cb8dc601efc14b8cf607553e3ad4fb5e6 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Fri, 14 Apr 2017 19:50:02 +0200 Subject: drivers: omap_hsmmc: move to DM_MMC_OPS Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 6ac26dd..ac57867 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -138,6 +138,7 @@ config MMC_PCI config MMC_OMAP_HS bool "TI OMAP High Speed Multimedia Card Interface support" + select DM_MMC_OPS if DM_MMC help This selects the TI OMAP High Speed Multimedia card Interface. If you have an omap2plus board with a Multimedia Card slot, diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index c136ab0..0b21ec6 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -326,11 +326,17 @@ static void mmc_reset_controller_fsm(struct hsmmc *mmc_base, u32 bit) } } } - +#ifndef CONFIG_DM_MMC static int omap_hsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) { struct omap_hsmmc_data *priv = omap_hsmmc_get_data(mmc); +#else +static int omap_hsmmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, + struct mmc_data *data) +{ + struct omap_hsmmc_data *priv = dev_get_priv(dev); +#endif struct hsmmc *mmc_base; unsigned int flags, mmc_stat; ulong start; @@ -558,9 +564,17 @@ static int mmc_write_data(struct hsmmc *mmc_base, const char *buf, return 0; } +#ifndef CONFIG_DM_MMC static int omap_hsmmc_set_ios(struct mmc *mmc) { struct omap_hsmmc_data *priv = omap_hsmmc_get_data(mmc); +#else +static int omap_hsmmc_set_ios(struct udevice *dev) +{ + struct omap_hsmmc_data *priv = dev_get_priv(dev); + struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); + struct mmc *mmc = upriv->mmc; +#endif struct hsmmc *mmc_base; unsigned int dsor = 0; ulong start; @@ -617,9 +631,9 @@ static int omap_hsmmc_set_ios(struct mmc *mmc) #ifdef OMAP_HSMMC_USE_GPIO #ifdef CONFIG_DM_MMC -static int omap_hsmmc_getcd(struct mmc *mmc) +static int omap_hsmmc_getcd(struct udevice *dev) { - struct omap_hsmmc_data *priv = omap_hsmmc_get_data(mmc); + struct omap_hsmmc_data *priv = dev_get_priv(dev); int value; value = dm_gpio_get_value(&priv->cd_gpio); @@ -632,9 +646,9 @@ static int omap_hsmmc_getcd(struct mmc *mmc) return value; } -static int omap_hsmmc_getwp(struct mmc *mmc) +static int omap_hsmmc_getwp(struct udevice *dev) { - struct omap_hsmmc_data *priv = omap_hsmmc_get_data(mmc); + struct omap_hsmmc_data *priv = dev_get_priv(dev); int value; value = dm_gpio_get_value(&priv->wp_gpio); @@ -674,6 +688,16 @@ static int omap_hsmmc_getwp(struct mmc *mmc) #endif #endif +#ifdef CONFIG_DM_MMC +static const struct dm_mmc_ops omap_hsmmc_ops = { + .send_cmd = omap_hsmmc_send_cmd, + .set_ios = omap_hsmmc_set_ios, +#ifdef OMAP_HSMMC_USE_GPIO + .get_cd = omap_hsmmc_getcd, + .get_wp = omap_hsmmc_getwp, +#endif +}; +#else static const struct mmc_ops omap_hsmmc_ops = { .send_cmd = omap_hsmmc_send_cmd, .set_ios = omap_hsmmc_set_ios, @@ -683,6 +707,7 @@ static const struct mmc_ops omap_hsmmc_ops = { .getwp = omap_hsmmc_getwp, #endif }; +#endif #ifndef CONFIG_DM_MMC int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio, @@ -835,7 +860,6 @@ static int omap_hsmmc_probe(struct udevice *dev) struct mmc *mmc; cfg->name = "OMAP SD/MMC"; - cfg->ops = &omap_hsmmc_ops; priv->base_addr = plat->base_addr; #ifdef OMAP_HSMMC_USE_GPIO priv->cd_inverted = plat->cd_inverted; @@ -857,7 +881,7 @@ static int omap_hsmmc_probe(struct udevice *dev) mmc->dev = dev; upriv->mmc = mmc; - return 0; + return omap_hsmmc_init_setup(mmc); } #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) @@ -901,6 +925,7 @@ U_BOOT_DRIVER(omap_hsmmc) = { #ifdef CONFIG_BLK .bind = omap_hsmmc_bind, #endif + .ops = &omap_hsmmc_ops, .probe = omap_hsmmc_probe, .priv_auto_alloc_size = sizeof(struct omap_hsmmc_data), .flags = DM_FLAG_PRE_RELOC, -- cgit v0.10.2 From 0e0dcc1916fb174966a3f170b69192e0c83ebced Mon Sep 17 00:00:00 2001 From: Wenyou Yang Date: Wed, 26 Apr 2017 09:32:30 +0800 Subject: mmc: sdhci: Fix maximum clock for programmable clock mode In the programmable clock mode, the SDCLK frequency is incorrectly assigned when the maximum clock has been assigned during probe, this causes the SDHCI not work well. In the programmable clock mode, when calculating the SDCLK Frequency Select, when the maximum clock has been assigned, it is the actual value, should not be multiplied by host->clk_mul. Otherwise, the maximum clock is multiplied host->clk_mul by the base clock achieved from the BASECLKF field of the Capabilities 0 Register. Signed-off-by: Wenyou Yang diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index b745977..161a6b1 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -332,8 +332,7 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock) */ if (host->clk_mul) { for (div = 1; div <= 1024; div++) { - if ((host->max_clk * host->clk_mul / div) - <= clock) + if ((host->max_clk / div) <= clock) break; } @@ -547,6 +546,14 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, #ifndef CONFIG_DM_MMC_OPS cfg->ops = &sdhci_ops; #endif + + /* Check whether the clock multiplier is supported or not */ + if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { + caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); + host->clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >> + SDHCI_CLOCK_MUL_SHIFT; + } + if (host->max_clk == 0) { if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) host->max_clk = (caps & SDHCI_CLOCK_V3_BASE_MASK) >> @@ -555,6 +562,8 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, host->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; host->max_clk *= 1000000; + if (host->clk_mul) + host->max_clk *= host->clk_mul; } if (host->max_clk == 0) { printf("%s: Hardware doesn't specify base clock frequency\n", @@ -590,11 +599,6 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { if (!(caps & SDHCI_CAN_DO_8BIT)) cfg->host_caps &= ~MMC_MODE_8BIT; - - /* Find out whether clock multiplier is supported */ - caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1); - host->clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >> - SDHCI_CLOCK_MUL_SHIFT; } if (host->host_caps) -- cgit v0.10.2 From 0cacd6b755172ae6be87bdc26528ccea1c2fc53d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 May 2017 15:52:04 +0900 Subject: mmc: sdhci-cadence: import updates from Linux 4.12 This driver is a counterpart of drivers/mmc/host/sdhci-cadence.c from Linux. Some updates for v4.12-rc1 can be imported to U-Boot. - Fix value of SDHCI_CDNS_HRS04_RDATA_SHIFT - Add polling for ACK bit to be sure that data are written to the PHY register - Retrieve PHY values from DT properties instead of fixed data The following is the list of upstream commits: - Linux commit 4e03f628b464e0580abadf5161eaa38c61d20943 mmc: sdhci-cadence: fix bit shift of read data from PHY port - Linux commit a0f8243229ed071c8da0ea7cedc1b7bf1b1515da mmc: sdhci-cadence: Fix writing PHY delay - Linux commit a89c472d8b55c5afc4c79e6e3d1338730034eb01 mmc: sdhci-cadence: Update PHY delay configuration Signed-off-by: Masahiro Yamada diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c index 2253bbc..dc86d10 100644 --- a/drivers/mmc/sdhci-cadence.c +++ b/drivers/mmc/sdhci-cadence.c @@ -7,8 +7,10 @@ #include #include +#include #include #include +#include #include #include @@ -17,7 +19,7 @@ #define SDHCI_CDNS_HRS04_ACK BIT(26) #define SDHCI_CDNS_HRS04_RD BIT(25) #define SDHCI_CDNS_HRS04_WR BIT(24) -#define SDHCI_CDNS_HRS04_RDATA_SHIFT 12 +#define SDHCI_CDNS_HRS04_RDATA_SHIFT 16 #define SDHCI_CDNS_HRS04_WDATA_SHIFT 8 #define SDHCI_CDNS_HRS04_ADDR_SHIFT 0 @@ -34,6 +36,9 @@ #define SDHCI_CDNS_PHY_DLY_EMMC_LEGACY 0x06 #define SDHCI_CDNS_PHY_DLY_EMMC_SDR 0x07 #define SDHCI_CDNS_PHY_DLY_EMMC_DDR 0x08 +#define SDHCI_CDNS_PHY_DLY_SDCLK 0x0b +#define SDHCI_CDNS_PHY_DLY_HSMMC 0x0c +#define SDHCI_CDNS_PHY_DLY_STROBE 0x0d struct sdhci_cdns_plat { struct mmc_config cfg; @@ -41,11 +46,31 @@ struct sdhci_cdns_plat { void __iomem *hrs_addr; }; -static void sdhci_cdns_write_phy_reg(struct sdhci_cdns_plat *plat, - u8 addr, u8 data) +struct sdhci_cdns_phy_cfg { + const char *property; + u8 addr; +}; + +static const struct sdhci_cdns_phy_cfg sdhci_cdns_phy_cfgs[] = { + { "cdns,phy-input-delay-sd-highspeed", SDHCI_CDNS_PHY_DLY_SD_HS, }, + { "cdns,phy-input-delay-legacy", SDHCI_CDNS_PHY_DLY_SD_DEFAULT, }, + { "cdns,phy-input-delay-sd-uhs-sdr12", SDHCI_CDNS_PHY_DLY_UHS_SDR12, }, + { "cdns,phy-input-delay-sd-uhs-sdr25", SDHCI_CDNS_PHY_DLY_UHS_SDR25, }, + { "cdns,phy-input-delay-sd-uhs-sdr50", SDHCI_CDNS_PHY_DLY_UHS_SDR50, }, + { "cdns,phy-input-delay-sd-uhs-ddr50", SDHCI_CDNS_PHY_DLY_UHS_DDR50, }, + { "cdns,phy-input-delay-mmc-highspeed", SDHCI_CDNS_PHY_DLY_EMMC_SDR, }, + { "cdns,phy-input-delay-mmc-ddr", SDHCI_CDNS_PHY_DLY_EMMC_DDR, }, + { "cdns,phy-dll-delay-sdclk", SDHCI_CDNS_PHY_DLY_SDCLK, }, + { "cdns,phy-dll-delay-sdclk-hsmmc", SDHCI_CDNS_PHY_DLY_HSMMC, }, + { "cdns,phy-dll-delay-strobe", SDHCI_CDNS_PHY_DLY_STROBE, }, +}; + +static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_plat *plat, + u8 addr, u8 data) { void __iomem *reg = plat->hrs_addr + SDHCI_CDNS_HRS04; u32 tmp; + int ret; tmp = (data << SDHCI_CDNS_HRS04_WDATA_SHIFT) | (addr << SDHCI_CDNS_HRS04_ADDR_SHIFT); @@ -54,17 +79,36 @@ static void sdhci_cdns_write_phy_reg(struct sdhci_cdns_plat *plat, tmp |= SDHCI_CDNS_HRS04_WR; writel(tmp, reg); + ret = readl_poll_timeout(reg, tmp, tmp & SDHCI_CDNS_HRS04_ACK, 10); + if (ret) + return ret; + tmp &= ~SDHCI_CDNS_HRS04_WR; writel(tmp, reg); + + return 0; } -static void sdhci_cdns_phy_init(struct sdhci_cdns_plat *plat) +static int sdhci_cdns_phy_init(struct sdhci_cdns_plat *plat, + const void *fdt, int nodeoffset) { - sdhci_cdns_write_phy_reg(plat, SDHCI_CDNS_PHY_DLY_SD_HS, 4); - sdhci_cdns_write_phy_reg(plat, SDHCI_CDNS_PHY_DLY_SD_DEFAULT, 4); - sdhci_cdns_write_phy_reg(plat, SDHCI_CDNS_PHY_DLY_EMMC_LEGACY, 9); - sdhci_cdns_write_phy_reg(plat, SDHCI_CDNS_PHY_DLY_EMMC_SDR, 2); - sdhci_cdns_write_phy_reg(plat, SDHCI_CDNS_PHY_DLY_EMMC_DDR, 3); + const u32 *prop; + int ret, i; + + for (i = 0; i < ARRAY_SIZE(sdhci_cdns_phy_cfgs); i++) { + prop = fdt_getprop(fdt, nodeoffset, + sdhci_cdns_phy_cfgs[i].property, NULL); + if (!prop) + continue; + + ret = sdhci_cdns_write_phy_reg(plat, + sdhci_cdns_phy_cfgs[i].addr, + fdt32_to_cpu(*prop)); + if (ret) + return ret; + } + + return 0; } static int sdhci_cdns_bind(struct udevice *dev) @@ -76,6 +120,7 @@ static int sdhci_cdns_bind(struct udevice *dev) static int sdhci_cdns_probe(struct udevice *dev) { + DECLARE_GLOBAL_DATA_PTR; struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct sdhci_cdns_plat *plat = dev_get_platdata(dev); struct sdhci_host *host = dev_get_priv(dev); @@ -94,7 +139,9 @@ static int sdhci_cdns_probe(struct udevice *dev) host->ioaddr = plat->hrs_addr + SDHCI_CDNS_SRS_BASE; host->quirks |= SDHCI_QUIRK_WAIT_SEND_CMD; - sdhci_cdns_phy_init(plat); + ret = sdhci_cdns_phy_init(plat, gd->fdt_blob, dev->of_offset); + if (ret) + return ret; ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0); if (ret) -- cgit v0.10.2 From d90e9458d7e7e7a44abe8477b562ec4961dd3cc6 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 May 2017 20:31:37 +0900 Subject: sandbox_noblk_defconfig: disable CONFIG_GENERIC_MMC As commit 54925327fa11 ("mmc: move CONFIG_GENERIC_MMC to Kconfig") addressed, this is one of the last weird defconfigs that define CONFIG_GENERIC_MMC without CONFIG_MMC. Now I took a closer look at this. Given that neither CONFIG_CMD_MMC nor CONFIG_MMC is set for this defconfig, CONFIG_GENERIC_MMC should be disabled. Signed-off-by: Masahiro Yamada diff --git a/configs/sandbox_noblk_defconfig b/configs/sandbox_noblk_defconfig index b30e165..6c6e659 100644 --- a/configs/sandbox_noblk_defconfig +++ b/configs/sandbox_noblk_defconfig @@ -105,7 +105,6 @@ CONFIG_CROS_EC_SPI=y CONFIG_PWRSEQ=y CONFIG_SPL_PWRSEQ=y # CONFIG_MMC is not set -CONFIG_GENERIC_MMC=y CONFIG_SPI_FLASH_SANDBOX=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_ATMEL=y -- cgit v0.10.2 From 67e09e248fd3ffaa36e0481d78a31be4736d68c0 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 May 2017 20:31:38 +0900 Subject: blanche_defconfig: enable CONFIG_MMC As commit 54925327fa11 ("mmc: move CONFIG_GENERIC_MMC to Kconfig") addressed, this is one of the last weird defconfigs that define CONFIG_GENERIC_MMC without CONFIG_MMC. Now I took a closer look at this. Given that both CONFIG_CMD_MMC and CONFIG_GENERIC_MMC are set for this defconfig, CONFIG_MMC should be enabled. Signed-off-by: Masahiro Yamada diff --git a/configs/blanche_defconfig b/configs/blanche_defconfig index 5664421..a963802 100644 --- a/configs/blanche_defconfig +++ b/configs/blanche_defconfig @@ -15,8 +15,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y -# CONFIG_MMC is not set -CONFIG_GENERIC_MMC=y +CONFIG_MMC=y CONFIG_MTD_NOR_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_BAR=y -- cgit v0.10.2 From 4aa2ba3a34e3e4413c2cc63fc54f3176881b1a56 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 May 2017 20:31:39 +0900 Subject: mmc: replace CONFIG_GENERIC_MMC with CONFIG_MMC Now CONFIG_GENERIC_MMC and CONFIG_MMC match for all defconfig. We do not need two options for the same feature. Deprecate the former. This commit was generated with the sed script 's/GENERIC_MMC/MMC/' and manual fixup of drivers/mmc/Kconfig. Signed-off-by: Masahiro Yamada diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b2d6e80..a17ba2c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -654,7 +654,7 @@ config ARCH_SUNXI imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBDISK_SUPPORT imply SPL_LIBGENERIC_SUPPORT - imply SPL_MMC_SUPPORT if GENERIC_MMC + imply SPL_MMC_SUPPORT if MMC imply SPL_POWER_SUPPORT imply SPL_SERIAL_SUPPORT diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 5cc82c9..b1ae079 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -684,7 +684,7 @@ int board_eth_init(bd_t *bis) return rv; } #endif /* defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD) */ -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(1, 0, 0, -1, -1); diff --git a/board/bosch/shc/board.c b/board/bosch/shc/board.c index e90693f..38577f3 100644 --- a/board/bosch/shc/board.c +++ b/board/bosch/shc/board.c @@ -632,7 +632,7 @@ void arch_preboot_os(void) leds_set_finish(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { int ret; diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c b/board/compulab/cl-som-am57x/cl-som-am57x.c index 4701b71..389eebb 100644 --- a/board/compulab/cl-som-am57x/cl-som-am57x.c +++ b/board/compulab/cl-som-am57x/cl-som-am57x.c @@ -33,7 +33,7 @@ int board_init(void) return 0; } -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC #define SB_SOM_CD_GPIO 187 #define SB_SOM_WP_GPIO 188 @@ -51,7 +51,7 @@ int board_mmc_init(bd_t *bis) return ret0 && ret1; } -#endif /* CONFIG_GENERIC_MMC */ +#endif /* CONFIG_MMC */ int misc_init_r(void) { diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index 2d9dd9d..f169125 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -372,7 +372,7 @@ void set_muxconf_regs(void) cm_t3730_set_muxconf(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) #define SB_T35_WP_GPIO 59 int board_mmc_getcd(struct mmc *mmc) @@ -391,7 +391,7 @@ int board_mmc_init(bd_t *bis) } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c index b55ded0..38eb641 100644 --- a/board/compulab/cm_t3517/cm_t3517.c +++ b/board/compulab/cm_t3517/cm_t3517.c @@ -115,7 +115,7 @@ int misc_init_r(void) return 0; } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) #define SB_T35_CD_GPIO 144 #define SB_T35_WP_GPIO 59 diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c index 7b58fcd..456ff24 100644 --- a/board/compulab/cm_t54/cm_t54.c +++ b/board/compulab/cm_t54/cm_t54.c @@ -96,7 +96,7 @@ uint mmc_get_env_part(struct mmc *mmc) } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) #define SB_T54_CD_GPIO 228 #define SB_T54_WP_GPIO 229 diff --git a/board/corscience/tricorder/tricorder.c b/board/corscience/tricorder/tricorder.c index 48d65e8..730b8ca 100644 --- a/board/corscience/tricorder/tricorder.c +++ b/board/corscience/tricorder/tricorder.c @@ -140,14 +140,14 @@ void set_muxconf_regs(void) MUX_TRICORDER(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/gumstix/duovero/duovero.c b/board/gumstix/duovero/duovero.c index 11d2d7f..ea32f4a 100644 --- a/board/gumstix/duovero/duovero.c +++ b/board/gumstix/duovero/duovero.c @@ -110,7 +110,7 @@ void set_muxconf_regs(void) sizeof(struct pad_conf_entry)); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c index 0f0eb3a..47bce4d 100644 --- a/board/hisilicon/hikey/hikey.c +++ b/board/hisilicon/hikey/hikey.c @@ -341,7 +341,7 @@ int board_init(void) return 0; } -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC static int init_dwmmc(void) { diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index d3914a1..843d35e 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -199,14 +199,14 @@ int board_eth_init(bd_t *bis) static inline void setup_net_chip(void) {} #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c index 1aaeb8d..5d2d997 100644 --- a/board/logicpd/am3517evm/am3517evm.c +++ b/board/logicpd/am3517evm/am3517evm.c @@ -152,7 +152,7 @@ void set_muxconf_regs(void) MUX_AM3517EVM(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index ce17db6..7990dd2 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -229,14 +229,14 @@ int board_late_init(void) } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c index 0fad23a..e91f874 100644 --- a/board/logicpd/zoom1/zoom1.c +++ b/board/logicpd/zoom1/zoom1.c @@ -106,7 +106,7 @@ void set_muxconf_regs(void) MUX_ZOOM1_MDK(); } -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/overo/overo.c b/board/overo/overo.c index 5e44726..f1a3d73 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -379,14 +379,14 @@ int board_eth_init(bd_t *bis) } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c index b371a40..3502bbf 100644 --- a/board/pandora/pandora.c +++ b/board/pandora/pandora.c @@ -121,7 +121,7 @@ void set_muxconf_regs(void) } } -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/quipos/cairo/cairo.c b/board/quipos/cairo/cairo.c index 7a1a61e..5fce45e 100644 --- a/board/quipos/cairo/cairo.c +++ b/board/quipos/cairo/cairo.c @@ -62,7 +62,7 @@ void set_muxconf_regs(void) MUX_CAIRO(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c index 405ed3b..49ed324 100644 --- a/board/samsung/arndale/arndale.c +++ b/board/samsung/arndale/arndale.c @@ -71,7 +71,7 @@ int dram_init_banksize(void) return 0; } -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC int board_mmc_init(bd_t *bis) { int ret; diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 49e4db2..1762696 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -250,7 +250,7 @@ int board_eth_init(bd_t *bis) return 0; } -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC static int init_mmc(void) { #ifdef CONFIG_MMC_SDHCI diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 203136f..dc4dead 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -208,7 +208,7 @@ mode_cmd[BOOT_MODE_EXIT + 1] = { static void display_board_info(void) { -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC struct mmc *mmc = find_mmc_device(0); #endif vidinfo_t *vid = &panel_info; @@ -226,7 +226,7 @@ static void display_board_info(void) lcd_printf("\tDRAM banks: %u\n", CONFIG_NR_DRAM_BANKS); lcd_printf("\tDRAM size: %u MB\n", gd->ram_size / SZ_1M); -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC if (mmc) { if (!mmc->capacity) mmc_init(mmc); diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 35ed398..1259383 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -72,7 +72,7 @@ int checkboard(void) } #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC int board_mmc_init(bd_t *bis) { int i, ret, ret_sd = 0; diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c index c730ac0..027755d 100644 --- a/board/samsung/smdkv310/smdkv310.c +++ b/board/samsung/smdkv310/smdkv310.c @@ -87,7 +87,7 @@ int checkboard(void) } #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC int board_mmc_init(bd_t *bis) { int i, err; diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 01de42d..4404edb 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -284,7 +284,7 @@ void board_nand_init(void) } #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC static void mmc_pinmux_setup(int sdc) { unsigned int pin; diff --git a/board/technexion/tao3530/tao3530.c b/board/technexion/tao3530/tao3530.c index cba48d4..21944c7 100644 --- a/board/technexion/tao3530/tao3530.c +++ b/board/technexion/tao3530/tao3530.c @@ -179,7 +179,7 @@ void set_muxconf_regs(void) #endif } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { omap_mmc_init(0, 0, 0, -1, -1); @@ -188,7 +188,7 @@ int board_mmc_init(bd_t *bis) } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/ti/am3517crane/am3517crane.c b/board/ti/am3517crane/am3517crane.c index faa95d7..5fa319d 100644 --- a/board/ti/am3517crane/am3517crane.c +++ b/board/ti/am3517crane/am3517crane.c @@ -63,7 +63,7 @@ void set_muxconf_regs(void) MUX_AM3517CRANE(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 6d444e0..3be697a 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -661,7 +661,7 @@ err: } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index e90fe1a..dc38a80 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -524,14 +524,14 @@ void set_muxconf_regs(void) MUX_BEAGLE(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index d8e48dd..8c02add 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -702,7 +702,7 @@ err: } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 4f132e5..fe8e793 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -259,14 +259,14 @@ int board_eth_init(bd_t *bis) } #endif /* CONFIG_CMD_NET */ -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index 6e03f6b..21aec8f 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -196,7 +196,7 @@ s16 divn_val[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { if (psc_enable_module(KS2_LPSC_MMC)) { diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c index 64d772c..447f82c 100644 --- a/board/ti/omap5_uevm/evm.c +++ b/board/ti/omap5_uevm/evm.c @@ -211,7 +211,7 @@ void set_muxconf_regs(void) sizeof(struct pad_conf_entry)); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 187ff3c..4db8f82 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -287,7 +287,7 @@ void set_muxconf_regs(void) sizeof(struct pad_conf_entry)); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/ti/sdp4430/sdp.c b/board/ti/sdp4430/sdp.c index 0eb60e4..bc8d32f 100644 --- a/board/ti/sdp4430/sdp.c +++ b/board/ti/sdp4430/sdp.c @@ -73,7 +73,7 @@ void set_muxconf_regs(void) sizeof(struct pad_conf_entry)); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { omap_mmc_init(0, 0, 0, -1, -1); diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c index e85794c..055a29d 100644 --- a/board/ti/ti814x/evm.c +++ b/board/ti/ti814x/evm.c @@ -111,7 +111,7 @@ int board_init(void) return 0; } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { omap_mmc_init(1, 0, 0, -1, -1); diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c index 5f57956..d31eeb8 100644 --- a/board/timll/devkit8000/devkit8000.c +++ b/board/timll/devkit8000/devkit8000.c @@ -131,14 +131,14 @@ void set_muxconf_regs(void) MUX_DEVKIT8000(); } -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } #endif -#if defined(CONFIG_GENERIC_MMC) +#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); diff --git a/common/board_r.c b/common/board_r.c index d69a33c..9f34b85 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -432,7 +432,7 @@ static int initr_onenand(void) } #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC static int initr_mmc(void) { puts("MMC: "); @@ -815,7 +815,7 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_CMD_ONENAND initr_onenand, #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC initr_mmc, #endif #ifdef CONFIG_HAS_DATAFLASH diff --git a/common/spl/Kconfig b/common/spl/Kconfig index f51ae2c..0d56f10 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -374,7 +374,7 @@ config SPL_LIBGENERIC_SUPPORT config SPL_MMC_SUPPORT bool "Support MMC" - depends on SPL && GENERIC_MMC + depends on SPL && MMC help Enable support for MMC (Multimedia Card) within SPL. This enables the MMC protocol implementation and allows any enabled drivers to diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index ac57867..0dd4443 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -10,10 +10,6 @@ config MMC If you want MMC/SD/SDIO support, you should say Y here and also to your specific host controller driver. -config GENERIC_MMC - bool "Generic MMC driver framework" - default MMC - config DM_MMC bool "Enable MMC controllers using Driver Model" depends on DM diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index de91f14..75a7cd3 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile @@ -6,11 +6,11 @@ # ifdef CONFIG_DM_MMC -obj-$(CONFIG_GENERIC_MMC) += mmc-uclass.o +obj-$(CONFIG_MMC) += mmc-uclass.o endif ifndef CONFIG_BLK -obj-$(CONFIG_GENERIC_MMC) += mmc_legacy.o +obj-$(CONFIG_MMC) += mmc_legacy.o endif obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o @@ -23,9 +23,9 @@ obj-$(CONFIG_MMC_DW_ROCKCHIP) += rockchip_dw_mmc.o obj-$(CONFIG_MMC_DW_SOCFPGA) += socfpga_dw_mmc.o obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o -obj-$(CONFIG_GENERIC_MMC) += mmc.o +obj-$(CONFIG_MMC) += mmc.o ifdef CONFIG_SUPPORT_EMMC_BOOT -obj-$(CONFIG_GENERIC_MMC) += mmc_boot.o +obj-$(CONFIG_MMC) += mmc_boot.o endif obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o obj-$(CONFIG_MMC_MESON_GX) += meson_gx_mmc.o @@ -46,7 +46,7 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o obj-$(CONFIG_SPL_SAVEENV) += mmc_write.o else -obj-$(CONFIG_GENERIC_MMC) += mmc_write.o +obj-$(CONFIG_MMC) += mmc_write.o endif # SDHCI diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index 9edb668..dd78429 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -347,7 +347,7 @@ static int dmmc_init(struct mmc *mmc) return 0; } -/* Set buswidth or clock as indicated by the GENERIC_MMC framework */ +/* Set buswidth or clock as indicated by the MMC framework */ static int dmmc_set_ios(struct mmc *mmc) { struct davinci_mmc *host = mmc->priv; -- cgit v0.10.2 From 792f0054a445b8653e028415dd28fef925be6a9a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 May 2017 20:31:40 +0900 Subject: mmc: descend into drivers/mmc only when CONFIG_MMC is enabled This simplifies makefiles. Also, arrange the order of objects in drivers/mmc/Makefile so that the framework objects are listed before drivers. Signed-off-by: Masahiro Yamada diff --git a/Makefile b/Makefile index 57fa6ec..bcab726 100644 --- a/Makefile +++ b/Makefile @@ -653,7 +653,6 @@ libs-y += drivers/ libs-y += drivers/dma/ libs-y += drivers/gpio/ libs-y += drivers/i2c/ -libs-y += drivers/mmc/ libs-y += drivers/mtd/ libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/ libs-y += drivers/mtd/onenand/ diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 0d56f10..e82a879 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -729,7 +729,7 @@ config TPL_MPC8XXX_INIT_DDR_SUPPORT config TPL_MMC_SUPPORT bool "Support MMC" - depends on TPL + depends on TPL && MMC help Enable support for MMC within TPL. See SPL_MMC_SUPPORT for details. diff --git a/drivers/Makefile b/drivers/Makefile index 6916420..64c39d3 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -76,6 +76,7 @@ obj-y += firmware/ obj-$(CONFIG_FPGA) += fpga/ obj-y += hwmon/ obj-y += misc/ +obj-$(CONFIG_MMC) += mmc/ obj-y += pcmcia/ obj-y += dfu/ obj-$(CONFIG_X86) += pch/ diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index 75a7cd3..a078649 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile @@ -5,17 +5,24 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifdef CONFIG_DM_MMC -obj-$(CONFIG_MMC) += mmc-uclass.o -endif +obj-y += mmc.o +obj-$(CONFIG_DM_MMC) += mmc-uclass.o ifndef CONFIG_BLK -obj-$(CONFIG_MMC) += mmc_legacy.o +obj-y += mmc_legacy.o +endif + +obj-$(CONFIG_SUPPORT_EMMC_BOOT) += mmc_boot.o + +ifdef CONFIG_SPL_BUILD +obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o +obj-$(CONFIG_SPL_SAVEENV) += mmc_write.o +else +obj-y += mmc_write.o endif obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o obj-$(CONFIG_MMC_DAVINCI) += davinci_mmc.o - obj-$(CONFIG_MMC_DW) += dw_mmc.o obj-$(CONFIG_MMC_DW_EXYNOS) += exynos_dw_mmc.o obj-$(CONFIG_MMC_DW_K3) += hi6220_dw_mmc.o @@ -23,10 +30,6 @@ obj-$(CONFIG_MMC_DW_ROCKCHIP) += rockchip_dw_mmc.o obj-$(CONFIG_MMC_DW_SOCFPGA) += socfpga_dw_mmc.o obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o -obj-$(CONFIG_MMC) += mmc.o -ifdef CONFIG_SUPPORT_EMMC_BOOT -obj-$(CONFIG_MMC) += mmc_boot.o -endif obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o obj-$(CONFIG_MMC_MESON_GX) += meson_gx_mmc.o obj-$(CONFIG_MMC_SPI) += mmc_spi.o @@ -42,13 +45,6 @@ obj-$(CONFIG_MMC_SANDBOX) += sandbox_mmc.o obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_SH_SDHI) += sh_sdhi.o -ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o -obj-$(CONFIG_SPL_SAVEENV) += mmc_write.o -else -obj-$(CONFIG_MMC) += mmc_write.o -endif - # SDHCI obj-$(CONFIG_MMC_SDHCI) += sdhci.o obj-$(CONFIG_MMC_SDHCI_ATMEL) += atmel_sdhci.o -- cgit v0.10.2 From b3125088a3cc362a21aa3bbd0c0e4e74d74a6f2b Mon Sep 17 00:00:00 2001 From: Wenyou Yang Date: Thu, 11 May 2017 08:25:12 +0800 Subject: mmc: atmel_sdhci: Enable the quirk SDHCI_QUIRK_WAIT_SEND_CMD To fix the timeout of sending the write command, enable the quirk SDHCI_QUIRK_WAIT_SEND_CMD. Signed-off-by: Wenyou Yang Reviewed-by: Simon Glass diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index 8522557..86e36a9 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -28,7 +28,7 @@ int atmel_sdhci_init(void *regbase, u32 id) host->name = "atmel_sdhci"; host->ioaddr = regbase; - host->quirks = 0; + host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD; max_clk = at91_get_periph_generated_clk(id); if (!max_clk) { printf("%s: Failed to get the proper clock\n", __func__); @@ -74,7 +74,7 @@ static int atmel_sdhci_probe(struct udevice *dev) host->name = dev->name; host->ioaddr = (void *)dev_get_addr(dev); - host->quirks = 0; + host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD; host->bus_width = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width", 4); -- cgit v0.10.2