ARM: imx: vining2000: Convert MMC and block to DM
authorMarek Vasut <marex@denx.de>
Fri, 17 May 2019 20:25:24 +0000 (22:25 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 11 Jun 2019 08:42:48 +0000 (10:42 +0200)
Enable DM block and DM MMC support on iMX6SX VINING|2000 .
Convert board code to match the DM support. This disables
USB mass storage support due to missing DM USB, however
that will be re-enabled in subsequent patch.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Silvio Fricke <silvio.fricke@softing.com>
Cc: Stefano Babic <sbabic@denx.de>
arch/arm/dts/imx6sx-softing-vining-2000.dts
board/softing/vining_2000/vining_2000.c
configs/vining_2000_defconfig

index 2bc51623a8060d08042c3e8cf601ec65e937e35e..371890ff6084412c4e9c4495063b319aaab59682 100644 (file)
        model = "Softing VIN|ING 2000";
        compatible = "samtec,imx6sx-vining-2000", "fsl,imx6sx";
 
+       aliases {
+               mmc0 = &usdhc4;
+               mmc1 = &usdhc2;
+       };
+
        chosen {
                stdout-path = &uart1;
        };
index f0313b06fbf99a31815fc30874e9c0295aff8a4a..9ab7fbeddf0924832acdf79e12a97e2ef47a7ffd 100644 (file)
@@ -76,30 +76,6 @@ static iomux_v3_cfg_t const uart1_pads[] = {
        MX6_PAD_GPIO1_IO05__UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const usdhc2_pads[] = {
-       MX6_PAD_SD2_CLK__USDHC2_CLK | MUX_PAD_CTRL(USDHC_CLK_PAD_CTRL),
-       MX6_PAD_SD2_CMD__USDHC2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD2_DATA0__USDHC2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD2_DATA1__USDHC2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD2_DATA2__USDHC2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD2_DATA3__USDHC2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_LCD1_VSYNC__GPIO3_IO_28 | MUX_PAD_CTRL(GPIO_PAD_CTRL),
-};
-
-static iomux_v3_cfg_t const usdhc4_pads[] = {
-       MX6_PAD_SD4_CLK__USDHC4_CLK | MUX_PAD_CTRL(USDHC_CLK_PAD_CTRL),
-       MX6_PAD_SD4_CMD__USDHC4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA0__USDHC4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA1__USDHC4_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA2__USDHC4_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA3__USDHC4_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA4__USDHC4_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA5__USDHC4_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA6__USDHC4_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_DATA7__USDHC4_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-       MX6_PAD_SD4_RESET_B__USDHC4_RESET_B | MUX_PAD_CTRL(USDHC_RESET_CTRL),
-};
-
 static iomux_v3_cfg_t const fec1_pads[] = {
        MX6_PAD_ENET1_MDC__ENET1_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL),
        MX6_PAD_ENET1_MDIO__ENET1_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL),
@@ -449,59 +425,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-static struct fsl_esdhc_cfg usdhc_cfg[2] = {
-       {USDHC4_BASE_ADDR, 0, 8},
-       {USDHC2_BASE_ADDR, 0, 4},
-};
-
-#define USDHC2_CD_GPIO IMX_GPIO_NR(3, 28)
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-       struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-
-       if (cfg->esdhc_base == USDHC4_BASE_ADDR)
-               return 1;
-       if (cfg->esdhc_base == USDHC2_BASE_ADDR)
-               return !gpio_get_value(USDHC2_CD_GPIO);
-
-       return -EINVAL;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-       int ret;
-
-       /*
-        * According to the board_mmc_init() the following map is done:
-        * (U-Boot device node)    (Physical Port)
-        * mmc0                    USDHC4
-        * mmc1                    USDHC2
-        */
-       imx_iomux_v3_setup_multiple_pads(
-               usdhc4_pads, ARRAY_SIZE(usdhc4_pads));
-       usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
-
-       imx_iomux_v3_setup_multiple_pads(
-               usdhc2_pads, ARRAY_SIZE(usdhc2_pads));
-       gpio_direction_input(USDHC2_CD_GPIO);
-       usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-
-       ret = fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
-       if (ret) {
-               printf("Warning: failed to initialize USDHC4\n");
-               return ret;
-       }
-
-       ret = fsl_esdhc_initialize(bis, &usdhc_cfg[1]);
-       if (ret) {
-               printf("Warning: failed to initialize USDHC2\n");
-               return ret;
-       }
-
-       return 0;
-}
-
 int board_init(void)
 {
        /* Address of boot parameters */
index 01736823b80944c081a776530ad80cf48a7b8726..2bd88149be74b2f8805825f443517c8b964684c9 100644 (file)
@@ -38,6 +38,7 @@ CONFIG_EFI_PARTITION=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6sx-softing-vining-2000"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_ESDHC=y
@@ -47,6 +48,5 @@ CONFIG_PCI=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_USB=y
-CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y