TianoCore EDK2 master
|
#include <PiPei.h>
#include <Ppi/UsbController.h>
#include <Ppi/UsbHostController.h>
#include <Ppi/IoMmu.h>
#include <Ppi/EndOfPeiPhase.h>
#include <Library/DebugLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/TimerLib.h>
#include <Library/IoLib.h>
Go to the source code of this file.
Data Structures | |
struct | FRAMELIST_ENTRY |
struct | QUEUE_HEAD |
struct | QH_STRUCT |
struct | TD |
struct | TD_STRUCT |
struct | _MEMORY_MANAGE_HEADER |
struct | USB_UHC_DEV |
Macros | |
#define | USB_SLOW_SPEED_DEVICE 0x01 |
#define | USB_FULL_SPEED_DEVICE 0x02 |
#define | NORMAL_MEMORY_BLOCK_UNIT_IN_PAGES 16 |
#define | USBCMD 0 /* Command Register Offset 00-01h */ |
#define | USBCMD_RS BIT0 /* Run/Stop */ |
#define | USBCMD_HCRESET BIT1 /* Host reset */ |
#define | USBCMD_GRESET BIT2 /* Global reset */ |
#define | USBCMD_EGSM BIT3 /* Global Suspend Mode */ |
#define | USBCMD_FGR BIT4 /* Force Global Resume */ |
#define | USBCMD_SWDBG BIT5 /* SW Debug mode */ |
#define | USBCMD_CF BIT6 /* Config Flag (sw only) */ |
#define | USBCMD_MAXP BIT7 /* Max Packet (0 = 32, 1 = 64) */ |
#define | USBSTS 2 /* Status Register Offset 02-03h */ |
#define | USBSTS_USBINT BIT0 /* Interrupt due to IOC */ |
#define | USBSTS_ERROR BIT1 /* Interrupt due to error */ |
#define | USBSTS_RD BIT2 /* Resume Detect */ |
#define | USBSTS_HSE BIT3 /* Host System Error - basically PCI problems */ |
#define | USBSTS_HCPE BIT4 /* Host Controller Process Error - the scripts were buggy */ |
#define | USBSTS_HCH BIT5 /* HC Halted */ |
#define | USBINTR 4 /* Interrupt Enable Register 04-05h */ |
#define | USBINTR_TIMEOUT BIT0 /* Timeout/CRC error enable */ |
#define | USBINTR_RESUME BIT1 /* Resume interrupt enable */ |
#define | USBINTR_IOC BIT2 /* Interrupt On Complete enable */ |
#define | USBINTR_SP BIT3 /* Short packet interrupt enable */ |
#define | USBFRNUM 6 |
#define | USBFLBASEADD 8 |
#define | USBSOF 0x0c |
#define | USBPORTSC1 0x10 /*Port 1 offset 10-11h */ |
#define | USBPORTSC2 0x12 /*Port 2 offset 12-13h */ |
#define | USBPORTSC_CCS BIT0 /* Current Connect Status ("device present") */ |
#define | USBPORTSC_CSC BIT1 /* Connect Status Change */ |
#define | USBPORTSC_PED BIT2 /* Port Enable / Disable */ |
#define | USBPORTSC_PEDC BIT3 /* Port Enable / Disable Change */ |
#define | USBPORTSC_LSL BIT4 /* Line Status Low bit*/ |
#define | USBPORTSC_LSH BIT5 /* Line Status High bit*/ |
#define | USBPORTSC_RD BIT6 /* Resume Detect */ |
#define | USBPORTSC_LSDA BIT8 /* Low Speed Device Attached */ |
#define | USBPORTSC_PR BIT9 /* Port Reset */ |
#define | USBPORTSC_SUSP BIT12 /* Suspend */ |
#define | SETUP_PACKET_ID 0x2D |
#define | INPUT_PACKET_ID 0x69 |
#define | OUTPUT_PACKET_ID 0xE1 |
#define | ERROR_PACKET_ID 0x55 |
#define | STALL_1_MICRO_SECOND 1 |
#define | STALL_1_MILLI_SECOND 1000 |
#define | USB_UHC_DEV_SIGNATURE SIGNATURE_32 ('p', 'u', 'h', 'c') |
#define | PEI_RECOVERY_USB_UHC_DEV_FROM_UHCI_THIS(a) CR (a, USB_UHC_DEV, UsbHostControllerPpi, USB_UHC_DEV_SIGNATURE) |
#define | PEI_RECOVERY_USB_UHC_DEV_FROM_THIS_NOTIFY(a) CR (a, USB_UHC_DEV, EndOfPeiNotifyList, USB_UHC_DEV_SIGNATURE) |
Typedefs | |
typedef struct _MEMORY_MANAGE_HEADER | MEMORY_MANAGE_HEADER |
Functions | |
EFI_STATUS EFIAPI | UhcControlTransfer (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_HOST_CONTROLLER_PPI *This, IN UINT8 DeviceAddress, IN UINT8 DeviceSpeed, IN UINT8 MaximumPacketLength, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION TransferDirection, IN OUT VOID *Data OPTIONAL, IN OUT UINTN *DataLength OPTIONAL, IN UINTN TimeOut, OUT UINT32 *TransferResult) |
EFI_STATUS EFIAPI | UhcBulkTransfer (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_HOST_CONTROLLER_PPI *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 MaximumPacketLength, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, OUT UINT32 *TransferResult) |
EFI_STATUS EFIAPI | UhcGetRootHubPortNumber (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_HOST_CONTROLLER_PPI *This, OUT UINT8 *PortNumber) |
EFI_STATUS EFIAPI | UhcGetRootHubPortStatus (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_HOST_CONTROLLER_PPI *This, IN UINT8 PortNumber, OUT EFI_USB_PORT_STATUS *PortStatus) |
EFI_STATUS EFIAPI | UhcSetRootHubPortFeature (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_HOST_CONTROLLER_PPI *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature) |
EFI_STATUS EFIAPI | UhcClearRootHubPortFeature (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_HOST_CONTROLLER_PPI *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature) |
EFI_STATUS | InitializeUsbHC (IN USB_UHC_DEV *UhcDev) |
EFI_STATUS | CreateFrameList (USB_UHC_DEV *UhcDev) |
UINT16 | USBReadPortW (IN USB_UHC_DEV *UhcDev, IN UINT32 Port) |
VOID | USBWritePortW (IN USB_UHC_DEV *UhcDev, IN UINT32 Port, IN UINT16 Data) |
VOID | USBWritePortDW (IN USB_UHC_DEV *UhcDev, IN UINT32 Port, IN UINT32 Data) |
VOID | ClearStatusReg (IN USB_UHC_DEV *UhcDev, IN UINT32 StatusAddr) |
BOOLEAN | IsStatusOK (IN USB_UHC_DEV *UhcDev, IN UINT32 StatusRegAddr) |
VOID | SetFrameListBaseAddress (IN USB_UHC_DEV *UhcDev, IN UINT32 FrameListRegAddr, IN UINT32 Addr) |
EFI_STATUS | CreateQH (IN USB_UHC_DEV *UhcDev, OUT QH_STRUCT **PtrQH) |
VOID | SetQHHorizontalLinkPtr (IN QH_STRUCT *PtrQH, IN VOID *PtrNext) |
VOID | SetQHHorizontalQHorTDSelect (IN QH_STRUCT *PtrQH, IN BOOLEAN IsQH) |
VOID | SetQHHorizontalValidorInvalid (IN QH_STRUCT *PtrQH, IN BOOLEAN IsValid) |
VOID | SetQHVerticalLinkPtr (IN QH_STRUCT *PtrQH, IN VOID *PtrNext) |
VOID | SetQHVerticalQHorTDSelect (IN QH_STRUCT *PtrQH, IN BOOLEAN IsQH) |
VOID | SetQHVerticalValidorInvalid (IN QH_STRUCT *PtrQH, IN BOOLEAN IsValid) |
EFI_STATUS | AllocateTDorQHStruct (IN USB_UHC_DEV *UhcDev, IN UINT32 Size, OUT VOID **PtrStruct) |
EFI_STATUS | CreateTD (IN USB_UHC_DEV *UhcDev, OUT TD_STRUCT **PtrTD) |
EFI_STATUS | GenSetupStageTD (IN USB_UHC_DEV *UhcDev, IN UINT8 DevAddr, IN UINT8 Endpoint, IN UINT8 DeviceSpeed, IN UINT8 *DevRequest, IN UINT8 *RequestPhy, IN UINT8 RequestLen, OUT TD_STRUCT **PtrTD) |
EFI_STATUS | GenDataTD (IN USB_UHC_DEV *UhcDev, IN UINT8 DevAddr, IN UINT8 Endpoint, IN UINT8 *PtrData, IN UINT8 *DataPhy, IN UINT8 Len, IN UINT8 PktID, IN UINT8 Toggle, IN UINT8 DeviceSpeed, OUT TD_STRUCT **PtrTD) |
EFI_STATUS | CreateStatusTD (IN USB_UHC_DEV *UhcDev, IN UINT8 DevAddr, IN UINT8 Endpoint, IN UINT8 PktID, IN UINT8 DeviceSpeed, OUT TD_STRUCT **PtrTD) |
VOID | SetTDLinkPtrValidorInvalid (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsValid) |
VOID | SetTDLinkPtrQHorTDSelect (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsQH) |
VOID | SetTDLinkPtrDepthorBreadth (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsDepth) |
VOID | SetTDLinkPtr (IN TD_STRUCT *PtrTDStruct, IN VOID *PtrNext) |
VOID * | GetTDLinkPtr (IN TD_STRUCT *PtrTDStruct) |
VOID | EnableorDisableTDShortPacket (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsEnable) |
VOID | SetTDControlErrorCounter (IN TD_STRUCT *PtrTDStruct, IN UINT8 MaxErrors) |
VOID | SetTDLoworFullSpeedDevice (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsLowSpeedDevice) |
VOID | SetTDControlIsochronousorNot (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsIsochronous) |
VOID | SetorClearTDControlIOC (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsSet) |
VOID | SetTDStatusActiveorInactive (IN TD_STRUCT *PtrTDStruct, IN BOOLEAN IsActive) |
UINT16 | SetTDTokenMaxLength (IN TD_STRUCT *PtrTDStruct, IN UINT16 MaxLen) |
VOID | SetTDTokenDataToggle1 (IN TD_STRUCT *PtrTDStruct) |
VOID | SetTDTokenDataToggle0 (IN TD_STRUCT *PtrTDStruct) |
VOID | SetTDTokenEndPoint (IN TD_STRUCT *PtrTDStruct, IN UINTN EndPoint) |
VOID | SetTDTokenDeviceAddress (IN TD_STRUCT *PtrTDStruct, IN UINTN DevAddr) |
VOID | SetTDTokenPacketID (IN TD_STRUCT *PtrTDStruct, IN UINT8 PacketID) |
VOID | SetTDDataBuffer (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusActive (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusStalled (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusBufferError (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusBabbleError (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusNAKReceived (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusCRCTimeOutError (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | IsTDStatusBitStuffError (IN TD_STRUCT *PtrTDStruct) |
UINT16 | GetTDStatusActualLength (IN TD_STRUCT *PtrTDStruct) |
BOOLEAN | GetTDLinkPtrValidorInvalid (IN TD_STRUCT *PtrTDStruct) |
UINTN | CountTDsNumber (IN TD_STRUCT *PtrFirstTD) |
VOID | LinkTDToQH (IN QH_STRUCT *PtrQH, IN TD_STRUCT *PtrTD) |
VOID | LinkTDToTD (IN TD_STRUCT *PtrPreTD, IN TD_STRUCT *PtrTD) |
EFI_STATUS | ExecuteControlTransfer (IN USB_UHC_DEV *UhcDev, IN TD_STRUCT *PtrTD, OUT UINTN *ActualLen, IN UINTN TimeOut, OUT UINT32 *TransferResult) |
EFI_STATUS | ExecBulkTransfer (IN USB_UHC_DEV *UhcDev, IN TD_STRUCT *PtrTD, IN OUT UINTN *ActualLen, IN UINT8 *DataToggle, IN UINTN TimeOut, OUT UINT32 *TransferResult) |
VOID | DeleteQueuedTDs (IN USB_UHC_DEV *UhcDev, IN TD_STRUCT *PtrFirstTD) |
BOOLEAN | CheckTDsResults (IN TD_STRUCT *PtrTD, OUT UINT32 *Result, OUT UINTN *ErrTDPos, OUT UINTN *ActualTransferSize) |
EFI_STATUS | CreateMemoryBlock (IN USB_UHC_DEV *UhcDev, OUT MEMORY_MANAGE_HEADER **MemoryHeader, IN UINTN MemoryBlockSizeInPages) |
EFI_STATUS | InitializeMemoryManagement (IN USB_UHC_DEV *UhcDev) |
EFI_STATUS | UhcAllocatePool (IN USB_UHC_DEV *UhcDev, OUT UINT8 **Pool, IN UINTN AllocSize) |
EFI_STATUS | AllocMemInMemoryBlock (IN MEMORY_MANAGE_HEADER *MemoryHeader, OUT VOID **Pool, IN UINTN NumberOfMemoryUnit) |
VOID | UhcFreePool (IN USB_UHC_DEV *UhcDev, IN UINT8 *Pool, IN UINTN AllocSize) |
VOID | InsertMemoryHeaderToList (IN MEMORY_MANAGE_HEADER *MemoryHeader, IN MEMORY_MANAGE_HEADER *NewMemoryHeader) |
EFI_STATUS | UhciMapUserRequest (IN USB_UHC_DEV *Uhc, IN OUT VOID *Request, OUT UINT8 **MappedAddr, OUT VOID **Map) |
EFI_STATUS | UhciMapUserData (IN USB_UHC_DEV *Uhc, IN EFI_USB_DATA_DIRECTION Direction, IN VOID *Data, IN OUT UINTN *Len, OUT UINT8 *PktId, OUT UINT8 **MappedAddr, OUT VOID **Map) |
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 | IoMmuUnmap (IN EDKII_IOMMU_PPI *IoMmu, IN VOID *Mapping) |
EFI_STATUS | IoMmuAllocateBuffer (IN EDKII_IOMMU_PPI *IoMmu, IN UINTN Pages, OUT VOID **HostAddress, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping) |
VOID | IoMmuInit (OUT EDKII_IOMMU_PPI **IoMmu) |
Private Header file for Usb Host Controller PEIM
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UhcPeim.h.
#define PEI_RECOVERY_USB_UHC_DEV_FROM_THIS_NOTIFY | ( | a | ) | CR (a, USB_UHC_DEV, EndOfPeiNotifyList, USB_UHC_DEV_SIGNATURE) |
#define PEI_RECOVERY_USB_UHC_DEV_FROM_UHCI_THIS | ( | a | ) | CR (a, USB_UHC_DEV, UsbHostControllerPpi, USB_UHC_DEV_SIGNATURE) |
#define USB_UHC_DEV_SIGNATURE SIGNATURE_32 ('p', 'u', 'h', 'c') |
#define USBINTR_IOC BIT2 /* Interrupt On Complete enable */ |
#define USBINTR_SP BIT3 /* Short packet interrupt enable */ |
#define USBINTR_TIMEOUT BIT0 /* Timeout/CRC error enable */ |
#define USBPORTSC_CCS BIT0 /* Current Connect Status ("device present") */ |
#define USBPORTSC_LSDA BIT8 /* Low Speed Device Attached */ |
#define USBPORTSC_PEDC BIT3 /* Port Enable / Disable Change */ |
#define USBSTS_HCPE BIT4 /* Host Controller Process Error - the scripts were buggy */ |
#define USBSTS_HSE BIT3 /* Host System Error - basically PCI problems */ |
typedef struct _MEMORY_MANAGE_HEADER MEMORY_MANAGE_HEADER |
EFI_STATUS AllocateTDorQHStruct | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT32 | Size, | ||
OUT VOID ** | PtrStruct | ||
) |
EFI_STATUS AllocMemInMemoryBlock | ( | IN MEMORY_MANAGE_HEADER * | MemoryHeader, |
OUT VOID ** | Pool, | ||
IN UINTN | NumberOfMemoryUnit | ||
) |
Alloc Memory In MemoryBlock.
MemoryHeader | The pointer to memory manage header. |
Pool | Buffer pointer to store the buffer pointer. |
NumberOfMemoryUnit | The size of the pool to be allocated. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_SUCCESS | Success. |
VOID ClearStatusReg | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT32 | StatusAddr | ||
) |
EFI_STATUS CreateFrameList | ( | USB_UHC_DEV * | UhcDev | ) |
EFI_STATUS CreateMemoryBlock | ( | IN USB_UHC_DEV * | UhcDev, |
OUT MEMORY_MANAGE_HEADER ** | MemoryHeader, | ||
IN UINTN | MemoryBlockSizeInPages | ||
) |
Create Memory Block.
UhcDev | The UCHI device. |
MemoryHeader | The Pointer to allocated memory block. |
MemoryBlockSizeInPages | The page size of memory block to be allocated. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_SUCCESS | Success. |
EFI_STATUS CreateQH | ( | IN USB_UHC_DEV * | UhcDev, |
OUT QH_STRUCT ** | PtrQH | ||
) |
EFI_STATUS CreateStatusTD | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT8 | DevAddr, | ||
IN UINT8 | Endpoint, | ||
IN UINT8 | PktID, | ||
IN UINT8 | DeviceSpeed, | ||
OUT TD_STRUCT ** | PtrTD | ||
) |
EFI_STATUS CreateTD | ( | IN USB_UHC_DEV * | UhcDev, |
OUT TD_STRUCT ** | PtrTD | ||
) |
VOID DeleteQueuedTDs | ( | IN USB_UHC_DEV * | UhcDev, |
IN TD_STRUCT * | PtrFirstTD | ||
) |
EFI_STATUS ExecBulkTransfer | ( | IN USB_UHC_DEV * | UhcDev, |
IN TD_STRUCT * | PtrTD, | ||
IN OUT UINTN * | ActualLen, | ||
IN UINT8 * | DataToggle, | ||
IN UINTN | TimeOut, | ||
OUT UINT32 * | TransferResult | ||
) |
Execute Bulk Transfer.
UhcDev | The UCHI device. |
PtrTD | A pointer to TD_STRUCT data. |
ActualLen | Actual transfer Length. |
DataToggle | DataToggle value. |
TimeOut | TimeOut value. |
TransferResult | Transfer Result. |
EFI_STATUS ExecuteControlTransfer | ( | IN USB_UHC_DEV * | UhcDev, |
IN TD_STRUCT * | PtrTD, | ||
OUT UINTN * | ActualLen, | ||
IN UINTN | TimeOut, | ||
OUT UINT32 * | TransferResult | ||
) |
Execute Control Transfer.
UhcDev | The UCHI device. |
PtrTD | A pointer to TD_STRUCT data. |
ActualLen | Actual transfer Length. |
TimeOut | TimeOut value. |
TransferResult | Transfer Result. |
EFI_STATUS GenDataTD | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT8 | DevAddr, | ||
IN UINT8 | Endpoint, | ||
IN UINT8 * | PtrData, | ||
IN UINT8 * | DataPhy, | ||
IN UINT8 | Len, | ||
IN UINT8 | PktID, | ||
IN UINT8 | Toggle, | ||
IN UINT8 | DeviceSpeed, | ||
OUT TD_STRUCT ** | PtrTD | ||
) |
Generate Data Stage TD.
UhcDev | The UHCI device. |
DevAddr | Device address. |
Endpoint | Endpoint number. |
PtrData | CPU memory address of user data buffer to transfer. |
DataPhy | PCI memory address of user data buffer to transfer. |
Len | Data length. |
PktID | PacketID. |
Toggle | Data toggle value. |
DeviceSpeed | Device Speed. |
PtrTD | TD_STRUCT generated. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resource. |
EFI_STATUS GenSetupStageTD | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT8 | DevAddr, | ||
IN UINT8 | Endpoint, | ||
IN UINT8 | DeviceSpeed, | ||
IN UINT8 * | DevRequest, | ||
IN UINT8 * | RequestPhy, | ||
IN UINT8 | RequestLen, | ||
OUT TD_STRUCT ** | PtrTD | ||
) |
Generate Setup Stage TD.
UhcDev | The UHCI device. |
DevAddr | Device address. |
Endpoint | Endpoint number. |
DeviceSpeed | Device Speed. |
DevRequest | CPU memory address of request structure buffer to transfer. |
RequestPhy | PCI memory address of request structure buffer to transfer. |
RequestLen | Request length. |
PtrTD | TD_STRUCT generated. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resource. |
EFI_STATUS InitializeMemoryManagement | ( | IN USB_UHC_DEV * | UhcDev | ) |
EFI_STATUS InitializeUsbHC | ( | IN USB_UHC_DEV * | UhcDev | ) |
VOID InsertMemoryHeaderToList | ( | IN MEMORY_MANAGE_HEADER * | MemoryHeader, |
IN MEMORY_MANAGE_HEADER * | NewMemoryHeader | ||
) |
EFI_STATUS IoMmuAllocateBuffer | ( | IN EDKII_IOMMU_PPI * | IoMmu, |
IN UINTN | Pages, | ||
OUT VOID ** | HostAddress, | ||
OUT EFI_PHYSICAL_ADDRESS * | DeviceAddress, | ||
OUT VOID ** | Mapping | ||
) |
Allocates pages that are suitable for an OperationBusMasterCommonBuffer or OperationBusMasterCommonBuffer64 mapping.
IoMmu | Pointer to IOMMU PPI. |
Pages | The number of pages to allocate. |
HostAddress | A pointer to store the base system memory address of the allocated range. |
DeviceAddress | The resulting map address for the bus master PCI controller to use to access the hosts HostAddress. |
Mapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | The requested memory pages were allocated. |
EFI_UNSUPPORTED | Attributes is unsupported. The only legal attribute bits are MEMORY_WRITE_COMBINE and MEMORY_CACHED. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_OUT_OF_RESOURCES | The memory pages could not be allocated. |
VOID IoMmuInit | ( | OUT EDKII_IOMMU_PPI ** | IoMmu | ) |
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 | ||
) |
Provides the controller-specific addresses required to access system memory from a DMA bus master.
IoMmu | Pointer to IOMMU PPI. |
Operation | Indicates if the bus master is going to read or write to system memory. |
HostAddress | The system memory address to map to the PCI controller. |
NumberOfBytes | On input the number of bytes to map. On output the number of bytes that were mapped. |
DeviceAddress | The resulting map address for the bus master PCI controller to use to access the hosts HostAddress. |
Mapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | The range was mapped for the returned NumberOfBytes. |
EFI_UNSUPPORTED | The HostAddress cannot be mapped as a common buffer. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
EFI_DEVICE_ERROR | The system hardware could not map the requested address. |
VOID IoMmuUnmap | ( | IN EDKII_IOMMU_PPI * | IoMmu, |
IN VOID * | Mapping | ||
) |
BOOLEAN IsStatusOK | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT32 | StatusRegAddr | ||
) |
VOID SetFrameListBaseAddress | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT32 | FrameListRegAddr, | ||
IN UINT32 | Addr | ||
) |
Set the beginning address of the data buffer that will be used during the transaction.
PtrTDStruct | Place to store TD_STRUCT pointer. |
EFI_STATUS UhcAllocatePool | ( | IN USB_UHC_DEV * | UhcDev, |
OUT UINT8 ** | Pool, | ||
IN UINTN | AllocSize | ||
) |
EFI_STATUS EFIAPI UhcBulkTransfer | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | DeviceAddress, | ||
IN UINT8 | EndPointAddress, | ||
IN UINT8 | MaximumPacketLength, | ||
IN OUT VOID * | Data, | ||
IN OUT UINTN * | DataLength, | ||
IN OUT UINT8 * | DataToggle, | ||
IN UINTN | TimeOut, | ||
OUT UINT32 * | TransferResult | ||
) |
Submits bulk transfer to a bulk endpoint of a USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction in bit 7. |
MaximumPacketLength | Maximum packet size the endpoint is capable of sending or receiving. |
Data | Array of pointers to the buffers of data to transmit from or receive into. |
DataLength | The lenght of the data buffer. |
DataToggle | On input, the initial data toggle for the transfer; On output, it is updated to to next data toggle to use of the subsequent bulk transfer. |
TimeOut | Indicates the maximum time, in millisecond, which the transfer is allowed to complete. |
TransferResult | A pointer to the detailed result information of the bulk transfer. |
EFI_SUCCESS | The transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resource. |
EFI_INVALID_PARAMETER | Parameters are invalid. |
EFI_TIMEOUT | The transfer failed due to timeout. |
EFI_DEVICE_ERROR | The transfer failed due to host controller error. |
Submits bulk transfer to a bulk endpoint of a USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction in bit 7. |
MaximumPacketLength | Maximum packet size the endpoint is capable of sending or receiving. |
Data | Array of pointers to the buffers of data to transmit from or receive into. |
DataLength | The lenght of the data buffer. |
DataToggle | On input, the initial data toggle for the transfer; On output, it is updated to to next data toggle to use of the subsequent bulk transfer. |
TimeOut | Indicates the maximum time, in millisecond, which the transfer is allowed to complete. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned. |
TransferResult | A pointer to the detailed result information of the bulk transfer. |
EFI_SUCCESS | The transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resource. |
EFI_INVALID_PARAMETER | Parameters are invalid. |
EFI_TIMEOUT | The transfer failed due to timeout. |
EFI_DEVICE_ERROR | The transfer failed due to host controller error. |
EFI_STATUS EFIAPI UhcClearRootHubPortFeature | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | PortNumber, | ||
IN EFI_USB_PORT_FEATURE | PortFeature | ||
) |
Clears a feature for the specified root hub port.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI. |
PortNumber | Specifies the root hub port whose feature is requested to be cleared. |
PortFeature | Indicates the feature selector associated with the feature clear request. |
EFI_SUCCESS | The feature specified by PortFeature was cleared for the USB root hub port specified by PortNumber. |
EFI_INVALID_PARAMETER | PortNumber is invalid or PortFeature is invalid. |
EFI_STATUS EFIAPI UhcControlTransfer | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | DeviceAddress, | ||
IN UINT8 | DeviceSpeed, | ||
IN UINT8 | MaximumPacketLength, | ||
IN EFI_USB_DEVICE_REQUEST * | Request, | ||
IN EFI_USB_DATA_DIRECTION | TransferDirection, | ||
IN OUT VOID *Data | OPTIONAL, | ||
IN OUT UINTN *DataLength | OPTIONAL, | ||
IN UINTN | TimeOut, | ||
OUT UINT32 * | TransferResult | ||
) |
Submits control transfer to a target USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI. |
DeviceAddress | The target device address. |
DeviceSpeed | Target device speed. |
MaximumPacketLength | Maximum packet size the default control transfer endpoint is capable of sending or receiving. |
Request | USB device request to send. |
TransferDirection | Specifies the data direction for the data stage. |
Data | Data buffer to be transmitted or received from USB device. |
DataLength | The size (in bytes) of the data buffer. |
TimeOut | Indicates the maximum timeout, in millisecond. |
TransferResult | Return the result of this control transfer. |
EFI_SUCCESS | Transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resources. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
EFI_TIMEOUT | Transfer failed due to timeout. |
EFI_DEVICE_ERROR | Transfer failed due to host controller or device error. |
Submits control transfer to a target USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI. |
DeviceAddress | The target device address. |
DeviceSpeed | Target device speed. |
MaximumPacketLength | Maximum packet size the default control transfer endpoint is capable of sending or receiving. |
Request | USB device request to send. |
TransferDirection | Specifies the data direction for the data stage. |
Data | Data buffer to be transmitted or received from USB device. |
DataLength | The size (in bytes) of the data buffer. |
TimeOut | Indicates the maximum timeout, in millisecond. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned. |
TransferResult | Return the result of this control transfer. |
EFI_SUCCESS | Transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resources. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
EFI_TIMEOUT | Transfer failed due to timeout. |
EFI_DEVICE_ERROR | Transfer failed due to host controller or device error. |
VOID UhcFreePool | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT8 * | Pool, | ||
IN UINTN | AllocSize | ||
) |
EFI_STATUS EFIAPI UhcGetRootHubPortNumber | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB_HOST_CONTROLLER_PPI * | This, | ||
OUT UINT8 * | PortNumber | ||
) |
Retrieves the number of root hub ports.
[in] | PeiServices | The pointer to the PEI Services Table. |
[in] | This | The pointer to this instance of the PEI_USB_HOST_CONTROLLER_PPI. |
[out] | PortNumber | The pointer to the number of the root hub ports. |
EFI_SUCCESS | The port number was retrieved successfully. |
EFI_INVALID_PARAMETER | PortNumber is NULL. |
EFI_STATUS EFIAPI UhcGetRootHubPortStatus | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | PortNumber, | ||
OUT EFI_USB_PORT_STATUS * | PortStatus | ||
) |
Retrieves the current status of a USB root hub port.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI. |
PortNumber | The root hub port to retrieve the state from. |
PortStatus | Variable to receive the port state. |
EFI_SUCCESS | The status of the USB root hub port specified. by PortNumber was returned in PortStatus. |
EFI_INVALID_PARAMETER | PortNumber is invalid. |
EFI_STATUS UhciMapUserData | ( | IN USB_UHC_DEV * | Uhc, |
IN EFI_USB_DATA_DIRECTION | Direction, | ||
IN VOID * | Data, | ||
IN OUT UINTN * | Len, | ||
OUT UINT8 * | PktId, | ||
OUT UINT8 ** | MappedAddr, | ||
OUT VOID ** | Map | ||
) |
Map address of user data buffer.
Uhc | The UHCI device. |
Direction | Direction of the data transfer. |
Data | The user data buffer. |
Len | Length of the user data. |
PktId | Packet identificaion. |
MappedAddr | Mapped address to return. |
Map | Identificaion of this mapping to return. |
EFI_STATUS UhciMapUserRequest | ( | IN USB_UHC_DEV * | Uhc, |
IN OUT VOID * | Request, | ||
OUT UINT8 ** | MappedAddr, | ||
OUT VOID ** | Map | ||
) |
Map address of request structure buffer.
Uhc | The UHCI device. |
Request | The user request buffer. |
MappedAddr | Mapped address of request. |
Map | Identificaion of this mapping to return. |
EFI_STATUS EFIAPI UhcSetRootHubPortFeature | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | PortNumber, | ||
IN EFI_USB_PORT_FEATURE | PortFeature | ||
) |
Sets a feature for the specified root hub port.
PeiServices | The pointer of EFI_PEI_SERVICES |
This | The pointer of PEI_USB_HOST_CONTROLLER_PPI |
PortNumber | Root hub port to set. |
PortFeature | Feature to set. |
EFI_SUCCESS | The feature specified by PortFeature was set. |
EFI_INVALID_PARAMETER | PortNumber is invalid or PortFeature is invalid. |
EFI_TIMEOUT | The time out occurred. |
UINT16 USBReadPortW | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT32 | Port | ||
) |
VOID USBWritePortDW | ( | IN USB_UHC_DEV * | UhcDev, |
IN UINT32 | Port, | ||
IN UINT32 | Data | ||
) |