/** @file\r
\r
+ This file contains the definination for host controller register operation routines.\r
+\r
Copyright (c) 2007, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- EhciReg.h\r
-\r
-Abstract:\r
-\r
- This file contains the definination for host controller register operation routines\r
-\r
-Revision History\r
-\r
**/\r
\r
#ifndef _EFI_EHCI_REG_H_\r
#define _EFI_EHCI_REG_H_\r
\r
\r
-enum {\r
+typedef enum {\r
//\r
// Capability register offset\r
//\r
EHC_PCI_CLASSC = 0x09,\r
EHC_PCI_CLASSC_PI = 0x20,\r
EHC_BAR_INDEX = 0 /* how many bytes away from USB_BASE to 0x10 */\r
-};\r
+}EHCI_REGISTER_OFFSET;\r
\r
#define EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0)\r
\r
} USB_CLASSC;\r
#pragma pack()\r
\r
+/**\r
+ Read EHCI capability register.\r
+\r
+ @param Ehc The EHCI device.\r
+ @param Offset Capability register address.\r
+\r
+ @return The register content.\r
\r
+**/\r
UINT32\r
EhcReadCapRegister (\r
IN USB2_HC_DEV *Ehc,\r
IN UINT32 Offset\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Read EHCI capability register\r
-\r
-Arguments:\r
-\r
- Ehc - The Ehc device\r
- Offset - Capability register address\r
-\r
-Returns:\r
-\r
- The register content read\r
-\r
---*/\r
;\r
\r
\r
/**\r
- Read Ehc Operation register\r
+ Read EHCI Operation register.\r
\r
- @param Ehc The EHCI device\r
- @param Offset The operation register offset\r
+ @param Ehc The EHCI device.\r
+ @param Offset The operation register offset.\r
\r
- @return The register content read\r
+ @return The register content.\r
\r
**/\r
UINT32\r
\r
\r
/**\r
- Write the data to the EHCI operation register\r
+ Write the data to the EHCI operation register.\r
\r
- @param Ehc The EHCI device\r
- @param Offset EHCI operation register offset\r
- @param Data The data to write\r
+ @param Ehc The EHCI device.\r
+ @param Offset EHCI operation register offset.\r
+ @param Data The data to write.\r
\r
- @return None\r
+ @return None.\r
\r
**/\r
VOID\r
\r
/**\r
Add support for UEFI Over Legacy (UoL) feature, stop\r
- the legacy USB SMI support\r
+ the legacy USB SMI support.\r
\r
@param Ehc The EHCI device.\r
\r
- @return None\r
+ @return None.\r
\r
**/\r
VOID\r
Set door bell and wait it to be ACKed by host controller.\r
This function is used to synchronize with the hardware.\r
\r
- @param Ehc The EHCI device\r
- @param Timeout The time to wait before abort (in millisecond, ms)\r
+ @param Ehc The EHCI device.\r
+ @param Timeout The time to wait before abort (in millisecond, ms).\r
\r
- @return EFI_SUCCESS : Synchronized with the hardware\r
- @return EFI_TIMEOUT : Time out happened while waiting door bell to set\r
+ @retval EFI_SUCCESS Synchronized with the hardware.\r
+ @retval EFI_TIMEOUT Time out happened while waiting door bell to set.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
- Clear all the interrutp status bits, these bits\r
- are Write-Clean\r
+ Clear all the interrutp status bits, these bits are Write-Clean.\r
\r
- @param Ehc The EHCI device\r
+ @param Ehc The EHCI device.\r
\r
- @return None\r
+ @return None.\r
\r
**/\r
VOID\r
\r
\r
/**\r
- Whether Ehc is halted\r
+ Whether Ehc is halted.\r
\r
- @param Ehc The EHCI device\r
+ @param Ehc The EHCI device.\r
\r
- @return TRUE : The controller is halted\r
- @return FALSE : It isn't halted\r
+ @retval TRUE The controller is halted.\r
+ @retval FALSE It isn't halted.\r
\r
**/\r
BOOLEAN\r
\r
\r
/**\r
- Whether system error occurred\r
+ Whether system error occurred.\r
\r
- @param Ehc The EHCI device\r
+ @param Ehc The EHCI device.\r
\r
- @return TRUE : System error happened\r
- @return FALSE : No system error\r
+ @retval TRUE System error happened.\r
+ @retval FALSE No system error.\r
\r
**/\r
BOOLEAN\r
;\r
\r
\r
-\r
/**\r
- Reset the host controller\r
+ Reset the host controller.\r
\r
- @param Ehc The EHCI device\r
- @param Timeout Time to wait before abort (in millisecond, ms)\r
+ @param Ehc The EHCI device.\r
+ @param Timeout Time to wait before abort (in millisecond, ms).\r
\r
- @return EFI_SUCCESS : The host controller is reset\r
- @return Others : Failed to reset the host\r
+ @retval EFI_SUCCESS The host controller is reset.\r
+ @return Others Failed to reset the host.\r
\r
**/\r
EFI_STATUS\r
;\r
\r
\r
-\r
/**\r
- Halt the host controller\r
+ Halt the host controller.\r
\r
- @param Ehc The EHCI device\r
- @param Timeout Time to wait before abort\r
+ @param Ehc The EHCI device.\r
+ @param Timeout Time to wait before abort.\r
\r
- @return EFI_SUCCESS : The EHCI is halt\r
- @return EFI_TIMEOUT : Failed to halt the controller before Timeout\r
+ @return EFI_SUCCESS The EHCI is halt.\r
+ @return EFI_TIMEOUT Failed to halt the controller before Timeout.\r
\r
**/\r
EFI_STATUS\r
;\r
\r
\r
-\r
/**\r
- Set the EHCI to run\r
+ Set the EHCI to run.\r
\r
- @param Ehc The EHCI device\r
- @param Timeout Time to wait before abort\r
+ @param Ehc The EHCI device.\r
+ @param Timeout Time to wait before abort.\r
\r
- @return EFI_SUCCESS : The EHCI is running\r
- @return Others : Failed to set the EHCI to run\r
+ @return EFI_SUCCESS The EHCI is running.\r
+ @return Others Failed to set the EHCI to run.\r
\r
**/\r
EFI_STATUS\r
\r
/**\r
Initialize the HC hardware.\r
- EHCI spec lists the five things to do to initialize the hardware\r
+ EHCI spec lists the five things to do to initialize the hardware:\r
1. Program CTRLDSSEGMENT\r
2. Set USBINTR to enable interrupts\r
3. Set periodic list base\r
4. Set USBCMD, interrupt threshold, frame list size etc\r
5. Write 1 to CONFIGFLAG to route all ports to EHCI\r
\r
- @param Ehc The EHCI device\r
+ @param Ehc The EHCI device.\r
\r
- @return EFI_SUCCESS : The EHCI has come out of halt state\r
- @return EFI_TIMEOUT : Time out happened\r
+ @return EFI_SUCCESS The EHCI has come out of halt state.\r
+ @return EFI_TIMEOUT Time out happened.\r
\r
**/\r
EFI_STATUS\r