platform: msm_shared: Add support for usb electrical and ch9 testing
This change adds support for usb electrical test mode support and
protocol test framework for hsusb & ssusb.
For supporting hsusb protocol testing add support for device qualifier,
other speed configuration support, end point halt and support for
interface set/get features.
For SSUSB add support for end point halt, function suspend, u1/u2 link
mode support, isochronous delay and update the usb2.0 version number to
0x201 for ss capable device.
Change-Id: I937a561862e5083b9c604b42090bb81ac81a09fe
diff --git a/platform/msm_shared/usb30_udc.h b/platform/msm_shared/usb30_udc.h
index 97ef7e8..56a2b10 100644
--- a/platform/msm_shared/usb30_udc.h
+++ b/platform/msm_shared/usb30_udc.h
@@ -39,6 +39,22 @@
typedef enum
{
+ UDC_DEFAULT_STATE,
+ UDC_ADDRESSED_STATE,
+ UDC_CONFIGURED_STATE,
+} usb_state_t;
+
+typedef enum
+{
+ ENDPOINT_HALT = 0,
+ FUNCTION_SUSPEND = 0,
+ U1_ENABLE = 48,
+ U2_ENABLE = 49,
+ LTM_ENABLE = 50,
+} udc_feature_select_t;
+
+typedef enum
+{
UDC_DESC_SPEC_20 = BIT(0),
UDC_DESC_SPEC_30 = BIT(1),
} udc_desc_spec_t;
@@ -69,6 +85,7 @@
uint8_t config_selected; /* keeps track of the selected configuration */
struct udc_request *queued_req; /* pointer to the currently queued request. NULL indicates no request is queued. */
+ usb_state_t usb_state; /* USB state, default, addressed & configured */
} udc_t;
@@ -93,6 +110,18 @@
uint32_t trb_count; /* size of TRB chain. */
};
+struct usb_qualifier_desc {
+ uint8_t bLength;
+ uint8_t bDescriptorType;
+ uint16_t bcdUSB;
+ uint8_t bDeviceClass;
+ uint8_t bDeviceSubClass;
+ uint8_t bDeviceProtocol;
+ uint8_t bMaxPacketSize0;
+ uint8_t bNumConfigurations;
+ uint8_t bReserved;
+}__PACKED;
+
struct udc_request *usb30_udc_request_alloc(void);
struct udc_endpoint *usb30_udc_endpoint_alloc(unsigned type, unsigned maxpkt);
void usb30_udc_request_free(struct udc_request *req);