]> git.proxmox.com Git - mirror_edk2.git/blobdiff - QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/Descriptor.h
QuarkSocPkg: Add new package for Quark SoC X1000
[mirror_edk2.git] / QuarkSocPkg / QuarkSouthCluster / Usb / Ohci / Dxe / Descriptor.h
diff --git a/QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/Descriptor.h b/QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/Descriptor.h
new file mode 100644 (file)
index 0000000..ca8baf5
--- /dev/null
@@ -0,0 +1,138 @@
+/** @file\r
+This file contains the descriptor definination of OHCI spec\r
+\r
+Copyright (c) 2013-2015 Intel Corporation.\r
+\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+\r
+\r
+#ifndef _DESCRIPTOR_H\r
+#define _DESCRIPTOR_H\r
+\r
+#define ED_FUNC_ADD     0x0001\r
+#define ED_ENDPT_NUM    0x0002\r
+#define ED_DIR          0x0004\r
+#define ED_SPEED        0x0008\r
+#define ED_SKIP         0x0010\r
+#define ED_FORMAT       0x0020\r
+#define ED_MAX_PACKET   0x0040\r
+#define ED_TDTAIL_PTR   0x0080\r
+#define ED_HALTED       0x0100\r
+#define ED_DTTOGGLE     0x0200\r
+#define ED_TDHEAD_PTR   0x0400\r
+#define ED_NEXT_EDPTR   0x0800\r
+#define ED_PDATA        0x1000\r
+#define ED_ZERO         0x2000\r
+\r
+#define TD_BUFFER_ROUND     0x0001\r
+#define TD_DIR_PID          0x0002\r
+#define TD_DELAY_INT        0x0004\r
+#define TD_DT_TOGGLE        0x0008\r
+#define TD_ERROR_CNT        0x0010\r
+#define TD_COND_CODE        0x0020\r
+#define TD_CURR_BUFFER_PTR  0x0040\r
+#define TD_NEXT_PTR         0x0080\r
+#define TD_BUFFER_END_PTR   0x0100\r
+#define TD_PDATA            0x0200\r
+\r
+#define ED_FROM_TD_DIR        0x0\r
+#define ED_OUT_DIR            0x1\r
+#define ED_IN_DIR             0x2\r
+#define ED_FROM_TD_ALSO_DIR   0x3\r
+\r
+#define TD_SETUP_PID          0x00\r
+#define TD_OUT_PID            0x01\r
+#define TD_IN_PID             0x02\r
+#define TD_NODATA_PID         0x03\r
+\r
+#define HI_SPEED              0\r
+#define LO_SPEED              1\r
+\r
+#define TD_NO_ERROR           0x00\r
+#define TD_CRC_ERROR          0x01\r
+#define TD_BITSTUFFING_ERROR  0x02\r
+#define TD_TOGGLE_ERROR       0x03\r
+#define TD_DEVICE_STALL       0x04\r
+#define TD_NO_RESPONSE        0x05\r
+#define TD_PIDCHK_FAIL        0x06\r
+#define TD_PID_UNEXPECTED     0x07\r
+#define TD_DATA_OVERRUN       0x08\r
+#define TD_DATA_UNDERRUN      0x09\r
+#define TD_BUFFER_OVERRUN     0x0C\r
+#define TD_BUFFER_UNDERRUN    0x0D\r
+#define TD_TOBE_PROCESSED     0x0E\r
+#define TD_TOBE_PROCESSED_2   0x0F\r
+\r
+#define TD_NO_DELAY           0x7\r
+\r
+#define TD_INT                0x1\r
+#define TD_CTL                0x2\r
+#define TD_BLK                0x3\r
+\r
+typedef struct {\r
+  UINT32 Reserved:18;\r
+  UINT32 BufferRounding:1;\r
+  UINT32 DirPID:2;\r
+  UINT32 DelayInterrupt:3;\r
+  UINT32 DataToggle:2;\r
+  UINT32 ErrorCount:2;\r
+  UINT32 ConditionCode:4;\r
+} TD_DESCRIPTOR_WORD0;\r
+\r
+typedef struct _TD_DESCRIPTOR {\r
+  TD_DESCRIPTOR_WORD0     Word0;\r
+  UINT32                  CurrBufferPointer;          // 32-bit Physical Address of buffer\r
+  UINT32                  NextTD;                     // 32-bit Physical Address of TD_DESCRIPTOR\r
+  UINT32                  BufferEndPointer;           // 32-bit Physical Address of buffer\r
+  UINT32                  NextTDPointer;              // 32-bit Physical Address of TD_DESCRIPTOR\r
+  UINT32                  DataBuffer;                 // 32-bit Physical Address of buffer\r
+  UINT32                  ActualSendLength;\r
+  UINT32                  Reserved;\r
+} TD_DESCRIPTOR;\r
+\r
+typedef struct {\r
+  UINT32 FunctionAddress:7;\r
+  UINT32 EndPointNum:4;\r
+  UINT32 Direction:2;\r
+  UINT32 Speed:1;\r
+  UINT32 Skip:1;\r
+  UINT32 Format:1;\r
+  UINT32 MaxPacketSize:11;\r
+  UINT32 FreeSpace:5;\r
+} ED_DESCRIPTOR_WORD0;\r
+\r
+typedef struct {\r
+  UINT32 Halted:1;\r
+  UINT32 ToggleCarry:1;\r
+  UINT32 Zero:2;\r
+  UINT32 TdHeadPointer:28;\r
+} ED_DESCRIPTOR_WORD2;\r
+\r
+typedef struct _ED_DESCRIPTOR {\r
+  ED_DESCRIPTOR_WORD0     Word0;\r
+  UINT32                  TdTailPointer;    // 32-bit Physical Address of TD_DESCRIPTOR\r
+  ED_DESCRIPTOR_WORD2     Word2;\r
+  UINT32                  NextED;           // 32-bit Physical Address of ED_DESCRIPTOR\r
+} ED_DESCRIPTOR;\r
+\r
+#define TD_PTR(p)            ((TD_DESCRIPTOR *)(UINTN)((p) << 4))\r
+#define ED_PTR(p)            ((ED_DESCRIPTOR *)(UINTN)((p) << 4))\r
+#define RIGHT_SHIFT_4(p)     ((UINT32)(p) >> 4)\r
+\r
+typedef enum {\r
+  CONTROL_LIST,\r
+  BULK_LIST,\r
+  INTERRUPT_LIST,\r
+  ISOCHRONOUS_LIST\r
+} DESCRIPTOR_LIST_TYPE;\r
+\r
+#endif\r