Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
r48674 r58459 3 3 The XHCI register operation routines. 4 4 5 Copyright (c) 2011 , Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR> 6 6 This program and the accompanying materials 7 7 are licensed and made available under the terms and conditions of the BSD License … … 500 500 @param Bit The bit of the register to wait for. 501 501 @param WaitToSet Wait the bit to set or clear. 502 @param Timeout The time to wait before abort (in mi llisecond, ms).502 @param Timeout The time to wait before abort (in microsecond, us). 503 503 504 504 @retval EFI_SUCCESS The bit successfully changed by host controller. … … 518 518 UINTN Loop; 519 519 520 Loop = (Timeout * XHC_1_MILLISECOND/ XHC_POLL_DELAY) + 1;520 Loop = (Timeout / XHC_POLL_DELAY) + 1; 521 521 522 522 for (Index = 0; Index < Loop; Index++) { … … 544 544 UINT32 Buffer; 545 545 546 if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) { 547 return; 548 } 549 546 550 DEBUG ((EFI_D_INFO, "XhcSetBiosOwnership: called to set BIOS ownership\n")); 547 551 … … 564 568 UINT32 Buffer; 565 569 570 if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) { 571 return; 572 } 573 566 574 DEBUG ((EFI_D_INFO, "XhcClearBiosOwnership: called to clear BIOS ownership\n")); 567 575 … … 572 580 573 581 /** 574 Calculate the XHCI legacy support capability register offset.582 Calculate the offset of the XHCI capability. 575 583 576 584 @param Xhc The XHCI Instance. 585 @param CapId The XHCI Capability ID. 577 586 578 587 @return The offset of XHCI legacy support capability register. … … 580 589 **/ 581 590 UINT32 582 XhcGetLegSupCapAddr ( 583 IN USB_XHCI_INSTANCE *Xhc 591 XhcGetCapabilityAddr ( 592 IN USB_XHCI_INSTANCE *Xhc, 593 IN UINT8 CapId 584 594 ) 585 595 { … … 595 605 // 596 606 Data = XhcReadExtCapReg (Xhc, ExtCapOffset); 597 if ((Data & 0xFF) == 0x1) {607 if ((Data & 0xFF) == CapId) { 598 608 return ExtCapOffset; 599 609 } … … 605 615 } while (NextExtCapReg != 0); 606 616 607 return 0 ;617 return 0xFFFFFFFF; 608 618 } 609 619 … … 647 657 648 658 @param Xhc The XHCI Instance. 649 @param Timeout Time to wait before abort (in mi llisecond, ms).659 @param Timeout Time to wait before abort (in microsecond, us). 650 660 651 661 @retval EFI_SUCCESS The XHCI host controller is reset. … … 660 670 { 661 671 EFI_STATUS Status; 672 673 Status = EFI_SUCCESS; 662 674 663 675 DEBUG ((EFI_D_INFO, "XhcResetHC!\n")); … … 673 685 } 674 686 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 677 693 return Status; 678 694 } … … 683 699 684 700 @param Xhc The XHCI Instance. 685 @param Timeout Time to wait before abort (in mi llisecond, ms).701 @param Timeout Time to wait before abort (in microsecond, us). 686 702 687 703 @return EFI_SUCCESS The XHCI host controller is halt. … … 707 723 708 724 @param Xhc The XHCI Instance. 709 @param Timeout Time to wait before abort (in mi llisecond, ms).725 @param Timeout Time to wait before abort (in microsecond, us). 710 726 711 727 @return EFI_SUCCESS The XHCI host controller is running.
Note:
See TracChangeset
for help on using the changeset viewer.