Add XHCI UEFI Driver

This commit is contained in:
Mykola Grymalyuk
2021-05-17 20:40:09 -06:00
parent f4d3154fd1
commit 15aacddd23
6 changed files with 54 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
# OpenCore Legacy Patcher changelog
## 0.1.6
- Add XHCI UEFI Driver for 3rd Party USB 3.0 Controllers
- Allows for Boot Support from OpenCore' Picker
## 0.1.5
- Fix crashing when Wireless module not present

View File

@@ -476,6 +476,21 @@ class BuildOpenCore:
print("- Adding Mac Pro, Xserve DRM patches")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree"
# Add XhciDxe if firmware doesn't have XHCI controller support and XCHI controller detected
if self.model not in ModelArray.XhciSupport and not self.constants.custom_model:
devices = plistlib.loads(subprocess.run("ioreg -c IOPCIDevice -r -d2 -a".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
try:
devices = [i for i in devices if i["class-code"] == binascii.unhexlify(self.constants.classcode_xhci)]
vendor_id = self.hexswap(binascii.hexlify(devices[0]["vendor-id"]).decode()[:4])
device_id = self.hexswap(binascii.hexlify(devices[0]["device-id"]).decode()[:4])
print("- Found XHCI Controller, adding Boot Support")
shutil.copy(self.constants.xhci_driver_path, self.constants.drivers_path)
self.config["UEFI"]["Drivers"] += ["XhciDxe.efi"]
except ValueError:
print("- No XHCI Controller Found (V)")
except IndexError:
print("- No XHCI Controller Found (I)")
# Add OpenCanopy
print("- Adding OpenCanopy GUI")
shutil.rmtree(self.constants.resources_path, onerror=rmtree_handler)

View File

@@ -111,6 +111,7 @@ class Constants:
self.classcode_wifi = "00800200"
self.classcode_gpu = "00000300"
self.classcode_gpu_variant = "00800300"
self.classcode_xhci = "30030C00"
# Nvidia GPU Architecture
self.arch_tesla = "NV50"
@@ -138,6 +139,8 @@ class Constants:
def nvme_driver_path(self): return self.payload_path / Path("Drivers/NvmExpressDxe.efi")
@property
def exfat_legacy_driver_path(self): return self.payload_path / Path("Drivers/ExFatDxeLegacy.efi")
@property
def xhci_driver_path(self): return self.payload_path / Path("Drivers/XhciDxe.efi")
# Kexts
@property

View File

@@ -47,6 +47,7 @@ class pci_probe:
# IOACPIPlane:/_SB/PCI0@0/P0P2@10000 -> /PCI0@0/P0P2@1
acpi_path = acpi_path_full.replace("IOACPIPlane:/_SB", "")
acpi_path = acpi_path.replace("0000", "")
acpi_path = acpi_path.replace("0001", "")
acpi_path = acpi_path.replace("ffff", "0")
acpi_path = acpi_path.upper()
return acpi_path

View File

@@ -442,6 +442,39 @@ NVMePatch = [
"Dortania1,1"
]
XhciSupport = [
"MacBookAir5,1",
"MacBookAir5,2",
"MacBookAir6,1",
"MacBookAir6,2",
"MacBookAir7,1",
"MacBookAir7,2",
"MacBookPro9,1",
"MacBookPro9,2",
"MacBookPro10,1",
"MacBookPro10,2",
"MacBookPro11,1",
"MacBookPro11,2",
"MacBookPro11,3",
"MacBookPro11,4",
"MacBookPro11,5",
"MacBookPro12,1",
"Macmini6,1",
"Macmini6,2",
"Macmini7,1",
"iMac13,1",
"iMac13,2",
"iMac13,3",
"iMac14,1",
"iMac14,2",
"iMac14,3",
"iMac15,1",
"iMac16,1",
"iMac16,2",
"MacPro6,1",
"Dortania1,1"
]
SidecarPatch = [
"MacBook8,1",
"MacBookAir5,1",

Binary file not shown.