[U-Boot] [RFC 4/6] configs: exynos: Add new CONFIG_SYS_ODROID_USB config option

Anand Moon linux.amoon at gmail.com
Mon Apr 1 11:52:30 UTC 2019


Add new CONFIG_SYS_ODROID_USB flag to avoid compliation
error on other development boards.

Fix below compilation error:
Error: You must add new CONFIG options using Kconfig
The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_ODROID_USB

Signed-off-by: Anand Moon <linux.amoon at gmail.com>
---
 board/samsung/odroid/Kconfig   | 3 +++
 drivers/usb/host/ehci-exynos.c | 6 ++++++
 include/configs/odroid.h       | 1 +
 3 files changed, 10 insertions(+)

diff --git a/board/samsung/odroid/Kconfig b/board/samsung/odroid/Kconfig
index 8b52a0d589..c5fbffabad 100644
--- a/board/samsung/odroid/Kconfig
+++ b/board/samsung/odroid/Kconfig
@@ -9,4 +9,7 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
 	default "odroid"
 
+config SYS_ODROID_USB
+	bool "Exynos4412 Odroid USB"
+
 endif
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index e6a542e092..3f62eba486 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -31,7 +31,9 @@ struct exynos_ehci_platdata {
 	struct gpio_desc vbus_gpio;
 };
 
+#ifdef CONFIG_SYS_ODROID_USB
 extern int exynos_usb_init(void);
+#endif
 
 /**
  * Contains pointers to register base addresses
@@ -145,6 +147,7 @@ static void exynos5_setup_usb_phy(struct exynos_usb_phy *usb)
 
 static int ehci_exynos_init_after_reset(struct ehci_ctrl *ehcntl)
 {
+#ifdef CONFIG_SYS_ODROID_USB
 	if (cpu_is_exynos4()) {
 		if (proid_is_exynos4412()) {
 			/*
@@ -153,6 +156,7 @@ static int ehci_exynos_init_after_reset(struct ehci_ctrl *ehcntl)
 			exynos_usb_init();
 		}
 	}
+#endif
 	return 0;
 }
 
@@ -172,10 +176,12 @@ static void exynos4412_setup_usb_phy(struct exynos4412_usb_phy *usb)
 	udelay(10);
 	clrbits_le32(&usb->usbphyrstcon, (RSTCON_HOSTPHY_SWRST | RSTCON_SWRST));
 
+#ifdef CONFIG_SYS_ODROID_USB
 	/*
 	 * "usb start" initialize the usb driver
 	 */
 	exynos_usb_init();
+#endif
 }
 
 static void setup_usb_phy(struct exynos_usb_phy *usb)
diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index 9f2d43e3fa..d8d30c0f62 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -32,6 +32,7 @@
 #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_SDRAM_BASE + 0x5E00000)
 #define CONFIG_SYS_LOAD_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x3E00000)
+#define CONFIG_SYS_ODROID_USB
 
 #include <linux/sizes.h>
 
-- 
2.21.0



More information about the U-Boot mailing list