]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: fsl_esdhc: Add new config option for default fallback mode
authorPali Rohár <pali@kernel.org>
Wed, 11 May 2022 18:27:13 +0000 (20:27 +0200)
committerPeng Fan <peng.fan@nxp.com>
Mon, 20 Jun 2022 07:52:45 +0000 (15:52 +0800)
Currently default fallback SDHC mode is 1-bit. Add new config option
CONFIG_SYS_FSL_ESDHC_DEFAULT_BUS_WIDTH to allow specifying default fallback
mode. This is useful e.g. for SPL builds which loads other parts from SD
card during boot process.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/Kconfig
drivers/mmc/fsl_esdhc.c

index c8f9709d2d49bedf192c08c24b2d31023f83db58..5a87db6be0835b606048152fe6fb93c3d0772065 100644 (file)
@@ -839,6 +839,11 @@ config FSL_ESDHC_VS33_NOT_SUPPORT
          For eSDHC, power supply is through peripheral circuit. 3.3V support is
          common. Select this if 3.3V power supply not supported.
 
+config SYS_FSL_ESDHC_DEFAULT_BUS_WIDTH
+       int
+       depends on FSL_ESDHC
+       default 1
+
 config FSL_ESDHC_IMX
        bool "Freescale/NXP i.MX eSDHC controller support"
        help
index 6c6d03d45003b298006e01d3a6257142b4082ea4..4e7bfdfaa7e71721e6920cf38b3e55ca5c31be20 100644 (file)
@@ -971,6 +971,7 @@ int fsl_esdhc_mmc_init(struct bd_info *bis)
 
        cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1);
        cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
+       cfg->max_bus_width = CONFIG_SYS_FSL_ESDHC_DEFAULT_BUS_WIDTH;
        /* Prefer peripheral clock which provides higher frequency. */
        if (gd->arch.sdhc_per_clk)
                cfg->sdhc_clk = gd->arch.sdhc_per_clk;