10#ifndef _EFI_PEI_XHCI_REG_H_
11#define _EFI_PEI_XHCI_REG_H_
16#define XHC_CAPLENGTH_OFFSET 0x00
17#define XHC_HCIVERSION_OFFSET 0x02
18#define XHC_HCSPARAMS1_OFFSET 0x04
19#define XHC_HCSPARAMS2_OFFSET 0x08
20#define XHC_HCSPARAMS3_OFFSET 0x0c
21#define XHC_HCCPARAMS_OFFSET 0x10
22#define XHC_DBOFF_OFFSET 0x14
23#define XHC_RTSOFF_OFFSET 0x18
28#define XHC_USBCMD_OFFSET 0x0000
29#define XHC_USBSTS_OFFSET 0x0004
30#define XHC_PAGESIZE_OFFSET 0x0008
31#define XHC_DNCTRL_OFFSET 0x0014
32#define XHC_CRCR_OFFSET 0x0018
33#define XHC_DCBAAP_OFFSET 0x0030
34#define XHC_CONFIG_OFFSET 0x0038
35#define XHC_PORTSC_OFFSET 0x0400
40#define XHC_MFINDEX_OFFSET 0x00
41#define XHC_IMAN_OFFSET 0x20
42#define XHC_IMOD_OFFSET 0x24
43#define XHC_ERSTSZ_OFFSET 0x28
44#define XHC_ERSTBA_OFFSET 0x30
45#define XHC_ERDP_OFFSET 0x38
50#define XHC_USBCMD_RUN BIT0
51#define XHC_USBCMD_RESET BIT1
52#define XHC_USBCMD_INTE BIT2
53#define XHC_USBCMD_HSEE BIT3
55#define XHC_USBSTS_HALT BIT0
56#define XHC_USBSTS_HSE BIT2
57#define XHC_USBSTS_EINT BIT3
58#define XHC_USBSTS_PCD BIT4
59#define XHC_USBSTS_SSS BIT8
60#define XHC_USBSTS_RSS BIT9
61#define XHC_USBSTS_SRE BIT10
62#define XHC_USBSTS_CNR BIT11
63#define XHC_USBSTS_HCE BIT12
65#define XHC_PAGESIZE_MASK 0xFFFF
67#define XHC_CRCR_RCS BIT0
68#define XHC_CRCR_CS BIT1
69#define XHC_CRCR_CA BIT2
70#define XHC_CRCR_CRR BIT3
72#define XHC_CONFIG_MASK 0xFF
74#define XHC_PORTSC_CCS BIT0
75#define XHC_PORTSC_PED BIT1
76#define XHC_PORTSC_OCA BIT3
77#define XHC_PORTSC_RESET BIT4
78#define XHC_PORTSC_PLS (BIT5|BIT6|BIT7|BIT8)
79#define XHC_PORTSC_PP BIT9
80#define XHC_PORTSC_PS (BIT10|BIT11|BIT12|BIT13)
81#define XHC_PORTSC_LWS BIT16
82#define XHC_PORTSC_CSC BIT17
83#define XHC_PORTSC_PEC BIT18
84#define XHC_PORTSC_WRC BIT19
85#define XHC_PORTSC_OCC BIT20
86#define XHC_PORTSC_PRC BIT21
87#define XHC_PORTSC_PLC BIT22
88#define XHC_PORTSC_CEC BIT23
89#define XHC_PORTSC_CAS BIT24
91#define XHC_HUB_PORTSC_CCS BIT0
92#define XHC_HUB_PORTSC_PED BIT1
93#define XHC_HUB_PORTSC_OCA BIT3
94#define XHC_HUB_PORTSC_RESET BIT4
95#define XHC_HUB_PORTSC_PP BIT9
96#define XHC_HUB_PORTSC_CSC BIT16
97#define XHC_HUB_PORTSC_PEC BIT17
98#define XHC_HUB_PORTSC_OCC BIT19
99#define XHC_HUB_PORTSC_PRC BIT20
100#define XHC_HUB_PORTSC_BHRC BIT21
102#define XHC_IMAN_IP BIT0
103#define XHC_IMAN_IE BIT1
105#define XHC_IMODI_MASK 0x0000FFFF
106#define XHC_IMODC_MASK 0xFFFF0000
111 UINT16 MaxIntrs : 11;
128 UINT32 ScratchBufHi : 5;
130 UINT32 ScratchBufLo : 5;
152 UINT16 MaxPsaSize : 4;
182 UINT8 HubContrCurrent;
193 Usb3PortBHPortReset = 28,
194 Usb3PortBHPortResetChange = 29
293 IN BOOLEAN WaitToSet,
VOID XhcPeiSetOpRegBit(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Bit)
BOOLEAN XhcPeiIsHalt(IN PEI_XHC_DEV *Xhc)
VOID XhcPeiClearRuntimeRegBit(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Bit)
UINT32 XhcPeiReadOpReg(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset)
EFI_STATUS XhcPeiRunHC(IN PEI_XHC_DEV *Xhc, IN UINT32 Timeout)
EFI_STATUS XhcPeiHaltHC(IN PEI_XHC_DEV *Xhc, IN UINT32 Timeout)
EFI_STATUS XhcPeiWaitOpRegBit(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Bit, IN BOOLEAN WaitToSet, IN UINT32 Timeout)
BOOLEAN XhcPeiIsSysError(IN PEI_XHC_DEV *Xhc)
VOID XhcPeiWriteOpReg(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Data)
VOID XhcPeiSetRuntimeRegBit(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Bit)
UINT32 XhcPeiReadRuntimeReg(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset)
VOID XhcPeiClearOpRegBit(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Bit)
EFI_STATUS XhcPeiResetHC(IN PEI_XHC_DEV *Xhc, IN UINT32 Timeout)
VOID XhcPeiWriteDoorBellReg(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Data)
VOID XhcPeiWriteRuntimeReg(IN PEI_XHC_DEV *Xhc, IN UINT32 Offset, IN UINT32 Data)