American Megatrends, Inc.

USBRecoverySrc

Copyright

Release Notes

© American Megatrends, Inc.


USBRecoverySrc

AMIBIOS Document References

Previous Release Notes

Release Notes 25.htm

Built on 10:24:24 01/08/13


Release Notes - NDA Required

Component Information:
Component Title: USB Recovery Source
Component Reference Name: UsbRecovery
Component Type:eModule
Release Date: 2012-02-01
Source Control Label: 4.6.3_USB_RECOVERY_SRC_25
Source Control Location: SS: Alaska;$/Alaska:/Source/Modules/USBRecovery;
Driver Dependencies
USB
Protocol Dependencies
N0NE
File Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
This Aptio 4.x component is a collection of sub-systems (or module parts) that facilitate firmware recovery using USB mass storage devices that support the USB Bulk-Only Transport (BOT) protocol, such as USB Flash Drives. Usage is straightforward:
  • Simply copy the file specified by RECOVERY_ROM in the project's Buid\Token.mak file (you may need to rename the generated file to the one specified by RECOVERY_ROM) to the root drive of one of the supported USB devices, connect the device and use the power switch to power on the system. The USB Recovery module will search for the device and install a EFI_PEI_RECOVERY_BLOCK_IO_PPI interface. Then, the Recovery module will do the rest.
The following is a list of features supported by this component:
  • Supports the following USB host controller interfaces:
    • Universal Host Controller Interface (UHCI)
    • Open Host Controller Interface (OHCI)
    • Enhanced Host Controller Interface (EHCI)
    • eXtensible Host Controller Interface (xHCI)
  • Supports for USB Mass Storage Bulk-Only Transport (BOT) Protocol devices
  • Supports Microsoft FAT12/16 and 32 based file systems
  • Following are some of the device types that are supported:
    • USB CDROM
    • USB Flash Drive (USB 1.1 and USB 2.0)
    • USB ZIP Drive
    • USB MO Drive
    • USB Hard Disk Drive
Filename | Description
UsbRecovery
Main Component 		Root\Core\em\UsbRecovery
UsbRecovery.cif | Component information file for the eModule.
PeiUsbLib.c | This source file contains the generic USB recovery related routines
USBRecoverySrc.chm | Chm file of the emodule.
UsbRecov.sdl | This is the AMI SDL File for the USB Recovery module
UsbRecov.mak | This file contains the NMAKE scripts to build the USB Recovery module into the Aptio 4.x projects.
UsbPeim.h | This header file contains the global equates related to USB Recovery PEIM
HubPeim.h | This header file contains the global equates related to USB Recovery PEIM
PeiUsbLib.h | This header file contains the generic USB recovery related constants and type definitions
usb.h | This header file contains the generic USB related constants and type definitions
UsbPeimSrc ModulePart | Root\Core\em\UsbRecovery\UsbPeimSrc - This module part contains the source files for the generic USB device related routines
HubPeim.c | This source file contains the routines related to generic USB Hub initialization and handling.
UsbIoPeim.c | This source file contains the routines related to generic USB I/O PPI.
UsbPeim.c | This source file contains the routines related to generic USB device initialization and handling.
UsbIoPpi ModulePart | Root\Include\Ppi - USB I/O PPI related constant and type definitions.
UsbIo.h | This header file contains the USB I/O PPI related constant and type definitions.
UsbBotPeimSrc Source ModulePart | Root\Core\em\UsbRecovery\UsbBotPeimSrc - This module part contains the source and header files related to handling USB Mass Storage Bulk-Only Protocol based devices.
UsbBotPeim.dxs | This dependency file describes the dependency expression for the UsbBotPeim.ffs file.
BotPeim.c | This source file contains the routines related to USB BOT device handling.
BotPeim.h | This header file contains the constants and type definitions related to USB BOT device handling.
PeiAtapi.c | This source file contains the routines related to handling generic ATAPI commands.
UsbBotPeim.c | This source file contains the routines related to USB BOT PEIM initialization.
UsbBotPeim.h | This header file contains the constants and type definitions related to USB BOT PEIM initialization.
Atapi.h | This header file contains the generic ATAPI related constant and type definitions.
UhciPeiUsb ModulePart | Root\Core\em\UsbRecovery\UhciPeiUsb - This module part contains the source files to support UHCI based USB host controllers.
UhciPeiUsb.C | This source file contains the routines related to UHCI Controller initialization and installation of the EFI_PEI_USB_CONTROLLER_PPI interface.
UsbHCPpi ModulePart | Root\Include\Ppi - This module part contains the source files to support UHCI based USB host controllers.
PeiGetUCtrl.h | This header file contains the generic UHCI related constant and type definitions.
UhcPeimSrc ModulePart | Root\Core\em\UsbRecovery\UhcPeimSrc - This module part contains the source files for the generic USB Host Controller related routines.
UhcPeim.c | This source file contains the routines related to UHCI Controller initialization and installation of the appropriate PEI_USB_HOST_CONTROLLER_PPI interface.
UhcPeim.h | This header file contains the constants and type definitions related to UHCI Controller initialization.
UsbHCPpi ModulePart | Root\Include\Ppi - This module part contains the source files for the generic USB Host Controller related routines.
UsbHostController.h | This header file contains the generic host controller related constant and type definitions. This file also contains the PPI definitions related to USB HC support. This file is used by OHCI and UHCI host controllers.
OhciPei ModulePart | Root\Core\em\UsbRecovery\OhciPei - This module part contains the source files to support OHCI based USB host controllers.
OhciPei.c | This source file contains the routines related to OHCI Controller initialization and install the PEI_USB_HOST_CONTROLLER_PPI interface..
OhciPeiBoard.c | This source file contains platform-specific code that may need to be ported. OhciPeiBoardInit() is called early, before generic OHCI initialization, and is typically used for platform-specific PCI and/or MMIO region initialization.
OhciPei.h | This header file contains the constants and type definitions related to OHCI Controller initialization.
OHCI PPI ModulePart | Root\INCLUDE\PPI - This file also contains the PPI definitions related to OHCI support
OhciPpi.h | This header file contains the generic OHCI related constant and type definitions.
EhciPei ModulePart | Root\Core\em\UsbRecovery\EhciPei - This module part contains the source files to support EHCI based USB host controllers.
EhciPei.c | This source file contains the routines related to EHCI Controller initialization, as well as the implementation and and installation of the PEI_USB_HOST_CONTROLLER_PPI interface.
EhciPeiBoard.c | This source file contains platform-specific code that may need to be ported. EhciPeiBoardInit() is called early, before generic EHCI initialization, and is typically used to make EHCI controller accessible on the PCI bus. If the EHCI controller is behind the bridge(s), they might require some programming to enable access to the EHCI controller. Also, any chipset or platform specific workarounds related to the EHCI controller initialization can be applied here.
EhciPei.h | This header file contains the constants and type definitions related to EHCI Controller.
BIOS Parameters:
Parameter Name | Type | Description
UsbRecov_SUPPORT | Boolean | Main switch to enable UsbRecovery support in Project
PEI_UHCI_SUPPORT | Boolean | Main switch to enable UHCI Controller support for USB recovery
PEI_OHCI_SUPPORT | Boolean | Main switch to enable OhciPei support in Projec
PEI_EHCI_SUPPORT | Boolean | Main switch to enable EhciPei support in Project
PEI_XHCI_SUPPORT | Boolean | Main switch to enable XhciPei support in Project
PEI_UHCI_IOBASE | Integer | IO Base Address for UHCI Controller during PEI phase
PEI_UHCI_PCI_DEVICES | Expression | List of supported UHCI controllers in the following format: {devfunc1, devfunc2,...,devfuncN}\devfunc represents the location of UHCI controller on PCI bus: dev = Bus << 24 + Dev << 16 + Func << 8. Value followed by dev is the PCI device interface, for UHCI it must be 0.\Note: number of entries {devfunc} must not be less than a number of supported UHCI controllers specified in USB_UHCI token.
PEI_UHCI_PCI_DEVICES | Expression | Default value if not using UHCI controller
PEI_EHCI_PCI_BDFS | Expression | List of supported EHCI controllers in the following format: {devfunc1, devfunc2,...,devfuncN}\devfunc represents the location of EHCI controller on PCI bus: dev = Bus << 24 + Dev << 16 + Func << 8. Value followed by dev is the PCI device interface, for EHCI it must be 0.\Note: number of entries {devfunc} must not be less than a number of supported EHCI controllers specified in PEI_NUM_EHCI token.
PEI_EHCI_MEM_BASE_ADDRESSES | Expression | List of base addresses for the respective EHCI controllers specified by PEI_EHCI_PCI_BDFS
PEI_OHCI_IOBASE | Integer | Memory Mapped IO Base Address for first Recovery module OHCI Controller during PEI phase
PEI_XHCI_MMIOBASE | Integer | MMIO Base Address for first XHCI Controller during PEI phase
PEI_XHCI_CONTROLLER_PCI_ADDRESS | Expression | Default value if XHCI controllers are not supported
PEI_XHCI_CONTROLLER_PCI_REGISTER_VALUES | Expression | Enable PCIe slot by programming bridge with the secondary/subordinate bus number and memory window.\Information format (AccessWidth is decimal), with a comma at the end:\ {Bus, Device, Function, Register, AccessWidth, BitsToSet, BitsToClear},
FORCE_RECOVERY | Boolean | Force recovery execution by forcing BootMode = BOOT_IN_RECOVERY_MODE in SbPei.c
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_38, Dated: 2011-12-20
Visual eBios: RSS.5.72.0219, Dated: 2011-12-20
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
NONE
General Bug Fixes:
NONE
EIP addressed in this label:
  • EIP #60439 - Generically handle the assignments of MMIO base address from Rx and UsbRecovery modules.
Files changed for EIP fixes:
  • Root\Core\EM\UsbRecovery\EhciPEI\EhciPei.c (EIP #60439)
Known Limitations and Erratas in this label:
  • USB Devices that support USB Mass Storage Control-Bulk-Interrupt (CBI) Protocol are not supported.
  • The USB Recovery module has not been verified for platforms that contain the combination of different types of controllers.
  • UsbBotPeim.ffs should appear before Recovery.ffs in the list of FV_BB files in Token.mak.
  • Controllers/devices may require a full power off and at least one successful boot before attempting recovery. This issue is being investigated.
Remaining Issues:
NONE
Unit Testing:
NONE
Validation Test Report

Validation Test Report.
Release History:

4.6.3_USB_RECOVERY_SRC_25

  • EIP - 60439
    [Category] - Improvement
    [ Description] - Generically handle the assignments of MMIO base address from Rx and UsbRecovery modules.
    [Files] - EhciPei.c

4.6.3_USB_RECOVERY_SRC_24

  • EIP - 47931
    [Category] - Improvement
    [Description] - Added USB 3.0 hub support.
    [Files] - EhciPei.c, EhciPei.h, HubPeim.c, HubPeim.h, OhciPei.c, OhciPei.h, UhcPeim.c, UhcPeim.h, usb.h, UsbHostController.h,
    UsbIoPeim.c, UsbPeim.c, UsbPeim.h, XhciPei.c, XhciPei.h

  • EIP 57444
    [Category] - Improvement
    [Description]- PI1.1 Support.
    [Files]- OhciPeiboard.c,Xhcipei.c, Peiusblib.c

  • EIP 51517
    [Category] - Bug Fix
    [Severity] - Important
    [Symptom] - Recovery fails when using USB port behind HUB
    [RootCause] - Port Power was not set
    [Solution] - Set Port Power if Port Power Control bit is 1.
    [Files] - EHCIPEI.C

  • EIP 48013
    [Category] - Improvement
    [Description] - Use 32 or 64 byte Context data structures dynamically.
    [Files] - XhciPei.c, XhciPei.h

  • EIP 50311
    [Category] - New Feature
    [Description] - Multiple LUN device support added.
    [Files] - BotPeim.c, UsbBotPeim.c, UsbBotPeim.h

  • EIP 52191
    [Category] - Bug Fix
    [Severity] - Minor
    [Symptom] - Recovery from card reader causes "EHCI Time-Out".
    [RootCause] - The card reader returns zero length during BOT data transport, BIOS will do data transport again if the remain data length isn't zero, then CSW will be received in data transport phase.
    [Solution] - Added the code that check if the transfered length is less than expect length, break the loop.
    [Files] - BotPeim.c

USB Recovery test suite:
  • Platform 1:
    Motherboard - Intel Piketon CRB DH55HC
    BIOS - SS: Alaska;$/Alaska/Projects/Intel/Piketon/DH55HC, label (INT)4.6.5_DH55HC_13
    USB recovery mass storage devices:
    • KingstonDataTraveler G2 1.00 4GB (FAT32)
  • Platform 2:
    Motherboard - Intel Huron River mobile CRB
    BIOS - SS: Alaska;$/Alaska/Projects/Intel/SandyBridge/CougarPoint-M_HuronRiver_Crb_0ABUC, label 4.6.3.5_VeB_0ABUC_009
    USB recovery mass storage devices:
    • KingstonDataTraveler G2 1.00 4GB (FAT32)

4.6.3_USB_RECOVERY_SRC_23

  • EIP 46492
    [Category] - Bug Fix
    [Severity] - Important
    [Symptom] - TdSize variable should be declared as a 32bit integer instead of a 8bit one.
    [Files] - XhciPei.c

  • EIP 46147
    [Category] - Bug Fix
    [Files] - XhciPei.c

  • EIP 43687
    [Category]-IMPROVEMENT
    [Description]- Build warning from UsbRecovery driver - UsbHostController.obj : warning LNK4221: no public symbols found; archive member will be inaccessible.
    [Files]- uhcpeim.c, usbpeim.c, UsbHostcontroller.h
    UhcPeimSrc\UhcPeim.c
    UhcPeimSrc\UsbHostController.h
    UsbPeimSrc\UsbPeim.c
  • EHCIStopAsyncSchedule gets called always when the EHCIStartAsyncSchedule function is called.

    • 4.6.3_USB_RECOVERY_SRC_22

    • Added xHCI recovery support - EIP#39060
    New files:
    • XhciPei.c
    • XhciPei.h
    New SDL tokens:
    • PEI_XHCI_SUPPORT - enable/disable xHCI recovery support in the project
    • PEI_XHCI_MMIOBASE - MMIO Base Address for first XHCI Controller during PEI phase
    • PEI_XHCI_CONTROLLER_PCI_ADDRESS - PCI location of supported xHCI controllers. The following format is used to specify the location: ""{bus,dev,func},{bus,dev,func},..."
    • PEI_XHCI_CONTROLLER_PCI_REGISTER_VALUES - Sequence of PCI configuration modification to make XHCI controller available in PEI. Information format (AccessWidth is decimal) is "{Bus, Device, Function, Register, AccessWidth, BitsToSet, BitsToClear}, {Bus, Device, ...}," with a comma at the end.
    USB xHCI (USB3.0) Recovery test suite
      Case 1:
    • Motherboard - Intel Piketon CRB DH55HS
    • BIOS - SS: Alaska;$/Alaska/Projects/Intel/Piketon/DH55HC, label "Internal_Only_4.6.4.0_DH55HC_03"
    • USB3.0 xHCI controllers:
      • off-board PCIe x1 NEC card; controller chip D72020F1
      • off-board PCIe x1 FrescoLogic card; controller chip FL1000
      • off-board PCIe x1 Asmedia card; controller chip ASM1042
    • USB recovery mass storage devices:
      • USB3.0 SuperTalent 16GB key (FAT32)
      • USB2.0 Generic 256MB key (FAT16)
      • USB3.0 CyberSlim HDD enclosure(FAT32)

      Case 2:
    • Motherboard - Intel Huron River mobile CRB
    • BIOS - SS: Alaska;$/Alaska/Projects/Intel/SandyBridge/CougarPoint-M_HuronRiver_Crb_0ABUC, label "4.6.3.5_VeB_0ABUC_007"
    • USB3.0 xHCI controllers:
      • off-board PCIe x1 NEC card; controller chip D72020F1
      • off-board PCIe x1 FrescoLogic card; controller chip FL1000
      • off-board PCIe x1 Asmedia card; controller chip ASM1042
    • USB recovery mass storage devices:
      • USB3.0 SuperTalent 16GB key (FAT32)
      • USB2.0 Generic 256MB key (FAT16)
      • USB3.0 CyberSlim HDD enclosure(FAT32)

    4.6.3_USB_RECOVERY_SRC_21

    • EhciPei.c - EIP#34401 - DebugRx causes the system to hang in Recovery mode.
    • EhciPei.h
    • UsbHostController.c
    • HubPeim.c - EIP#34401 - DebugRx causes the system to hang in Recovery mode.

    4.6.3_USB_RECOVERY_SRC_20

    • UsbRecovery.sdl - The elink that adds the Usb Recovery FFS file into FV_BB has changed. The elink that adds the Usb Recovery FFS file into FV_BB has changed. - priority no longer defined - InvofeOrder now equal AfterParent

    4.6.3_USB_RECOVERY_SRC_19

    • PeiUsbLib.c - EIP#31987 - Added the generic USBRecovery Fix in the module.
    • usb.h
    • UhcPeim.c
    • HubPeim.c
    • UsbPeim.c - Fix for EIP32503: Changed the descriptior data parser.
    • BotPeim.c - EIP#31987 - Added the generic USBRecovery Fix in the module.
    • PeiAtapi.c
    • UsbBotPeim.c - Bugfixes found by Coverity tests: EIP34507.

    4.6.3_USB_RECOVERY_SRC_18

    • EhciPei.c - EIP#28255: EhciHcGetRootHubPortStatus returns proper status.
    • UsbPeim.c - EIP#28255: Set proper TransactionTranslator field for a non-hispeed USB device.
    • Usb.h - EIP#31475: Corrected the order of the enum constants in EFI_USB_DATA_DIRECTION. Green H Update patch V4

    4.6.3_USB_RECOVERY_SRC_17

    • Fix for EIP#22856:DVD-ROM Flash Test - Fail
    • Fix for EIP#24681:Recovery fails when a USB keyboard and USB flash drive are attached to the system
    Description:
    • Rootcause for both the issue(EIP22856,EIP24681) was USB HC state was not set to "STOP" state after loading the recovery capsule and HC status bits are not cleared. Modified files so HC is set to HALT state after loading recovery module so USB driver clears the status Registers.
    Changed Files:
    • core\em\UsbRecovery\EhciPEI\EhciPei.c
    • core\em\UsbRecovery\EhciPEI\EhciPei.h

    4.6.3_USB_RECOVERY_SRC_16

    • Removed unnecessary CLEAR_FEATURE (Reset) and SET_FEATURE (Enable) in the hub enumeration routine.
    • Added TransactionTranslator for slow/full speed devices behind USB2 hub.
    • Added IsPortHighSpeedDeviceAttached function.
    • EHCIStopAsyncSchedule gets called always when the EHCIStartAsyncSchedule function is called.

    4.6.3_USB_RECOVERY_SRC_15

    • Added EHCI controller support.
    Fixes/Changes:
    • Modified the definition and usage of MaxPacketSize of the Bulk endpoint. It was defined as UINT8, it is now changed to UINT16. The earlier UINT8 definition was good for USB1.1 endpoints that can not exceed 64 Bytes. This is no longer true for USB2.0 devices.

    4.6.3_USB_RECOVERY_SRC_14

    • Added EHCI-related fixes for issues that may occur if EHCI is used before USB Recovery is invoked:
      • Added SDL Tokens: PEI_EHCI_PCI_BDFS and PEI_EHCI_MEM_BASE_ADDRESSES (see Building the Module for more information).
    • Removed/modified some debugging development code:
      • Removed SDL Tokens: USBR_DEBUG_SUPPORT and USBR_SERIAL_PORT_AVAILABLE
      • Removed Elinks: UsbRecoveryDebug_DIR and $(BUILD_DIR)\UsbRecoveryDebugDxe.ffs
      • Modified SDL Token: FORCE_RECOVERY to default value of 0.

    4.6.3_USB_RECOVERY_SRC_13

    • Most porting is accomplished now in SDL, such that OhciPeiBoard.c should not need modified for most platforms,
    • PEI_OHCI_IOBASE SDL token is added to specify the first OHCI MMIO base address, and all other addresses are calculated from there,
    • PEI_OHCI_PCI_DEVICES token is replaced with the USBR_OHCI_CONTROLLER_PCI_ADDRESS eLink to specify OHCI controller device addresses,
    • USBR_OHCI_CONTROLLER_PCI_REGISTER_VALUE eLink is added to specify platform specific PCI configuration space register values for each controller specified by USBR_OHCI_CONTROLLER_PCI_ADDRESS,
    • Debugging code is smaller if a serial port is not available,
    • Added more function headers.
    New Features:
    • Added more debugging features and error messages,
    • The keyboard controller is used, if available, for interactive debugging, if the serial console is not available,
    • Port80 is now used more extensively to display debug information, which is useful for systems without serial port support.

    4.6.3_USB_RECOVERY_SRC_12

    • added more function headers,
    • removed code that will never be used (I.e., #if Bala ... #endif),
    • moved typedef, constants and extern declarations into header files,
    • now all controller blocks are enabled for the SB700 (EHCI controllers route to companion controller by default),
    • removed unused constants and typedefs n OhciPei.h (also reorganized the file to make it more readable),
    • renamed many functions/variables according to coding standard,
    • removed code initializing data structures for periodic lists, as this is not needed,
    • removed the CONTROLLER_TYPE SDL token to allow UHCI and OHCI controllers to supported simultaneously (this type of platform has not been tested) (modified MAKE files accordingly).
    New Features:
    • File-level debugging is now available,
    • AMI_USB_DEBUG_INTERFACE.WaitConsoleKey() now returns the key press so that conditional debugging can be dynamic (alphanumeric keys only).

    4.6.3_USB_RECOVERY_SRC_11

    • UsbBotPeim.ffs is now added to FV_BB firmware volume with InvokeOrder = BeforeParent and Priority = 0 so that it executes before Recovery.ffs, when all dependencies are equal (see respective *.dxs files).
    • removed INIT_LIST from the UsbBotPeim.ffs NMAKE command line to an fix issue with stack corruption when the code size is large,
    • removed unused code and reorganized build targets in UsbRecov.mak,
    • fixed build issue where the PCI address array was initialized with zero elements when OHCI support was enabled,
    • now using PEI_STALL_PPI interface for all delays, instead of local FixedDelay(),
    • OHCI support has been implemented and tested with AMD SB700.
    New Features:
    • added OhciPeiBoard.c for platform-specific code,
    • added USB Debug Interface:
      1. allows USB-specific debugging,
      2. installs as a PPI and Protocol,
      3. can be used by the USB module or the USB Recovery Module.

    4.6.3_USB_RECOVERY_SRC_06

    • Fixed erroneous initialization of UHCI controller due to the lack of dependency expression
    • Fixed UHCI reset timings as per AMI USB Device reset code
    • Corrected AMI Copyright headers for all files and updated AMI files with coding standards
    New Features:
    • Introduced UHCI Controller porting SDL tokens
    • Included USB Recovery as Source module

    © American Megatrends Inc.


USBRecoverySrc

AMIBIOS Document References

Previous Validation Test Reports

Validation Test Report 25.htm


Release Notes - NDA Required

Validation Test Report for Sdiodriver Label (INT)a4.6.3_USB_RECOVERY_SRC_25

Platform Information Form :

Board Information - Piketon
BIOS Information (Label, Path) - Label'0ABUT701'
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

1)Aptio 4.x UsbRecovery
REF-32309: DOS USB HDD Recovery Flash---- PASS
Status Update:

2)Build
REF-31549: N/A Test ROM Build---- PASS
Status Update:

3)Flash
REF-28837: Not OS Specific Ctrl + Home Flash from USB Floppy---U/T
Status Update:*** ROM image for SUT is 2MB which is too large for a floppy disk.

4)Flash
REF-28772: Not OS Specific DVD-ROM Flash---- PASS
Status Update:

5)USB
REF-31912: N/A USB 3.0 Recovery---- FAIL
Status Update:Unable able to flash recovery image via USB 3.0 PCIe adapter, USB 3.0 flash drive, USB 3.0 hard drive, and USB 3.0 Blu-Ray/DVD-ROM drive.

Platform Information Form :

Board Information - Emerald lake
BIOS Information (Label, Path) - Label'1APTJ313'',Path'$/Alaska/Projects/Intel/IvyBridge/PantherPoint_ChiefRiver_Crb_1APTJ/CheifRiver,Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

1)Aptio 4.x UsbRecovery
REF-32480: N/A BIOS recovery behind a USB 3.0 hub---- PASS
Status Update:

REF-32479: N/A BIOS recovery behind USB 2.0 hub---- PASS
Status Update:

REF-32477: N/A BIOS recovery via USB 2.0 card reader---- PASS
Status Update:

REF-32478: N/A BIOS recovery via USB 3.0 card reader---- FAIL
Status Update: *** Unable to perform recovery flash via media cards on USB 3.0 card reader. Device appears to not power on during recovery start process.

REF-32604: .N/A USB 2.0 DVD Drive Flash Recovery ---- PASS
Status Update:

REF-32563: N/A USB 2.0 Key Recovery Flash---- PASS
Status Update:

REF-32605:N/A USB 3.0 DVD Drive Flash Recovery---- PASS
Status Update:

REF-32564: N/A USB 3.0 HDD Recovery Flash---- PASS
Status Update:

REF-32565: N/A USB 3.0 Key Recovery Flash---- PASS
Status Update:

REF-32309: DOS USB HDD Recovery Flash---- PASS
Status Update:

2)Build
REF-31549: N/A Test ROM Build---- PASS
Status Update:

3)Flash
REF-28837: Not OS Specific Ctrl + Home Flash from USB Floppy---- U/T
Status Update: *** BIOS image larger than 1.44MB

Platform Information Form :

Board Information - AMD_DORY
BIOS Information (Label, Path) - Label'4.6.5.1_VEB_1AOUQ_013',Path'SS: Alaska;$/Alaska/Projects/AMD/AgesaV5/OrochiPI/Dory_1AOUQ/Dory.Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

1)Aptio 4.x UsbRecovery
REF-32480: N/A BIOS recovery behind a USB 3.0 hub----U/T
Status Update:*** Due to a limitation, this feature will not be tested at this time.

REF-32479: N/A BIOS recovery behind USB 2.0 hub---- FAIL
Status Update: *** USB key - Pass
*** USB DVD drive - Fail - Hangs on checkpoint F2
*** USB hard drive - Pass

REF-32477: N/A BIOS recovery via USB 2.0 card reader---- FAIL
Status Update: *** SD card - Fail - Hangs on checkpoint F2
*** CF card - Fail - Hangs on checkpoint F2
*** Memory Stick Pro card - Pass
*** SmartMedia card - Pass

REF-32478: N/A BIOS recovery via USB 3.0 card reader----U/T
Status Update:*** Due to a limitation, this feature will not be tested at this time.

REF-32564: EFI Boot to SD Card(EFI)---- U/T
Status Update:*** Due to a limitation, this feature will not be tested at this time.

REF-32563: N/A USB 3.0 Key Recovery Flash---- U/T
Status Update: *** Due to a limitation, this feature will not be tested at this time.

REF-32309: DOS USB HDD Recovery Flash---- PASS
Status Update:

REF-32565: N/A USB Key Recovery Flash---- PASS
Status Update:

2)Build
REF-31549: N/A Test ROM Build---- PASS
Status Update:

3)Flash
REF-28837: Not OS Specific Ctrl + Home Flash from USB Floppy---- U/T
Status Update:*** BIOS image is larger than 1.44M

REF-28772: Not OS Specific DVD-ROM Flash---- FAIL
Bug id - 75897 Status Update: *** Unable to perform BIOS recovery on USB 2.0 DVD drive behind a USB 2.0 hub, system hangs at checkpoint F2.

4)USB
REF-31912: N/A USB 3.0 Recovery---- U/T
Status Update: *** Due to a limitation, this feature will not be tested at this time.


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2012 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.


Release Notes - NDA Required

Component Information:
Component Title: USB Recovery Source
Component Reference Name: UsbRecovery
Component Type: eModule
Release Date: 2013-01-08
Source Control Label: 4.6.3_USB_RECOVERY_SRC_26
Source Control Location: SS: Alaska;$/Alaska:/Source/Modules/USBRecovery;
Dependencies
Component Dependencies
ONE
Dependent Component Title: USB
Dependent Component Reference Name: USB
Dependent Source Control Label: 4.6.3_USB_08.10.24
Dependent Source Control Location: SS: Alaska;$/Alaska/SOURCE/Modules/USB/Alaska;

File Dependencies
N0NE

Protocol Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
This Aptio 4.x component is a collection of sub-systems (or module parts) that facilitate firmware recovery using USB mass storage devices that support the USB Bulk-Only Transport (BOT) protocol, such as USB Flash Drives. Usage is straightforward:
  • Simply copy the file specified by RECOVERY_ROM in the project's Buid\Token.mak file (you may need to rename the generated file to the one specified by RECOVERY_ROM) to the root drive of one of the supported USB devices, connect the device and use the power switch to power on the system. The USB Recovery module will search for the device and install a EFI_PEI_RECOVERY_BLOCK_IO_PPI interface. Then, the Recovery module will do the rest.
The following is a list of features supported by this component:
  • Supports the following USB host controller interfaces:
    • Universal Host Controller Interface (UHCI)
    • Open Host Controller Interface (OHCI)
    • Enhanced Host Controller Interface (EHCI)
    • eXtensible Host Controller Interface (xHCI)
  • Supports for USB Mass Storage Bulk-Only Transport (BOT) Protocol devices
  • Supports Microsoft FAT12/16 and 32 based file systems
  • Following are some of the device types that are supported:
    • USB CDROM
    • USB Flash Drive (USB 1.1 and USB 2.0)
    • USB ZIP Drive
    • USB MO Drive
    • USB Hard Disk Drive
Filename | Description
UsbRecovery
Main Component 		Root\Core\em\UsbRecovery
UsbRecovery.cif | Component information file for the eModule.
PeiUsbLib.c | This source file contains the generic USB recovery related routines
USBRecoverySrc.chm | Chm file of the emodule.
UsbRecov.sdl | This is the AMI SDL File for the USB Recovery module
UsbRecov.mak | This file contains the NMAKE scripts to build the USB Recovery module into the Aptio 4.x projects.
UsbPeim.h | This header file contains the global equates related to USB Recovery PEIM
HubPeim.h | This header file contains the global equates related to USB Recovery PEIM
PeiUsbLib.h | This header file contains the generic USB recovery related constants and type definitions
usb.h | This header file contains the generic USB related constants and type definitions
UsbPeimSrc ModulePart | Root\Core\em\UsbRecovery\UsbPeimSrc - This module part contains the source files for the generic USB device related routines
HubPeim.c | This source file contains the routines related to generic USB Hub initialization and handling.
UsbIoPeim.c | This source file contains the routines related to generic USB I/O PPI.
UsbPeim.c | This source file contains the routines related to generic USB device initialization and handling.
UsbIoPpi ModulePart | Root\Include\Ppi - USB I/O PPI related constant and type definitions.
UsbIo.h | This header file contains the USB I/O PPI related constant and type definitions.
UsbBotPeimSrc Source ModulePart | Root\Core\em\UsbRecovery\UsbBotPeimSrc - This module part contains the source and header files related to handling USB Mass Storage Bulk-Only Protocol based devices.
UsbBotPeim.dxs | This dependency file describes the dependency expression for the UsbBotPeim.ffs file.
BotPeim.c | This source file contains the routines related to USB BOT device handling.
BotPeim.h | This header file contains the constants and type definitions related to USB BOT device handling.
PeiAtapi.c | This source file contains the routines related to handling generic ATAPI commands.
UsbBotPeim.c | This source file contains the routines related to USB BOT PEIM initialization.
UsbBotPeim.h | This header file contains the constants and type definitions related to USB BOT PEIM initialization.
Atapi.h | This header file contains the generic ATAPI related constant and type definitions.
UhciPeiUsb ModulePart | Root\Core\em\UsbRecovery\UhciPeiUsb - This module part contains the source files to support UHCI based USB host controllers.
UhciPeiUsb.C | This source file contains the routines related to UHCI Controller initialization and installation of the EFI_PEI_USB_CONTROLLER_PPI interface.
UsbHCPpi ModulePart | Root\Include\Ppi - This module part contains the source files to support UHCI based USB host controllers.
PeiGetUCtrl.h | This header file contains the generic UHCI related constant and type definitions.
UhcPeimSrc ModulePart | Root\Core\em\UsbRecovery\UhcPeimSrc - This module part contains the source files for the generic USB Host Controller related routines.
UhcPeim.c | This source file contains the routines related to UHCI Controller initialization and installation of the appropriate PEI_USB_HOST_CONTROLLER_PPI interface.
UhcPeim.h | This header file contains the constants and type definitions related to UHCI Controller initialization.
UsbHCPpi ModulePart | Root\Include\Ppi - This module part contains the source files for the generic USB Host Controller related routines.
UsbHostController.h | This header file contains the generic host controller related constant and type definitions. This file also contains the PPI definitions related to USB HC support. This file is used by OHCI and UHCI host controllers.
OhciPei ModulePart | Root\Core\em\UsbRecovery\OhciPei - This module part contains the source files to support OHCI based USB host controllers.
OhciPei.c | This source file contains the routines related to OHCI Controller initialization and install the PEI_USB_HOST_CONTROLLER_PPI interface..
OhciPeiBoard.c | This source file contains platform-specific code that may need to be ported. OhciPeiBoardInit() is called early, before generic OHCI initialization, and is typically used for platform-specific PCI and/or MMIO region initialization.
OhciPei.h | This header file contains the constants and type definitions related to OHCI Controller initialization.
OHCI PPI ModulePart | Root\INCLUDE\PPI - This file also contains the PPI definitions related to OHCI support
OhciPpi.h | This header file contains the generic OHCI related constant and type definitions.
EhciPei ModulePart | Root\Core\em\UsbRecovery\EhciPei - This module part contains the source files to support EHCI based USB host controllers.
EhciPei.c | This source file contains the routines related to EHCI Controller initialization, as well as the implementation and and installation of the PEI_USB_HOST_CONTROLLER_PPI interface.
EhciPeiBoard.c | This source file contains platform-specific code that may need to be ported. EhciPeiBoardInit() is called early, before generic EHCI initialization, and is typically used to make EHCI controller accessible on the PCI bus. If the EHCI controller is behind the bridge(s), they might require some programming to enable access to the EHCI controller. Also, any chipset or platform specific workarounds related to the EHCI controller initialization can be applied here.
EhciPei.h | This header file contains the constants and type definitions related to EHCI Controller.
BIOS Parameters:
Parameter Name | Type | Description
UsbRecov_SUPPORT | Boolean | Main switch to enable UsbRecovery support in Project
PEI_UHCI_SUPPORT | Boolean | Main switch to enable UHCI Controller support for USB recovery
PEI_OHCI_SUPPORT | Boolean | Main switch to enable OhciPei support in Projec
PEI_EHCI_SUPPORT | Boolean | Main switch to enable EhciPei support in Project
PEI_XHCI_SUPPORT | Boolean | Main switch to enable XhciPei support in Project
PEI_UHCI_IOBASE | Integer | IO Base Address for UHCI Controller during PEI phase
PEI_UHCI_PCI_DEVICES | Expression | List of supported UHCI controllers in the following format: {devfunc1, devfunc2,...,devfuncN}\devfunc represents the location of UHCI controller on PCI bus: dev = Bus << 24 + Dev << 16 + Func << 8. Value followed by dev is the PCI device interface, for UHCI it must be 0.\Note: number of entries {devfunc} must not be less than a number of supported UHCI controllers specified in USB_UHCI token.
PEI_UHCI_PCI_DEVICES | Expression | Default value if not using UHCI controller
PEI_EHCI_PCI_BDFS | Expression | List of supported EHCI controllers in the following format: {devfunc1, devfunc2,...,devfuncN}\devfunc represents the location of EHCI controller on PCI bus: dev = Bus << 24 + Dev << 16 + Func << 8. Value followed by dev is the PCI device interface, for EHCI it must be 0.\Note: number of entries {devfunc} must not be less than a number of supported EHCI controllers specified in PEI_NUM_EHCI token.
PEI_EHCI_MEM_BASE_ADDRESSES | Expression | List of base addresses for the respective EHCI controllers specified by PEI_EHCI_PCI_BDFS
PEI_OHCI_IOBASE | Integer | Memory Mapped IO Base Address for first Recovery module OHCI Controller during PEI phase
PEI_XHCI_MMIOBASE | Integer | MMIO Base Address for first XHCI Controller during PEI phase
PEI_XHCI_CONTROLLER_PCI_ADDRESS | Expression | Default value if XHCI controllers are not supported
PEI_XHCI_CONTROLLER_PCI_REGISTER_VALUES | Expression | Enable PCIe slot by programming bridge with the secondary/subordinate bus number and memory window.\Information format (AccessWidth is decimal), with a comma at the end:\ {Bus, Device, Function, Register, AccessWidth, BitsToSet, BitsToClear},
FORCE_RECOVERY | Boolean | Force recovery execution by forcing BootMode = BOOT_IN_RECOVERY_MODE in SbPei.c
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_40, Dated: 2012-06-21
Visual eBios: RSS.5.73.0239, Dated: 2012-06-21
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
NONE
General Bug Fixes and EIP Addressed in this Label:
General Bug Fixes
EIP #99922 - System hanged on CP:9C during USB Recovery from cold boot.
EIP #75547 - Xhci recovery funtion failed when SS devices on USB 3.0 port.

EIP Addressed
EIP #77332 - Implement pei loadfirmware.
EIP #75547 - Xhci recovery funtion failed when SS devices on USB 3.0 port.
EIP #99922 - System hanged on CP:9C during USB Recovery from cold boot.
EIP #97069 - Reset root port algorythm update.
EIP #103990 - Synchronized with USB PEI module 4.6.3_USB_08.10.24.
Files Changed for General Bug Fixes and EIP Addressed in this Label:
Root\Core\em\UsbRecovery\UsbRecov.mak (EIP #77332)
Root\Core\em\UsbRecovery\UsbPeim.h (EIP #103990)
Root\Core\em\UsbRecovery\HubPeim.h (EIP #103990)
Root\Core\em\UsbRecovery\PeiUsbLib.c (EIP #103990)
Root\Core\em\UsbRecovery\PeiUsbLib.h (EIP #103990)
Root\Core\em\UsbRecovery\usb.h (EIP #97069)
Root\Core\em\UsbRecovery\OhciPEI\OhciPei.c (EIP #103990, #97069)
Root\Core\em\UsbRecovery\OhciPEI\OhciPei.h (EIP #103990, #97069)
Root\Core\em\UsbRecovery\EhciPEI\EhciPei.c (EIP #103990, #97069, #99922)
Root\Core\em\UsbRecovery\EhciPEI\EhciPei.h (EIP #103990, #97069)
Root\Core\em\UsbRecovery\XhciPEI\XhciPei.c (EIP #103990, #75547)
Root\Core\em\UsbRecovery\XhciPEI\XhciPei.h (EIP #103990, #75547)
Root\Core\em\UsbRecovery\UhcPeimSrc\UhcPeim.c (EIP #103990, #97069)
Root\Core\em\UsbRecovery\UhcPeimSrc\UhcPeim.h (EIP #97069)
Root\Core\em\UsbRecovery\UsbPeimSrc\HubPeim.c(EIP #103990)
Root\Core\em\UsbRecovery\UsbPeimSrc\UsbPeim.c(EIP #103990, #97069)
Root\Core\em\UsbRecovery\UsbBotPeimSrc\BotPeim.c(EIP #103990)
Root\Core\em\UsbRecovery\UsbBotPeimSrc\BotPeim.h(EIP #103990)
Root\Core\em\UsbRecovery\UsbBotPeimSrc\PeiAtapi.c(EIP #103990)
Root\Core\em\UsbRecovery\UsbBotPeimSrc\UsbBotPeim.c(EIP #103990)
Root\Core\em\UsbRecovery\UsbBotPeimSrc\UsbBotPeim.h(EIP #103990)
Known Limitations and Erratas in this label:
  • USB Devices that support USB Mass Storage Control-Bulk-Interrupt (CBI) Protocol are not supported.
  • The USB Recovery module has not been verified for platforms that contain the combination of different types of controllers.
  • UsbBotPeim.ffs should appear before Recovery.ffs in the list of FV_BB files in Token.mak.
  • Controllers/devices may require a full power off and at least one successful boot before attempting recovery. This issue is being investigated.
Remaining Issues:
NONE
Unit Testing:
NONE
Validation Testing:
Here is the Quality Assurance System Test Plan
Here is the Quality Assurance Test Results
Release History:

4.6.3_USB_RECOVERY_SRC_26

  • [TAG] EIP77332
    [Category] Improvement
    [Description] Implement pei loadfirmware.
    [Files] LoadFirmware.cif,LoadFirmware.sdl,LoadFirmware.mak,PeiRenesas.c,PeiRenesas.h,
    DxeRenesas.c,DxeRenesas.h,UsbRecov.mak

  • [TAG] EIP103990
    [Category] Improvement
    [Description] Synchronized with USB PEI module 4.6.3_USB_08.10.24.
    [Files] EhciPei.c, EhciPei.h, OhciPei.c, OhciPei.h, UhcPeim.c, BotPeim.c, BotPeim.h, PeiAtapi.c, UsbBotPeim.c, UsbBotPeim.h,
    HubPeim.c, UsbPeim.c, XhciPei.c, XhciPei.h, HubPeim.h, PeiUsbLib.c, PeiUsbLib.h, UsbPeim.h

  • [TAG] EIP97069
    [Category] Improvement
    [Description] Reset root port algorythm update.
    [Files] EhciPei.c, EhciPei.h, OhciPei.c, OhciPei.h, UhcPeim.c, UhcPeim.h, UsbPeim.c, usb.h

  • TAG] EIP99922
    [Category] Bug Fix
    [Severity] Normal
    [Symptom] System hanged on CP:9C during USB Recovery from cold boot.
    [RootCause] Usb controller need reset when pei exit.
    [Solution] Reset usb controller when pei exit
    [Files] EhciPei.c

  • [TAG] EIP75547
    [Category] Bug Fix
    [Severity] Normal
    [Symptom] Xhci recovery funtion failed when SS devices on USB 3.0 port.
    [RootCause] The SS device connected to USB2 port.
    [Solution] Reset the USB2 port when initial xhci controller, then the SS device reconnect to USB3 port.
    [Files] XhciPei.c, XhciPei.h

Release_4.6.3_USB_RECOVERY_SRC_25

© American Megatrends Inc.


Release Notes - NDA Required

Validation Test Report for Sdiodriver Label (INT)a4.6.3_USB_RECOVERY_SRC_26

Platform Information Form :

Board Information - Chief River
BIOS Information (Label, Path) - Label'4.6.5.4_VEB_1APTJ026',Path'SS: Alaska;$/Alaska/Projects/Intel/IvyBridge/PantherPoint_ChiefRiver_Crb_1APTJ/CheifRiver,Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

Description: Intel CPU Reference Code is not to support X64_BUILD=0. Tested only with USB 2.0 devices.

1)Aptio 4.x UsbRecovery
REF-32480: N/A BIOS recovery behind a USB 3.0 hub---- U/T
Status Update: Unavailable of USB3.0 device

REF-32479: N/A BIOS recovery behind USB 2.0 hub---- PASS
Status Update:

REF-32477: N/A BIOS recovery via USB 2.0 card reader---- PASS
Status Update: SD card - PASS
MMC - PASS
MicroSD card - Not Available
CF - Not Available
Memory Stick - Not Available
SmartMedia card - Not Available

REF-32478: N/A BIOS recovery via USB 3.0 card reader---- U/T
Status Update: Unavailable of USB 3.0 card reader

REF-32604: .N/A USB 2.0 DVD Drive Flash Recovery ---- PASS
Status Update:

REF-32563: N/A USB 2.0 Key Recovery Flash---- PASS
Status Update:

REF-32605:N/A USB 3.0 DVD Drive Flash Recovery---- U/T
Status Update: Unavailable of USB 3.0 DVD drive

REF-32564: N/A USB 3.0 HDD Recovery Flash---- U/T
Status Update: Unavailable USB 3.0 Hard Drive

REF-32565: N/A USB 3.0 Key Recovery Flash---- PASS
Status Update: LACIE USB 3.0

REF-32309: DOS USB HDD Recovery Flash---- U/T
Status Update: Unavailable USB Hard Drive

2)Build
REF-31549: N/A Test ROM Build---- PASS
Status Update:

3)Flash
REF-28837: Not OS Specific Ctrl + Home Flash from USB Floppy---- U/T
Status Update: BIOS image larger than 1.44MB

REF-28772: .N/A DVD-ROM Flash---- PASS
Status Update:

4)USB
REF-31912:.N/A USB 3.0 Recovery---- U/T
Status Update: Unavailable of External USB 3.0 controller

Platform Information Form :

Board Information - AMD_DORY
BIOS Information (Label, Path) - Label'4.6.5.3_VEB_1AOUQ_016',Path'SS: Alaska;$/Alaska/Projects/AMD/AgesaV5/OrochiPI/Dory_1AOUQ/Dory.Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

Description: Tested With both x32 and x64 build BIOS and Tested only with USB 2.0 devices.

1)Aptio 4.x UsbRecovery
REF-32480: N/A BIOS recovery behind a USB 3.0 hub---- U/T
Status Update: Unavailable of USB3.0 device

REF-32479: N/A BIOS recovery behind USB 2.0 hub---- PASS
Status Update:

REF-32477: N/A BIOS recovery via USB 2.0 card reader---- PASS
Status Update: SD card - PASS
MMC - PASS
MicroSD card - Not Available
CF - Not Available
Memory Stick - Not Available
SmartMedia card - Not Available

REF-32478: N/A BIOS recovery via USB 3.0 card reader---- U/T
Status Update: Unavailable of USB 3.0 card reader

REF-32604: .N/A USB 2.0 DVD Drive Flash Recovery ---- PASS
Status Update:

REF-32563: N/A USB 2.0 Key Recovery Flash---- PASS
Status Update:

REF-32605:N/A USB 3.0 DVD Drive Flash Recovery---- U/T
Status Update: Unavailable of USB 3.0 DVD drive

REF-32564: N/A USB 3.0 HDD Recovery Flash---- U/T
Status Update: Unavailable USB 3.0 Hard Drive

REF-32565: N/A USB 3.0 Key Recovery Flash---- PASS
Status Update: LACIE USB 3.0

REF-32309: DOS USB HDD Recovery Flash---- U/T
Status Update: Unavailable USB Hard Drive

2)Build
REF-31549: N/A Test ROM Build---- PASS
Status Update:

3)Flash
REF-28837: Not OS Specific Ctrl + Home Flash from USB Floppy---- U/T
Status Update: BIOS image larger than 1.44MB

REF-28772: .N/A DVD-ROM Flash---- PASS
Status Update: Tested with USB 2.0 hub and DVD-ROM USB 2.0 device

4)USB
REF-31912:.N/A USB 3.0 Recovery---- U/T
Status Update: Unavailable of External USB 3.0 controller


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the .asm files.
For a list in alphabetical order, see In Alphabetical Order.

  • AmiMapping.h
  • atapi.h
  • BotPeim.c
  • BotPeim.h
  • EhciPei.c
  • EhciPei.h
  • EhciPeiBoard.c
  • HubPeim.c
  • HubPeim.h
  • OhciPei.c
  • OhciPei.h
  • OhciPeiBoard.c
  • PeiAtapi.c
  • PeiUsbLib.c
  • PeiUsbLib.h
  • UhciPeiUsb.c
  • UhcPeim.c
  • UhcPeim.h
  • usb.h
  • UsbBotPeim.c
  • UsbBotPeim.dxs
  • UsbBotPeim.h
  • UsbIoPeim.c
  • UsbPeim.c
  • UsbPeim.h
  • UsbRecov.mak
  • XhciPei.c
  • XhciPei.h


AmiMapping.h

Description:
This file is the mapping header file that maps Tiano related
equates to AMI equates


atapi.h

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.


BotPeim.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
Mass Storage BOT PEIM


BotPeim.h

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.


EhciPei.c

Description:
This file is the main source file for the EHCI PEI USB
recovery module.  Its entry point at EhciPeiUsbEntryPoint
will be executed from the UsbRecoveryInitialize INIT_LIST.

The following functions are used in the file: EhciPei.c.

Function | Description
DwordReadMem | This routine reads a DWORD from the specified Memory Address
DwordWriteMem | This routine writes a DWORD to a specified Memory Address
EhciGetOperationalRegisterBase | This function uses ControllerIndex and the global PCI_BUS_DEV_FUNCTION array to access a particular controller's PCI configuration space in order to obtain the Operational Register base address.
EhciHcBulkTransfer | This function intiates a USB bulk transfer and waits on it to complete.
EhciHcClearRootHubPortFeature | This function clears an EHCI specification port feature as specified by PortFeature for the port specified by PortNumber.
EhciHcControlTransfer | This function intiates a USB control transfer and waits on it to complete.
EhciHcGetRootHubPortNumber | This function returns the number of downstream ports as specified in the HcRhDescriptorA operational register.
EhciHcGetRootHubPortStatus | This function obtains the port status and port change status for a port specified by PortNumber and updates the EFI_USB_PORT_STATUS data structure as specified the the PortStatus pointer parameter.
EhciHcReset | This function performs a software reset of the host controller.
EhciHcSetRootHubPortFeature | This function sets port feature as specified by PortFeature for the port specified by PortNumber.
EhciInitHC | EHCI controller initialization.
EHCIInitializeQueueHead | This function initializes the queue head with default values
EhciPeiUsbEntryPoint | This is the entry point into the EHCI controller initialization subsystem.
EHCIProcessQH | This function whether all the TD's in the QH is completed
EhciReleasePortOwner |
EHCISetQTDBufferPointers | This function will set the 5 buffer pointer in the qTD appropriately depending upon the input size
EHCIStartAsyncSchedule | This function starts the asynchronous schedule
EHCIStopAsyncSchedule | This function stops the asynchronous transfer and sets the asynchronous pointer to null
EHCIWaitForAsyncTransferComplete | This function waits for asynchronous transfer completion.
NotifyOnRecoveryCapsuleLoaded | This routine halts the all available EHCI host controller
Update_EHCIDbg_PortUsed | Check debugport of a controlller is in use or not.


DwordReadMem in the EhciPei.c

Function : DwordReadMem

File: EhciPei.c
Description:
This routine reads a DWORD from the specified Memory Address
Input:
dBaseAddr   - Memory address to read
bOffset     - Offset of dBaseAddr
Output:
Value read
Built on 10:24:23 01/08/13


DwordWriteMem in the EhciPei.c

Function : DwordWriteMem

File: EhciPei.c
Description:
This routine writes a DWORD to a specified Memory Address
Input:
dBaseAddr   - Memory address to write
bOffset     - Offset of dBaseAddr
dValue      - Data to write
Built on 10:24:23 01/08/13


EhciGetOperationalRegisterBase in the EhciPei.c

Function : EhciGetOperationalRegisterBase

File: EhciPei.c
Description:
This function uses ControllerIndex and the global PCI_BUS_DEV_FUNCTION
array to access a particular controller's PCI configuration space in
order to obtain the Operational Register base address.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN UINT16 ControllerIndex
   --  Index of the controller in the global
       PCI_BUS_DEV_FUNCTION array
Output:
UINT32 (Return Value)
   = Base address for this controller's operational
       registers.
Built on 10:24:23 01/08/13


EhciHcBulkTransfer in the EhciPei.c

Function : EhciHcBulkTransfer

File: EhciPei.c
Description:
This function intiates a USB bulk transfer and waits on it to
complete.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 DeviceAddress
   --  USB address of the device for which the control
       transfer is to be issued
IN UINT8 EndPointAddress
   --  Particular endpoint for the device
IN UINT8 MaximumPacketLength
   --  Maximum number of bytes that can be sent to or
       received from the endpoint in a single data packet
OPTIONAL IN OUT VOID *DataBuffer
   --  Pointer to source or destination buffer
OPTIONAL IN OUT UINTN *DataLength
   --  Length of buffer
IN OUT UINT8 *DataToggle
   --  Used to update the control/status DataToggle field
       of the Transfer Descriptor
IN UINTN TimeOut
   --  Not used
OUT UINT32 *TransferResult
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EhciHcClearRootHubPortFeature in the EhciPei.c

Function : EhciHcClearRootHubPortFeature

File: EhciPei.c
Description:
This function clears an EHCI specification port feature as specified
by PortFeature for the port specified by PortNumber.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 PortNumber
   --  Port number whose feature is to be set
IN EFI_USB_PORT_FEATURE PortFeature
   --  Feature to set
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EhciHcControlTransfer in the EhciPei.c

Function : EhciHcControlTransfer

File: EhciPei.c
Description:
This function intiates a USB control transfer and waits on it to
complete.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 bDeviceAddress
   --  USB address of the device for which the control
       transfer is to be issued
IN UINT8 DeviceSpeed
   --  Not used
IN UINT8 MaximumPacketLength
   --  Maximum number of bytes that can be sent to or
       received from the endpoint in a single data packet
IN EFI_USB_DEVICE_REQUEST *Request
   --  EFI_USB_DEVICE_REQUEST pointer
IN EFI_USB_DATA_DIRECTION TransferDirection
   --  Direction of transfer
OPTIONAL IN OUT VOID *DataBuffer
   --  Pointer to source or destination buffer
OPTIONAL IN OUT UINTN *DataLength
   --  Length of buffer
IN UINTN TimeOut
   --  Not used
OUT UINT32 *TransferResult
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EhciHcGetRootHubPortNumber in the EhciPei.c

Function : EhciHcGetRootHubPortNumber

File: EhciPei.c
Description:
This function returns the number of downstream ports as specified
in the HcRhDescriptorA operational register.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
OUT UINT8 *PortNumber
   --  Number of downstream ports
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EhciHcGetRootHubPortStatus in the EhciPei.c

Function : EhciHcGetRootHubPortStatus

File: EhciPei.c
Description:
This function obtains the port status and port change status for
a port specified by PortNumber and updates the EFI_USB_PORT_STATUS
data structure as specified the the PortStatus pointer parameter.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 PortNumber
   --  Port number for which status is requested
OUT EFI_USB_PORT_STATUS *PortStatus
   --  EFI_USB_PORT_STATUS pointer's data is updated
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EhciHcReset in the EhciPei.c

Function : EhciHcReset

File: EhciPei.c
Description:
This function performs a software reset of the host controller.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_EHCI_DEV *EhciDevPtr
   --  PEI_EHCI_DEV pointer
Output:
VOID (Return Value)
Notes:
It is assumed that all necessary operational register data has been
saved prior to calling this function.
Built on 10:24:23 01/08/13


EhciHcSetRootHubPortFeature in the EhciPei.c

Function : EhciHcSetRootHubPortFeature

File: EhciPei.c
Description:
This function sets port feature as specified by
PortFeature for the port specified by PortNumber.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 PortNumber
   --  Port number whose feature is to be set
IN EFI_USB_PORT_FEATURE PortFeature
   --  Feature to set
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EhciInitHC in the EhciPei.c

Function : EhciInitHC

File: EhciPei.c
Description:
EHCI controller initialization.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_EHCI_DEV *EhciDevPtr
   --  PEI_EHCI_DEV pointer
IN UINT8 Index
   --  Index of this controller in the global
       PCI_BUS_DEV_FUNCTION array
Output:
VOID (Return Value)

Note:
EhciDevPtr->UsbHostControllerBaseAddress is is initialized
Built on 10:24:23 01/08/13


EHCIInitializeQueueHead in the EhciPei.c

Function : EHCIInitializeQueueHead

File: EhciPei.c
Description:
This function initializes the queue head with default values
Input:
fpQH    Pointer to queue head
Built on 10:24:23 01/08/13


EhciPeiUsbEntryPoint in the EhciPei.c

Function : EhciPeiUsbEntryPoint

File: EhciPei.c
Description:
This is the entry point into the EHCI controller initialization
subsystem.
Input:
IN EFI_FFS_FILE_HEADER *FfsHeader
   --  EFI_FFS_FILE_HEADER pointer
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Built on 10:24:23 01/08/13


EHCIProcessQH in the EhciPei.c

Function : EHCIProcessQH

File: EhciPei.c
Description:
This function whether all the TD's in the QH is completed
Input:
fpQH    - Pointer to the QH which has to be completed
Built on 10:24:23 01/08/13


EhciReleasePortOwner in the EhciPei.c

Function : EhciReleasePortOwner

File: EhciPei.c
Description:
Input:
Output:
None
Built on 10:24:23 01/08/13


EHCISetQTDBufferPointers in the EhciPei.c

Function : EHCISetQTDBufferPointers

File: EhciPei.c
Description:
This function will set the 5 buffer pointer in the qTD
appropriately depending upon the input size
Input:
fpQtd   - Pointer to the qTD
fpBuf   - 32bit absolute buffer pointer
wSize   - Amount of data to be transferred
Output:
None
Built on 10:24:23 01/08/13


EHCIStartAsyncSchedule in the EhciPei.c

Function : EHCIStartAsyncSchedule

File: EhciPei.c
Description:
This function starts the asynchronous schedule
Built on 10:24:23 01/08/13


EHCIStopAsyncSchedule in the EhciPei.c

Function : EHCIStopAsyncSchedule

File: EhciPei.c
Description:
This function stops the asynchronous transfer and sets the
asynchronous pointer to null


EHCIWaitForAsyncTransferComplete in the EhciPei.c

Function : EHCIWaitForAsyncTransferComplete

File: EhciPei.c
Description:
This function waits for asynchronous transfer completion.


NotifyOnRecoveryCapsuleLoaded in the EhciPei.c

Function : NotifyOnRecoveryCapsuleLoaded

File: EhciPei.c
Description:
This routine halts the all available EHCI host controller
Input:
PeiServices
dMemAddr   - EHCI HC Mem_Base address


Update_EHCIDbg_PortUsed in the EhciPei.c

Function : Update_EHCIDbg_PortUsed

File: EhciPei.c
Description:
Check debugport of a controlller is in use or not.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN UINT16 ControllerIndex
   --  Index of the controller in the global
       PCI_BUS_DEV_FUNCTION array

Output :

Note : EHCIDbg_PortUsed used to maintain the debugport usage of
CURRENT processing controller.


EhciPei.h

Description:
This file is the main header file for the EHCI PEI USB
recovery module. It contains generic constant and type
declarations/definitions.


EhciPeiBoard.c

Description:
This file contains routines that are board specific for
initializing the EHCI controller in the USB Recovery module.

The following functions are used in the file: EhciPeiBoard.c.

Function | Description
EhciPeiBoardInit | This is a porting hook for board-specific EHCI controller initialization


EhciPeiBoardInit in the EhciPeiBoard.c

Function : EhciPeiBoardInit

File: EhciPeiBoard.c
Description:
This is a porting hook for board-specific EHCI controller
initialization
Input:
IN EFI_PEI_SERVICES **PeiServices -
IN EFI_PEI_PCI_CFG_PPI *Pci -
IN EFI_PEI_STALL_PPI *StallPpi -
Output:
VOID
Built on 10:24:23 01/08/13


HubPeim.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
PEIM

The following functions are used in the file: HubPeim.c.

Function | Description
PeiHubGetPortStatus | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to issue a Hub Class-specific request to obtain the port status and port status change bits.


PeiHubGetPortStatus in the HubPeim.c

Function : PeiHubGetPortStatus

File: HubPeim.c
Description:
This function uses a device's PEI_USB_IO_PPI interface to execute a
control transfer on the default control pipe to issue a Hub
Class-specific request to obtain the port status and port status
change bits.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN PEI_USB_IO_PPI *UsbIoPpi
   --  PEI_USB_IO_PPI interface pointer for the device
       that is being accessed
IN UINT8 Port
   --  This value is the hub port number for which the
       status is to be returned.
OUT UINT32 *PortStatus
   --  This output value is the USB Specification
       (Revision 2.0) Hub Port Status field (upper word)
       and Change Status field (lower word) values as
       returned by the Get Port Status Hub Class device
       standard request.
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


HubPeim.h

Description:
This file belongs to "Framework" and included here for
compatibility purposes. This file is modified by AMI to include
copyright message, appropriate header and integration code


OhciPei.c

Description:
This file is the main source file for the OHCI PEI USB
recovery module.  Its entry point at OhciPeiUsbEntryPoint
will be executed from the UsbRecoveryInitialize INIT_LIST.

The following functions are used in the file: OhciPei.c.

Function | Description
OhciGetOperationalRegisterBase | This function uses ControllerIndex and the global PCI_BUS_DEV_FUNCTION array to access a particular controller's PCI configuration space in order to obtain the Operational Register base address.
OhciHcBulkTransfer | This function intiates a USB bulk transfer and waits on it to complete.
OhciHcClearRootHubPortFeature | This function clears an OHCI specification port feature as specified by PortFeature for the port specified by PortNumber.
OhciHcControlTransfer | This function intiates a USB control transfer and waits on it to complete.
OhciHcGetRootHubPortNumber | This function returns the number of downstream ports as specified in the HcRhDescriptorA operational register.
OhciHcGetRootHubPortStatus | This function obtains the port status and port change status for a port specified by PortNumber and updates the EFI_USB_PORT_STATUS data structure as specified the the PortStatus pointer parameter.
OhciHcReset | This function performs a software reset of the host controller.
OhciHcSetRootHubPortFeature | This function sets an OHCI specification port feature as specified by PortFeature for the port specified by PortNumber.
OhciHcWaitForTransferComplete | This function waits for a tranfer to complete by polling the HcInterruptStatus register's WritebackDoneHead field.
OhciInitHC | All leading whitespace on this line is removed by Helpbuilder Description of this function can be block aligned in this section. The first tab that Helpbuilder will recognize will be at tab stop 21, which will indent 4 spaces in Helpbuilder. This text is indented 4 spaces in Helpbuilder
OhciInitHcca | This routine allocates memory for the the Host Controller Communications Area (HCCA), aligned on a 256 byte boundary, and updates the HcHcca operational register pointer, as well as the corresponding PEI_OHCI_DEV.pFrameList pointer.
OhciPeiUsbEntryPoint | This is the entry point into the OHCI controller initialization subsystem.


OhciGetOperationalRegisterBase in the OhciPei.c

Function : OhciGetOperationalRegisterBase

File: OhciPei.c
Description:
This function uses ControllerIndex and the global PCI_BUS_DEV_FUNCTION
array to access a particular controller's PCI configuration space in
order to obtain the Operational Register base address.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN UINT16 ControllerIndex
   --  Index of the controller in the global
       PCI_BUS_DEV_FUNCTION array
Output:
UINT32 (Return Value)
   = Base address for this controller's operational
       registers.


OhciHcBulkTransfer in the OhciPei.c

Function : OhciHcBulkTransfer

File: OhciPei.c
Description:
This function intiates a USB bulk transfer and waits on it to
complete.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 DeviceAddress
   --  USB address of the device for which the control
       transfer is to be issued
IN UINT8 EndPointAddress
   --  Particular endpoint for the device
IN UINT8 MaximumPacketLength
   --  Maximum number of bytes that can be sent to or
       received from the endpoint in a single data packet
OPTIONAL IN OUT VOID *DataBuffer
   --  Pointer to source or destination buffer
OPTIONAL IN OUT UINTN *DataLength
   --  Length of buffer
IN OUT UINT8 *DataToggle
   --  Used to update the control/status DataToggle field
       of the Transfer Descriptor
IN UINTN TimeOut
   --  Not used
OUT UINT32 *TransferResult
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciHcClearRootHubPortFeature in the OhciPei.c

Function : OhciHcClearRootHubPortFeature

File: OhciPei.c
Description:
This function clears an OHCI specification port feature as specified
by PortFeature for the port specified by PortNumber.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 PortNumber
   --  Port number whose feature is to be set
IN EFI_USB_PORT_FEATURE PortFeature
   --  Feature to set
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciHcControlTransfer in the OhciPei.c

Function : OhciHcControlTransfer

File: OhciPei.c
Description:
This function intiates a USB control transfer and waits on it to
complete.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 bDeviceAddress
   --  USB address of the device for which the control
       transfer is to be issued
IN UINT8 DeviceType
   --  Not used
IN UINT8 MaximumPacketLength
   --  Maximum number of bytes that can be sent to or
       received from the endpoint in a single data packet
IN EFI_USB_DEVICE_REQUEST *Request
   --  EFI_USB_DEVICE_REQUEST pointer
IN EFI_USB_DATA_DIRECTION TransferDirection
   --  Direction of transfer
OPTIONAL IN OUT VOID *DataBuffer
   --  Pointer to source or destination buffer
OPTIONAL IN OUT UINTN *DataLength
   --  Length of buffer
IN UINTN TimeOut
   --  Not used
OUT UINT32 *TransferResult
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciHcGetRootHubPortNumber in the OhciPei.c

Function : OhciHcGetRootHubPortNumber

File: OhciPei.c
Description:
This function returns the number of downstream ports as specified
in the HcRhDescriptorA operational register.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
OUT UINT8 *PortNumber
   --  Number of downstream ports
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciHcGetRootHubPortStatus in the OhciPei.c

Function : OhciHcGetRootHubPortStatus

File: OhciPei.c
Description:
This function obtains the port status and port change status for
a port specified by PortNumber and updates the EFI_USB_PORT_STATUS
data structure as specified the the PortStatus pointer parameter.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 PortNumber
   --  Port number for which status is requested
OUT EFI_USB_PORT_STATUS *PortStatus
   --  EFI_USB_PORT_STATUS pointer's data is updated
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciHcReset in the OhciPei.c

Function : OhciHcReset

File: OhciPei.c
Description:
This function performs a software reset of the host controller.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_OHCI_DEV *OhciDevPtr
   --  PEI_OHCI_DEV pointer
Output:
VOID (Return Value)
Notes:
It is assumed that all necessary operational register data has been
saved prior to calling this function.


OhciHcSetRootHubPortFeature in the OhciPei.c

Function : OhciHcSetRootHubPortFeature

File: OhciPei.c
Description:
This function sets an OHCI specification port feature as specified by
PortFeature for the port specified by PortNumber.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 PortNumber
   --  Port number whose feature is to be set
IN EFI_USB_PORT_FEATURE PortFeature
   --  Feature to set
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciHcWaitForTransferComplete in the OhciPei.c

Function : OhciHcWaitForTransferComplete

File: OhciPei.c
Description:
This function waits for a tranfer to complete by polling the
HcInterruptStatus register's WritebackDoneHead field.
Input:
IN PEI_OHCI_DEV *OhciDevPtr
   --  PEI_OHCI_DEV pointer
IN POHCI_TD Td
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciInitHC in the OhciPei.c

Function : OhciInitHC

File: OhciPei.c
Description:
All leading whitespace on this line is removed by Helpbuilder
Description of this function can be block aligned in this section.
The first tab that Helpbuilder will recognize will be at tab stop 21,
which will indent 4 spaces in Helpbuilder.

   This text is indented 4 spaces in Helpbuilder
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_OHCI_DEV *OhciDevPtr
   --  PEI_OHCI_DEV pointer
IN UINT8 Index
   --  Index of this controller in the global
       PCI_BUS_DEV_FUNCTION array
Output:
VOID (Return Value)


OhciInitHcca in the OhciPei.c

Function : OhciInitHcca

File: OhciPei.c
Description:
This routine allocates memory for the the Host Controller
Communications Area (HCCA), aligned on a 256 byte boundary,
and updates the HcHcca operational register pointer, as
well as the corresponding PEI_OHCI_DEV.pFrameList
pointer.
Input:
IN PEI_OHCI_DEV *OhciDevPtr
   --  This is a pointer to a PEI_OHCI_DEV structure
       for an OHCI controller.
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciPeiUsbEntryPoint in the OhciPei.c

Function : OhciPeiUsbEntryPoint

File: OhciPei.c
Description:
This is the entry point into the OHCI controller initialization
subsystem.
Input:
IN EFI_FFS_FILE_HEADER *FfsHeader
   --  EFI_FFS_FILE_HEADER pointer
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


OhciPei.h

Description:
This file is the main header file for the OHCI PEI USB
recovery module. It contains generic constant and type
declarations/definitions.

The following data structures are used in the file: OhciPei.h.

Variable | Description
OHCI_PCI_PROGRAMMING_TABLE | This structure type defines the parameters to be used in a call to EFI_PEI_PCI_CFG_PPI.Modify(), when programming the PCI configuration space for a particular OHCI controller.
PCI_BUS_DEV_FUNCTION | This structure type defines the bus, device and function number that compose a PCI address.


OHCI_PCI_PROGRAMMING_TABLE in the OhciPei.h

Variable : OHCI_PCI_PROGRAMMING_TABLE

File: OhciPei.h
Fields:

Type | Name | Description
EFI_PEI_PCI_CFG_PPI_WIDTH | Size | Size of the access
UINT32 | Register | Register/offset within the PCI configuration space
UINT32 | SetBits | Bits to set
UINT32 | ClearBits | Bits to clear

Description:
This structure type defines the parameters to be used in a call
to EFI_PEI_PCI_CFG_PPI.Modify(), when programming the PCI
configuration space for a particular OHCI controller.
Notes:
See also


PCI_BUS_DEV_FUNCTION in the OhciPei.h

Variable : PCI_BUS_DEV_FUNCTION

File: OhciPei.h
Fields:

Type | Name | Description
UINT8 | Bus | PCI Bus on which a particular OHCI controller resides
UINT8 | Device | PCI Device number for a particular OHCI controller
UINT8 | Function | PCI Function number for a particular OHCI controller

Description:
This structure type defines the bus, device and function number
that compose a PCI address.


OhciPeiBoard.c

Description:
This file contains routines that are board specific for
initializing the OHCI controller in the USB Recovery module.

The following functions are used in the file: OhciPeiBoard.c.

Function | Description
DefaultInit | This function generically initializes the PCI configuration space registers for all the OHCI controllers whose PCI addresses are specified by the global PCI_BUS_DEV_FUNCTION array and whose PCI register programming details are specified by the global OHCI_PCI_PROGRAMMING_TABLE array.
OhciPeiBoardInit | This is a porting hook for board-specific OHCI controller initialization

The following tables are used in the file: OhciPeiBoard.c.

Table | Description
gOhciControllerPciTable | This is an array of type: PCI_BUS_DEV_FUNCTION This array is initialized from the PEI_OHCI_PCI_DEVICES SDL token, which specifies a {bus,device,function} entry for each OHCI controller. If no OHCI controllers exist, there will be only one NULL entry. This array is used for PCI initialization of OHCI controllers, as well as access to PCI configuration registers.
gOhciPciRegisterTable | This is an array of type: OHCI_PCI_PROGRAMMING_TABLE This array is initialized from the OHCI_CONTROLLER_PCI_REGISTER_VALUE SDL eLink, which specifies a { RegisterSize, Register, BitsToSet, BitsToClear } entry for each register in the PCI configuration space that needs to be modified. This array is used for PCI initialization of OHCI controllers.


DefaultInit in the OhciPeiBoard.c

Function : DefaultInit

File: OhciPeiBoard.c
Description:
This function generically initializes the PCI configuration space
registers for all the OHCI controllers whose PCI addresses are
specified by the global PCI_BUS_DEV_FUNCTION array and whose PCI
register programming details are specified by the global
OHCI_PCI_PROGRAMMING_TABLE array.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN EFI_PEI_PCI_CFG_PPI *Pci
   --  EFI_PEI_PCI_CFG_PPI pointer
IN EFI_PEI_STALL_PPI *StallPpi
   --  EFI_PEI_STALL_PPI pointer
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Notes:
This function should not need porting.  All porting is accomplished
in the global PCI_BUS_DEV_FUNCTION and OHCI_PCI_PROGRAMMING_TABLE
arrays, where the former is defined by the
USBR_OHCI_CONTROLLER_PCI_ADDRESS SDL eLink and the latter is defined
by the USBR_OHCI_CONTROLLER_PCI_REGISTER_VALUE SDL eLink.
Built on 10:24:23 01/08/13


gOhciControllerPciTable in the OhciPeiBoard.c

Table : gOhciControllerPciTable

File: OhciPeiBoard.c
Description:
This is an array of type: PCI_BUS_DEV_FUNCTION

This array is initialized from the PEI_OHCI_PCI_DEVICES SDL
token, which specifies a {bus,device,function} entry for each OHCI
controller.  If no OHCI controllers exist, there will be only one
NULL entry.

This array is used for PCI initialization of OHCI controllers,
as well as access to PCI configuration registers.
Notes:
gOhciControllerPciTable and gOhciControllerCount are accessed via
extern declarations by OHCI generic code to access PCI configuration
space registers.


gOhciPciRegisterTable in the OhciPeiBoard.c

Table : gOhciPciRegisterTable

File: OhciPeiBoard.c
Description:
This is an array of type: OHCI_PCI_PROGRAMMING_TABLE

This array is initialized from the OHCI_CONTROLLER_PCI_REGISTER_VALUE
SDL eLink, which specifies a { RegisterSize, Register, BitsToSet,
BitsToClear } entry for each register in the PCI configuration space
that needs to be modified.

This array is used for PCI initialization of OHCI controllers.
Notes:
If no OHCI controllers exist, there will be only one
NULL entry.

When this table is used, it is assumed that all OHCI controllers
are identically programmed for the platform.

Other important notes are:

   1)  do not include the BAR register (the first BAR is
       PEI_OHCI_IOBASE and subsequent BAR values are
       calculated from there),
   2)  the command register should be last, as it enables
       the devices MMIO access space.


OhciPeiBoardInit in the OhciPeiBoard.c

Function : OhciPeiBoardInit

File: OhciPeiBoard.c
Description:
This is a porting hook for board-specific OHCI controller
initialization
Input:
IN EFI_PEI_SERVICES **PeiServices -
IN EFI_PEI_PCI_CFG_PPI *Pci -
IN EFI_PEI_STALL_PPI *StallPpi -
Output:
VOID


PeiAtapi.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
PEIM

The following functions are used in the file: PeiAtapi.c.

Function | Description
IsMediaChange | This function verifies whether Media change had happened or not by checking the Sense Data obtained from the drive
IsMediaError | This function verifies whether Media access is having problem or not by checking the Sense Data obtained from the drive
IsNoMedia | This function verifies whether Media is present in the drive or not by checking the Sense Data obtained from the drive
PeiUsbInquiry | This function issues the ATA Inquiry command to the USB mass storage device
PeiUsbRead10 | This function issues the ATA Read (10) command to the USB mass storage device
PeiUsbReadCapacity | This function issues the ATA Read Capacity command to the USB mass storage device
PeiUsbReadFormattedCapacity | This function issues the ATA Read Formatted Capacity command to the USB mass storage device
PeiUsbRequestSense | This function issues the ATA Request Sense command to the USB mass storage device
PeiUsbTestUnitReady | This function issues the ATA Test Unit Ready command to the USB mass storage device
PeiUsbValidatePartitionTable | This function validates the existence of the partition table from the LBA 0 data provided and return FdEmulOffset value (hidden sector) from the partition table


IsMediaChange in the PeiAtapi.c

Function : IsMediaChange

File: PeiAtapi.c
Description:
This function verifies whether Media change had happened
or not by checking the Sense Data obtained from the drive
Input:
*SenseData          Sense data obtained from the drive
SenseCounts         Sense count value
Output:
Returns TRUE if media has changed
       FALSE otherwise


IsMediaError in the PeiAtapi.c

Function : IsMediaError

File: PeiAtapi.c
Description:
This function verifies whether Media access is having problem
or not by checking the Sense Data obtained from the drive
Input:
*SenseData          Sense data obtained from the drive
SenseCounts         Sense count value
Output:
Returns TRUE if media has error
       FALSE otherwise


IsNoMedia in the PeiAtapi.c

Function : IsNoMedia

File: PeiAtapi.c
Description:
This function verifies whether Media is present in the drive
or not by checking the Sense Data obtained from the drive
Input:
*SenseData          Sense data obtained from the drive
SenseCounts         Sense count value
Output:
Returns TRUE if media is present
       FALSE otherwise


PeiUsbInquiry in the PeiAtapi.c

Function : PeiUsbInquiry

File: PeiAtapi.c
Description:
This function issues the ATA Inquiry command to the USB
mass storage device
Input:
**PeiServices       Pointer to the PEI services table
*PeiBotDevice       Pointer to the PEI_BOT_DEVICE structure
Output:
Return Status based on the command


PeiUsbRead10 in the PeiAtapi.c

Function : PeiUsbRead10

File: PeiAtapi.c
Description:
This function issues the ATA Read (10) command to the USB
mass storage device
Input:
**PeiServices       Pointer to the PEI services table
*PeiBotDevice       Pointer to the PEI_BOT_DEVICE structure
*Buffer             Buffer to read the data into
Lba                 Start LBA Number
NumberOfBlocks      Number of blocks to read
Output:
Return Status based on the command


PeiUsbReadCapacity in the PeiAtapi.c

Function : PeiUsbReadCapacity

File: PeiAtapi.c
Description:
This function issues the ATA Read Capacity command to the USB
mass storage device
Input:
**PeiServices       Pointer to the PEI services table
*PeiBotDevice       Pointer to the PEI_BOT_DEVICE structure
Output:
Return Status based on the command


PeiUsbReadFormattedCapacity in the PeiAtapi.c

Function : PeiUsbReadFormattedCapacity

File: PeiAtapi.c
Description:
This function issues the ATA Read Formatted Capacity command
to the USB mass storage device
Input:
**PeiServices       Pointer to the PEI services table
*PeiBotDevice       Pointer to the PEI_BOT_DEVICE structure
Output:
Return Status based on the command


PeiUsbRequestSense in the PeiAtapi.c

Function : PeiUsbRequestSense

File: PeiAtapi.c
Description:
This function issues the ATA Request Sense command to the USB
mass storage device
Input:
**PeiServices       Pointer to the PEI services table
*PeiBotDevice       Pointer to the PEI_BOT_DEVICE structure
*SenseCounts        Buffer to return sense key data
*SenseKeyBuffer     Buffer used for internal use
Output:
Return Status based on the command


PeiUsbTestUnitReady in the PeiAtapi.c

Function : PeiUsbTestUnitReady

File: PeiAtapi.c
Description:
This function issues the ATA Test Unit Ready command to the USB
mass storage device
Input:
**PeiServices       Pointer to the PEI services table
*PeiBotDevice       Pointer to the PEI_BOT_DEVICE structure
Output:
Return Status based on the command


PeiUsbValidatePartitionTable in the PeiAtapi.c

Function : PeiUsbValidatePartitionTable

File: PeiAtapi.c
Description:
This function validates the existence of the partition table
from the LBA 0 data provided and return FdEmulOffset value
(hidden sector) from the partition table
Input:
**PeiServices       Pointer to the PEI services table
*Buffer             Pointer to the buffer containing LBA 0
                   data
LastBlock           Last LBA address

*FdEmulOffset       Returned FD emulation hidden sector value
Output:
Nothing


PeiUsbLib.c

Description:
This file belongs to "Framework" and included here for
compatibility purposes. This file is modified by AMI to include
copyright message, appropriate header and integration code.
This file contains generic routines needed for USB recover
PEIM

The following functions are used in the file: PeiUsbLib.c.

Function | Description
IsPortConnect | This function returns true if the Hub Class device's Current Connect Status bit is set in the port status value specified by PortStatus.
IsPortConnectChange | This function returns true if the Hub Class device's Connect Status Change bit is set in the port change status value specified by PortChangeStatus.
IsPortEnable |
IsPortHighSpeedDeviceAttached | This function returns true if the Hub Class device's High-Speed Device Attached bit is set in the port status value specified by PortStatus.
IsPortLowSpeedDeviceAttached | This function returns true if the Hub Class device's Low-Speed Device Attached bit is set in the port status value specified by PortStatus.
IsPortSuperSpeedDeviceAttached | This function returns true if connect status indicates the SuperSpeed device.
PeiCopyMem | This library function copies bytes specified by Length from the memory location specified by Source to the memory location specified by Destination.
PeiUsbClearDeviceFeature | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to clear or disable a specific feature.
PeiUsbClearEndpointHalt | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to clear a bulk Endpoint halt condition (and resetting the Halt status bit) for a specified Endpoint.
PeiUsbGetDescriptor | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to obtain a device descriptor.
PeiUsbSetConfiguration | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to set the device's default configuration index of 1.
PeiUsbSetDeviceAddress | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to set the device's address on the USB bus for all future accesses.
ZeroMem | This library function initializes provided buffer with Zero


IsPortConnect in the PeiUsbLib.c

Function : IsPortConnect

File: PeiUsbLib.c
Description:
This function returns true if the Hub Class device's Current Connect
Status bit is set in the port status value specified by PortStatus.
Input:
IN UINT16 PortStatus
   --  This value is the USB Specification (Revision 2.0)
       Hub Port Status Field value as returned by the Get
       Port Status Hub Class device standard request.
Output:
BOOLEAN (Return Value)
   = TRUE if a device is present or FALSE if a device is not
       present


IsPortConnectChange in the PeiUsbLib.c

Function : IsPortConnectChange

File: PeiUsbLib.c
Description:
This function returns true if the Hub Class device's Connect Status
Change bit is set in the port change status value specified
by PortChangeStatus.
Input:
IN UINT16 PortStatus
   --  This value is the USB Specification (Revision 2.0)
       Hub Port Change Field value as returned by the Get
       Port Status Hub Class device standard request.
Output:
BOOLEAN (Return Value)
   = TRUE if Current Connect status has changed or FALSE
       if no change has occurred to Current Connect status


IsPortEnable in the PeiUsbLib.c

Function : IsPortEnable

File: PeiUsbLib.c
Description:
Input:
Output:


IsPortHighSpeedDeviceAttached in the PeiUsbLib.c

Function : IsPortHighSpeedDeviceAttached

File: PeiUsbLib.c
Description:
This function returns true if the Hub Class device's High-Speed
Device Attached bit is set in the port status value specified by
PortStatus.
Input:
IN UINT16 PortStatus
   --  This value is the USB Specification (Revision 2.0)
       Hub Port Status Field value as returned by the Get
       Port Status Hub Class device standard request.
Output:
BOOLEAN (Return Value)
   = TRUE if a high-speed device is present or FALSE otherwise


IsPortLowSpeedDeviceAttached in the PeiUsbLib.c

Function : IsPortLowSpeedDeviceAttached

File: PeiUsbLib.c
Description:
This function returns true if the Hub Class device's Low-Speed
Device Attached bit is set in the port status value specified by
PortStatus.
Input:
IN UINT16 PortStatus
   --  This value is the USB Specification (Revision 2.0)
       Hub Port Status Field value as returned by the Get
       Port Status Hub Class device standard request.
Output:
BOOLEAN (Return Value)
   = TRUE if a low-speed device is present or FALSE otherwise


IsPortSuperSpeedDeviceAttached in the PeiUsbLib.c

Function : IsPortSuperSpeedDeviceAttached

File: PeiUsbLib.c
Description:
This function returns true if connect status indicates the SuperSpeed
device.
Output:
BOOLEAN (Return Value)
   = TRUE if a super-speed device is present or FALSE otherwise


PeiCopyMem in the PeiUsbLib.c

Function : PeiCopyMem

File: PeiUsbLib.c
Description:
This library function copies bytes specified by Length from the memory
location specified by Source to the memory location specified by
Destination.
Input:
OUT VOID *Destination
   --  Target memory location of copy
IN  VOID *Source
   --  Source memory location
IN  UINTN Length
   --  Number of bytes to copy
Output:
VOID (No Return Value)


PeiUsbClearDeviceFeature in the PeiUsbLib.c

Function : PeiUsbClearDeviceFeature

File: PeiUsbLib.c
Description:
This function uses a device's PEI_USB_IO_PPI interface to execute a
control transfer on the default control pipe to clear or disable a
specific feature.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN PEI_USB_IO_PPI *UsbIoPpi
   --  PEI_USB_IO_PPI interface pointer for the device
       that is being accessed
IN EFI_USB_RECIPIENT Recipient
   --  The recipient of the request can be a device,
       an interface or an endpoint respectively specified
       by EfiUsbDevice, EfiUsbInterface or EfiUsbEndpoint.
IN UINT16 Value
   --  The feature selector to be cleared or disabled
IN UINT16 Target
   --  This value specifies an index for a specific
       interface/endpoint or zero for device recipients.
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


PeiUsbClearEndpointHalt in the PeiUsbLib.c

Function : PeiUsbClearEndpointHalt

File: PeiUsbLib.c
Description:
This function uses a device's PEI_USB_IO_PPI interface to execute a
control transfer on the default control pipe to clear a bulk Endpoint
halt condition (and resetting the Halt status bit) for a specified
Endpoint.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN PEI_USB_IO_PPI *UsbIoPpi
   --  PEI_USB_IO_PPI interface pointer for the device
       that is being accessed
IN UINT8 EndpointAddress
   --  The endpoint for which the Halt condition is to be
       cleared
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


PeiUsbGetDescriptor in the PeiUsbLib.c

Function : PeiUsbGetDescriptor

File: PeiUsbLib.c
Description:
This function uses a device's PEI_USB_IO_PPI interface to execute a
control transfer on the default control pipe to obtain a device
descriptor.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN PEI_USB_IO_PPI *UsbIoPpi
   --  PEI_USB_IO_PPI interface pointer for the device
       that is being accessed
IN UINT16 Value
   --  The upper byte of Value specifies the type of
       descriptor and the lower byte of Value specifies
       the index (for configuration and string descriptors)
IN UINT16 Index
   --  Specifies the Language ID for string descriptors
       or zero for all other descriptors
IN UINT16 DescriptorLength
   --  Specifies the length of the descriptor to be
       retrieved
IN VOID *Descriptor
   --  Allocated buffer in which the descriptor will be
       returned
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code
Notes:
The lower byte of Value is typically zero and the upper byte of
Value specifies the type of descriptor:

   READ_BITS(Value,15,8)   Descriptor
           1               DEVICE
           2               CONFIGURATION
           3               STRING
           4               INTERFACE
           5               ENDPOINT
           6               DEVICE_QUALIFIER
           7               OTHER_SPEED_CONFIGURATION
           8               INTERFACE_POWER

For additional reference, read the USB Device Framework chapter in
the USB Specification (Revision 2.0)


PeiUsbSetConfiguration in the PeiUsbLib.c

Function : PeiUsbSetConfiguration

File: PeiUsbLib.c
Description:
This function uses a device's PEI_USB_IO_PPI interface to execute a
control transfer on the default control pipe to set the device's
default configuration index of 1.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN PEI_USB_IO_PPI *UsbIoPpi
   --  PEI_USB_IO_PPI interface pointer for the device
       that is being accessed
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


PeiUsbSetDeviceAddress in the PeiUsbLib.c

Function : PeiUsbSetDeviceAddress

File: PeiUsbLib.c
Description:
This function uses a device's PEI_USB_IO_PPI interface to execute a
control transfer on the default control pipe to set the device's
address on the USB bus for all future accesses.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  PEI Sevices table pointer
IN PEI_USB_IO_PPI *UsbIoPpi
   --  PEI_USB_IO_PPI interface pointer for the device
       that is being accessed
IN UINT16 AddressValue
   --  The device address to be set
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


ZeroMem in the PeiUsbLib.c

Function : ZeroMem

File: PeiUsbLib.c
Description:
This library function initializes provided buffer with Zero
Input:
*Buffer     Pointer to the buffer whose content to be inited
Size        Number of bytes to be filled in
Output:
Returns None


PeiUsbLib.h

Description:
This file belongs to "Framework" and included here for
compatibility purposes. This file is modified by AMI to include
copyright message, appropriate header and integration code.


UhciPeiUsb.c

Description:
This file is the main source file for the UHCI PEI USB
recovery module

The following functions are used in the file: UhciPeiUsb.c.

Function | Description
ClearEhciConfigFlagReg |
EnableUhciController | This function enables the UHCI controller
GetUhciController | This function returns controller type and I/O base address value for the controller specified
UhciPeiUsbEntryPoint | This function is the entry point for this PEI. This function initializes the UHCI Controller


ClearEhciConfigFlagReg in the UhciPeiUsb.c

Function : ClearEhciConfigFlagReg

File: UhciPeiUsb.c
Description:
Input:
**PeiServices       Pointer to the PEI services table
*PciCfgPpi          Pointer to the PCI Configuration PPI
Built on 10:24:23 01/08/13


EnableUhciController in the UhciPeiUsb.c

Function : EnableUhciController

File: UhciPeiUsb.c
Description:
This function enables the UHCI controller
Input:
**PeiServices       Pointer to the PEI services table
*PciCfgPpi          Pointer to the PCI Configuration PPI
BaseAddress         I/O base Address to be programmed for the
                   UHCI controller
UsbControllerId     USB Controller ID
Output:
EFI_STATUS


GetUhciController in the UhciPeiUsb.c

Function : GetUhciController

File: UhciPeiUsb.c
Description:
This function returns controller type and I/O base address
value for the controller specified
Input:
**PeiServices       Pointer to the PEI services table
*PciCfgPpi          Pointer to the PCI Configuration PPI
UsbControllerId     USB Controller ID
Output:
EFI_STATUS
*ControllerType     Type of the USB controller
*IoBaseAddress      I/O base Address programmed for this
                   controller


UhciPeiUsbEntryPoint in the UhciPeiUsb.c

Function : UhciPeiUsbEntryPoint

File: UhciPeiUsb.c
Description:
This function is the entry point for this PEI. This function
initializes the UHCI Controller
Input:
FfsHeader   Pointer to the FFS file header
PeiServices Pointer to the PEI services table
Output:
Return Status based on errors that occurred while waiting for
time to expire.


UhcPeim.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
PEIM


UhcPeim.h

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.


usb.h

Description:
This file belongs to "Framework" and included here for
compatibility purposes. This file is modified by AMI to include
copyright message and appropriate header


UsbBotPeim.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
PEIM


UsbBotPeim.dxs

Description:
This file is the dependency file for the USB BOT protocol PEIM


UsbBotPeim.h

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.


UsbIoPeim.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
PEIM


UsbPeim.c

Description:
This file belongs to "Framework".
This file is modified by AMI to include copyright message,
appropriate header and integration code.
This file contains generic routines needed for USB recovery
PEIM


UsbPeim.h

Description:
This file belongs to "Framework" and included here for
compatibility purposes. This file is modified by AMI to include
copyright message, appropriate header and integration code


UsbRecov.mak

Description:
Contains make script to build USB Recovery related
PEIM.  This script file generates UhciPeiUsb, OhciPei,
UhcPeim, UsbPeim and UsbBotPeim


XhciPei.c

Description:
This file is the main source file for the xHCI PEI USB recovery module.
Its entry point at XhciPeiUsbEntryPoint will be executed from the
UsbRecoveryInitialize INIT_LIST.

The following functions are used in the file: XhciPei.c.

Function | Description
GetSlotId | This function retrieves SlotId from the Slot<->Address mapping table.
UpdateDeviceMap | This function updates SlotId<->Address mapping table.
UpdatePortStatusSpeed | This function converts XHCI speed definition into the terms of PEI_USB_HOST_CONTROLLER_PPI (namely XHCI_DEVSPEED_xyz is converted into USB_PORT_STAT_xyz).
XHCI_ProcessInterrupt | This is the XHCI controller event handler. It walks through the Event Ring and executes the event associated code if needed. Updates the Event Ring Data Pointer in the xHC to let it know which events are completed.
XhciAdvanceEnqueuePtr | This function advances returns the pointer to the current TRB and anvances dequeue pointer. If the advance pointer is Link TRB, then it: 1) activates Link TRB by updating its cycle bit, 2) updates dequeue pointer to the value pointed by Link TRB.
XhciClearStalledEp | This function is called to restart endpoint. After Endpoint STALLs, it transitions from Halted to Stopped state. It is restored back to Running state by moving the endpoint ring dequeue pointer past the failed control transfer with a Set TR Dequeue Pointer. Then it is restarted by ringing the doorbell. Alternatively endpint is restarted using Configure Endpoint command.
XhciEnableEndpoints | This function parses the device descriptor data and enables the endpoints by 1)assigning the Transfer TRB and 2)executing ConfigureEndpoint command for the slot. Section 4.3.5.
XhciEnableUsb2Port |
XhciExecuteCommand | This function places a given command in the Command Ring, rings HC doorbell, and waits for the command completion.
XhciExtCapParser |
XhciGetContextEntry | This function calculates and returns the pointer to a context entry for a given index.
XhciGetDeviceContext | This function calculates and returns the pointer to a device context for a given Slot.
XhciGetTheDoorbell | This function calculates and returns the pointer to a doorbell for a given Slot.
XhciGetXfrRing | This routine calculates the address of the address ring of a particular Slot/Endpoint.
XhciHcBulkTransfer | This function intiates a USB bulk transfer and waits on it to complete.
XhciHcClearRootHubPortFeature | Host controller PEI_USB_HOST_CONTROLLER_PPI API function; clears a requested feature of a root hub port.
XhciHcControlTransfer | This function intiates a USB control transfer and waits on it to complete.
XhciHcGetRootHubPortNumber | This function returns number of root ports supported by the controller.
XhciHcGetRootHubPortStatus | Host controller API function; returns root hub port status in terms of PEI_USB_HOST_CONTROLLER_PPI definition.
XhciHcPreConfigureDevice | This function does preliminary device initialization: enables slot and sets the address.
XhciHcSetRootHubPortFeature | Host controller PEI_USB_HOST_CONTROLLER_PPI API function; sets a requested feature of a root hub port.
XhciInitHC | This function initializes xHCI controller registers and starts it.
XhciInitRing | Transfer ring initialization. There is an option to create a Link TRB in the end of the ring.
XhciInitXfrRing | This function initializes transfer ring of given endpoint
XhciMmio64Write | MMIO write; depending on 64-bit access availability executes either one 64-bit write or two 32-bit writes.
XhciPeiUsbEntryPoint | This is the entry point into the XHCI initialization.
XhciTranslateInterval | This routine calculates the Interval field to be used in device's endpoint context. Interval is calculated using the following rules (Section 6.2.3.6): For SuperSpeed bulk and control endpoints, the Interval field shall not be used by the xHC. For all other endpoint types and speeds, system software shall translate the bInterval field in the USB Endpoint Descriptor to the appropriate value for this field. For high-speed and SuperSpeed Interrupt and Isoch endpoints the bInterval field the Endpoint Descriptor is computed as 125æs * 2^(bInterval-1), where bInterval = 1 to 16, therefore Interval = bInterval - 1. For low-speed Interrupt and full-speed Interrupt and Isoch endpoints the bInterval field declared by a Full or Low-speed device is computed as bInterval * 1ms., where bInterval = 1 to 255. For Full- and Low-speed devices software shall round the value of Endpoint Context Interval field down to the nearest base 2 multiple of bInterval * 8.
XhciUpdateEp0MaxPacket | This function verifies the MaxPacket size of the control pipe. If it does not match the one received as a part of GET_DESCRIPTOR, then this function updates the MaxPacket data in DeviceContext and HC is notified via EvaluateContext command.
XhciWaitForEvent | This function walks through the active TRBs in the event ring and looks for the command TRB to be complete. If found, returns SlotId and CompletionCode from the completed event TRB. In the end it processes the event ring, adjusting its Dequeue Pointer.


GetSlotId in the XhciPei.c

Function : GetSlotId

File: XhciPei.c
Description:
This function retrieves SlotId from the Slot<->Address mapping table.
Output:
SlotId variable is updated
EFI_STATUS (Return Value)
= EFI_SUCCESS if update is successful
= EFI_NOT_FOUND if the requested Slot is not found in the mapping table


UpdateDeviceMap in the XhciPei.c

Function : UpdateDeviceMap

File: XhciPei.c
Description:
This function updates SlotId<->Address mapping table.
Output:
EFI_STATUS (Return Value)
= EFI_SUCCESS if update is successful
= EFI_NOT_FOUND if there is no room for a new entry in the map


UpdatePortStatusSpeed in the XhciPei.c

Function : UpdatePortStatusSpeed

File: XhciPei.c
Description:
This function converts XHCI speed definition into the terms
of PEI_USB_HOST_CONTROLLER_PPI (namely XHCI_DEVSPEED_xyz is converted
into USB_PORT_STAT_xyz).


XHCI_ProcessInterrupt in the XhciPei.c

Function : XHCI_ProcessInterrupt

File: XhciPei.c
Description:
This is the XHCI controller event handler. It walks through
the Event Ring and executes the event associated code if needed. Updates
the Event Ring Data Pointer in the xHC to let it know which events are
completed.
Output:
EFI_NOT_READY   - Need more Interrupt processing
EFI_SUCCESS     - No interrupts pending


XhciAdvanceEnqueuePtr in the XhciPei.c

Function : XhciAdvanceEnqueuePtr

File: XhciPei.c
Description:
This function advances returns the pointer to the current TRB and anvances
dequeue pointer. If the advance pointer is Link TRB, then it: 1) activates
Link TRB by updating its cycle bit, 2) updates dequeue pointer to the value
pointed by Link TRB.
Input:
Ring - TRB ring to be updated
Output:
TRB that can be used for command, transfer, etc.


XhciClearStalledEp in the XhciPei.c

Function : XhciClearStalledEp

File: XhciPei.c
Description:
This function is called to restart endpoint. After Endpoint STALLs, it
transitions from Halted to Stopped state. It is restored back to Running
state by moving the endpoint ring dequeue pointer past the failed control
transfer with a Set TR Dequeue Pointer. Then it is restarted by ringing the
doorbell. Alternatively endpint is restarted using Configure Endpoint command.
Input:
Stalled EP data - SlotId and DCI


XhciEnableEndpoints in the XhciPei.c

Function : XhciEnableEndpoints

File: XhciPei.c
Description:
This function parses the device descriptor data and enables the endpoints
by 1)assigning the Transfer TRB and 2)executing ConfigureEndpoint command
for the slot. Section 4.3.5.
Input:
Desc    - Device Configuration Descriptor data pointer
Output:
EFI_DEVICE_ERROR on error, EFI_SUCCESS on success
Notes:
1) This call is executed before SET_CONFIGURATION control transfer
2) Device slot is addressed by gSlotBeingConfigured
3) EP0 information is valid in the Device


XhciEnableUsb2Port in the XhciPei.c

Function : XhciEnableUsb2Port

File: XhciPei.c
Description:


XhciExecuteCommand in the XhciPei.c

Function : XhciExecuteCommand

File: XhciPei.c
Description:
This function places a given command in the Command Ring, rings HC doorbell,
and waits for the command completion.
Output:
EFI_DEVICE_ERROR on execution failure, otherwise EFI_SUCCESS
Params - pointer to the command specific data.
Notes:
Caller is responsible for a data placeholder.


XhciExtCapParser in the XhciPei.c

Function : XhciExtCapParser

File: XhciPei.c
Description:


XhciGetContextEntry in the XhciPei.c

Function : XhciGetContextEntry

File: XhciPei.c
Description:
This function calculates and returns the pointer to a context entry for
a given index.


XhciGetDeviceContext in the XhciPei.c

Function : XhciGetDeviceContext

File: XhciPei.c
Description:
This function calculates and returns the pointer to a device context for
a given Slot.


XhciGetTheDoorbell in the XhciPei.c

Function : XhciGetTheDoorbell

File: XhciPei.c
Description:
This function calculates and returns the pointer to a doorbell for a
given Slot.


XhciGetXfrRing in the XhciPei.c

Function : XhciGetXfrRing

File: XhciPei.c
Description:
This routine calculates the address of the address ring of a particular
Slot/Endpoint.
Output:
Pointer to the transfer ring


XhciHcBulkTransfer in the XhciPei.c

Function : XhciHcBulkTransfer

File: XhciPei.c
Description:
This function intiates a USB bulk transfer and waits on it to
complete.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 DeviceAddress
   --  USB address of the device for which the control
       transfer is to be issued
IN UINT8 EndPointAddress
   --  Particular endpoint for the device
IN UINT8 MaximumPacketLength
   --  Maximum number of bytes that can be sent to or
       received from the endpoint in a single data packet
OPTIONAL IN OUT VOID *DataBuffer
   --  Pointer to source or destination buffer
OPTIONAL IN OUT UINTN *DataLength
   --  Length of buffer
IN OUT UINT8 *DataToggle
   --  Used to update the control/status DataToggle field
       of the Transfer Descriptor
IN UINTN TimeOut
   --  Not used
OUT UINT32 *TransferResult
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


XhciHcClearRootHubPortFeature in the XhciPei.c

Function : XhciHcClearRootHubPortFeature

File: XhciPei.c
Description:
Host controller PEI_USB_HOST_CONTROLLER_PPI API function; clears a requested
feature of a root hub port.


XhciHcControlTransfer in the XhciPei.c

Function : XhciHcControlTransfer

File: XhciPei.c
Description:
This function intiates a USB control transfer and waits on it to
complete.
Input:
IN EFI_PEI_SERVICES **PeiServices
   --  EFI_PEI_SERVICES pointer
IN PEI_USB_HOST_CONTROLLER_PPI *This
   --  PEI_USB_HOST_CONTROLLER_PPI pointer
IN UINT8 bDeviceAddress
   --  USB address of the device for which the control
       transfer is to be issued
IN UINT8 DeviceType
   --  Not used
IN UINT8 MaximumPacketLength
   --  Maximum number of bytes that can be sent to or
       received from the endpoint in a single data packet
IN EFI_USB_DEVICE_REQUEST *Request
   --  EFI_USB_DEVICE_REQUEST pointer
IN EFI_USB_DATA_DIRECTION TransferDirection
   --  Direction of transfer
OPTIONAL IN OUT VOID *DataBuffer
   --  Pointer to source or destination buffer
OPTIONAL IN OUT UINTN *DataLength
   --  Length of buffer
IN UINTN TimeOut
   --  Not used
OUT UINT32 *TransferResult
   --  Not used
Output:
EFI_STATUS (Return Value)
   = EFI_SUCCESS on successful completion
       or valid EFI error code


XhciHcGetRootHubPortNumber in the XhciPei.c

Function : XhciHcGetRootHubPortNumber

File: XhciPei.c
Description:
This function returns number of root ports supported by the controller.


XhciHcGetRootHubPortStatus in the XhciPei.c

Function : XhciHcGetRootHubPortStatus

File: XhciPei.c
Description:
Host controller API function; returns root hub port status in terms of
PEI_USB_HOST_CONTROLLER_PPI definition.


XhciHcPreConfigureDevice in the XhciPei.c

Function : XhciHcPreConfigureDevice

File: XhciPei.c
Description:
This function does preliminary device initialization: enables slot and
sets the address.
Output:
EFI_STATUS (Return Value)
= EFI_SUCCESS on successful pre-configuration completion
= EFI_DEVICE_ERROR on error


XhciHcSetRootHubPortFeature in the XhciPei.c

Function : XhciHcSetRootHubPortFeature

File: XhciPei.c
Description:
Host controller PEI_USB_HOST_CONTROLLER_PPI API function; sets a requested
feature of a root hub port.


XhciInitHC in the XhciPei.c

Function : XhciInitHC

File: XhciPei.c
Description:
This function initializes xHCI controller registers and starts it.
Input:
EFI_PEI_SERVICES    **PeiServices
-- PEI_SERVICES pointer
USB3_CONTROLLER     *Usb3Hc
-- XHCI controller data structure pointer
UINT8               ControllerIndex
-- 0-based index of the controller to be initialized
Output:
EFI_STATUS (Return Value)
= EFI_SUCCESS on successful initialization completion


XhciInitRing in the XhciPei.c

Function : XhciInitRing

File: XhciPei.c
Description:
Transfer ring initialization. There is an option to create a Link TRB in
the end of the ring.


XhciInitXfrRing in the XhciPei.c

Function : XhciInitXfrRing

File: XhciPei.c
Description:
This function initializes transfer ring of given endpoint
Output:
Pointer to the transfer ring


XhciMmio64Write in the XhciPei.c

Function : XhciMmio64Write

File: XhciPei.c
Description:
MMIO write; depending on 64-bit access availability executes either one
64-bit write or two 32-bit writes.


XhciPeiUsbEntryPoint in the XhciPei.c

Function : XhciPeiUsbEntryPoint

File: XhciPei.c
Description:
This is the entry point into the XHCI initialization.
Input:
IN EFI_FFS_FILE_HEADER *FfsHeader
--  EFI_FFS_FILE_HEADER pointer
IN EFI_PEI_SERVICES **PeiServices
--  EFI_PEI_SERVICES pointer
Output:
EFI_STATUS (Return Value)
= EFI_SUCCESS on successful completion or valid EFI error code


XhciTranslateInterval in the XhciPei.c

Function : XhciTranslateInterval

File: XhciPei.c
Description:
This routine calculates the Interval field to be used in device's endpoint
context. Interval is calculated using the following rules (Section 6.2.3.6):

For SuperSpeed bulk and control endpoints, the Interval field shall not be
used by the xHC. For all other endpoint types and speeds, system software
shall translate the bInterval field in the USB Endpoint Descriptor to the
appropriate value for this field.

For high-speed and SuperSpeed Interrupt and Isoch endpoints the bInterval
field the Endpoint Descriptor is computed as 125æs * 2^(bInterval-1), where
bInterval = 1 to 16, therefore Interval = bInterval - 1.

For low-speed Interrupt and full-speed Interrupt and Isoch endpoints the
bInterval field declared by a Full or Low-speed device is computed as
bInterval * 1ms., where bInterval = 1 to 255.

For Full- and Low-speed devices software shall round the value of Endpoint
Context Interval field down to the nearest base 2 multiple of bInterval * 8.
Input:
EpType      Endpoint type, see XHCI_EP_CONTEXT.DW1.EpType field definitions
Speed       Endpoint speed, 1..4 for XHCI_DEVSPEED_FULL, _LOW, _HIGH, _SUPER
Interval    Poll interval value from endpoint descriptor
Output:
Interval value to be written to the endpoint context


XhciUpdateEp0MaxPacket in the XhciPei.c

Function : XhciUpdateEp0MaxPacket

File: XhciPei.c
Description:
This function verifies the MaxPacket size of the control pipe. If it does
not match the one received as a part of GET_DESCRIPTOR, then this function
updates the MaxPacket data in DeviceContext and HC is notified via
EvaluateContext command.
Input:
Usb3Hc  Pointer to the HC structure
Device  Evaluated device context pointer
SlotId  Device context index in DCBAA
Endp0MaxPacket  Max packet size obtained from the device


XhciWaitForEvent in the XhciPei.c

Function : XhciWaitForEvent

File: XhciPei.c
Description:
This function walks through the active TRBs in the event ring and looks for
the command TRB to be complete. If found, returns SlotId and CompletionCode
from the completed event TRB. In the end it processes the event ring,
adjusting its Dequeue Pointer.


XhciPei.h

Description:
This file is the main header file for the EHCI PEI USB recovery module. It
contains generic constant and type declarations/definitions.


Functions in Alphabetical Order

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.

  • C
  • D
  • E
  • G
  • I
  • N
  • O
  • P
  • U
  • X
  • Z
Built on 10:24:23 01/08/13


Functions in Alphabetical Order

C

Function | Description
ClearEhciConfigFlagReg |

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

D

Function | Description
DefaultInit | This function generically initializes the PCI configuration space registers for all the OHCI controllers whose PCI addresses are specified by the global PCI_BUS_DEV_FUNCTION array and whose PCI register programming details are specified by the global OHCI_PCI_PROGRAMMING_TABLE array.
DwordReadMem | This routine reads a DWORD from the specified Memory Address
DwordWriteMem | This routine writes a DWORD to a specified Memory Address

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

E

Function | Description
EhciGetOperationalRegisterBase | This function uses ControllerIndex and the global PCI_BUS_DEV_FUNCTION array to access a particular controller's PCI configuration space in order to obtain the Operational Register base address.
EhciHcBulkTransfer | This function intiates a USB bulk transfer and waits on it to complete.
EhciHcClearRootHubPortFeature | This function clears an EHCI specification port feature as specified by PortFeature for the port specified by PortNumber.
EhciHcControlTransfer | This function intiates a USB control transfer and waits on it to complete.
EhciHcGetRootHubPortNumber | This function returns the number of downstream ports as specified in the HcRhDescriptorA operational register.
EhciHcGetRootHubPortStatus | This function obtains the port status and port change status for a port specified by PortNumber and updates the EFI_USB_PORT_STATUS data structure as specified the the PortStatus pointer parameter.
EhciHcReset | This function performs a software reset of the host controller.
EhciHcSetRootHubPortFeature | This function sets port feature as specified by PortFeature for the port specified by PortNumber.
EhciInitHC | EHCI controller initialization.
EHCIInitializeQueueHead | This function initializes the queue head with default values
EhciPeiBoardInit | This is a porting hook for board-specific EHCI controller initialization
EhciPeiUsbEntryPoint | This is the entry point into the EHCI controller initialization subsystem.
EHCIProcessQH | This function whether all the TD's in the QH is completed
EhciReleasePortOwner |
EHCISetQTDBufferPointers | This function will set the 5 buffer pointer in the qTD appropriately depending upon the input size
EHCIStartAsyncSchedule | This function starts the asynchronous schedule
EHCIStopAsyncSchedule | This function stops the asynchronous transfer and sets the asynchronous pointer to null
EHCIWaitForAsyncTransferComplete | This function waits for asynchronous transfer completion.
EnableUhciController | This function enables the UHCI controller

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

G

Function | Description
GetSlotId | This function retrieves SlotId from the Slot<->Address mapping table.
GetUhciController | This function returns controller type and I/O base address value for the controller specified

Table | Description
gOhciControllerPciTable | This is an array of type: PCI_BUS_DEV_FUNCTION This array is initialized from the PEI_OHCI_PCI_DEVICES SDL token, which specifies a {bus,device,function} entry for each OHCI controller. If no OHCI controllers exist, there will be only one NULL entry. This array is used for PCI initialization of OHCI controllers, as well as access to PCI configuration registers.
gOhciPciRegisterTable | This is an array of type: OHCI_PCI_PROGRAMMING_TABLE This array is initialized from the OHCI_CONTROLLER_PCI_REGISTER_VALUE SDL eLink, which specifies a { RegisterSize, Register, BitsToSet, BitsToClear } entry for each register in the PCI configuration space that needs to be modified. This array is used for PCI initialization of OHCI controllers.

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

I

Function | Description
IsMediaChange | This function verifies whether Media change had happened or not by checking the Sense Data obtained from the drive
IsMediaError | This function verifies whether Media access is having problem or not by checking the Sense Data obtained from the drive
IsNoMedia | This function verifies whether Media is present in the drive or not by checking the Sense Data obtained from the drive
IsPortConnect | This function returns true if the Hub Class device's Current Connect Status bit is set in the port status value specified by PortStatus.
IsPortConnectChange | This function returns true if the Hub Class device's Connect Status Change bit is set in the port change status value specified by PortChangeStatus.
IsPortEnable |
IsPortHighSpeedDeviceAttached | This function returns true if the Hub Class device's High-Speed Device Attached bit is set in the port status value specified by PortStatus.
IsPortLowSpeedDeviceAttached | This function returns true if the Hub Class device's Low-Speed Device Attached bit is set in the port status value specified by PortStatus.
IsPortSuperSpeedDeviceAttached | This function returns true if connect status indicates the SuperSpeed device.

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

N

Function | Description
NotifyOnRecoveryCapsuleLoaded | This routine halts the all available EHCI host controller

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

O

Function | Description
OhciGetOperationalRegisterBase | This function uses ControllerIndex and the global PCI_BUS_DEV_FUNCTION array to access a particular controller's PCI configuration space in order to obtain the Operational Register base address.
OhciHcBulkTransfer | This function intiates a USB bulk transfer and waits on it to complete.
OhciHcClearRootHubPortFeature | This function clears an OHCI specification port feature as specified by PortFeature for the port specified by PortNumber.
OhciHcControlTransfer | This function intiates a USB control transfer and waits on it to complete.
OhciHcGetRootHubPortNumber | This function returns the number of downstream ports as specified in the HcRhDescriptorA operational register.
OhciHcGetRootHubPortStatus | This function obtains the port status and port change status for a port specified by PortNumber and updates the EFI_USB_PORT_STATUS data structure as specified the the PortStatus pointer parameter.
OhciHcReset | This function performs a software reset of the host controller.
OhciHcSetRootHubPortFeature | This function sets an OHCI specification port feature as specified by PortFeature for the port specified by PortNumber.
OhciHcWaitForTransferComplete | This function waits for a tranfer to complete by polling the HcInterruptStatus register's WritebackDoneHead field.
OhciInitHC | All leading whitespace on this line is removed by Helpbuilder Description of this function can be block aligned in this section. The first tab that Helpbuilder will recognize will be at tab stop 21, which will indent 4 spaces in Helpbuilder. This text is indented 4 spaces in Helpbuilder
OhciInitHcca | This routine allocates memory for the the Host Controller Communications Area (HCCA), aligned on a 256 byte boundary, and updates the HcHcca operational register pointer, as well as the corresponding PEI_OHCI_DEV.pFrameList pointer.
OhciPeiBoardInit | This is a porting hook for board-specific OHCI controller initialization
OhciPeiUsbEntryPoint | This is the entry point into the OHCI controller initialization subsystem.

Data Structure | Description
OHCI_PCI_PROGRAMMING_TABLE | This structure type defines the parameters to be used in a call to EFI_PEI_PCI_CFG_PPI.Modify(), when programming the PCI configuration space for a particular OHCI controller.

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

P

Function | Description
PeiCopyMem | This library function copies bytes specified by Length from the memory location specified by Source to the memory location specified by Destination.
PeiHubGetPortStatus | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to issue a Hub Class-specific request to obtain the port status and port status change bits.
PeiUsbClearDeviceFeature | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to clear or disable a specific feature.
PeiUsbClearEndpointHalt | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to clear a bulk Endpoint halt condition (and resetting the Halt status bit) for a specified Endpoint.
PeiUsbGetDescriptor | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to obtain a device descriptor.
PeiUsbInquiry | This function issues the ATA Inquiry command to the USB mass storage device
PeiUsbRead10 | This function issues the ATA Read (10) command to the USB mass storage device
PeiUsbReadCapacity | This function issues the ATA Read Capacity command to the USB mass storage device
PeiUsbReadFormattedCapacity | This function issues the ATA Read Formatted Capacity command to the USB mass storage device
PeiUsbRequestSense | This function issues the ATA Request Sense command to the USB mass storage device
PeiUsbSetConfiguration | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to set the device's default configuration index of 1.
PeiUsbSetDeviceAddress | This function uses a device's PEI_USB_IO_PPI interface to execute a control transfer on the default control pipe to set the device's address on the USB bus for all future accesses.
PeiUsbTestUnitReady | This function issues the ATA Test Unit Ready command to the USB mass storage device
PeiUsbValidatePartitionTable | This function validates the existence of the partition table from the LBA 0 data provided and return FdEmulOffset value (hidden sector) from the partition table

Data Structure | Description
PCI_BUS_DEV_FUNCTION | This structure type defines the bus, device and function number that compose a PCI address.

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

U

Function | Description
UhciPeiUsbEntryPoint | This function is the entry point for this PEI. This function initializes the UHCI Controller
Update_EHCIDbg_PortUsed | Check debugport of a controlller is in use or not.
UpdateDeviceMap | This function updates SlotId<->Address mapping table.
UpdatePortStatusSpeed | This function converts XHCI speed definition into the terms of PEI_USB_HOST_CONTROLLER_PPI (namely XHCI_DEVSPEED_xyz is converted into USB_PORT_STAT_xyz).

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

X

Function | Description
XHCI_ProcessInterrupt | This is the XHCI controller event handler. It walks through the Event Ring and executes the event associated code if needed. Updates the Event Ring Data Pointer in the xHC to let it know which events are completed.
XhciAdvanceEnqueuePtr | This function advances returns the pointer to the current TRB and anvances dequeue pointer. If the advance pointer is Link TRB, then it: 1) activates Link TRB by updating its cycle bit, 2) updates dequeue pointer to the value pointed by Link TRB.
XhciClearStalledEp | This function is called to restart endpoint. After Endpoint STALLs, it transitions from Halted to Stopped state. It is restored back to Running state by moving the endpoint ring dequeue pointer past the failed control transfer with a Set TR Dequeue Pointer. Then it is restarted by ringing the doorbell. Alternatively endpint is restarted using Configure Endpoint command.
XhciEnableEndpoints | This function parses the device descriptor data and enables the endpoints by 1)assigning the Transfer TRB and 2)executing ConfigureEndpoint command for the slot. Section 4.3.5.
XhciEnableUsb2Port |
XhciExecuteCommand | This function places a given command in the Command Ring, rings HC doorbell, and waits for the command completion.
XhciExtCapParser |
XhciGetContextEntry | This function calculates and returns the pointer to a context entry for a given index.
XhciGetDeviceContext | This function calculates and returns the pointer to a device context for a given Slot.
XhciGetTheDoorbell | This function calculates and returns the pointer to a doorbell for a given Slot.
XhciGetXfrRing | This routine calculates the address of the address ring of a particular Slot/Endpoint.
XhciHcBulkTransfer | This function intiates a USB bulk transfer and waits on it to complete.
XhciHcClearRootHubPortFeature | Host controller PEI_USB_HOST_CONTROLLER_PPI API function; clears a requested feature of a root hub port.
XhciHcControlTransfer | This function intiates a USB control transfer and waits on it to complete.
XhciHcGetRootHubPortNumber | This function returns number of root ports supported by the controller.
XhciHcGetRootHubPortStatus | Host controller API function; returns root hub port status in terms of PEI_USB_HOST_CONTROLLER_PPI definition.
XhciHcPreConfigureDevice | This function does preliminary device initialization: enables slot and sets the address.
XhciHcSetRootHubPortFeature | Host controller PEI_USB_HOST_CONTROLLER_PPI API function; sets a requested feature of a root hub port.
XhciInitHC | This function initializes xHCI controller registers and starts it.
XhciInitRing | Transfer ring initialization. There is an option to create a Link TRB in the end of the ring.
XhciInitXfrRing | This function initializes transfer ring of given endpoint
XhciMmio64Write | MMIO write; depending on 64-bit access availability executes either one 64-bit write or two 32-bit writes.
XhciPeiUsbEntryPoint | This is the entry point into the XHCI initialization.
XhciTranslateInterval | This routine calculates the Interval field to be used in device's endpoint context. Interval is calculated using the following rules (Section 6.2.3.6): For SuperSpeed bulk and control endpoints, the Interval field shall not be used by the xHC. For all other endpoint types and speeds, system software shall translate the bInterval field in the USB Endpoint Descriptor to the appropriate value for this field. For high-speed and SuperSpeed Interrupt and Isoch endpoints the bInterval field the Endpoint Descriptor is computed as 125æs * 2^(bInterval-1), where bInterval = 1 to 16, therefore Interval = bInterval - 1. For low-speed Interrupt and full-speed Interrupt and Isoch endpoints the bInterval field declared by a Full or Low-speed device is computed as bInterval * 1ms., where bInterval = 1 to 255. For Full- and Low-speed devices software shall round the value of Endpoint Context Interval field down to the nearest base 2 multiple of bInterval * 8.
XhciUpdateEp0MaxPacket | This function verifies the MaxPacket size of the control pipe. If it does not match the one received as a part of GET_DESCRIPTOR, then this function updates the MaxPacket data in DeviceContext and HC is notified via EvaluateContext command.
XhciWaitForEvent | This function walks through the active TRBs in the event ring and looks for the command TRB to be complete. If found, returns SlotId and CompletionCode from the completed event TRB. In the end it processes the event ring, adjusting its Dequeue Pointer.

Built on 10:24:23 01/08/13


Functions in Alphabetical Order

Z

Function | Description
ZeroMem | This library function initializes provided buffer with Zero

Built on 10:24:23 01/08/13


General Information