11#ifndef _RECOVERY_EHC_H_
12#define _RECOVERY_EHC_H_
31#define EFI_LIST_ENTRY LIST_ENTRY
38#define EFI_USB_SPEED_FULL 0x0000
39#define EFI_USB_SPEED_LOW 0x0001
40#define EFI_USB_SPEED_HIGH 0x0002
44#define EHC_1_MICROSECOND 1
45#define EHC_1_MILLISECOND (1000 * EHC_1_MICROSECOND)
46#define EHC_1_SECOND (1000 * EHC_1_MILLISECOND)
51#define EHC_RESET_TIMEOUT (1 * EHC_1_SECOND)
52#define EHC_GENERIC_TIMEOUT (10 * EHC_1_MILLISECOND)
57#define EHC_ROOT_PORT_RECOVERY_STALL (20 * EHC_1_MILLISECOND)
62#define EHC_SYNC_POLL_INTERVAL (6 * EHC_1_MILLISECOND)
64#define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Field)
66#define EHC_LOW_32BIT(Addr64) ((UINT32)(((UINTN)(Addr64)) & 0XFFFFFFFF))
67#define EHC_HIGH_32BIT(Addr64) ((UINT32)(RShiftU64((UINTN)(Addr64), 32) & 0XFFFFFFFF))
68#define EHC_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & (Bit)) == (Bit)))
70#define EHC_REG_BIT_IS_SET(Ehc, Offset, Bit) \
71 (EHC_BIT_IS_SET(EhcReadOpReg ((Ehc), (Offset)), (Bit)))
73#define USB2_HC_DEV_SIGNATURE SIGNATURE_32 ('e', 'h', 'c', 'i')
85 UINT32 UsbHostControllerBaseAddress;
112 VOID *PeriodFrameMap;
120 UINT32 HcStructParams;
123 UINT32 High32bitAddr;
126#define PEI_RECOVERY_USB_EHC_DEV_FROM_EHCI_THIS(a) CR (a, PEI_USB2_HC_DEV, Usb2HostControllerPpi, USB2_HC_DEV_SIGNATURE)
127#define PEI_RECOVERY_USB_EHC_DEV_FROM_THIS_NOTIFY(a) CR (a, PEI_USB2_HC_DEV, EndOfPeiNotifyList, USB2_HC_DEV_SIGNATURE)
239 IN VOID *HostAddress,
281 OUT VOID **HostAddress,
299 IN VOID *HostAddress,
EFI_STATUS InitializeUsbHC(IN PEI_USB2_HC_DEV *EhcDev)
VOID IoMmuFreeBuffer(IN EDKII_IOMMU_PPI *IoMmu, IN UINTN Pages, IN VOID *HostAddress, IN VOID *Mapping)
VOID IoMmuUnmap(IN EDKII_IOMMU_PPI *IoMmu, IN VOID *Mapping)
EFI_STATUS UsbHcFreeMemPool(IN PEI_USB2_HC_DEV *Ehc, IN USBHC_MEM_POOL *Pool)
VOID UsbHcFreeMem(IN PEI_USB2_HC_DEV *Ehc, IN USBHC_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size)
VOID * UsbHcAllocateMem(IN PEI_USB2_HC_DEV *Ehc, IN USBHC_MEM_POOL *Pool, IN UINTN Size)
EFI_STATUS IoMmuMap(IN EDKII_IOMMU_PPI *IoMmu, IN EDKII_IOMMU_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
VOID IoMmuInit(OUT EDKII_IOMMU_PPI **IoMmu)
EFI_STATUS IoMmuAllocateBuffer(IN EDKII_IOMMU_PPI *IoMmu, IN UINTN Pages, OUT VOID **HostAddress, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
USBHC_MEM_POOL * UsbHcInitMemPool(IN PEI_USB2_HC_DEV *Ehc, IN BOOLEAN Check4G, IN UINT32 Which4G)
UINT64 EFI_PHYSICAL_ADDRESS