build: Add AMD GOP injection

This commit is contained in:
Mykola Grymalyuk
2022-11-13 20:38:49 -07:00
parent 9b7074bde5
commit a672183880
6 changed files with 46 additions and 2 deletions

View File

@@ -16,6 +16,8 @@
- Allows for easier identification of version when reporting issues - Allows for easier identification of version when reporting issues
- Drop usage of `HW_BID` rerouting in boot.efi - Drop usage of `HW_BID` rerouting in boot.efi
- Patch out PlatformSupport.plist instead, allows for less maintenance overall - Patch out PlatformSupport.plist instead, allows for less maintenance overall
- Add support for AMD GOP injection (AMDGOP.efi)
- For MXM iMacs and Mac Pros with GPU VBIOS lacking GOP support (ie. no UEFI output even after OC loads)
- Increment Binaries: - Increment Binaries:
- AirPortBrcmFixup 2.1.6 - release - AirPortBrcmFixup 2.1.6 - release
- AppleALC 1.7.6 - release - AppleALC 1.7.6 - release

View File

@@ -2480,13 +2480,24 @@ class wx_python_gui:
self.timeout_spinner.Bind(wx.EVT_SPINCTRL, self.timeout_spinner_click) self.timeout_spinner.Bind(wx.EVT_SPINCTRL, self.timeout_spinner_click)
self.timeout_spinner.Centre(wx.HORIZONTAL) self.timeout_spinner.Centre(wx.HORIZONTAL)
# AMD GOP Injection
self.set_gop_injection = wx.CheckBox(self.frame_modal, label="AMD GOP Injection")
self.set_gop_injection.SetPosition(wx.Point(
30,
self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5))
self.set_gop_injection.SetValue(self.constants.gop_injection)
self.set_gop_injection.Bind(wx.EVT_CHECKBOX, self.gop_injection_checkbox_click)
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"]
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.set_gop_injection.Disable()
# Disable Thunderbolt # Disable Thunderbolt
self.disable_thunderbolt_checkbox = wx.CheckBox(self.frame_modal, label="Disable Thunderbolt") self.disable_thunderbolt_checkbox = wx.CheckBox(self.frame_modal, label="Disable Thunderbolt")
self.disable_thunderbolt_checkbox.SetValue(self.constants.disable_tb) self.disable_thunderbolt_checkbox.SetValue(self.constants.disable_tb)
self.disable_thunderbolt_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_tb_click) self.disable_thunderbolt_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_tb_click)
self.disable_thunderbolt_checkbox.SetPosition(wx.Point( self.disable_thunderbolt_checkbox.SetPosition(wx.Point(
30, self.set_gop_injection.GetPosition().x,
self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5)) self.set_gop_injection.GetPosition().y + self.set_gop_injection.GetSize().height))
self.disable_thunderbolt_checkbox.SetToolTip(wx.ToolTip("Disables Thunderbolt support on MacBookPro11,x\nMainly applicable for systems that cannot boot with Thunderbolt enabled")) self.disable_thunderbolt_checkbox.SetToolTip(wx.ToolTip("Disables Thunderbolt support on MacBookPro11,x\nMainly applicable for systems that cannot boot with Thunderbolt enabled"))
if not self.constants.custom_model and not self.computer.real_model.startswith("MacBookPro11"): if not self.constants.custom_model and not self.computer.real_model.startswith("MacBookPro11"):
self.disable_thunderbolt_checkbox.Disable() self.disable_thunderbolt_checkbox.Disable()
@@ -2745,6 +2756,14 @@ class wx_python_gui:
print("Content Caching Disabled") print("Content Caching Disabled")
self.constants.set_content_caching = False self.constants.set_content_caching = False
def gop_injection_checkbox_click(self, event=None):
if self.set_gop_injection.GetValue():
print("GOP Injection Enabled")
self.constants.gop_injection = True
else:
print("GOP Injection Disabled")
self.constants.gop_injection = False
def disable_tb_click(self, event=None): def disable_tb_click(self, event=None):
if self.disable_thunderbolt_checkbox.GetValue(): if self.disable_thunderbolt_checkbox.GetValue():
print("Disable Thunderbolt Enabled") print("Disable Thunderbolt Enabled")

View File

@@ -2505,6 +2505,18 @@
<key>LoadEarly</key> <key>LoadEarly</key>
<false/> <false/>
</dict> </dict>
<dict>
<key>Comment</key>
<string></string>
<key>Path</key>
<string>AMDGOP.efi</string>
<key>Enabled</key>
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
</array> </array>
<key>Input</key> <key>Input</key>
<dict> <dict>

BIN
payloads/Drivers/AMDGOP.efi Normal file

Binary file not shown.

View File

@@ -277,6 +277,12 @@ class build_graphics_audio:
self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
# AMD GOP VBIOS injection for AMD GCN 1-4 GPUs
if self.constants.gop_injection is True:
print("- Adding AMDGOP.efi")
shutil.copy(self.constants.amd_gop_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("AMDGOP.efi", "UEFI", "Drivers")["Enabled"] = True
def spoof_handling(self): def spoof_handling(self):
if self.constants.serial_settings == "None": if self.constants.serial_settings == "None":
return return

View File

@@ -177,6 +177,7 @@ class Constants:
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support
self.force_nv_web = False # Force Nvidia Web Drivers on Tesla and Kepler self.force_nv_web = False # Force Nvidia Web Drivers on Tesla and Kepler
self.force_output_support = False # Force Output support for Mac Pros with PC VBIOS self.force_output_support = False # Force Output support for Mac Pros with PC VBIOS
self.gop_injection = False # Set GOP Injection support
## Miscellaneous ## Miscellaneous
self.disallow_cpufriend = False # Disable CPUFriend self.disallow_cpufriend = False # Disable CPUFriend
@@ -248,6 +249,10 @@ class Constants:
def exfat_legacy_driver_path(self): def exfat_legacy_driver_path(self):
return self.payload_path / Path("Drivers/ExFatDxeLegacy.efi") return self.payload_path / Path("Drivers/ExFatDxeLegacy.efi")
@property
def amd_gop_driver_path(self):
return self.payload_path / Path("Drivers/AMDGOP.efi")
@property @property
def xhci_driver_path(self): def xhci_driver_path(self):
return self.payload_path / Path("Drivers/XhciDxe.efi") return self.payload_path / Path("Drivers/XhciDxe.efi")