[U-Boot] [PATCH v3 16/31] ARM: i.MX6: sabresd: Enable DM_USB

Jagan Teki jagan at openedev.com
Wed Apr 5 19:20:26 UTC 2017


From: Jagan Teki <jagan at amarulasolutions.com>

Enable DM_USB for dt supported sabresd config boards:
- imx6q_sabresd_defconfig
- imx6qp_sabresd_defconfig

Cc: Stefano Babic <sbabic at denx.de>
Cc: Fabio Estevam <fabio.estevam at nxp.com>
Cc: Michael Trimarchi <michael at amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 board/freescale/mx6sabresd/mx6sabresd.c | 4 ++--
 configs/imx6q_sabresd_defconfig         | 1 +
 configs/imx6qp_sabresd_defconfig        | 1 +
 include/configs/mx6sabresd.h            | 9 ++++++---
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
index 5776b39..a143dbb 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -515,7 +515,7 @@ int board_eth_init(bd_t *bis)
 	return cpu_eth_init(bis);
 }
 
-#ifdef CONFIG_USB_EHCI_MX6
+#if defined(CONFIG_USB_EHCI_MX6) && !defined(CONFIG_DM_USB)
 #define USB_OTHERREGS_OFFSET	0x800
 #define UCTRL_PWR_POL		(1 << 9)
 
@@ -599,7 +599,7 @@ int board_init(void)
 #ifndef CONFIG_DM_I2C
 	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
 #endif
-#ifdef CONFIG_USB_EHCI_MX6
+#if defined(CONFIG_USB_EHCI_MX6) && !defined(CONFIG_DM_USB)
 	setup_usb();
 #endif
 
diff --git a/configs/imx6q_sabresd_defconfig b/configs/imx6q_sabresd_defconfig
index 84e34f1..9ac3c9c 100644
--- a/configs/imx6q_sabresd_defconfig
+++ b/configs/imx6q_sabresd_defconfig
@@ -57,6 +57,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
+CONFIG_DM_USB=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
 CONFIG_DM_PMIC_PFUZE100=y
diff --git a/configs/imx6qp_sabresd_defconfig b/configs/imx6qp_sabresd_defconfig
index f0be6ea..a01482c 100644
--- a/configs/imx6qp_sabresd_defconfig
+++ b/configs/imx6qp_sabresd_defconfig
@@ -58,6 +58,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
+CONFIG_DM_USB=y
 # CONFIG_BLK is not set
 # CONFIG_DM_MMC_OPS is not set
 CONFIG_DM_PMIC_PFUZE100=y
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index 6abe7a4..4f6bb1b 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -70,12 +70,15 @@
 
 /* USB Configs */
 #ifdef CONFIG_USB_EHCI_MX6
-#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1 /* Enabled USB controller number */
+
+# ifndef CONFIG_DM_USB
+#  define CONFIG_MXC_USB_FLAGS		0
+#  define CONFIG_USB_MAX_CONTROLLER_COUNT	1 /* Enabled USB controller number */
+#  define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+# endif
 #endif
 
 #endif                         /* __MX6QSABRESD_CONFIG_H */
-- 
1.9.1



More information about the U-Boot mailing list