From 1a7e7e64cba5954d481b37d96f71e2c6d270bce5 Mon Sep 17 00:00:00 2001 From: Jan Dabros Date: Thu, 22 Apr 2021 16:01:43 +0200 Subject: servo_v4(p1): Implement empty usb interface descriptor After removal of gpio_over_usb, firmware for servo_v4 was implementing only 5 interfaces, even tough configuration descriptor claimed 6. This leads to kernel warning during enumeration and more importantly some UEFI implementations on high-end devices refused to boot. Eventually we would like to remove EMPTY identifier and re-define all consecutive interface numbers, however this bring implications to the hdctools, which are using hardcoded values during normal operation. BUG=b:183857501 BRANCH=main TEST=Connect servo_v4 & servo_v4p1 to server machines (e.g HP,DELL) in the lab and reboot the server. It should boot without issues TEST=Plug servo_v4/v4p1 into host computer and verify dmesg. No warnings should be visible in the output. For error case one may have seen: `config 1 has 5 interfaces, different from the descriptor's value: 6 config 1 has no interface number 1` Signed-off-by: Jan Dabros Change-Id: Ibc114aaeae7572845d3c6160cb897a9856e2f276 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846330 Reviewed-by: Ruben Rodriguez Buchillon Reviewed-by: Vincent Palatin --- board/servo_v4p1/board.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'board/servo_v4p1/board.c') diff --git a/board/servo_v4p1/board.c b/board/servo_v4p1/board.c index 481b2ac16e..1ec782b2cf 100644 --- a/board/servo_v4p1/board.c +++ b/board/servo_v4p1/board.c @@ -337,6 +337,23 @@ USB_STREAM_CONFIG_USART_IFACE(usart4_usb, usart4) +/* + * Define usb interface descriptor for the `EMPTY` usb interface, to satisfy + * UEFI and kernel requirements (see b/183857501). + */ +const struct usb_interface_descriptor +USB_IFACE_DESC(USB_IFACE_EMPTY) = { + .bLength = USB_DT_INTERFACE_SIZE, + .bDescriptorType = USB_DT_INTERFACE, + .bInterfaceNumber = USB_IFACE_EMPTY, + .bAlternateSetting = 0, + .bNumEndpoints = 0, + .bInterfaceClass = USB_CLASS_VENDOR_SPEC, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0, + .iInterface = 0, +}; + /****************************************************************************** * Define the strings used in our USB descriptors. */ -- cgit v1.2.1