[U-Boot] [PATCH 8/8] ARM: imx: dh-imx6: Convert SPI support to DM

Marek Vasut marex at denx.de
Sun May 12 00:57:15 UTC 2019


Enable DM SPI and SF support on DHCOM iMX6 PDK2.
Convert board code to match the DM support.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Fabio Estevam <fabio.estevam at nxp.com>
Cc: Ludwig Zenz <lzenz at dh-electronics.com>
Cc: Stefano Babic <sbabic at denx.de>
---
 board/dhelectronics/dh_imx6/dh_imx6.c | 10 ----------
 configs/dh_imx6_defconfig             |  4 ++++
 include/configs/dh_imx6.h             |  5 +++++
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c b/board/dhelectronics/dh_imx6/dh_imx6.c
index 2381df84b4..68336ff269 100644
--- a/board/dhelectronics/dh_imx6/dh_imx6.c
+++ b/board/dhelectronics/dh_imx6/dh_imx6.c
@@ -272,16 +272,6 @@ int board_early_init_f(void)
 	return 0;
 }
 
-#ifdef CONFIG_MXC_SPI
-int board_spi_cs_gpio(unsigned bus, unsigned cs)
-{
-	if (bus == 0 && cs == 0)
-		return IMX_GPIO_NR(2, 30);
-	else
-		return -1;
-}
-#endif
-
 int board_init(void)
 {
 	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 9418de10e7..f2bb87132a 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -47,13 +47,16 @@ CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
@@ -63,6 +66,7 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_DM_SCSI=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index e68467dda3..3b1d0a99a1 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -66,6 +66,11 @@
 #define CONFIG_LBA48
 
 /* SPI Flash Configs */
+#if defined(CONFIG_SPL_BUILD)
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_SPI_FLASH_MTD
+#endif
 
 /* UART */
 #define CONFIG_MXC_UART
-- 
2.20.1



More information about the U-Boot mailing list