TianoCore EDK2 master
Loading...
Searching...
No Matches
XhciReg.c
Go to the documentation of this file.
1
11#include "Xhci.h"
12
23UINT8
26 IN UINT32 Offset
27 )
28{
29 UINT8 Data;
30 EFI_STATUS Status;
31
32 Data = 0;
33
34 Status = Xhc->PciIo->Mem.Read (
35 Xhc->PciIo,
36 EfiPciIoWidthUint8,
37 XHC_BAR_INDEX,
38 (UINT64)Offset,
39 1,
40 &Data
41 );
42
43 if (EFI_ERROR (Status)) {
44 DEBUG ((DEBUG_ERROR, "XhcReadCapReg: Pci Io read error - %r at %d\n", Status, Offset));
45 Data = 0xFF;
46 }
47
48 return Data;
49}
50
61UINT32
64 IN UINT32 Offset
65 )
66{
67 UINT32 Data;
68 EFI_STATUS Status;
69
70 Status = Xhc->PciIo->Mem.Read (
71 Xhc->PciIo,
72 EfiPciIoWidthUint32,
73 XHC_BAR_INDEX,
74 (UINT64)Offset,
75 1,
76 &Data
77 );
78
79 if (EFI_ERROR (Status)) {
80 DEBUG ((DEBUG_ERROR, "XhcReadCapReg: Pci Io read error - %r at %d\n", Status, Offset));
81 Data = 0xFFFFFFFF;
82 }
83
84 return Data;
85}
86
97UINT32
100 IN UINT32 Offset
101 )
102{
103 UINT32 Data;
104 EFI_STATUS Status;
105
106 ASSERT (Xhc->CapLength != 0);
107
108 Status = Xhc->PciIo->Mem.Read (
109 Xhc->PciIo,
110 EfiPciIoWidthUint32,
111 XHC_BAR_INDEX,
112 Xhc->CapLength + Offset,
113 1,
114 &Data
115 );
116
117 if (EFI_ERROR (Status)) {
118 DEBUG ((DEBUG_ERROR, "XhcReadOpReg: Pci Io Read error - %r at %d\n", Status, Offset));
119 Data = 0xFFFFFFFF;
120 }
121
122 return Data;
123}
124
133VOID
136 IN UINT32 Offset,
137 IN UINT32 Data
138 )
139{
140 EFI_STATUS Status;
141
142 ASSERT (Xhc->CapLength != 0);
143
144 Status = Xhc->PciIo->Mem.Write (
145 Xhc->PciIo,
146 EfiPciIoWidthUint32,
147 XHC_BAR_INDEX,
148 Xhc->CapLength + Offset,
149 1,
150 &Data
151 );
152
153 if (EFI_ERROR (Status)) {
154 DEBUG ((DEBUG_ERROR, "XhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset));
155 }
156}
157
166VOID
169 IN UINT32 Offset,
170 IN UINT32 Data
171 )
172{
173 EFI_STATUS Status;
174
175 ASSERT (Xhc->DBOff != 0);
176
177 Status = Xhc->PciIo->Mem.Write (
178 Xhc->PciIo,
179 EfiPciIoWidthUint32,
180 XHC_BAR_INDEX,
181 Xhc->DBOff + Offset,
182 1,
183 &Data
184 );
185
186 if (EFI_ERROR (Status)) {
187 DEBUG ((DEBUG_ERROR, "XhcWriteOpReg: Pci Io Write error: %r at %d\n", Status, Offset));
188 }
189}
190
200UINT32
203 IN UINT32 Offset
204 )
205{
206 UINT32 Data;
207 EFI_STATUS Status;
208
209 ASSERT (Xhc->RTSOff != 0);
210
211 Status = Xhc->PciIo->Mem.Read (
212 Xhc->PciIo,
213 EfiPciIoWidthUint32,
214 XHC_BAR_INDEX,
215 Xhc->RTSOff + Offset,
216 1,
217 &Data
218 );
219
220 if (EFI_ERROR (Status)) {
221 DEBUG ((DEBUG_ERROR, "XhcReadRuntimeReg: Pci Io Read error - %r at %d\n", Status, Offset));
222 Data = 0xFFFFFFFF;
223 }
224
225 return Data;
226}
227
236VOID
239 IN UINT32 Offset,
240 IN UINT32 Data
241 )
242{
243 EFI_STATUS Status;
244
245 ASSERT (Xhc->RTSOff != 0);
246
247 Status = Xhc->PciIo->Mem.Write (
248 Xhc->PciIo,
249 EfiPciIoWidthUint32,
250 XHC_BAR_INDEX,
251 Xhc->RTSOff + Offset,
252 1,
253 &Data
254 );
255
256 if (EFI_ERROR (Status)) {
257 DEBUG ((DEBUG_ERROR, "XhcWriteRuntimeReg: Pci Io Write error: %r at %d\n", Status, Offset));
258 }
259}
260
270UINT32
273 IN UINT32 Offset
274 )
275{
276 UINT32 Data;
277 EFI_STATUS Status;
278
279 ASSERT (Xhc->ExtCapRegBase != 0);
280
281 Status = Xhc->PciIo->Mem.Read (
282 Xhc->PciIo,
283 EfiPciIoWidthUint32,
284 XHC_BAR_INDEX,
285 Xhc->ExtCapRegBase + Offset,
286 1,
287 &Data
288 );
289
290 if (EFI_ERROR (Status)) {
291 DEBUG ((DEBUG_ERROR, "XhcReadExtCapReg: Pci Io Read error - %r at %d\n", Status, Offset));
292 Data = 0xFFFFFFFF;
293 }
294
295 return Data;
296}
297
306VOID
309 IN UINT32 Offset,
310 IN UINT32 Data
311 )
312{
313 EFI_STATUS Status;
314
315 ASSERT (Xhc->ExtCapRegBase != 0);
316
317 Status = Xhc->PciIo->Mem.Write (
318 Xhc->PciIo,
319 EfiPciIoWidthUint32,
320 XHC_BAR_INDEX,
321 Xhc->ExtCapRegBase + Offset,
322 1,
323 &Data
324 );
325
326 if (EFI_ERROR (Status)) {
327 DEBUG ((DEBUG_ERROR, "XhcWriteExtCapReg: Pci Io Write error: %r at %d\n", Status, Offset));
328 }
329}
330
339VOID
342 IN UINT32 Offset,
343 IN UINT32 Bit
344 )
345{
346 UINT32 Data;
347
348 Data = XhcReadRuntimeReg (Xhc, Offset);
349 Data |= Bit;
350 XhcWriteRuntimeReg (Xhc, Offset, Data);
351}
352
361VOID
364 IN UINT32 Offset,
365 IN UINT32 Bit
366 )
367{
368 UINT32 Data;
369
370 Data = XhcReadRuntimeReg (Xhc, Offset);
371 Data &= ~Bit;
372 XhcWriteRuntimeReg (Xhc, Offset, Data);
373}
374
383VOID
386 IN UINT32 Offset,
387 IN UINT32 Bit
388 )
389{
390 UINT32 Data;
391
392 Data = XhcReadOpReg (Xhc, Offset);
393 Data |= Bit;
394 XhcWriteOpReg (Xhc, Offset, Data);
395}
396
405VOID
408 IN UINT32 Offset,
409 IN UINT32 Bit
410 )
411{
412 UINT32 Data;
413
414 Data = XhcReadOpReg (Xhc, Offset);
415 Data &= ~Bit;
416 XhcWriteOpReg (Xhc, Offset, Data);
417}
418
436 IN UINT32 Offset,
437 IN UINT32 Bit,
438 IN BOOLEAN WaitToSet,
439 IN UINT32 Timeout
440 )
441{
442 UINT64 TimeoutTicks;
443 UINT64 ElapsedTicks;
444 UINT64 TicksDelta;
445 UINT64 CurrentTick;
446
447 if (Timeout == 0) {
448 return EFI_TIMEOUT;
449 }
450
451 TimeoutTicks = XhcConvertTimeToTicks (XHC_MICROSECOND_TO_NANOSECOND (Timeout * XHC_1_MILLISECOND));
452 ElapsedTicks = 0;
453 CurrentTick = GetPerformanceCounter ();
454 do {
455 if (XHC_REG_BIT_IS_SET (Xhc, Offset, Bit) == WaitToSet) {
456 return EFI_SUCCESS;
457 }
458
459 gBS->Stall (XHC_1_MICROSECOND);
460 TicksDelta = XhcGetElapsedTicks (&CurrentTick);
461 // Ensure that ElapsedTicks is always incremented to avoid indefinite hangs
462 if (TicksDelta == 0) {
463 TicksDelta = XhcConvertTimeToTicks (XHC_MICROSECOND_TO_NANOSECOND (XHC_1_MICROSECOND));
464 }
465
466 ElapsedTicks += TicksDelta;
467 } while (ElapsedTicks < TimeoutTicks);
468
469 return EFI_TIMEOUT;
470}
471
478VOID
481 )
482{
483 UINT32 Buffer;
484
485 if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) {
486 return;
487 }
488
489 DEBUG ((DEBUG_INFO, "XhcSetBiosOwnership: called to set BIOS ownership\n"));
490
491 Buffer = XhcReadExtCapReg (Xhc, Xhc->UsbLegSupOffset);
492 Buffer = ((Buffer & (~USBLEGSP_OS_SEMAPHORE)) | USBLEGSP_BIOS_SEMAPHORE);
493 XhcWriteExtCapReg (Xhc, Xhc->UsbLegSupOffset, Buffer);
494}
495
502VOID
505 )
506{
507 UINT32 Buffer;
508
509 if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) {
510 return;
511 }
512
513 DEBUG ((DEBUG_INFO, "XhcClearBiosOwnership: called to clear BIOS ownership\n"));
514
515 Buffer = XhcReadExtCapReg (Xhc, Xhc->UsbLegSupOffset);
516 Buffer = ((Buffer & (~USBLEGSP_BIOS_SEMAPHORE)) | USBLEGSP_OS_SEMAPHORE);
517 XhcWriteExtCapReg (Xhc, Xhc->UsbLegSupOffset, Buffer);
518}
519
529UINT32
532 IN UINT8 CapId
533 )
534{
535 UINT32 ExtCapOffset;
536 UINT8 NextExtCapReg;
537 UINT32 Data;
538
539 ExtCapOffset = 0;
540
541 do {
542 //
543 // Check if the extended capability register's capability id is USB Legacy Support.
544 //
545 Data = XhcReadExtCapReg (Xhc, ExtCapOffset);
546 if ((Data & 0xFF) == CapId) {
547 return ExtCapOffset;
548 }
549
550 //
551 // If not, then traverse all of the ext capability registers till finding out it.
552 //
553 NextExtCapReg = (UINT8)((Data >> 8) & 0xFF);
554 ExtCapOffset += (NextExtCapReg << 2);
555 } while (NextExtCapReg != 0);
556
557 return 0xFFFFFFFF;
558}
559
569UINT32
572 IN UINT8 MajorVersion
573 )
574{
575 UINT32 ExtCapOffset;
576 UINT8 NextExtCapReg;
577 UINT32 Data;
578 UINT32 NameString;
579 XHC_SUPPORTED_PROTOCOL_DW0 UsbSupportDw0;
580
581 if (Xhc == NULL) {
582 return 0;
583 }
584
585 ExtCapOffset = 0;
586
587 do {
588 //
589 // Check if the extended capability register's capability id is USB Legacy Support.
590 //
591 Data = XhcReadExtCapReg (Xhc, ExtCapOffset);
592 UsbSupportDw0.Dword = Data;
593 if ((Data & 0xFF) == XHC_CAP_USB_SUPPORTED_PROTOCOL) {
594 if (UsbSupportDw0.Data.RevMajor == MajorVersion) {
595 NameString = XhcReadExtCapReg (Xhc, ExtCapOffset + XHC_SUPPORTED_PROTOCOL_NAME_STRING_OFFSET);
596 if (NameString == XHC_SUPPORTED_PROTOCOL_NAME_STRING_VALUE) {
597 //
598 // Ensure Name String field is xHCI supported protocols in xHCI Supported Protocol Capability Offset 04h
599 //
600 return ExtCapOffset;
601 }
602 }
603 }
604
605 //
606 // If not, then traverse all of the ext capability registers till finding out it.
607 //
608 NextExtCapReg = (UINT8)((Data >> 8) & 0xFF);
609 ExtCapOffset += (NextExtCapReg << 2);
610 } while (NextExtCapReg != 0);
611
612 return 0xFFFFFFFF;
613}
614
626UINT32
629 IN UINT32 ExtCapOffset,
630 IN UINT8 PortSpeed,
631 IN UINT8 PortNumber
632 )
633{
636 UINT32 Count;
637 UINT32 MinPortIndex;
638 UINT32 MaxPortIndex;
639
640 if ((Xhc == NULL) || (ExtCapOffset == 0xFFFFFFFF)) {
641 return 0;
642 }
643
644 //
645 // According to XHCI 1.1 spec November 2017,
646 // Section 7.2 xHCI Supported Protocol Capability
647 // 1. Get the PSIC(Protocol Speed ID Count) value.
648 // 2. The PSID register boundary should be Base address + PSIC * 0x04
649 //
650 PortId.Dword = XhcReadExtCapReg (Xhc, ExtCapOffset + XHC_SUPPORTED_PROTOCOL_DW2_OFFSET);
651
652 //
653 // According to XHCI 1.1 spec November 2017, valid values
654 // for CompPortOffset are 1 to CompPortCount - 1.
655 //
656 // PortNumber is zero-indexed, so subtract 1.
657 //
658 if ((PortId.Data.CompPortOffset == 0) || (PortId.Data.CompPortCount == 0)) {
659 return 0;
660 }
661
662 MinPortIndex = PortId.Data.CompPortOffset - 1;
663 MaxPortIndex = MinPortIndex + PortId.Data.CompPortCount - 1;
664
665 if ((PortNumber < MinPortIndex) || (PortNumber > MaxPortIndex)) {
666 return 0;
667 }
668
669 for (Count = 0; Count < PortId.Data.Psic; Count++) {
670 Reg.Dword = XhcReadExtCapReg (Xhc, ExtCapOffset + XHC_SUPPORTED_PROTOCOL_PSI_OFFSET + (Count << 2));
671 if (Reg.Data.Psiv == PortSpeed) {
672 return Reg.Dword;
673 }
674 }
675
676 return 0;
677}
678
689UINT16
692 IN UINT8 PortSpeed,
693 IN UINT8 PortNumber
694 )
695{
697 UINT16 UsbSpeedIdMap;
698
699 if (Xhc == NULL) {
700 return 0;
701 }
702
703 SpField.Dword = 0;
704 UsbSpeedIdMap = 0;
705
706 //
707 // Check xHCI Supported Protocol Capability, find the PSIV field to match
708 // PortSpeed definition when the Major Revision is 03h.
709 //
710 if (Xhc->Usb3SupOffset != 0xFFFFFFFF) {
711 SpField.Dword = XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpeed, PortNumber);
712 if (SpField.Dword != 0) {
713 //
714 // Found the corresponding PORTSC value in PSIV field of USB3 offset.
715 //
716 UsbSpeedIdMap = USB_PORT_STAT_SUPER_SPEED;
717 }
718 }
719
720 //
721 // Check xHCI Supported Protocol Capability, find the PSIV field to match
722 // PortSpeed definition when the Major Revision is 02h.
723 //
724 if ((UsbSpeedIdMap == 0) && (Xhc->Usb2SupOffset != 0xFFFFFFFF)) {
725 SpField.Dword = XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpeed, PortNumber);
726 if (SpField.Dword != 0) {
727 //
728 // Found the corresponding PORTSC value in PSIV field of USB2 offset.
729 //
730 if (SpField.Data.Psie == 2) {
731 //
732 // According to XHCI 1.1 spec November 2017,
733 // Section 7.2.1 the Protocol Speed ID Exponent (PSIE) field definition,
734 // PSIE value shall be applied to Protocol Speed ID Mantissa when calculating, value 2 shall represent bit rate in Mb/s
735 //
736 if (SpField.Data.Psim == XHC_SUPPORTED_PROTOCOL_USB2_HIGH_SPEED_PSIM) {
737 //
738 // PSIM shows as default High-speed protocol, apply to High-speed mapping
739 //
740 UsbSpeedIdMap = USB_PORT_STAT_HIGH_SPEED;
741 }
742 } else if (SpField.Data.Psie == 1) {
743 //
744 // According to XHCI 1.1 spec November 2017,
745 // Section 7.2.1 the Protocol Speed ID Exponent (PSIE) field definition,
746 // PSIE value shall be applied to Protocol Speed ID Mantissa when calculating, value 1 shall represent bit rate in Kb/s
747 //
748 if (SpField.Data.Psim == XHC_SUPPORTED_PROTOCOL_USB2_LOW_SPEED_PSIM) {
749 //
750 // PSIM shows as default Low-speed protocol, apply to Low-speed mapping
751 //
752 UsbSpeedIdMap = USB_PORT_STAT_LOW_SPEED;
753 }
754 }
755 }
756 }
757
758 return UsbSpeedIdMap;
759}
760
770BOOLEAN
773 )
774{
775 return XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HALT);
776}
777
787BOOLEAN
790 )
791{
792 return XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HSE);
793}
794
804VOID
807 )
808{
809 EFI_STATUS Status;
810 EFI_PCI_IO_PROTOCOL *PciIo;
811 UINT16 XhciCmd;
812
813 PciIo = Xhc->PciIo;
814 Status = PciIo->Pci.Read (
815 PciIo,
816 EfiPciIoWidthUint16,
817 PCI_COMMAND_OFFSET,
818 sizeof (XhciCmd) / sizeof (UINT16),
819 &XhciCmd
820 );
821 if (!EFI_ERROR (Status)) {
822 if ((XhciCmd & EFI_PCI_COMMAND_SERR) != 0) {
823 XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_HSEE);
824 }
825 }
826}
827
841 IN UINT32 Timeout
842 )
843{
844 EFI_STATUS Status;
845
846 Status = EFI_SUCCESS;
847
848 DEBUG ((DEBUG_INFO, "XhcResetHC!\n"));
849 //
850 // Host can only be reset when it is halt. If not so, halt it
851 //
852 if (!XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HALT)) {
853 Status = XhcHaltHC (Xhc, Timeout);
854
855 if (EFI_ERROR (Status)) {
856 return Status;
857 }
858 }
859
860 if ((Xhc->DebugCapSupOffset == 0xFFFFFFFF) || ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset) & 0xFF) != XHC_CAP_USB_DEBUG) ||
861 ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset + XHC_DC_DCCTRL) & BIT0) == 0))
862 {
863 XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET);
864 //
865 // Some XHCI host controllers require to have extra 1ms delay before accessing any MMIO register during reset.
866 // Otherwise there may have the timeout case happened.
867 // The below is a workaround to solve such problem.
868 //
869 gBS->Stall (PcdGet16 (PcdDelayXhciHCReset));
870 Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout);
871
872 if (!EFI_ERROR (Status)) {
873 //
874 // The USBCMD HSEE Bit will be reset to default 0 by USBCMD HCRST.
875 // Set USBCMD HSEE Bit if PCICMD SERR# Enable Bit is set.
876 //
877 XhcSetHsee (Xhc);
878 }
879 }
880
881 return Status;
882}
883
897 IN UINT32 Timeout
898 )
899{
900 EFI_STATUS Status;
901
902 XhcClearOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RUN);
903 Status = XhcWaitOpRegBit (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HALT, TRUE, Timeout);
904 return Status;
905}
906
920 IN UINT32 Timeout
921 )
922{
923 EFI_STATUS Status;
924
925 XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RUN);
926 Status = XhcWaitOpRegBit (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HALT, FALSE, Timeout);
927 return Status;
928}
UINT64 EFIAPI GetPerformanceCounter(VOID)
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define PcdGet16(TokenName)
Definition: PcdLib.h:349
#define EFI_PCI_COMMAND_SERR
0x0100
Definition: Pci22.h:599
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
UINT64 XhcGetElapsedTicks(IN OUT UINT64 *PreviousTick)
Definition: Xhci.c:2383
UINT64 XhcConvertTimeToTicks(IN UINT64 Time)
Definition: Xhci.c:2319
VOID XhcSetRuntimeRegBit(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Bit)
Definition: XhciReg.c:340
EFI_STATUS XhcResetHC(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Timeout)
Definition: XhciReg.c:839
BOOLEAN XhcIsSysError(IN USB_XHCI_INSTANCE *Xhc)
Definition: XhciReg.c:788
UINT32 XhcReadRuntimeReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset)
Definition: XhciReg.c:201
EFI_STATUS XhcRunHC(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Timeout)
Definition: XhciReg.c:918
UINT32 XhcGetCapabilityAddr(IN USB_XHCI_INSTANCE *Xhc, IN UINT8 CapId)
Definition: XhciReg.c:530
VOID XhcClearBiosOwnership(IN USB_XHCI_INSTANCE *Xhc)
Definition: XhciReg.c:503
EFI_STATUS XhcHaltHC(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Timeout)
Definition: XhciReg.c:895
VOID XhcClearRuntimeRegBit(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Bit)
Definition: XhciReg.c:362
UINT16 XhcCheckUsbPortSpeedUsedPsic(IN USB_XHCI_INSTANCE *Xhc, IN UINT8 PortSpeed, IN UINT8 PortNumber)
Definition: XhciReg.c:690
VOID XhcSetHsee(IN USB_XHCI_INSTANCE *Xhc)
Definition: XhciReg.c:805
VOID XhcWriteRuntimeReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Data)
Definition: XhciReg.c:237
VOID XhcClearOpRegBit(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Bit)
Definition: XhciReg.c:406
UINT32 XhcReadExtCapReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset)
Definition: XhciReg.c:271
VOID XhcWriteOpReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Data)
Definition: XhciReg.c:134
VOID XhcSetBiosOwnership(IN USB_XHCI_INSTANCE *Xhc)
Definition: XhciReg.c:479
UINT32 XhcGetSupportedProtocolCapabilityAddr(IN USB_XHCI_INSTANCE *Xhc, IN UINT8 MajorVersion)
Definition: XhciReg.c:570
UINT32 XhciPsivGetPsid(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 ExtCapOffset, IN UINT8 PortSpeed, IN UINT8 PortNumber)
Definition: XhciReg.c:627
UINT32 XhcReadCapReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset)
Definition: XhciReg.c:62
VOID XhcSetOpRegBit(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Bit)
Definition: XhciReg.c:384
VOID XhcWriteDoorBellReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Data)
Definition: XhciReg.c:167
UINT32 XhcReadOpReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset)
Definition: XhciReg.c:98
BOOLEAN XhcIsHalt(IN USB_XHCI_INSTANCE *Xhc)
Definition: XhciReg.c:771
UINT8 XhcReadCapReg8(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset)
Definition: XhciReg.c:24
VOID XhcWriteExtCapReg(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Data)
Definition: XhciReg.c:307
EFI_STATUS XhcWaitOpRegBit(IN USB_XHCI_INSTANCE *Xhc, IN UINT32 Offset, IN UINT32 Bit, IN BOOLEAN WaitToSet, IN UINT32 Timeout)
Definition: XhciReg.c:434
EFI_PCI_IO_PROTOCOL_CONFIG Read
Definition: PciIo.h:232