[U-Boot] [PATCH v2 3/5] mmc: mmc_spi: Re-write driver using DM framework

Bin Meng bmeng.cn at gmail.com
Fri Jul 5 06:28:57 UTC 2019


On Sat, Jun 29, 2019 at 2:57 PM Anup Patel <Anup.Patel at wdc.com> wrote:
>
> From: Bhargav Shah <bhargavshah1988 at gmail.com>
>
> This patch rewrites MMC SPI driver using U-Boot DM
> framework and get it's working on SiFive Unleashed
> board.
>
> Signed-off-by: Bhargav Shah <bhargavshah1988 at gmail.com>
> Signed-off-by: Anup Patel <anup.patel at wdc.com>
> ---
>  drivers/mmc/Kconfig   |  18 ++
>  drivers/mmc/mmc_spi.c | 469 +++++++++++++++++++++++++++---------------
>  2 files changed, 320 insertions(+), 167 deletions(-)
>
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index c23299ea96..f750dad00a 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -46,6 +46,24 @@ config SPL_DM_MMC
>
>  if MMC
>
> +config MMC_SPI
> +       bool "Support for SPI-based MMC controller"
> +       depends on DM_MMC && DM_SPI
> +       help
> +         This selects SPI-based MMC controllers.
> +         If you have an MMC controller on a SPI bus, say Y here.
> +
> +         If unsure, say N.
> +
> +config MMC_SPI_CRC_ON
> +       bool "Support CRC for SPI-based MMC controller"
> +       depends on MMC_SPI
> +       default y
> +       help
> +         This enables CRC for SPI-based MMC controllers.
> +
> +         If unsure, say N.
> +

scripts/config_whitelist.txt should be updated to remove the non-DM
version macros: CONFIG_MMC_SPI_xxx

cmd/mmc_spi.c should be completely dropped as it is for non-DM version
MMC SPI driver.

mmc_spi_init() declaration in mmc.h should be removed.

With commit: f51d7fc8ce455ef201f86e1fab4d380444b96789 ("board:
Arcturus: DM: Disable drivers without DM support"), UCP1020 board
removes most legacy non-DM SPI MMC support, but still has
CONFIG_MMC_SPI in UCP1020.h. That should be removed too.
+Oleksandr Zhadan and Michael Durrant who maintains UCP1020 board for
the awareness.

[snip]

Other than above,
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
Tested-by: Bin Meng <bmeng.cn at gmail.com>

Regards,
Bin


More information about the U-Boot mailing list