EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions

MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c File Reference

#include "Ehci.h"

Go to the source code of this file.

Functions

UINT32 EhcReadCapRegister (IN USB2_HC_DEV *Ehc, IN UINT32 Offset)
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)
EFI_STATUS EhcWaitOpRegBit (IN USB2_HC_DEV *Ehc, IN UINT32 Offset, IN UINT32 Bit, IN BOOLEAN WaitToSet, IN UINT32 Timeout)
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)
EFI_STATUS EhcEnablePeriodSchd (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
EFI_STATUS EhcDisablePeriodSchd (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
EFI_STATUS EhcEnableAsyncSchd (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
EFI_STATUS EhcDisableAsyncSchd (IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
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)

Detailed Description

The EHCI register operation routines.

Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file EhciReg.c.


Function Documentation

VOID EhcAckAllInterrupt ( IN USB2_HC_DEV Ehc)

Clear all the interrutp status bits, these bits are Write-Clean.

Parameters:
EhcThe EHCI device.

Definition at line 305 of file EhciReg.c.

VOID EhcClearLegacySupport ( IN USB2_HC_DEV Ehc)

Add support for UEFI Over Legacy (UoL) feature, stop the legacy USB SMI support.

Parameters:
EhcThe EHCI device.

Definition at line 221 of file EhciReg.c.

VOID EhcClearOpRegBit ( IN USB2_HC_DEV Ehc,
IN UINT32  Offset,
IN UINT32  Bit 
)

Clear one bit of the operational register while keeping other bits.

Parameters:
EhcThe EHCI device.
OffsetThe offset of the operational register.
BitThe bit mask of the register to clear.

Definition at line 162 of file EhciReg.c.

EFI_STATUS EhcDisableAsyncSchd ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Disable asynchrounous schedule.

Parameters:
EhcThe EHCI device.
TimeoutTime to wait before abort (in millisecond, ms).
Return values:
EFI_SUCCESSThe asynchronous schedule is disabled.
Returns:
Others Failed to disable the asynchronous schedule.

Definition at line 402 of file EhciReg.c.

EFI_STATUS EhcDisablePeriodSchd ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Disable periodic schedule.

Parameters:
EhcThe EHCI device.
TimeoutTime to wait before abort (in millisecond, ms).
Return values:
EFI_SUCCESSPeriodic schedule is disabled.
EFI_DEVICE_ERRORFail to disable periodic schedule.

Definition at line 350 of file EhciReg.c.

EFI_STATUS EhcEnableAsyncSchd ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Enable asynchrounous schedule.

Parameters:
EhcThe EHCI device.
TimeoutTime to wait before abort.
Return values:
EFI_SUCCESSThe EHCI asynchronous schedule is enabled.
Returns:
Others Failed to enable the asynchronous scheudle.

Definition at line 376 of file EhciReg.c.

EFI_STATUS EhcEnablePeriodSchd ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Enable the periodic schedule then wait EHC to actually enable it.

Parameters:
EhcThe EHCI device.
TimeoutThe time to wait before abort (in millisecond, ms).
Return values:
EFI_SUCCESSThe periodical schedule is enabled.
EFI_TIMEOUTTime out happened while enabling periodic schedule.

Definition at line 325 of file EhciReg.c.

EFI_STATUS EhcHaltHC ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Halt the host controller.

Parameters:
EhcThe EHCI device.
TimeoutTime to wait before abort.
Return values:
EFI_SUCCESSThe EHCI is halt.
EFI_TIMEOUTFailed to halt the controller before Timeout.

Definition at line 499 of file EhciReg.c.

EFI_STATUS EhcInitHC ( IN USB2_HC_DEV Ehc)

Initialize the HC hardware. EHCI spec lists the five things to do to initialize the hardware: 1. Program CTRLDSSEGMENT 2. Set USBINTR to enable interrupts 3. Set periodic list base 4. Set USBCMD, interrupt threshold, frame list size etc 5. Write 1 to CONFIGFLAG to route all ports to EHCI

Parameters:
EhcThe EHCI device.
Returns:
EFI_SUCCESS The EHCI has come out of halt state.
EFI_TIMEOUT Time out happened.

Definition at line 552 of file EhciReg.c.

BOOLEAN EhcIsHalt ( IN USB2_HC_DEV Ehc)

Whether Ehc is halted.

Parameters:
EhcThe EHCI device.
Return values:
TRUEThe controller is halted.
FALSEIt isn't halted.

Definition at line 427 of file EhciReg.c.

BOOLEAN EhcIsSysError ( IN USB2_HC_DEV Ehc)

Whether system error occurred.

Parameters:
EhcThe EHCI device.
Returns:
TRUE System error happened.
FALSE No system error.

Definition at line 445 of file EhciReg.c.

UINT32 EhcReadCapRegister ( IN USB2_HC_DEV Ehc,
IN UINT32  Offset 
)

Read EHCI capability register.

Parameters:
EhcThe EHCI device.
OffsetCapability register address.
Returns:
The register content read.
Return values:
Iferr, return 0xffff.

Definition at line 31 of file EhciReg.c.

UINT32 EhcReadOpReg ( IN USB2_HC_DEV Ehc,
IN UINT32  Offset 
)

Read EHCI Operation register.

Parameters:
EhcThe EHCI device.
OffsetThe operation register offset.
Returns:
The register content read.
Return values:
Iferr, return 0xffff.

Definition at line 68 of file EhciReg.c.

EFI_STATUS EhcResetHC ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Reset the host controller.

Parameters:
EhcThe EHCI device.
TimeoutTime to wait before abort (in millisecond, ms).
Return values:
EFI_SUCCESSThe host controller is reset.
Returns:
Others Failed to reset the host.

Definition at line 464 of file EhciReg.c.

EFI_STATUS EhcRunHC ( IN USB2_HC_DEV Ehc,
IN UINT32  Timeout 
)

Set the EHCI to run.

Parameters:
EhcThe EHCI device.
TimeoutTime to wait before abort.
Return values:
EFI_SUCCESSThe EHCI is running.
Returns:
Others Failed to set the EHCI to run.

Definition at line 523 of file EhciReg.c.

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.

Parameters:
EhcThe EHCI device.
TimeoutThe time to wait before abort (in millisecond, ms).
Return values:
EFI_SUCCESSSynchronized with the hardware.
EFI_TIMEOUTTime out happened while waiting door bell to set.

Definition at line 271 of file EhciReg.c.

VOID EhcSetOpRegBit ( IN USB2_HC_DEV Ehc,
IN UINT32  Offset,
IN UINT32  Bit 
)

Set one bit of the operational register while keeping other bits.

Parameters:
EhcThe EHCI device.
OffsetThe offset of the operational register.
BitThe bit mask of the register to set.

Definition at line 139 of file EhciReg.c.

EFI_STATUS EhcWaitOpRegBit ( IN 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).

Parameters:
EhcThe EHCI device.
OffsetThe offset of the operation register.
BitThe bit of the register to wait for.
WaitToSetWait the bit to set or clear.
TimeoutThe time to wait before abort (in millisecond).
Return values:
EFI_SUCCESSThe bit successfully changed by host controller.
EFI_TIMEOUTThe time out occurred.

Definition at line 191 of file EhciReg.c.

VOID EhcWriteOpReg ( IN USB2_HC_DEV Ehc,
IN UINT32  Offset,
IN UINT32  Data 
)

Write the data to the EHCI operation register.

Parameters:
EhcThe EHCI device.
OffsetEHCI operation register offset.
DataThe data to write.

Definition at line 105 of file EhciReg.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines