Commit 4125bbce authored by Tom Rini's avatar Tom Rini
Browse files

Merge branch 'master' of git://git.denx.de/u-boot-mmc



- Add #undef CONFIG_DM_MMC_OPS to omap3_logic in the SPL build case, to
  match other TI platforms in the same situation.
Signed-off-by: default avatarTom Rini <trini@konsulko.com>
parents d09ec7f8 b3125088
......@@ -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/
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -341,7 +341,7 @@ int board_init(void)
return 0;
}
#ifdef CONFIG_GENERIC_MMC
#ifdef CONFIG_MMC
static int init_dwmmc(void)
{
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -50,7 +50,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);
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)) {
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -432,7 +432,7 @@ static int initr_onenand(void)
}
#endif
#ifdef CONFIG_GENERIC_MMC
#ifdef CONFIG_MMC
static int initr_mmc(void)
{
puts("MMC: ");
......@@ -798,7 +798,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
......
......@@ -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
......@@ -743,7 +743,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.
......
......@@ -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
......
......@@ -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
......
......@@ -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/
......
......@@ -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
......@@ -138,6 +134,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,
......
......@@ -5,17 +5,24 @@
# SPDX-License-Identifier: GPL-2.0+
#
ifdef CONFIG_DM_MMC
obj-$(CONFIG_GENERIC_MMC) += mmc-uclass.o
endif
obj-y += mmc.o
obj-$(CONFIG_DM_MMC) += mmc-uclass.o
ifndef CONFIG_BLK
obj-$(CONFIG_GENERIC_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_GENERIC_MMC) += mmc.o
ifdef CONFIG_SUPPORT_EMMC_BOOT
obj-$(CONFIG_GENERIC_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_GENERIC_MMC) += mmc_write.o
endif
# SDHCI
obj-$(CONFIG_MMC_SDHCI) += sdhci.o
obj-$(CONFIG_MMC_SDHCI_ATMEL) += atmel_sdhci.o
......
......@@ -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);
......
......@@ -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;
......
......@@ -326,11 +326,17 @@ static void mmc_reset_controller_fsm(struct hsmmc *mmc_base, u32 bit)
}
}