10#ifndef _EFI_EHCI_REG_H_
11#define _EFI_EHCI_REG_H_
20#define EHC_CAPLENGTH_OFFSET 0
21#define EHC_HCSPARAMS_OFFSET 0x04
22#define EHC_HCCPARAMS_OFFSET 0x08
27#define HCSP_NPORTS 0x0F
29#define HCCP_64BIT 0x01
34#define EHC_USBCMD_OFFSET 0x0
35#define EHC_USBSTS_OFFSET 0x04
36#define EHC_USBINTR_OFFSET 0x08
37#define EHC_FRINDEX_OFFSET 0x0C
38#define EHC_CTRLDSSEG_OFFSET 0x10
39#define EHC_FRAME_BASE_OFFSET 0x14
40#define EHC_ASYNC_HEAD_OFFSET 0x18
41#define EHC_CONFIG_FLAG_OFFSET 0x40
42#define EHC_PORT_STAT_OFFSET 0x44
44#define EHC_FRAME_LEN 1024
49#define CONFIGFLAG_ROUTE_EHC 0x01
51#define USBCMD_RUN 0x01
52#define USBCMD_RESET 0x02
53#define USBCMD_ENABLE_PERIOD 0x10
54#define USBCMD_ENABLE_ASYNC 0x20
55#define USBCMD_IAAD 0x40
57#define USBSTS_IAA 0x20
58#define USBSTS_PERIOD_ENABLED 0x4000
59#define USBSTS_ASYNC_ENABLED 0x8000
60#define USBSTS_HALT 0x1000
61#define USBSTS_SYS_ERROR 0x10
62#define USBSTS_INTACK_MASK 0x003F
65#define PORTSC_CONN 0x01
66#define PORTSC_CONN_CHANGE 0x02
67#define PORTSC_ENABLED 0x04
68#define PORTSC_ENABLE_CHANGE 0x08
69#define PORTSC_OVERCUR 0x10
70#define PORTSC_OVERCUR_CHANGE 0x20
71#define PORSTSC_RESUME 0x40
72#define PORTSC_SUSPEND 0x80
73#define PORTSC_RESET 0x100
74#define PORTSC_LINESTATE_K 0x400
75#define PORTSC_LINESTATE_J 0x800
76#define PORTSC_POWER 0x1000
77#define PORTSC_OWNER 0x2000
78#define PORTSC_CHANGE_MASK 0x2A
83#define EHC_BAR_INDEX 0
88#define EHC_DEBUG_PORT_CAP_ID 0x0A
90#define EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0)
92#define EHC_ADDR(High, QhHw32) \
93 ((VOID *) (UINTN) (LShiftU64 ((High), 32) | ((QhHw32) & 0xFFFFFFF0)))
95#define EHCI_IS_DATAIN(EndpointAddr) EHC_BIT_IS_SET((EndpointAddr), 0x80)
154 IN CONST UINT8 *PortNumber OPTIONAL
VOID EhcClearOpRegBit(IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Bit)
EFI_STATUS EhcResetHC(IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
VOID EhcWriteOpReg(IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Data)
EFI_STATUS EhcInitHC(IN USB2_HC_DEV *Ehc)
EFI_STATUS EhcSetAndWaitDoorBell(IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
VOID EhcSetOpRegBit(IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Bit)
BOOLEAN EhcIsHalt(IN USB2_HC_DEV *Ehc)
EFI_STATUS EhcHaltHC(IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
VOID EhcClearLegacySupport(IN USB2_HC_DEV *Ehc)
UINT32 EhcReadCapRegister(IN USB2_HC_DEV *Ehc, IN UINT32 Offset)
BOOLEAN EhcIsSysError(IN USB2_HC_DEV *Ehc)
EFI_STATUS EhcRunHC(IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
UINT32 EhcReadOpReg(IN USB2_HC_DEV *Ehc, IN UINT32 Offset)
VOID EhcAckAllInterrupt(IN USB2_HC_DEV *Ehc)
BOOLEAN EhcIsDebugPortInUse(IN CONST USB2_HC_DEV *Ehc, IN CONST UINT8 *PortNumber OPTIONAL)