summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-10-01 14:52:56 -0400
committerTom Rini <trini@konsulko.com>2020-10-01 14:52:56 -0400
commit7e373a1a6ac27492ffebba146d70c4d39a9b9f36 (patch)
tree7b2613665cc6f1ab9becd1e37561d098518b769c /include
parentf352c51f575e13a3117d8d5867cbe59fd6f2bd13 (diff)
parente15e817f3eb13dd4b58f465b009164ecd8b997cf (diff)
Merge branch 'next' of git://git.denx.de/u-boot-usb into next
- Assorted XHCI improvements
Diffstat (limited to 'include')
-rw-r--r--include/usb/xhci.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/include/usb/xhci.h b/include/usb/xhci.h
index 7d34103fd5c..e1d382369a3 100644
--- a/include/usb/xhci.h
+++ b/include/usb/xhci.h
@@ -101,8 +101,6 @@ struct xhci_hccr {
/* bits 8:18, Max Interrupters */
#define HCS_MAX_INTRS(p) (((p) >> 8) & 0x7ff)
/* bits 24:31, Max Ports - max value is 0x7F = 127 ports */
-#define HCS_MAX_PORTS_SHIFT 24
-#define HCS_MAX_PORTS_MASK (0xff << HCS_MAX_PORTS_SHIFT)
#define HCS_MAX_PORTS(p) (((p) >> 24) & 0xff)
/* HCSPARAMS2 - hcs_params2 - bitmasks */
@@ -634,11 +632,8 @@ struct xhci_ep_ctx {
*/
#define FORCE_EVENT (0x1)
#define ERROR_COUNT(p) (((p) & 0x3) << 1)
-#define ERROR_COUNT_SHIFT (1)
-#define ERROR_COUNT_MASK (0x3)
#define CTX_TO_EP_TYPE(p) (((p) >> 3) & 0x7)
#define EP_TYPE(p) ((p) << 3)
-#define EP_TYPE_SHIFT (3)
#define ISOC_OUT_EP 1
#define BULK_OUT_EP 2
#define INT_OUT_EP 3
@@ -649,13 +644,10 @@ struct xhci_ep_ctx {
/* bit 6 reserved */
/* bit 7 is Host Initiate Disable - for disabling stream selection */
#define MAX_BURST(p) (((p)&0xff) << 8)
-#define MAX_BURST_MASK (0xff)
-#define MAX_BURST_SHIFT (8)
#define CTX_TO_MAX_BURST(p) (((p) >> 8) & 0xff)
#define MAX_PACKET(p) (((p)&0xffff) << 16)
#define MAX_PACKET_MASK (0xffff)
#define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff)
-#define MAX_PACKET_SHIFT (16)
/* Get max packet size from ep desc. Bit 10..0 specify the max packet size.
* USB2.0 spec 9.6.6.
@@ -849,10 +841,9 @@ struct xhci_event_cmd {
/* Normal TRB fields */
/* transfer_len bitmasks - bits 0:16 */
#define TRB_LEN(p) ((p) & 0x1ffff)
-#define TRB_LEN_MASK (0x1ffff)
+/* TD Size, packets remaining in this TD, bits 21:17 (5 bits, so max 31) */
+#define TRB_TD_SIZE(p) (min((p), (u32)31) << 17)
/* Interrupter Target - which MSI-X vector to target the completion event at */
-#define TRB_INTR_TARGET_SHIFT (22)
-#define TRB_INTR_TARGET_MASK (0x3ff)
#define TRB_INTR_TARGET(p) (((p) & 0x3ff) << 22)
#define GET_INTR_TARGET(p) (((p) >> 22) & 0x3ff)
#define TRB_TBC(p) (((p) & 0x3) << 7)
@@ -882,7 +873,6 @@ struct xhci_event_cmd {
/* Control transfer TRB specific fields */
#define TRB_DIR_IN (1<<16)
#define TRB_TX_TYPE(p) ((p) << 16)
-#define TRB_TX_TYPE_SHIFT (16)
#define TRB_DATA_OUT 2
#define TRB_DATA_IN 3
@@ -903,7 +893,6 @@ union xhci_trb {
/* TRB bit mask */
#define TRB_TYPE_BITMASK (0xfc00)
#define TRB_TYPE(p) ((p) << 10)
-#define TRB_TYPE_SHIFT (10)
#define TRB_FIELD_TO_TYPE(p) (((p) & TRB_TYPE_BITMASK) >> 10)
/* TRB type IDs */
@@ -1227,6 +1216,9 @@ struct xhci_ctrl {
struct xhci_scratchpad *scratchpad;
struct xhci_virt_device *devs[MAX_HC_SLOTS];
int rootdev;
+ u16 hci_version;
+ u32 quirks;
+#define XHCI_MTK_HOST BIT(0)
};
unsigned long trb_addr(struct xhci_segment *seg, union xhci_trb *trb);