diff options
Diffstat (limited to 'drivers/mmc')
64 files changed, 91 insertions, 45 deletions
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index d0944793c9..549634891a 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -147,16 +147,9 @@ config SPL_MMC_IO_VOLTAGE support. For eMMC this not mandatory, but not enabling this option may prevent the driver of using the faster modes. -config MMC_SUPPORTS_TUNING - bool - -config SPL_MMC_SUPPORTS_TUNING - bool - config MMC_UHS_SUPPORT bool "enable UHS support" depends on MMC_IO_VOLTAGE - select MMC_SUPPORTS_TUNING help The Ultra High Speed (UHS) bus is available on some SDHC and SDXC cards. The IO voltage must be switchable from 3.3v to 1.8v. The bus @@ -165,7 +158,6 @@ config MMC_UHS_SUPPORT config SPL_MMC_UHS_SUPPORT bool "enable UHS support in SPL" depends on SPL_MMC_IO_VOLTAGE - select SPL_MMC_SUPPORTS_TUNING help The Ultra High Speed (UHS) bus is available on some SDHC and SDXC cards. The IO voltage must be switchable from 3.3v to 1.8v. The bus @@ -201,7 +193,6 @@ config SPL_MMC_HS400_SUPPORT config MMC_HS200_SUPPORT bool "enable HS200 support" - select MMC_SUPPORTS_TUNING help The HS200 mode is support by some eMMC. The bus frequency is up to 200MHz. This mode requires tuning the IO. @@ -209,7 +200,6 @@ config MMC_HS200_SUPPORT config SPL_MMC_HS200_SUPPORT bool "enable HS200 support in SPL" depends on SPL_MMC - select SPL_MMC_SUPPORTS_TUNING help The HS200 mode is support by some eMMC. The bus frequency is up to 200MHz. This mode requires tuning the IO. @@ -357,7 +347,6 @@ 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. If you have an OcteonTX/TX2 or MIPS Octeon board with a diff --git a/drivers/mmc/am654_sdhci.c b/drivers/mmc/am654_sdhci.c index 48fac7a11b..fadab7d40b 100644 --- a/drivers/mmc/am654_sdhci.c +++ b/drivers/mmc/am654_sdhci.c @@ -6,6 +6,7 @@ */ #include <clk.h> +#include <common.h> #include <dm.h> #include <malloc.h> #include <mmc.h> @@ -396,7 +397,7 @@ static void am654_sdhci_write_b(struct sdhci_host *host, u8 val, int reg) writeb(val, host->ioaddr + reg); } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING #define ITAPDLY_LENGTH 32 #define ITAPDLY_LAST_INDEX (ITAPDLY_LENGTH - 1) @@ -499,7 +500,7 @@ static int am654_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) } #endif const struct sdhci_ops am654_sdhci_ops = { -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .platform_execute_tuning = am654_sdhci_execute_tuning, #endif .deferred_probe = am654_sdhci_deferred_probe, @@ -559,7 +560,7 @@ static int j721e_4bit_sdhci_set_ios_post(struct sdhci_host *host) } const struct sdhci_ops j721e_4bit_sdhci_ops = { -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .platform_execute_tuning = am654_sdhci_execute_tuning, #endif .deferred_probe = am654_sdhci_deferred_probe, diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index f00b0ff0dc..cecc7ad783 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -11,6 +11,7 @@ /* #define DEBUG */ +#include "common.h" #include <clk.h> #include <errno.h> #include <log.h> diff --git a/drivers/mmc/aspeed_sdhci.c b/drivers/mmc/aspeed_sdhci.c index 87a6f66ebb..c9626c6beb 100644 --- a/drivers/mmc/aspeed_sdhci.c +++ b/drivers/mmc/aspeed_sdhci.c @@ -4,6 +4,7 @@ * Eddie James <eajames@linux.ibm.com> */ +#include <common.h> #include <clk.h> #include <dm.h> #include <malloc.h> diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index 0b265196f0..d92bad97b7 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -4,6 +4,7 @@ * Wenyou.Yang <wenyou.yang@atmel.com> */ +#include <common.h> #include <clk.h> #include <dm.h> #include <malloc.h> diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c index 598a51d914..5e48394fd0 100644 --- a/drivers/mmc/bcm2835_sdhci.c +++ b/drivers/mmc/bcm2835_sdhci.c @@ -36,6 +36,7 @@ * Inspired by sdhci-pci.c, by Pierre Ossman */ +#include <common.h> #include <dm.h> #include <log.h> #include <malloc.h> diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c index 720127468d..5c23c03d10 100644 --- a/drivers/mmc/bcm2835_sdhost.c +++ b/drivers/mmc/bcm2835_sdhost.c @@ -30,6 +30,7 @@ * sdhci.c and sdhci-pci.c by Pierre Ossman */ #include <clk.h> +#include <common.h> #include <dm.h> #include <mmc.h> #include <asm/arch/msg.h> diff --git a/drivers/mmc/bcmstb_sdhci.c b/drivers/mmc/bcmstb_sdhci.c index 7bddbebb16..49846adcf5 100644 --- a/drivers/mmc/bcmstb_sdhci.c +++ b/drivers/mmc/bcmstb_sdhci.c @@ -6,6 +6,7 @@ * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org> */ +#include <common.h> #include <dm.h> #include <mach/sdhci.h> #include <malloc.h> diff --git a/drivers/mmc/ca_dw_mmc.c b/drivers/mmc/ca_dw_mmc.c index 54a2ba4795..a17ed8c11c 100644 --- a/drivers/mmc/ca_dw_mmc.c +++ b/drivers/mmc/ca_dw_mmc.c @@ -4,6 +4,7 @@ * Arthur Li <arthur.li@cortina-access.com> */ +#include <common.h> #include <dwmmc.h> #include <fdtdec.h> #include <asm/global_data.h> diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index 5107fcd836..3a3d23aec0 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -6,6 +6,7 @@ */ #include <config.h> +#include <common.h> #include <dm.h> #include <errno.h> #include <mmc.h> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index e6107c770f..e103664145 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -6,6 +6,7 @@ */ #include <bouncebuf.h> +#include <common.h> #include <cpu_func.h> #include <errno.h> #include <log.h> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index a51f762988..2f849c43b1 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -4,6 +4,7 @@ * Jaehoon Chung <jh80.chung@samsung.com> */ +#include <common.h> #include <dwmmc.h> #include <fdtdec.h> #include <asm/global_data.h> diff --git a/drivers/mmc/f_sdh30.c b/drivers/mmc/f_sdh30.c index f47cf84852..3d587a464d 100644 --- a/drivers/mmc/f_sdh30.c +++ b/drivers/mmc/f_sdh30.c @@ -5,6 +5,7 @@ * Copyright 2021 Socionext, Inc. */ +#include <common.h> #include <clk.h> #include <dm.h> #include <malloc.h> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 0c66980b62..595d88bd56 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -10,6 +10,7 @@ */ #include <config.h> +#include <common.h> #include <command.h> #include <cpu_func.h> #include <errno.h> @@ -1101,7 +1102,7 @@ static int fsl_esdhc_reinit(struct udevice *dev) return esdhc_init_common(priv, &plat->mmc); } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static int fsl_esdhc_execute_tuning(struct udevice *dev, uint32_t opcode) { struct fsl_esdhc_plat *plat = dev_get_plat(dev); @@ -1174,7 +1175,7 @@ static const struct dm_mmc_ops fsl_esdhc_ops = { .get_cd = fsl_esdhc_get_cd, .send_cmd = fsl_esdhc_send_cmd, .set_ios = fsl_esdhc_set_ios, -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .execute_tuning = fsl_esdhc_execute_tuning, #endif .reinit = fsl_esdhc_reinit, diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index a9b8d7dd67..b74c014002 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -11,6 +11,7 @@ */ #include <config.h> +#include <common.h> #include <command.h> #include <clk.h> #include <cpu_func.h> @@ -634,7 +635,7 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) priv->clock = clock; } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static int esdhc_change_pinstate(struct udevice *dev) { struct fsl_esdhc_priv *priv = dev_get_priv(dev); @@ -912,7 +913,7 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) int ret __maybe_unused; u32 clock; -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING /* * call esdhc_set_timing() before update the clock rate, * This is because current we support DDR and SDR mode, @@ -950,7 +951,7 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) esdhc_setbits32(®s->sysctl, SYSCTL_PEREN | SYSCTL_CKEN); } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING /* * For HS400/HS400ES mode, make sure set the strobe dll in the * target clock rate. So call esdhc_set_strobe_dll() after the @@ -1617,7 +1618,7 @@ static const struct dm_mmc_ops fsl_esdhc_ops = { .get_cd = fsl_esdhc_get_cd, .send_cmd = fsl_esdhc_send_cmd, .set_ios = fsl_esdhc_set_ios, -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .execute_tuning = fsl_esdhc_execute_tuning, #endif #if CONFIG_IS_ENABLED(MMC_HS400_ES_SUPPORT) diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c index 1a11258be4..6d7c0cff22 100644 --- a/drivers/mmc/fsl_esdhc_spl.c +++ b/drivers/mmc/fsl_esdhc_spl.c @@ -3,7 +3,7 @@ * Copyright 2013 Freescale Semiconductor, Inc. */ -#include <config.h> +#include <common.h> #include <cpu_func.h> #include <hang.h> #include <mmc.h> diff --git a/drivers/mmc/ftsdc010_mci.c b/drivers/mmc/ftsdc010_mci.c index 11e44264e4..cabb747fbb 100644 --- a/drivers/mmc/ftsdc010_mci.c +++ b/drivers/mmc/ftsdc010_mci.c @@ -9,6 +9,7 @@ * Author: Rick Chen (rick@andestech.com) */ +#include <common.h> #include <clk.h> #include <log.h> #include <malloc.h> diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index 6a531fa096..3ee99558f6 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -8,7 +8,7 @@ * Copyright (C) 2004-2006 Atmel Corporation */ -#include <config.h> +#include <common.h> #include <clk.h> #include <display_options.h> #include <dm.h> diff --git a/drivers/mmc/hi6220_dw_mmc.c b/drivers/mmc/hi6220_dw_mmc.c index c68a9157bf..dc0210402b 100644 --- a/drivers/mmc/hi6220_dw_mmc.c +++ b/drivers/mmc/hi6220_dw_mmc.c @@ -4,6 +4,7 @@ * peter.griffin <peter.griffin@linaro.org> */ +#include <common.h> #include <clk.h> #include <dm.h> #include <dwmmc.h> diff --git a/drivers/mmc/iproc_sdhci.c b/drivers/mmc/iproc_sdhci.c index 7ab74ff117..11d86ad658 100644 --- a/drivers/mmc/iproc_sdhci.c +++ b/drivers/mmc/iproc_sdhci.c @@ -4,6 +4,7 @@ * */ +#include <common.h> #include <dm.h> #include <errno.h> #include <malloc.h> diff --git a/drivers/mmc/jz_mmc.c b/drivers/mmc/jz_mmc.c index fc10bb256a..61e48ee0f6 100644 --- a/drivers/mmc/jz_mmc.c +++ b/drivers/mmc/jz_mmc.c @@ -6,6 +6,7 @@ * Author: Paul Burton <paul.burton@imgtec.com> */ +#include <common.h> #include <malloc.h> #include <mmc.h> #include <asm/global_data.h> diff --git a/drivers/mmc/kona_sdhci.c b/drivers/mmc/kona_sdhci.c index 83f1412263..2bbe673b91 100644 --- a/drivers/mmc/kona_sdhci.c +++ b/drivers/mmc/kona_sdhci.c @@ -3,6 +3,7 @@ * Copyright 2013 Broadcom Corporation. */ +#include <common.h> #include <malloc.h> #include <sdhci.h> #include <linux/delay.h> diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c index 5852b24c6d..0825c0a2a8 100644 --- a/drivers/mmc/meson_gx_mmc.c +++ b/drivers/mmc/meson_gx_mmc.c @@ -3,6 +3,7 @@ * (C) Copyright 2016 Carlo Caione <carlo@caione.org> */ +#include <common.h> #include <clk.h> #include <cpu_func.h> #include <dm.h> diff --git a/drivers/mmc/mmc-pwrseq.c b/drivers/mmc/mmc-pwrseq.c index a1c9624a22..2539f61323 100644 --- a/drivers/mmc/mmc-pwrseq.c +++ b/drivers/mmc/mmc-pwrseq.c @@ -4,6 +4,7 @@ * Jaehoon Chung <jh80.chung@samsung.com> */ +#include <common.h> #include <dm.h> #include <mmc.h> #include <pwrseq.h> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index da6a39b7d9..24170c59ec 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -7,6 +7,7 @@ #define LOG_CATEGORY UCLASS_MMC +#include <common.h> #include <bootdev.h> #include <log.h> #include <mmc.h> @@ -111,7 +112,7 @@ int mmc_getcd(struct mmc *mmc) return dm_mmc_get_cd(mmc->dev); } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static int dm_mmc_execute_tuning(struct udevice *dev, uint opcode) { struct dm_mmc_ops *ops = mmc_get_ops(dev); diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index b18dc331f7..7b068c71ff 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -8,6 +8,7 @@ */ #include <config.h> +#include <common.h> #include <blk.h> #include <command.h> #include <dm.h> @@ -16,7 +17,6 @@ #include <errno.h> #include <mmc.h> #include <part.h> -#include <time.h> #include <linux/bitops.h> #include <linux/delay.h> #include <linux/printk.h> @@ -24,7 +24,6 @@ #include <malloc.h> #include <memalign.h> #include <linux/list.h> -#include <linux/printk.h> #include <div64.h> #include "mmc_private.h" @@ -330,7 +329,7 @@ int mmc_set_blocklen(struct mmc *mmc, int len) MMC_QUIRK_RETRY_SET_BLOCKLEN, 4); } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static const u8 tuning_blk_pattern_4bit[] = { 0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc, 0xc3, 0x3c, 0xcc, 0xff, 0xfe, 0xff, 0xfe, 0xef, @@ -1622,7 +1621,7 @@ static inline int bus_width(uint cap) } #if !CONFIG_IS_ENABLED(DM_MMC) -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static int mmc_execute_tuning(struct mmc *mmc, uint opcode) { return -ENOTSUPP; @@ -1703,7 +1702,7 @@ void mmc_dump_capabilities(const char *text, uint caps) struct mode_width_tuning { enum bus_mode mode; uint widths; -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING uint tuning; #endif }; @@ -1744,7 +1743,7 @@ static inline int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage) #if !CONFIG_IS_ENABLED(MMC_TINY) static const struct mode_width_tuning sd_modes_by_pref[] = { #if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING { .mode = UHS_SDR104, .widths = MMC_MODE_4BIT | MMC_MODE_1BIT, @@ -1847,7 +1846,7 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps) mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE); -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING /* execute tuning if needed */ if (mwt->tuning && !mmc_host_is_spi(mmc)) { err = mmc_execute_tuning(mmc, @@ -2225,7 +2224,7 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps) mmc_select_mode(mmc, mwt->mode); mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE); -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING /* execute tuning if needed */ if (mwt->tuning) { diff --git a/drivers/mmc/mmc_boot.c b/drivers/mmc/mmc_boot.c index 367c957b51..0a74b1fb77 100644 --- a/drivers/mmc/mmc_boot.c +++ b/drivers/mmc/mmc_boot.c @@ -4,6 +4,7 @@ * Written by Amar <amarendra.xt@samsung.com> */ +#include <common.h> #include <log.h> #include <mmc.h> #include "mmc_private.h" diff --git a/drivers/mmc/mmc_bootdev.c b/drivers/mmc/mmc_bootdev.c index 5a1688b75d..55ecead2dd 100644 --- a/drivers/mmc/mmc_bootdev.c +++ b/drivers/mmc/mmc_bootdev.c @@ -6,6 +6,7 @@ * Written by Simon Glass <sjg@chromium.org> */ +#include <common.h> #include <bootdev.h> #include <dm.h> #include <mmc.h> diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c index a87d2276c1..a101ee43fd 100644 --- a/drivers/mmc/mmc_legacy.c +++ b/drivers/mmc/mmc_legacy.c @@ -5,6 +5,7 @@ * Written by Simon Glass <sjg@chromium.org> */ +#include <common.h> #include <log.h> #include <malloc.h> #include <mmc.h> diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 675e642efd..bcea800e5f 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -6,6 +6,7 @@ * * Licensed under the GPL-2 or later. */ +#include <common.h> #include <errno.h> #include <log.h> #include <malloc.h> diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c index c023d15e52..a6f93380dd 100644 --- a/drivers/mmc/mmc_write.c +++ b/drivers/mmc/mmc_write.c @@ -7,6 +7,7 @@ */ #include <config.h> +#include <common.h> #include <blk.h> #include <dm.h> #include <part.h> diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c index 4ce0de6c47..5e9d66526a 100644 --- a/drivers/mmc/msm_sdhci.c +++ b/drivers/mmc/msm_sdhci.c @@ -7,6 +7,7 @@ * Based on Linux driver */ +#include <common.h> #include <clk.h> #include <dm.h> #include <malloc.h> diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 3a9258255a..296aaee733 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -7,6 +7,7 @@ */ #include <clk.h> +#include <common.h> #include <dm.h> #include <mmc.h> #include <errno.h> @@ -1010,7 +1011,7 @@ static int msdc_ops_get_wp(struct udevice *dev) #endif } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static u32 test_delay_bit(u32 delay, u32 bit) { bit %= PAD_DELAY_MAX; @@ -1759,7 +1760,7 @@ static const struct dm_mmc_ops msdc_ops = { .set_ios = msdc_ops_set_ios, .get_cd = msdc_ops_get_cd, .get_wp = msdc_ops_get_wp, -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .execute_tuning = msdc_execute_tuning, #endif .wait_dat0 = msdc_ops_wait_dat0, diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c index 2da5334c21..dbdd671c88 100644 --- a/drivers/mmc/mv_sdhci.c +++ b/drivers/mmc/mv_sdhci.c @@ -3,6 +3,7 @@ * Marvell SD Host Controller Interface */ +#include <common.h> #include <dm.h> #include <malloc.h> #include <sdhci.h> diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c index 5af1953cd1..fea55c61ed 100644 --- a/drivers/mmc/mvebu_mmc.c +++ b/drivers/mmc/mvebu_mmc.c @@ -7,6 +7,7 @@ * Written-by: Maen Suleiman, Gerald Kerma */ +#include <common.h> #include <errno.h> #include <log.h> #include <malloc.h> diff --git a/drivers/mmc/mxcmmc.c b/drivers/mmc/mxcmmc.c index 1acea6f820..0057273a2a 100644 --- a/drivers/mmc/mxcmmc.c +++ b/drivers/mmc/mxcmmc.c @@ -17,6 +17,7 @@ */ #include <config.h> +#include <common.h> #include <command.h> #include <mmc.h> #include <part.h> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index 95390a5be7..35a8e21058 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -20,6 +20,7 @@ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net */ +#include <common.h> #include <log.h> #include <malloc.h> #include <mmc.h> diff --git a/drivers/mmc/nexell_dw_mmc.c b/drivers/mmc/nexell_dw_mmc.c index 2e1ce54c7d..2723e4887c 100644 --- a/drivers/mmc/nexell_dw_mmc.c +++ b/drivers/mmc/nexell_dw_mmc.c @@ -6,6 +6,7 @@ * (C) Copyright 2019 Stefan Bosch <stefan_b@posteo.net> */ +#include <common.h> #include <dm.h> #include <dt-structs.h> #include <dwmmc.h> diff --git a/drivers/mmc/npcm_sdhci.c b/drivers/mmc/npcm_sdhci.c index dff4732ea0..d63521d685 100644 --- a/drivers/mmc/npcm_sdhci.c +++ b/drivers/mmc/npcm_sdhci.c @@ -3,6 +3,7 @@ * Copyright (c) 2022 Nuvoton Technology Corp. */ +#include <common.h> #include <dm.h> #include <sdhci.h> #include <clk.h> diff --git a/drivers/mmc/octeontx_hsmmc.c b/drivers/mmc/octeontx_hsmmc.c index 3b5e122173..7f9c4f4d36 100644 --- a/drivers/mmc/octeontx_hsmmc.c +++ b/drivers/mmc/octeontx_hsmmc.c @@ -794,7 +794,7 @@ octeontx_mmc_get_cr_mods(struct mmc *mmc, const struct mmc_cmd *cmd, u8 desired_ctype = 0; if (IS_MMC(mmc)) { -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING if (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200) { if (cmd->resp_type == MMC_RSP_R1) cr.rtype_xor = 1; @@ -1631,7 +1631,7 @@ static int octeontx_mmc_dev_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, return octeontx_mmc_send_cmd(dev_to_mmc(dev), cmd, data); } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static int octeontx_mmc_test_cmd(struct mmc *mmc, u32 opcode, int *statp) { struct mmc_cmd cmd; @@ -2421,12 +2421,12 @@ static int octeontx_mmc_execute_tuning(struct udevice *dev, u32 opcode) return 0; } -#else /* CONFIG_MMC_SUPPORTS_TUNING */ +#else /* MMC_SUPPORTS_TUNING */ static void octeontx_mmc_set_emm_timing(struct mmc *mmc, union mio_emm_timing emm_timing) { } -#endif /* CONFIG_MMC_SUPPORTS_TUNING */ +#endif /* MMC_SUPPORTS_TUNING */ /** * Calculate the clock period with rounding up @@ -2573,7 +2573,7 @@ static int octeontx_mmc_set_ios(struct udevice *dev) err = octeontx_mmc_configure_delay(mmc); -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING if (!err && mmc->selected_mode == MMC_HS_400 && !slot->hs400_tuned) { debug("%s: Tuning HS400 mode\n", __func__); err = octeontx_tune_hs400(mmc); @@ -3776,7 +3776,7 @@ static const struct dm_mmc_ops octeontx_hsmmc_ops = { .set_ios = octeontx_mmc_set_ios, .get_cd = octeontx_mmc_get_cd, .get_wp = octeontx_mmc_get_wp, -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .execute_tuning = octeontx_mmc_execute_tuning, #endif }; diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 2b7f9fc9a2..99f21b2c54 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -23,6 +23,7 @@ */ #include <config.h> +#include <common.h> #include <cpu_func.h> #include <log.h> #include <malloc.h> @@ -576,7 +577,7 @@ static uint32_t omap_hsmmc_set_capabilities(struct mmc *mmc) return val; } -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING static void omap_hsmmc_disable_tuning(struct mmc *mmc) { struct hsmmc *mmc_base; @@ -1517,7 +1518,7 @@ static const struct dm_mmc_ops omap_hsmmc_ops = { .get_cd = omap_hsmmc_getcd, .get_wp = omap_hsmmc_getwp, #endif -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .execute_tuning = omap_hsmmc_execute_tuning, #endif .wait_dat0 = omap_hsmmc_wait_dat0, diff --git a/drivers/mmc/owl_mmc.c b/drivers/mmc/owl_mmc.c index bd4906f58e..e84171a661 100644 --- a/drivers/mmc/owl_mmc.c +++ b/drivers/mmc/owl_mmc.c @@ -11,6 +11,7 @@ * channel, and those special bits used in this driver is picked from vendor * source exclusively for MMC/SD. */ +#include <common.h> #include <clk.h> #include <cpu_func.h> #include <dm.h> diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c index d446c55f72..4d163ccba0 100644 --- a/drivers/mmc/pci_mmc.c +++ b/drivers/mmc/pci_mmc.c @@ -4,6 +4,7 @@ * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com> */ +#include <common.h> #include <dm.h> #include <errno.h> #include <log.h> diff --git a/drivers/mmc/piton_mmc.c b/drivers/mmc/piton_mmc.c index fed1f84160..a330bbf8cb 100644 --- a/drivers/mmc/piton_mmc.c +++ b/drivers/mmc/piton_mmc.c @@ -11,6 +11,7 @@ #include <asm/gpio.h> #include <asm/io.h> +#include <common.h> #include <div64.h> #include <dm.h> #include <errno.h> diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 1a10b7057a..ad4529d6af 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -3,6 +3,7 @@ * Copyright (c) 2013 Google, Inc */ +#include <common.h> #include <clk.h> #include <dm.h> #include <dt-structs.h> diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index 35667b86b5..c889c7bc98 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -5,6 +5,7 @@ * Rockchip SD Host Controller Interface */ +#include <common.h> #include <clk.h> #include <dm.h> #include <dm/ofnode.h> diff --git a/drivers/mmc/rpmb.c b/drivers/mmc/rpmb.c index 0658ce22cf..b68d98573c 100644 --- a/drivers/mmc/rpmb.c +++ b/drivers/mmc/rpmb.c @@ -8,6 +8,7 @@ */ #include <config.h> +#include <common.h> #include <log.h> #include <memalign.h> #include <mmc.h> diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index 80dbb38c9b..3b74feae68 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -4,6 +4,7 @@ * Jaehoon Chung <jh80.chung@samsung.com> */ +#include <common.h> #include <dm.h> #include <log.h> #include <malloc.h> diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c index a24520f2e7..0ba7940a4d 100644 --- a/drivers/mmc/sandbox_mmc.c +++ b/drivers/mmc/sandbox_mmc.c @@ -4,6 +4,7 @@ * Written by Simon Glass <sjg@chromium.org> */ +#include <common.h> #include <dm.h> #include <errno.h> #include <fdtdec.h> diff --git a/drivers/mmc/sdhci-adma.c b/drivers/mmc/sdhci-adma.c index fdb189d71a..283ba956de 100644 --- a/drivers/mmc/sdhci-adma.c +++ b/drivers/mmc/sdhci-adma.c @@ -3,6 +3,7 @@ * SDHCI ADMA2 helper functions. */ +#include <common.h> #include <cpu_func.h> #include <sdhci.h> #include <malloc.h> diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c index 07ec35a046..c0a9f60b14 100644 --- a/drivers/mmc/sdhci-cadence.c +++ b/drivers/mmc/sdhci-cadence.c @@ -4,6 +4,7 @@ * Author: Masahiro Yamada <yamada.masahiro@socionext.com> */ +#include <common.h> #include <dm.h> #include <asm/global_data.h> #include <dm/device_compat.h> @@ -273,7 +274,7 @@ static int sdhci_cdns_probe(struct udevice *dev) host->ops = &sdhci_cdns_ops; host->quirks |= SDHCI_QUIRK_WAIT_SEND_CMD; sdhci_cdns_mmc_ops = sdhci_ops; -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING sdhci_cdns_mmc_ops.execute_tuning = sdhci_cdns_execute_tuning; #endif diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 560b7e889c..af654ea8d1 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -7,6 +7,7 @@ * Murray.Jensen@cmst.csiro.au, 27-Jan-01. */ +#include <common.h> #include <cpu_func.h> #include <dm.h> #include <errno.h> @@ -14,7 +15,6 @@ #include <malloc.h> #include <mmc.h> #include <sdhci.h> -#include <time.h> #include <asm/cache.h> #include <linux/bitops.h> #include <linux/delay.h> @@ -351,7 +351,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, return -ECOMM; } -#if defined(CONFIG_DM_MMC) && CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#if defined(CONFIG_DM_MMC) && defined(MMC_SUPPORTS_TUNING) static int sdhci_execute_tuning(struct udevice *dev, uint opcode) { int err; @@ -848,7 +848,7 @@ const struct dm_mmc_ops sdhci_ops = { .set_ios = sdhci_set_ios, .get_cd = sdhci_get_cd, .deferred_probe = sdhci_deferred_probe, -#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING) +#ifdef MMC_SUPPORTS_TUNING .execute_tuning = sdhci_execute_tuning, #endif .wait_dat0 = sdhci_wait_dat0, diff --git a/drivers/mmc/sh_mmcif.c b/drivers/mmc/sh_mmcif.c index 06a30d5efb..76dc1c68b8 100644 --- a/drivers/mmc/sh_mmcif.c +++ b/drivers/mmc/sh_mmcif.c @@ -6,6 +6,7 @@ */ #include <config.h> +#include <common.h> #include <log.h> #include <watchdog.h> #include <command.h> diff --git a/drivers/mmc/snps_dw_mmc.c b/drivers/mmc/snps_dw_mmc.c index 9bdbe5070b..0134399e39 100644 --- a/drivers/mmc/snps_dw_mmc.c +++ b/drivers/mmc/snps_dw_mmc.c @@ -7,6 +7,7 @@ * Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> */ +#include <common.h> #include <clk.h> #include <dm.h> #include <dwmmc.h> diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c index f738019b83..387cb8b6b5 100644 --- a/drivers/mmc/socfpga_dw_mmc.c +++ b/drivers/mmc/socfpga_dw_mmc.c @@ -3,6 +3,7 @@ * (C) Copyright 2013 Altera Corporation <www.altera.com> */ +#include <common.h> #include <log.h> #include <asm/arch/clock_manager.h> #include <asm/arch/secure_reg_helper.h> diff --git a/drivers/mmc/sti_sdhci.c b/drivers/mmc/sti_sdhci.c index 91018b7e21..23a1dd43c9 100644 --- a/drivers/mmc/sti_sdhci.c +++ b/drivers/mmc/sti_sdhci.c @@ -4,6 +4,7 @@ * Author(s): Patrice Chotard, <patrice.chotard@foss.st.com> for STMicroelectronics. */ +#include <common.h> #include <dm.h> #include <log.h> #include <mmc.h> diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c index 9483fb57da..39ae79ba12 100644 --- a/drivers/mmc/stm32_sdmmc2.c +++ b/drivers/mmc/stm32_sdmmc2.c @@ -6,6 +6,7 @@ #define LOG_CATEGORY UCLASS_MMC +#include <common.h> #include <clk.h> #include <cpu_func.h> #include <dm.h> diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index 0b56d1405b..714706d241 100644 --- a/drivers/mmc/sunxi_mmc.c +++ b/drivers/mmc/sunxi_mmc.c @@ -13,6 +13,7 @@ * proper DM_MMC implementation at the end. */ +#include <common.h> #include <dm.h> #include <errno.h> #include <log.h> diff --git a/drivers/mmc/tangier_sdhci.c b/drivers/mmc/tangier_sdhci.c index ae65c310b6..1156427332 100644 --- a/drivers/mmc/tangier_sdhci.c +++ b/drivers/mmc/tangier_sdhci.c @@ -2,6 +2,7 @@ /* * Copyright (c) 2017 Intel Corporation */ +#include <common.h> #include <dm.h> #include <dm/device.h> #include <linux/io.h> diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c index 5ed7f01d3f..c01fb3d016 100644 --- a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@ -7,6 +7,7 @@ */ #include <bouncebuf.h> +#include <common.h> #include <dm.h> #include <errno.h> #include <log.h> diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c index 0b396122b4..719c4830bc 100644 --- a/drivers/mmc/tmio-common.c +++ b/drivers/mmc/tmio-common.c @@ -4,6 +4,7 @@ * Author: Masahiro Yamada <yamada.masahiro@socionext.com> */ +#include <common.h> #include <clk.h> #include <cpu_func.h> #include <fdtdec.h> diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c index 5b3650d52e..8cde4308aa 100644 --- a/drivers/mmc/uniphier-sd.c +++ b/drivers/mmc/uniphier-sd.c @@ -4,6 +4,7 @@ * Author: Masahiro Yamada <yamada.masahiro@socionext.com> */ +#include <common.h> #include <clk.h> #include <fdtdec.h> #include <malloc.h> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c index 0e4902fab7..27dbe0404e 100644 --- a/drivers/mmc/xenon_sdhci.c +++ b/drivers/mmc/xenon_sdhci.c @@ -14,6 +14,7 @@ * Stefan Roese <sr@denx.de> */ +#include <common.h> #include <dm.h> #include <fdtdec.h> #include <asm/global_data.h> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 898be5a091..935540d171 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -7,6 +7,7 @@ */ #include <clk.h> +#include <common.h> #include <dm.h> #include <fdtdec.h> #include <linux/delay.h> |