10#ifndef _EFI_EHCI_REG_H_
11#define _EFI_EHCI_REG_H_
16#define EHC_CAPLENGTH_OFFSET 0
17#define EHC_HCSPARAMS_OFFSET 0x04
18#define EHC_HCCPARAMS_OFFSET 0x08
23#define HCSP_NPORTS 0x0F
24#define HCCP_64BIT 0x01
29#define EHC_USBCMD_OFFSET 0x0
30#define EHC_USBSTS_OFFSET 0x04
31#define EHC_USBINTR_OFFSET 0x08
32#define EHC_FRINDEX_OFFSET 0x0C
33#define EHC_CTRLDSSEG_OFFSET 0x10
34#define EHC_FRAME_BASE_OFFSET 0x14
35#define EHC_ASYNC_HEAD_OFFSET 0x18
36#define EHC_CONFIG_FLAG_OFFSET 0x40
37#define EHC_PORT_STAT_OFFSET 0x44
39#define EHC_FRAME_LEN 1024
44#define CONFIGFLAG_ROUTE_EHC 0x01
46#define USBCMD_RUN 0x01
47#define USBCMD_RESET 0x02
48#define USBCMD_ENABLE_PERIOD 0x10
49#define USBCMD_ENABLE_ASYNC 0x20
50#define USBCMD_IAAD 0x40
52#define USBSTS_IAA 0x20
53#define USBSTS_PERIOD_ENABLED 0x4000
54#define USBSTS_ASYNC_ENABLED 0x8000
55#define USBSTS_HALT 0x1000
56#define USBSTS_SYS_ERROR 0x10
57#define USBSTS_INTACK_MASK 0x003F
60#define PORTSC_CONN 0x01
61#define PORTSC_CONN_CHANGE 0x02
62#define PORTSC_ENABLED 0x04
63#define PORTSC_ENABLE_CHANGE 0x08
64#define PORTSC_OVERCUR 0x10
65#define PORTSC_OVERCUR_CHANGE 0x20
66#define PORSTSC_RESUME 0x40
67#define PORTSC_SUSPEND 0x80
68#define PORTSC_RESET 0x100
69#define PORTSC_LINESTATE_K 0x400
70#define PORTSC_LINESTATE_J 0x800
71#define PORTSC_POWER 0x1000
72#define PORTSC_OWNER 0x2000
73#define PORTSC_CHANGE_MASK 0x2A
78#define EHC_BAR_INDEX 0
80#define EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0)
82#define EHC_ADDR(High, QhHw32) \
83 ((VOID *) (UINTN) (LShiftU64 ((High), 32) | ((QhHw32) & 0xFFFFFFF0)))
85#define EHCI_IS_DATAIN(EndpointAddr) EHC_BIT_IS_SET((EndpointAddr), 0x80)
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)
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)