diff options
author | Scott Collyer <scollyer@google.com> | 2021-04-21 17:13:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-04 18:06:02 +0000 |
commit | 70b6e533f9a7e78a2f59d4247beabff973011560 (patch) | |
tree | c13f6ed3cd223e39576fb3d06f7e8f37a8855c2e | |
parent | e2921a619fb7b1ba980171ce327289265e44cc94 (diff) | |
download | chrome-ec-70b6e533f9a7e78a2f59d4247beabff973011560.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>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2871051
Tested-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r-- | chip/stm32/usb.c | 2 | ||||
-rw-r--r-- | include/config.h | 5 | ||||
-rw-r--r-- | zephyr/Kconfig.usbc | 19 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 10 |
4 files changed, 35 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 b5b7ac05b2..30e8d3f9f6 100644 --- a/include/config.h +++ b/include/config.h @@ -4515,6 +4515,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 7f5d65c400..d46beb165f 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -138,6 +138,25 @@ config PLATFORM_EC_USB_PID To reserve a new PID within Google, use go/usb and see http://google3/hardware/standards/usb +config PLATFORM_EC_USB_BCD_DEV + hex "USB Device ID" + default 0 + help + This specifies the USB device version, reported by board when acting + as the upstream facing port (UFP). This is a 16-bit unsigned integer + 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 e2b0a03cb7..7ef3a4cc3d 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -479,6 +479,16 @@ enum battery_type { #define CONFIG_USB_PID CONFIG_PLATFORM_EC_USB_PID #endif +#undef CONFIG_USB_BCD_DEV +#ifdef CONFIG_PLATFORM_EC_USB_BCD_DEV +#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 |