]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: imx: udoo_neo: convert to DM_MMC
authorPeter Robinson <pbrobinson@gmail.com>
Thu, 1 Apr 2021 20:08:12 +0000 (21:08 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 20 Apr 2021 17:31:35 +0000 (13:31 -0400)
Convert UDOO Neo to use DM MMC.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Francesco Montefoschi <francesco.montefoschi@udoo.org>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi [new file with mode: 0644]
board/udoo/neo/neo.c
configs/udoo_neo_defconfig

diff --git a/arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi b/arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi
new file mode 100644 (file)
index 0000000..daf2489
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+       aliases {
+               mmc0 = &usdhc2;
+       };
+};
index 653ca1ca5a62a2644589b2be0dd98160e21d52bc..ef7de0aacc8ae1cd47d7cd218c56c4850a9a31b4 100644 (file)
@@ -19,8 +19,6 @@
 #include <asm/gpio.h>
 #include <asm/mach-imx/iomux-v3.h>
 #include <env.h>
-#include <mmc.h>
-#include <fsl_esdhc_imx.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/io.h>
 #include <asm/mach-imx/mxc_i2c.h>
@@ -218,19 +216,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_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),
-       /* CD pin */
-       MX6_PAD_SD1_DATA0__GPIO6_IO_2 | MUX_PAD_CTRL(NO_PAD_CTRL),
-       /* Power */
-       MX6_PAD_SD1_CMD__GPIO6_IO_1 | MUX_PAD_CTRL(NO_PAD_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),
@@ -393,30 +378,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-static struct fsl_esdhc_cfg usdhc_cfg[1] = {
-       {USDHC2_BASE_ADDR, 0, 4},
-};
-
-#define USDHC2_PWR_GPIO IMX_GPIO_NR(6, 1)
-#define USDHC2_CD_GPIO IMX_GPIO_NR(6, 2)
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-       return !gpio_get_value(USDHC2_CD_GPIO);
-}
-
-int board_mmc_init(struct bd_info *bis)
-{
-       imx_iomux_v3_setup_multiple_pads(usdhc2_pads, ARRAY_SIZE(usdhc2_pads));
-       usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-       usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR;
-       gpio_direction_input(USDHC2_CD_GPIO);
-       gpio_direction_output(USDHC2_PWR_GPIO, 1);
-
-       gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
-       return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
-}
-
 static char *board_string(void)
 {
        switch (get_board_value()) {
index 44ca8cfc3db07627e6b5649dbeae719619d4c3f9..3df2ac19e7054f3e3f6ab199fde32f41d561741b 100644 (file)
@@ -38,6 +38,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DM=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y