VirtualBox

Ignore:
Timestamp:
Oct 28, 2015 8:17:18 PM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c

    r48674 r58459  
    33  The XHCI register operation routines.
    44
    5 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    500500  @param  Bit          The bit of the register to wait for.
    501501  @param  WaitToSet    Wait the bit to set or clear.
    502   @param  Timeout      The time to wait before abort (in millisecond, ms).
     502  @param  Timeout      The time to wait before abort (in microsecond, us).
    503503
    504504  @retval EFI_SUCCESS  The bit successfully changed by host controller.
     
    518518  UINTN                   Loop;
    519519
    520   Loop   = (Timeout * XHC_1_MILLISECOND / XHC_POLL_DELAY) + 1;
     520  Loop   = (Timeout / XHC_POLL_DELAY) + 1;
    521521
    522522  for (Index = 0; Index < Loop; Index++) {
     
    544544  UINT32                    Buffer;
    545545
     546  if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) {
     547    return;
     548  }
     549
    546550  DEBUG ((EFI_D_INFO, "XhcSetBiosOwnership: called to set BIOS ownership\n"));
    547551
     
    564568  UINT32                    Buffer;
    565569
     570  if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) {
     571    return;
     572  }
     573
    566574  DEBUG ((EFI_D_INFO, "XhcClearBiosOwnership: called to clear BIOS ownership\n"));
    567575
     
    572580
    573581/**
    574   Calculate the XHCI legacy support capability register offset.
     582  Calculate the offset of the XHCI capability.
    575583
    576584  @param  Xhc     The XHCI Instance.
     585  @param  CapId   The XHCI Capability ID.
    577586
    578587  @return The offset of XHCI legacy support capability register.
     
    580589**/
    581590UINT32
    582 XhcGetLegSupCapAddr (
    583   IN USB_XHCI_INSTANCE    *Xhc
     591XhcGetCapabilityAddr (
     592  IN USB_XHCI_INSTANCE    *Xhc,
     593  IN UINT8                CapId
    584594  )
    585595{
     
    595605    //
    596606    Data = XhcReadExtCapReg (Xhc, ExtCapOffset);
    597     if ((Data & 0xFF) == 0x1) {
     607    if ((Data & 0xFF) == CapId) {
    598608      return ExtCapOffset;
    599609    }
     
    605615  } while (NextExtCapReg != 0);
    606616
    607   return 0;
     617  return 0xFFFFFFFF;
    608618}
    609619
     
    647657
    648658  @param  Xhc          The XHCI Instance.
    649   @param  Timeout      Time to wait before abort (in millisecond, ms).
     659  @param  Timeout      Time to wait before abort (in microsecond, us).
    650660
    651661  @retval EFI_SUCCESS  The XHCI host controller is reset.
     
    660670{
    661671  EFI_STATUS              Status;
     672
     673  Status = EFI_SUCCESS;
    662674
    663675  DEBUG ((EFI_D_INFO, "XhcResetHC!\n"));
     
    673685  }
    674686
    675   XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET);
    676   Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout);
     687  if ((Xhc->DebugCapSupOffset == 0xFFFFFFFF) || ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset) & 0xFF) != XHC_CAP_USB_DEBUG) ||
     688      ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset + XHC_DC_DCCTRL) & BIT0) == 0)) {
     689    XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET);
     690    Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout);
     691  }
     692
    677693  return Status;
    678694}
     
    683699
    684700  @param  Xhc          The XHCI Instance.
    685   @param  Timeout      Time to wait before abort (in millisecond, ms).
     701  @param  Timeout      Time to wait before abort (in microsecond, us).
    686702
    687703  @return EFI_SUCCESS  The XHCI host controller is halt.
     
    707723
    708724  @param  Xhc          The XHCI Instance.
    709   @param  Timeout      Time to wait before abort (in millisecond, ms).
     725  @param  Timeout      Time to wait before abort (in microsecond, us).
    710726
    711727  @return EFI_SUCCESS  The XHCI host controller is running.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette