public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 11/29] imx6: aristainetos: convert to DM_MMC
Date: Sun,  1 Dec 2019 11:23:14 +0100	[thread overview]
Message-ID: <20191201102332.21397-12-hs@denx.de> (raw)
In-Reply-To: <20191201102332.21397-1-hs@denx.de>

Enable DM_MMC support.

Signed-off-by: Heiko Schocher <hs@denx.de>
---

 board/aristainetos/aristainetos.c | 53 -------------------------------
 configs/aristainetos2_defconfig   |  1 +
 include/configs/aristainetos2.h   |  2 +-
 3 files changed, 2 insertions(+), 54 deletions(-)

diff --git a/board/aristainetos/aristainetos.c b/board/aristainetos/aristainetos.c
index 00ffac8eb6..6de71a46ed 100644
--- a/board/aristainetos/aristainetos.c
+++ b/board/aristainetos/aristainetos.c
@@ -19,8 +19,6 @@
 #include <asm/mach-imx/boot_mode.h>
 #include <asm/mach-imx/mxc_i2c.h>
 #include <asm/mach-imx/video.h>
-#include <mmc.h>
-#include <fsl_esdhc_imx.h>
 #include <miiphy.h>
 #include <netdev.h>
 #include <asm/arch/mxc_hdmi.h>
@@ -43,10 +41,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |			\
-	PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm |			\
-	PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
-
 #define ENET_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
 	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
 
@@ -63,9 +57,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define ECSPI4_CS1		IMX_GPIO_NR(5, 2)
 
-#define USDHC2_PAD_CTRL (PAD_CTL_SPEED_LOW |			\
-	PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
-
 #if (CONFIG_SYS_BOARD_VERSION == 2)
 	/* 4.3 display controller */
 	#define ECSPI1_CS0		IMX_GPIO_NR(4, 9)
@@ -706,15 +697,6 @@ struct i2c_pads_info i2c_pad_info2 = {
 	}
 };
 
-iomux_v3_cfg_t const usdhc1_pads[] = {
-	MX6_PAD_SD1_CLK__SD1_CLK	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD1_CMD__SD1_CMD	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD1_DAT0__SD1_DATA0	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD1_DAT1__SD1_DATA1	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD1_DAT2__SD1_DATA2	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-	MX6_PAD_SD1_DAT3__SD1_DATA3	| MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
-
 int dram_init(void)
 {
 	gd->ram_size = imx_ddr_size();
@@ -722,41 +704,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_FSL_ESDHC_IMX
-struct fsl_esdhc_cfg usdhc_cfg[2] = {
-	{USDHC1_BASE_ADDR},
-	{USDHC2_BASE_ADDR},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-	return 1;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
-	imx_iomux_v3_setup_multiple_pads(usdhc1_pads, ARRAY_SIZE(usdhc1_pads));
-#if (CONFIG_SYS_BOARD_VERSION == 2)
-	/*
-	 * usdhc2 has a levelshifter on the carrier board Rev. DV1,
-	 * that will automatically detect the driving direction.
-	 * During initialisation this isn't working correctly,
-	 * which causes DAT3 to be driven low towards the SD-card.
-	 * This causes a SD-card enetring the SPI-Mode
-	 * and therefore getting inaccessible until next power cycle.
-	 * As workaround we drive the DAT3 line as GPIO and set it high.
-	 * This makes usdhc2 unusable in u-boot, but works for the
-	 * initialisation in Linux
-	 */
-	imx_iomux_v3_setup_pad(MX6_PAD_SD2_DAT3__GPIO1_IO12 |
-			       MUX_PAD_CTRL(NO_PAD_CTRL));
-	gpio_direction_output(IMX_GPIO_NR(1, 12) , 1);
-#endif
-	return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
-}
-#endif
-
 struct display_info_t const displays[] = {
 	{
 		.bus	= -1,
diff --git a/configs/aristainetos2_defconfig b/configs/aristainetos2_defconfig
index 03be7f3f8f..02c64a947c 100644
--- a/configs/aristainetos2_defconfig
+++ b/configs/aristainetos2_defconfig
@@ -53,6 +53,7 @@ CONFIG_ENV_SPI_EARLY=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_OFFSET_REDUND=0xE0000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
diff --git a/include/configs/aristainetos2.h b/include/configs/aristainetos2.h
index 9291cfdffd..b008928c06 100644
--- a/include/configs/aristainetos2.h
+++ b/include/configs/aristainetos2.h
@@ -45,7 +45,7 @@
 #define CONFIG_MMCROOT		"/dev/mmcblk0p1"
 
 /* MMC Configs */
-#define CONFIG_SYS_FSL_ESDHC_ADDR      0
+#define CONFIG_SYS_FSL_ESDHC_ADDR      USDHC1_BASE_ADDR
 
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_ETHPRIME			"FEC"
-- 
2.21.0

  parent reply	other threads:[~2019-12-01 10:23 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-01 10:23 [U-Boot] [PATCH v1 00/29] convert aristainetos board to DM Heiko Schocher
2019-12-01 10:23 ` [U-Boot] [PATCH v1 01/29] imx6: remove aristainetos board Heiko Schocher
2019-12-29 10:25   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 02/29] video: lg4573: convert to DM Heiko Schocher
2019-12-29 10:25   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 03/29] imx6: aristainetos: move defines to Kconfig Heiko Schocher
2019-12-29 10:27   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 04/29] imx6: aristainetos: remove 2b version Heiko Schocher
2019-12-29 10:25   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 05/29] imx6: aristainetos: disable gigabit support Heiko Schocher
2019-12-29 10:24   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 06/29] imx6: aristainetos: add device tree from linux Heiko Schocher
2019-12-29 10:28   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 07/29] imx6: aristainetos: add thumb build Heiko Schocher
2019-12-29 10:26   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 08/29] imx6: aristainetos: remove aristainetos-v2.c Heiko Schocher
2019-12-29 10:25   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 09/29] imx6: aristainetos: prepare dts for other board versions Heiko Schocher
2019-12-29 10:27   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 10/29] imx6: aristainetos: add DM_SERIAL support Heiko Schocher
2019-12-29 10:27   ` sbabic at denx.de
2019-12-01 10:23 ` Heiko Schocher [this message]
2019-12-29 10:27   ` [U-Boot] [PATCH v1 11/29] imx6: aristainetos: convert to DM_MMC sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 12/29] imx6: aristainetos: convert gpio pins to DM and DTS Heiko Schocher
2019-12-29 10:28   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 13/29] imx6: aristainetos: convert to DM_USB Heiko Schocher
2019-12-29 10:27   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 14/29] imx6: aristainetos: convert CONFIG_DM_SPI Heiko Schocher
2019-12-29 10:27   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 15/29] imx6: aristainetos: enable DM_ETH Heiko Schocher
2019-12-29 10:26   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 16/29] imx6: aristainetos: add DM_VIDEO support Heiko Schocher
2019-12-29 10:28   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 17/29] imx6: aristainetos: add DM_I2C support Heiko Schocher
2019-12-29 10:24   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 18/29] imx6: aristainetos: convert to DM_PWM/DM_BACKLIGHT Heiko Schocher
2019-12-29 10:26   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 19/29] imx6: aristainetos: get rid of CONFIG_BOARDNAME Heiko Schocher
2019-12-29 10:26   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 20/29] imx6: aristainetos: add i2c eeprom support Heiko Schocher
2019-12-29 10:28   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 21/29] imx6: aristainetos: add AUTOBOOT_KEYED Heiko Schocher
2019-12-29 10:28   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 22/29] imx6: aristainetos: add version variable Heiko Schocher
2019-12-29 10:24   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 23/29] imx6: aristainetos: cleanup bootmode settings Heiko Schocher
2019-12-29 10:24   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 24/29] imx6: aristainetos: WDT DM conversion enable WDT reset Heiko Schocher
2019-12-29 10:27   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 25/29] imx6: aristainetos: cleanup default Environment Heiko Schocher
2019-12-29 10:28   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 26/29] imx6: aristainetos: enable HAB boot Heiko Schocher
2019-12-29 10:25   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 27/29] imx6: aristainetos: readd aristainetos 2b board Heiko Schocher
2019-12-29 10:26   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 28/29] imx6: aristainetos: add aristainetos 2b csl Heiko Schocher
2019-12-29 10:29   ` sbabic at denx.de
2019-12-01 10:23 ` [U-Boot] [PATCH v1 29/29] imx6: aristainetos: add support for rev C board Heiko Schocher
2019-12-29 10:25   ` sbabic at denx.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191201102332.21397-12-hs@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox