diff options
author | Scott Collyer <scollyer@google.com> | 2021-04-21 17:13:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-02 02:48:04 +0000 |
commit | 8c438c712b7d4113874addc52a88ab9508e3ee44 (patch) | |
tree | 06cc7e6396e012e716bbd9073ee0c27b914e35ff | |
parent | 98ca457dfcdbf135618c42c81bda1445b2fdabae (diff) | |
download | chrome-ec-8c438c712b7d4113874addc52a88ab9508e3ee44.tar.gz |
usb-ep: Add config option to define VID
This value was previously hardcoded to Google's VID. However, some
products with USB-EP support may require a different VID to correctly
support fwupd.
BUG=b:181920029
BRANCH=quiche
TEST=verified that fwupd works on baklava
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I23c36507a90428ab46cd5efde7d79581207bde74
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2848424
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
-rw-r--r-- | chip/stm32/usb.c | 2 | ||||
-rw-r--r-- | include/config.h | 5 | ||||
-rw-r--r-- | zephyr/Kconfig.usbc | 10 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
4 files changed, 21 insertions, 1 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c index 63c931d7d9..b3f1189b9d 100644 --- a/chip/stm32/usb.c +++ b/chip/stm32/usb.c @@ -55,7 +55,7 @@ static const struct usb_device_descriptor dev_desc = { .bDeviceSubClass = 0x00, .bDeviceProtocol = 0x00, .bMaxPacketSize0 = USB_MAX_PACKET_SIZE, - .idVendor = USB_VID_GOOGLE, + .idVendor = CONFIG_USB_VID, .idProduct = CONFIG_USB_PID, .bcdDevice = CONFIG_USB_BCD_DEV, .iManufacturer = USB_STR_VENDOR, diff --git a/include/config.h b/include/config.h index 3adc23c1c1..8dc2d0aa5a 100644 --- a/include/config.h +++ b/include/config.h @@ -4620,6 +4620,11 @@ #undef CONFIG_USB_PID /* + * USB Vendor ID used for USB endpoints. + */ +#define CONFIG_USB_VID USB_VID_GOOGLE + +/* * Track overcurrent events for sinking partners coming from some component on * the board. Auto-enabled for drivers which contain support for this feature. */ diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 5f2def4b02..1aeb113eb3 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -147,6 +147,16 @@ config PLATFORM_EC_USB_BCD_DEV and should be set to a version number relevant to the release version of the product. +config PLATFORM_EC_USB_VID + hex "USB Vendor ID" + default 0x18d1 + help + This specifies the USB vendor ID used for boards which expose a + USB endpont when the port is in UFP mode. The default value is + set to Google's assigned VID and typically would not need to be + changed. But, in certain cases this may need to be changed to + match an OEM's vendor ID. + config PLATFORM_EC_USBC_RETIMER_INTEL_BB bool "Support Intel Burnside Bridge retimer" help diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 4d732e7331..1bb7e11cb8 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -672,6 +672,11 @@ #define CONFIG_USB_BCD_DEV CONFIG_PLATFORM_EC_USB_BCD_DEV #endif +#undef CONFIG_USB_VID +#ifdef CONFIG_PLATFORM_EC_USB_VID +#define CONFIG_USB_VID CONFIG_PLATFORM_EC_USB_VID +#endif + /* VBUS-voltage measurement */ #undef CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT #undef CONFIG_USB_PD_VBUS_MEASURE_CHARGER |