summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorYunzhi Li <lyz@rock-chips.com>2015-07-02 15:28:11 +0800
committerPatrick Georgi <pgeorgi@google.com>2015-07-16 22:39:59 +0200
commitebd3da7dba7d72b0d7a4fa50ffbad61259562447 (patch)
tree715a8a4873f22173fad0c73cbf311d3ca1081a96 /payloads/libpayload/include
parentae3d71a4d10b28bb5da1b3399358988acdcf1ace (diff)
downloadcoreboot-ebd3da7dba7d72b0d7a4fa50ffbad61259562447.tar.xz
libpayload: usb: dwc2: support split transaction
With split transaction, dwc2 host controller can handle full- and low-speed devices on hub in high-speed mode. This commit adds support for split control and interrupt transfers BUG=None TEST=Connect usb keyboard through hub, usb keyboard can work BRANCH=None Change-Id: If7a00db21c8ad4c635f39581382b877603075d1a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 4fb514b7f7f7e414fa94bfce05420957b1c57019 Original-Change-Id: I07e64064c6182d33905ae4efb13712645de7cf93 Original-Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Original-Reviewed-on: https://chromium-review.googlesource.com/283282 Original-Tested-by: Lin Huang <hl@rock-chips.com> Original-Commit-Queue: Lin Huang <hl@rock-chips.com> Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/10956 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/usb/dwc2_registers.h24
-rw-r--r--payloads/libpayload/include/usb/usb.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/payloads/libpayload/include/usb/dwc2_registers.h b/payloads/libpayload/include/usb/dwc2_registers.h
index 0e46985d4b..b44a5ac2f7 100644
--- a/payloads/libpayload/include/usb/dwc2_registers.h
+++ b/payloads/libpayload/include/usb/dwc2_registers.h
@@ -597,6 +597,30 @@ typedef union {
};
} hcchar_t;
+/**
+ * This union represents the bit fields in the Host Channel-n Split Control
+ * Register.
+ */
+typedef union {
+ /* raw register data */
+ uint32_t d32;
+
+ /* register bits */
+ struct {
+ /** Port Address */
+ unsigned prtaddr:7;
+ /** Hub Address */
+ unsigned hubaddr:7;
+ /** Transaction Position */
+ unsigned xactpos:2;
+ /** Do Complete Split */
+ unsigned compsplt:1;
+ unsigned reserved:14;
+ /** Split Enable */
+ unsigned spltena:1;
+ };
+} hcsplit_t;
+
typedef enum {
EPDIR_OUT = 0,
EPDIR_IN,
diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h
index df507db6ea..cf52a4aece 100644
--- a/payloads/libpayload/include/usb/usb.h
+++ b/payloads/libpayload/include/usb/usb.h
@@ -277,6 +277,8 @@ void usb_hid_init (usbdev_t *dev);
void usb_msc_init (usbdev_t *dev);
void usb_generic_init (usbdev_t *dev);
+int closest_usb2_hub(const usbdev_t *dev, int *const addr, int *const port);
+
static inline unsigned char
gen_bmRequestType (dev_req_dir dir, dev_req_type type, dev_req_recp recp)
{