]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/usb_defs.h
armv8/ls2085ardb: Add USB support for ls2085ardb
[karo-tx-uboot.git] / include / usb_defs.h
index d7f7465fe554ebe2f6b7e57ab4a1d64814b940b4..8214ba9bf5577093a370ed8cb1144f3b3fc680bd 100644 (file)
 #define USB_TEST_MODE_FORCE_ENABLE  0x05
 
 
-/* "pipe" definitions */
-
-#define PIPE_ISOCHRONOUS    0
-#define PIPE_INTERRUPT      1
-#define PIPE_CONTROL        2
-#define PIPE_BULK           3
+/*
+ * "pipe" definitions, use unsigned so we can compare reliably, since this
+ * value is shifted up to bits 30/31.
+ */
+#define PIPE_ISOCHRONOUS    0U
+#define PIPE_INTERRUPT      1U
+#define PIPE_CONTROL        2U
+#define PIPE_BULK           3U
 #define PIPE_DEVEP_MASK     0x0007ff00
 
 #define USB_ISOCHRONOUS    0
 #define USB_CONTROL        2
 #define USB_BULK           3
 
+#define USB_PIPE_TYPE_SHIFT    30
+#define USB_PIPE_TYPE_MASK     (3 << USB_PIPE_TYPE_SHIFT)
+
+#define USB_PIPE_DEV_SHIFT     8
+#define USB_PIPE_DEV_MASK      (0x7f << USB_PIPE_DEV_SHIFT)
+
+#define USB_PIPE_EP_SHIFT      15
+#define USB_PIPE_EP_MASK       (0xf << USB_PIPE_EP_SHIFT)
+
 /* USB-status codes: */
 #define USB_ST_ACTIVE           0x1            /* TD is active */
 #define USB_ST_STALLED          0x2            /* TD is stalled */
 #define HUB_CHANGE_LOCAL_POWER 0x0001
 #define HUB_CHANGE_OVERCURRENT 0x0002
 
+/* Mask for wIndex in get/set port feature */
+#define USB_HUB_PORT_MASK      0xf
+
 /*
  * CBI style
  */