[PATCHv2 2/4] tegra: Test on CONFIG_CMD_USB being enabled for distro bootcmd

Tom Rini trini at konsulko.com
Fri Jul 9 16:11:54 CEST 2021


Reuse the common logic to allow for BOOT_TARGET_DEVICES to list USB as a
possibility if we're building for a platform that will have USB but not
if we don't, so that we don't hit the link-time check for trying to have
USB boot on a non-USB system.

Cc: Tom Warren <twarren at nvidia.com>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
Changes in v2:
- New patch.  This problem shows up later in the series when we stop
  building USB framework without a host controller of some sort also
  enabled.
---
 include/configs/tegra-common-post.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index fae0e761fb42..dd7a75ae4674 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -21,11 +21,18 @@
 #define CONFIG_SYS_NONCACHED_MEMORY	(1 << 20)	/* 1 MiB */
 
 #ifndef CONFIG_SPL_BUILD
+
+#if CONFIG_IS_ENABLED(CMD_USB)
+# define BOOT_TARGET_USB(func) func(USB, usb, 0)
+#else
+# define BOOT_TARGET_USB(func)
+#endif
+
 #ifndef BOOT_TARGET_DEVICES
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 1) \
 	func(MMC, mmc, 0) \
-	func(USB, usb, 0) \
+	BOOT_TARGET_USB(func) \
 	func(PXE, pxe, na) \
 	func(DHCP, dhcp, na)
 #endif
-- 
2.17.1



More information about the U-Boot mailing list