MdeModulePkg XhciDxe: Assign Usb2Hc.XXXRevision based on SBRN
Current hard code Usb2Hc.XXXRevision may be not accurate. This patch updates code to assign Usb2Hc.XXXRevision based on SBRN (Serial Bus Release Number, PCI configuration space offset 0x60) although there is no code consuming them. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
@@ -1770,6 +1770,7 @@ XhcCreateUsbHc (
|
||||
EFI_STATUS Status;
|
||||
UINT32 PageSize;
|
||||
UINT16 ExtCapReg;
|
||||
UINT8 ReleaseNumber;
|
||||
|
||||
Xhc = AllocateZeroPool (sizeof (USB_XHCI_INSTANCE));
|
||||
|
||||
@@ -1786,6 +1787,19 @@ XhcCreateUsbHc (
|
||||
Xhc->OriginalPciAttributes = OriginalPciAttributes;
|
||||
CopyMem (&Xhc->Usb2Hc, &gXhciUsb2HcTemplate, sizeof (EFI_USB2_HC_PROTOCOL));
|
||||
|
||||
Status = PciIo->Pci.Read (
|
||||
PciIo,
|
||||
EfiPciIoWidthUint8,
|
||||
XHC_PCI_SBRN_OFFSET,
|
||||
1,
|
||||
&ReleaseNumber
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Xhc->Usb2Hc.MajorRevision = (ReleaseNumber & 0xF0) >> 4;
|
||||
Xhc->Usb2Hc.MinorRevision = (ReleaseNumber & 0x0F);
|
||||
}
|
||||
|
||||
InitializeListHead (&Xhc->AsyncIntTransfers);
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user