TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | USB_PORT_STATE_MAP |
struct | USB_CLASSC |
Macros | |
#define | EHC_CAPLENGTH_OFFSET 0 |
#define | EHC_HCSPARAMS_OFFSET 0x04 |
#define | EHC_HCCPARAMS_OFFSET 0x08 |
#define | HCSP_NPORTS 0x0F |
#define | HCSP_PPC 0x10 |
#define | HCCP_64BIT 0x01 |
#define | EHC_USBCMD_OFFSET 0x0 |
#define | EHC_USBSTS_OFFSET 0x04 |
#define | EHC_USBINTR_OFFSET 0x08 |
#define | EHC_FRINDEX_OFFSET 0x0C |
#define | EHC_CTRLDSSEG_OFFSET 0x10 |
#define | EHC_FRAME_BASE_OFFSET 0x14 |
#define | EHC_ASYNC_HEAD_OFFSET 0x18 |
#define | EHC_CONFIG_FLAG_OFFSET 0x40 |
#define | EHC_PORT_STAT_OFFSET 0x44 |
#define | EHC_FRAME_LEN 1024 |
#define | CONFIGFLAG_ROUTE_EHC 0x01 |
#define | USBCMD_RUN 0x01 |
#define | USBCMD_RESET 0x02 |
#define | USBCMD_ENABLE_PERIOD 0x10 |
#define | USBCMD_ENABLE_ASYNC 0x20 |
#define | USBCMD_IAAD 0x40 |
#define | USBSTS_IAA 0x20 |
#define | USBSTS_PERIOD_ENABLED 0x4000 |
#define | USBSTS_ASYNC_ENABLED 0x8000 |
#define | USBSTS_HALT 0x1000 |
#define | USBSTS_SYS_ERROR 0x10 |
#define | USBSTS_INTACK_MASK 0x003F |
#define | PORTSC_CONN 0x01 |
#define | PORTSC_CONN_CHANGE 0x02 |
#define | PORTSC_ENABLED 0x04 |
#define | PORTSC_ENABLE_CHANGE 0x08 |
#define | PORTSC_OVERCUR 0x10 |
#define | PORTSC_OVERCUR_CHANGE 0x20 |
#define | PORSTSC_RESUME 0x40 |
#define | PORTSC_SUSPEND 0x80 |
#define | PORTSC_RESET 0x100 |
#define | PORTSC_LINESTATE_K 0x400 |
#define | PORTSC_LINESTATE_J 0x800 |
#define | PORTSC_POWER 0x1000 |
#define | PORTSC_OWNER 0x2000 |
#define | PORTSC_CHANGE_MASK 0x2A |
#define | EHC_BAR_INDEX 0 |
#define | EHC_DEBUG_PORT_CAP_ID 0x0A |
#define | EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0) |
#define | EHC_ADDR(High, QhHw32) ((VOID *) (UINTN) (LShiftU64 ((High), 32) | ((QhHw32) & 0xFFFFFFF0))) |
#define | EHCI_IS_DATAIN(EndpointAddr) EHC_BIT_IS_SET((EndpointAddr), 0x80) |
Functions | |
UINT32 | EhcReadCapRegister (IN USB2_HC_DEV *Ehc, IN UINT32 Offset) |
BOOLEAN | EhcIsDebugPortInUse (IN CONST USB2_HC_DEV *Ehc, IN CONST UINT8 *PortNumber OPTIONAL) |
UINT32 | EhcReadOpReg (IN USB2_HC_DEV *Ehc, IN UINT32 Offset) |
VOID | EhcWriteOpReg (IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Data) |
VOID | EhcSetOpRegBit (IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Bit) |
VOID | EhcClearOpRegBit (IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Bit) |
VOID | EhcClearLegacySupport (IN USB2_HC_DEV *Ehc) |
EFI_STATUS | EhcSetAndWaitDoorBell (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout) |
VOID | EhcAckAllInterrupt (IN USB2_HC_DEV *Ehc) |
BOOLEAN | EhcIsHalt (IN USB2_HC_DEV *Ehc) |
BOOLEAN | EhcIsSysError (IN USB2_HC_DEV *Ehc) |
EFI_STATUS | EhcResetHC (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout) |
EFI_STATUS | EhcHaltHC (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout) |
EFI_STATUS | EhcRunHC (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout) |
EFI_STATUS | EhcInitHC (IN USB2_HC_DEV *Ehc) |
This file contains the definination for host controller register operation routines.
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EhciReg.h.
#define EHCI_IS_DATAIN | ( | EndpointAddr | ) | EHC_BIT_IS_SET((EndpointAddr), 0x80) |
VOID EhcAckAllInterrupt | ( | IN USB2_HC_DEV * | Ehc | ) |
VOID EhcClearLegacySupport | ( | IN USB2_HC_DEV * | Ehc | ) |
VOID EhcClearOpRegBit | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS EhcHaltHC | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
Halt the host controller.
Ehc | The EHCI device. |
Timeout | Time to wait before abort. |
Halt the host controller.
Ehc | The EHCI device. |
Timeout | Time to wait before abort. |
EFI_SUCCESS | The EHCI is halt. |
EFI_TIMEOUT | Failed to halt the controller before Timeout. |
EFI_STATUS EhcInitHC | ( | IN USB2_HC_DEV * | Ehc | ) |
Initialize the HC hardware. EHCI spec lists the five things to do to initialize the hardware:
Ehc | The EHCI device. |
BOOLEAN EhcIsDebugPortInUse | ( | IN CONST USB2_HC_DEV * | Ehc, |
IN CONST UINT8 *PortNumber | OPTIONAL | ||
) |
Check whether the host controller has an in-use debug port.
[in] | Ehc | The Enhanced Host Controller to query. |
[in] | PortNumber | If PortNumber is not NULL, then query whether PortNumber is an in-use debug port on Ehc. (PortNumber is taken in UEFI notation, i.e., zero-based.) Otherwise, query whether Ehc has any in-use debug port. |
TRUE | PortNumber is an in-use debug port on Ehc (if PortNumber is not NULL), or some port on Ehc is an in-use debug port (otherwise). |
FALSE | PortNumber is not an in-use debug port on Ehc (if PortNumber is not NULL), or no port on Ehc is an in-use debug port (otherwise). |
BOOLEAN EhcIsHalt | ( | IN USB2_HC_DEV * | Ehc | ) |
BOOLEAN EhcIsSysError | ( | IN USB2_HC_DEV * | Ehc | ) |
UINT32 EhcReadCapRegister | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset | ||
) |
Read EHCI capability register.
Ehc | The EHCI device. |
Offset | Capability register address. |
Read EHCI capability register.
Ehc | The EHCI device. |
Offset | Capability register address. |
If | err, return 0xffff. |
UINT32 EhcReadOpReg | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset | ||
) |
Read EHCI Operation register.
Ehc | The EHCI device. |
Offset | The operation register offset. |
Read EHCI Operation register.
Ehc | The EHCI device. |
Offset | The operation register offset. |
If | err, return 0xffff. |
EFI_STATUS EhcResetHC | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
EFI_STATUS EhcRunHC | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Timeout | ||
) |
Set the EHCI to run.
Ehc | The EHCI device. |
Timeout | Time to wait before abort. |
Set the EHCI to run.
Ehc | The EHCI device. |
Timeout | Time to wait before abort. |
EFI_SUCCESS | The EHCI is running. |
EFI_STATUS EhcSetAndWaitDoorBell | ( | IN 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_SUCCESS | Synchronized with the hardware. |
EFI_TIMEOUT | Time out happened while waiting door bell to set. |
VOID EhcSetOpRegBit | ( | IN USB2_HC_DEV * | Ehc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |