summaryrefslogtreecommitdiff
path: root/board/toradex
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2021-07-23 09:39:46 +0300
committerStefano Babic <sbabic@denx.de>2021-08-09 14:09:29 +0300
commit421440f70de659789b4bec90fda48f1eddf67eed (patch)
tree033908410726bcd357b5b06f43ebf1e862d3ea5f /board/toradex
parent46307ef01e083e3bbbad62f6b75107201e0c6184 (diff)
downloadu-boot-421440f70de659789b4bec90fda48f1eddf67eed.tar.xz
board: toradex: make USB PID from config block optional
If config block support is enabled, USB gadget modes unconditionally use Toradex Product ID as USB PID. Some applications might prefer a different and/or static USB PID. Add a Kconfig configuration option to descide whether to use USB PID from config block or the fallback config option CONFIG_G_DNL_PRODUCT_NUM. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'board/toradex')
-rw-r--r--board/toradex/common/Kconfig10
-rw-r--r--board/toradex/common/tdx-common.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/board/toradex/common/Kconfig b/board/toradex/common/Kconfig
index 36068d2e3b..1f6a5e4db5 100644
--- a/board/toradex/common/Kconfig
+++ b/board/toradex/common/Kconfig
@@ -84,4 +84,14 @@ config TDX_CFG_BLOCK_EXTRA
Enables fetching auxilary config blocks from carrier board/display
adapter EEPROMs.
+config TDX_CFG_BLOCK_USB_GADGET_PID
+ bool "Use config block product ID as USB product ID"
+ depends on USB_GADGET_DOWNLOAD
+ default y
+ help
+ Use the Toradex product ID learned from the config block as USB
+ product ID. An offset of 0x4000 is added to the product ID since
+ inside the Toradex vendor ID (0x1b67) the range starting from
+ offset 0x4000 is reserved for Colibri/Apalis modules.
+
endif
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index a3d287ed5e..061abf7537 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -147,7 +147,7 @@ int show_board_info(void)
return 0;
}
-#ifdef CONFIG_USB_GADGET_DOWNLOAD
+#ifdef CONFIG_TDX_CFG_BLOCK_USB_GADGET_PID
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
{
unsigned short usb_pid;