[PATCH 4/5] ARM: imx: udoo: Convert block devices to DM

Peter Robinson pbrobinson at gmail.com
Fri Apr 2 18:52:50 CEST 2021


Enable DM block, DM MMC and DM SATA support on iMX6 Udoo
convert board code to match the DM support.

Signed-off-by: Peter Robinson <pbrobinson at gmail.com>
Cc: Fabio Estevam <fabio.estevam at nxp.com>
Cc: Stefano Babic <sbabic at denx.de>
---
 arch/arm/dts/imx6qdl-udoo-u-boot.dtsi |  7 +++++++
 board/udoo/udoo.c                     | 30 ---------------------------
 configs/udoo_defconfig                |  3 +++
 include/configs/udoo.h                |  6 ------
 4 files changed, 10 insertions(+), 36 deletions(-)
 create mode 100644 arch/arm/dts/imx6qdl-udoo-u-boot.dtsi

diff --git a/arch/arm/dts/imx6qdl-udoo-u-boot.dtsi b/arch/arm/dts/imx6qdl-udoo-u-boot.dtsi
new file mode 100644
index 0000000000..749791a13f
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-udoo-u-boot.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+	aliases {
+		mmc0 = &usdhc3;
+	};
+};
diff --git a/board/udoo/udoo.c b/board/udoo/udoo.c
index d83f23dd35..c1acc25a9d 100644
--- a/board/udoo/udoo.c
+++ b/board/udoo/udoo.c
@@ -19,8 +19,6 @@
 #include <asm/gpio.h>
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/sata.h>
-#include <mmc.h>
-#include <fsl_esdhc_imx.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
@@ -56,15 +54,6 @@ static iomux_v3_cfg_t const uart2_pads[] = {
 	IOMUX_PADS(PAD_EIM_D27__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
 };
 
-static iomux_v3_cfg_t const usdhc3_pads[] = {
-	IOMUX_PADS(PAD_SD3_CLK__SD3_CLK    | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD3_CMD__SD3_CMD    | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-	IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
-};
-
 static iomux_v3_cfg_t const wdog_pads[] = {
 	IOMUX_PADS(PAD_EIM_A24__GPIO5_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL)),
 	IOMUX_PADS(PAD_EIM_D19__GPIO3_IO19),
@@ -176,13 +165,6 @@ static void setup_iomux_wdog(void)
 	gpio_direction_input(WDT_TRG);
 }
 
-static struct fsl_esdhc_cfg usdhc_cfg = { USDHC3_BASE_ADDR };
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-	return 1; /* Always present */
-}
-
 int board_eth_init(struct bd_info *bis)
 {
 	uint32_t base = IMX_FEC_BASE;
@@ -217,15 +199,6 @@ free_bus:
 	return ret;
 }
 
-int board_mmc_init(struct bd_info *bis)
-{
-	SETUP_IOMUX_PADS(usdhc3_pads);
-	usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
-	usdhc_cfg.max_bus_width = 4;
-
-	return fsl_esdhc_initialize(bis, &usdhc_cfg);
-}
-
 int board_early_init_f(void)
 {
 	setup_iomux_wdog();
@@ -248,9 +221,6 @@ int board_init(void)
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-#ifdef CONFIG_SATA
-	setup_sata();
-#endif
 	return 0;
 }
 
diff --git a/configs/udoo_defconfig b/configs/udoo_defconfig
index deec4bc82f..2735f02af3 100644
--- a/configs/udoo_defconfig
+++ b/configs/udoo_defconfig
@@ -17,6 +17,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
@@ -38,8 +39,10 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_BOUNCE_BUFFER=y
+CONFIG_DM_MMC=y
 CONFIG_DWC_AHSATA=y
 CONFIG_FSL_USDHC=y
+CONFIG_DM_SCSI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_PHYLIB=y
diff --git a/include/configs/udoo.h b/include/configs/udoo.h
index b4fbf8c638..25f40074c5 100644
--- a/include/configs/udoo.h
+++ b/include/configs/udoo.h
@@ -21,13 +21,7 @@
 #define CONFIG_MXC_UART_BASE		UART2_BASE
 
 /* SATA Configs */
-
-#ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
-#define CONFIG_DWC_AHSATA_PORT_ID	0
-#define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
 #define CONFIG_LBA48
-#endif
 
 /* Network support */
 
-- 
2.31.1



More information about the U-Boot mailing list