TianoCore EDK2 master
|
#include "EhcPeim.h"
Go to the source code of this file.
Variables | |
USB_PORT_STATE_MAP | mUsbPortStateMap [] |
USB_PORT_STATE_MAP | mUsbPortChangeMap [] |
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EhcPeim.c.
VOID EhcAckAllInterrupt | ( | IN PEI_USB2_HC_DEV * | Ehc | ) |
EFI_STATUS EFIAPI EhcBulkTransfer | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | DeviceAddress, | ||
IN UINT8 | EndPointAddress, | ||
IN UINT8 | DeviceSpeed, | ||
IN UINTN | MaximumPacketLength, | ||
IN OUT VOID * | Data[EFI_USB_MAX_BULK_BUFFER_NUM], | ||
IN OUT UINTN * | DataLength, | ||
IN OUT UINT8 * | DataToggle, | ||
IN UINTN | TimeOut, | ||
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR * | Translator, | ||
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_USB2_HOST_CONTROLLER_PPI. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction in bit 7. |
DeviceSpeed | Device speed, Low speed device doesn't support bulk transfer. |
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. |
Translator | A pointr to the transaction translator data. |
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. |
VOID EhcClearOpRegBit | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS EFIAPI EhcClearRootHubPortFeature | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_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_USB2_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 EhcControlTransfer | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | DeviceAddress, | ||
IN UINT8 | DeviceSpeed, | ||
IN UINTN | MaximumPacketLength, | ||
IN EFI_USB_DEVICE_REQUEST * | Request, | ||
IN EFI_USB_DATA_DIRECTION | TransferDirection, | ||
IN OUT VOID * | Data, | ||
IN OUT UINTN * | DataLength, | ||
IN UINTN | TimeOut, | ||
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR * | Translator, | ||
OUT UINT32 * | TransferResult | ||
) |
Submits control transfer to a target USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB2_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. |
Translator | Transaction translator to be used by this device. |
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. |
EFI_STATUS EhcEnableAsyncSchd | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
EFI_STATUS EhcEnablePeriodSchd | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
Enable the periodic schedule then wait EHC to actually enable it.
Ehc | The EHCI device. |
Timeout | The time to wait before abort (in millisecond, ms). |
EFI_TIMEOUT | Time out happened while enabling periodic schedule. |
EFI_SUCCESS | The periodical schedule is enabled. |
EFI_STATUS EFIAPI EhcEndOfPei | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor, | ||
IN VOID * | Ppi | ||
) |
One notified function to stop the Host Controller at the end of PEI
[in] | PeiServices | Pointer to PEI Services Table. |
[in] | NotifyDescriptor | Pointer to the descriptor for the Notification event that caused this function to execute. |
[in] | Ppi | Pointer to the PPI data associated with this function. |
EFI_SUCCESS | The function completes successfully |
others |
EFI_STATUS EFIAPI EhcGetRootHubPortNumber | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_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_USB2_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 EhcGetRootHubPortStatus | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_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_USB2_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 EhcHaltHC | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
EFI_STATUS EhcInitHC | ( | IN PEI_USB2_HC_DEV * | Ehc | ) |
Initialize the HC hardware. EHCI spec lists the five things to do to initialize the hardware.
Ehc | The EHCI device. |
EFI_SUCCESS | The EHCI has come out of halt state. |
EFI_TIMEOUT | Time out happened. |
BOOLEAN EhcIsHalt | ( | IN PEI_USB2_HC_DEV * | Ehc | ) |
BOOLEAN EhcIsSysError | ( | IN PEI_USB2_HC_DEV * | Ehc | ) |
EFI_STATUS EFIAPI EhcPeimEntry | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
VOID EhcPowerOnAllPorts | ( | IN PEI_USB2_HC_DEV * | Ehc | ) |
UINT32 EhcReadCapRegister | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset | ||
) |
UINT32 EhcReadOpReg | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset | ||
) |
EFI_STATUS EhcResetHC | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
EFI_STATUS EhcRunHC | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
EFI_STATUS EhcSetAndWaitDoorBell | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
Set door bell and wait it to be ACKed by host controller. This function is used to synchronize with the hardware.
Ehc | The EHCI device. |
Timeout | The time to wait before abort (in millisecond, ms). |
EFI_TIMEOUT | Time out happened while waiting door bell to set. |
EFI_SUCCESS | Synchronized with the hardware. |
VOID EhcSetOpRegBit | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS EFIAPI EhcSetRootHubPortFeature | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_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_USB2_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. |
EFI_STATUS EhcWaitOpRegBit | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit, | ||
IN BOOLEAN | WaitToSet, | ||
IN UINT32 | Timeout | ||
) |
Wait the operation register's bit as specified by Bit to become set (or clear).
Ehc | The EHCI device. |
Offset | The offset of the operational register. |
Bit | The bit mask of the register to wait for. |
WaitToSet | Wait the bit to set or clear. |
Timeout | The time to wait before abort (in millisecond). |
EFI_SUCCESS | The bit successfully changed by host controller. |
EFI_TIMEOUT | The time out occurred. |
VOID EhcWriteOpReg | ( | IN PEI_USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset, | ||
IN UINT32 | Data | ||
) |
EFI_STATUS InitializeUsbHC | ( | IN PEI_USB2_HC_DEV * | EhcDev | ) |
USB_PORT_STATE_MAP mUsbPortChangeMap[] |
USB_PORT_STATE_MAP mUsbPortStateMap[] |