]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: imx: udoo: Convert block devices to DM
authorPeter Robinson <pbrobinson@gmail.com>
Fri, 2 Apr 2021 16:52:50 +0000 (17:52 +0100)
committerStefano Babic <sbabic@denx.de>
Thu, 8 Apr 2021 18:29:54 +0000 (20:29 +0200)
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@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
arch/arm/dts/imx6qdl-udoo-u-boot.dtsi [new file with mode: 0644]
board/udoo/udoo.c
configs/udoo_defconfig
include/configs/udoo.h

diff --git a/arch/arm/dts/imx6qdl-udoo-u-boot.dtsi b/arch/arm/dts/imx6qdl-udoo-u-boot.dtsi
new file mode 100644 (file)
index 0000000..749791a
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+       aliases {
+               mmc0 = &usdhc3;
+       };
+};
index d83f23dd3581d05f1b63aa8dc84dfa90aed47abe..c1acc25a9d883f72ef510021df820d5a5f40fedb 100644 (file)
@@ -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;
 }
 
index deec4bc82f9ab96d1beab9496eca5bf58eebff8e..2735f02af343a10b49928cf0150d5c17b87099ab 100644 (file)
@@ -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
index b4fbf8c6383dc3da744a987a08841a1a5fe49733..25f40074c5b617e0c4635c1035f626d8d7689a0a 100644 (file)
 #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 */