#DSDT Bereinigen von Michael alias anonymous writer into definitionblock code_regex (External\s+\(BNUM,\s+.*\)) replace_matched begin //%1 end; #Patch 1 Grundpatch # Maintained by: toleda for: github.com/toleda/audio_hdmi_9series # File: has0-9series-Clean_Compile.txt_v1.0 # Credits: SJ_UnderWater, RehabMan, shrieken213 # # Complier fixes for newly extracted AMI/9series/dsdts # into device label PCI0 code_regex (\s+Zero){2,} remove_matched; into method label ADBG code_regex Arg0 remove_matched; into_all method label _PS3 code_regex PS3X\n replace_matched begin Store (Zero, PS3X)\n end; into_all method label _PS2 code_regex PS2X\n replace_matched begin Store (Zero, PS2X)\n end; into_all method label _PS0 code_regex PS0X\n replace_matched begin Store (Zero, PS0X)\n end; into_all method label _INI code_regex INIR\n replace_matched begin Store (Zero, INIR)\n end; # # Complier warnings and remarks fixes # into method label SPL1 insert begin Return (Zero) end; into method label RDCA insert begin Return (Zero) end; into method label CNRS insert begin Return (Zero) end; into_all method label GPEH insert begin Return (Zero) end; into method label _PS0 parent_label XHC insert begin Return (Zero) end; into method label _PS3 parent_label XHC insert begin Return (Zero) end; into method label _PS0 parent_label NVM0 insert begin Return (Zero) end; into method label _PS3 parent_label NVM0 insert begin Return (Zero) end; into method label _PS0 parent_label RHUB insert begin Return (Zero) end; into method label _DSM parent_label SHUB insert begin Return (Zero) end; into method label _DSM parent_label DFUD insert begin Return (Zero) end; into method label _DSM parent_label TPD4 insert begin Return (Zero) end; into method label _DSM parent_label TPL0 insert begin Return (Zero) end; into method label _DSM parent_label TPL1 insert begin Return (Zero) end; into method label _DSM parent_label TPL2 insert begin Return (Zero) end; into method label _DSM parent_label TPL3 insert begin Return (Zero) end; into method label _DSM parent_label TPD0 insert begin Return (Zero) end; into method label _DSM parent_label TPD1 insert begin Return (Zero) end; into method label _DSM parent_label TPD2 insert begin Return (Zero) end; into method label _DSM parent_label TPD3 insert begin Return (Zero) end; into method label _DSM parent_label TPD7 insert begin Return (Zero) end; into method label _DSM parent_label TPD8 insert begin Return (Zero) end; into method label _DSM parent_label TPD9 insert begin Return (Zero) end; into method label _HID parent_label _SB.TPM insert begin Return (Zero) end; into_all method label _DEP set_label begin DEP end; into_all method label _HRV set_label begin HRV end; into method label ADBG replace_content begin If (CondRefOf (MDBG))\n {\n Return (MDBG)\n }\n Return (Zero)\n end; into_all all code_regex (Acquire\s\(MUT0,\s0x)....\) replace_matched begin Acquire (MUT0, 0xFFFF) end; into device label SIO1 code_regex 0x00(,\s+//\s+L) replaceall_matched begin 0x01%1 end; # Change _T_0 to T_0 into_all all code_regex _T_0 replaceall_matched begin T_0 end; into_all all code_regex _T_1 replaceall_matched begin T_1 end; into_all all code_regex _T_2 replaceall_matched begin T_2 end; # # Debug into definitionblock code_regex . insert begin Store ("hsr0-9series-Clean_Compile_v1.0 dsdt edits, github.com/toleda", Debug) end; #Patch 2 “Rename _DSM Methods to XDSM” #Maintained by: RehabMan for: Laptop Patches #rename_DSM.txt # To remove all _DSM methods by renaming to XDSM. # # Since "Remove _DSM methods" exposes a MaciASL bug with certain files, # this one can be used instead. into_all method label _DSM set_label begin XDSM end; into_all method code_regex _DSM replaceall_matched begin XDSM end; #Patch 3 "Fix _WAK Arg0 v2" #Maintained by: RehabMan for: Laptop Patches #system_WAK2.txt # # In 10.8.5 and perhaps later versions of OS X, DSDT method _WAK # called after resuming from S3 suspend (Sleep, or suspend to RAM), # is called with garbage in Arg0, where it should be a value # representing the sleep state being left (1-5). # # This causes problems for code in DSDT _WAK method which expects # and checks against Arg0==3 for wake from sleep to turn on various # devices or restore internal state to a working state. # # This patch adds code at the very beginning of the method to # force an an out-of-range Arg0 to 3. # # See system_WAK1.txt for an alternate patch # # Note regarding Yosemite: # At least in Yosemite 10.10.2, this bug appears to be fixed. # I didn't notice/verify on other versions of Yosemite # into method label _WAK code_regex ([\s\S]*) replace_matched begin If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n %1 end; into method label \_WAK code_regex ([\s\S]*) replace_matched begin If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }\n %1 end; #Patch 4 "HPET Fix" #Maintained by: RehabMan for: Laptop Patches #system_HPET.txt # If you have panic "No HPETs available..." or have a abrubt restart # after waking from sleep, you may need this patch. # The patch makes sure the HPET device is always available. # HPET fix to avoid AppleIntelCPUPowerManagement panic into method label _STA parent_hid PNP0103 remove_entry; into device name_hid PNP0103 code_regex Name\s\(_STA\,\s+0x0F\) remove_matched; into device name_hid PNP0103 insert begin Name (_STA, 0x0F)\n end; into method label _CRS parent_hid PNP0103 remove_entry; into device name_hid PNP0103 insert begin Method (_CRS, 0, NotSerialized)\n {\n Return (BUF0)\n }\n end; #Patch 5 "SMBUS Fix" #Maintained by: RehabMan for: Laptop Patches #system_SMBUS.txt # SMBUS fix into device label BUS0 parent_adr 0x001F0003 remove_entry; into device name_adr 0x001F0003 insert begin Device (BUS0)\n {\n Name (_CID, "smbus")\n Name (_ADR, Zero)\n Device (DVL0)\n {\n Name (_ADR, 0x57)\n Name (_CID, "diagsvault")\n Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package() { "address", 0x57 })\n }\n }\n }\n end; #Patch 6 "IRQ Fix" #Maintained by: RehabMan for: Laptop Patches #system_IRQ.txt # This can fix non-working audio and also has an affect on HPET. # # Use this if you have issues with patched AppleHDA (required on almost all laptops) # or if you have issues with HPET (restart after wake). # IRQ fix into device name_hid PNP0000 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; into device name_hid PNP0100 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; into device name_hid PNP0B00 code_regex IRQNoFlags\s\(\)\n\s+\{(\d+)\} remove_matched; into device name_hid PNP0103 code_regex IRQNoFlags\s\(\)\n\s+\{.*\} removeall_matched; into device name_hid PNP0103 code_regex Name\s\(([^,]+),\sResourceTemplate\s\(\).*\n\s+\{((?:.|\n)*)\}\) replace_matched begin Name (%1, ResourceTemplate()\n {\n IRQNoFlags() { 0, 8, 11, 15 }\n %2 })\n end; #Patch 7 "RTC Fix" #Maintained by: RehabMan for: Laptop Patches #system_RTC.txt # RTC fix into device name_hid PNP0B00 code_regex (IO\s\((?:\s*[^,]+,\s*(?:\/\/\s.*)?\s*\n)+\s*)(\dx\d+)(,\s*(?:\/\/\s.*)?\s*\n\s*\)) replace_matched begin %10x02%3 end; #Patch 8 VoodooI2C "Windows 10 DSDT Patch for VoodooI2C" # Windows 10 DSDT Patch for VoodooI2C # Allows I2C controllers and devices to be discovered by OS X. # Based off patches written by RehabMan into_all method code_regex If\s+\([\\]?_OSI\s+\(\"Windows\s2015\"\)\) replace_matched begin If(LOr(_OSI("Darwin"),_OSI("Windows 2015"))) end; #Patch 9 "Fix Mutex with non-zero SyncLevel" #Maintained by: RehabMan for: Laptop Patches #system_Mutex.txt # # Some DSDTs use Mutex objects with non-zero a SyncLevel. Evidently, # OS X has some difficulty with this part of the ACPI spec, either that # or the DSDTs are, in fact, codec incorrectly and Windows is ignoring # it. # The common result of a non-zero SyncLevel is failure of methods at the # point of Acquire on the mutext in question. This can result in strange # behavior, failed battery status, or other issues. # # This patch corrects all Mutex objects declared with a non-zero # SyncLevel to use zero. # # 2x as there is some sort of MaciASL bug... # (code_regex_not seems broken) #into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; #into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; # 10x as workaround for MaciASL bug... into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end; #Patch 10 "Fix PNOT/PPNT" #Maintained by: RehabMan for: Laptop Patches #system_PNOT.txt # PNOT or PPNT are commonly called from EC/AC adapter related code # and often access identifiers that are present in SSDTs generally # dropped (CPU SSDTs) # # Because of this, it is best to make these methods do nothing. # make PNOT/PPNT/PNTF a no-op into method label PNOT replace_content begin // nothing end; into method label PPNT replace_content begin // nothing end; into method label PNTF replace_content begin // nothing end; #Patch 11 "Add IMEI" #Maintained by: RehabMan for: Laptop Patches #system_IMEI.txt # if you already have an IMEI/HECI/MEI device, you should not use this patch # but if you do, these patches will remove the existing one into device name_adr 0x00160000 remove_entry; into device label IMEI parent_label PCI0 remove_entry; # add missing IMEI device into device label PCI0 insert begin Device (IMEI)\n {\n Name (_ADR, 0x00160000)\n }\n end; #Patch 13 "Shutdown Fix v2" #Maintained by: RehabMan for: Laptop Patches #system_Shutdown2.txt # Shutdown fix v2 into method label _PTS code_regex ([\s\S]*) replace_matched begin If (LNotEqual(Arg0,5)) {\n %1\n }\n end; #Patch 14 “USB3 _PRW 0x6D (instant wake)” #Maintained by: RehabMan for: Laptop Patches #usb_prw_0x6d_xhc_skl.txt # remove _PRW methods to prevent instant wake # delete any existing XHC1 device into device label XHC1 name_adr 0x00140000 remove_entry; # if _PRW objects are methods into method label _PRW parent_adr 0x00140000 remove_entry; into method label _PRW parent_adr 0x00140001 remove_entry; into method label _PRW parent_adr 0x001F0003 remove_entry; # some other LAN cards use 0x00190000 into method label _PRW parent_adr 0x00190000 remove_entry; into method label _PRW parent_adr 0x001F0006 remove_entry; # if _PRW methods are stuffed into a separate scope into method label _PRW parent_label _SB.PCI0.EHC1 remove_entry; into method label _PRW parent_label _SB.PCI0.EHC2 remove_entry; into method label _PRW parent_label _SB.PCI0.XHC remove_entry; into method label _PRW parent_label \_SB.PCI0.EHC1 remove_entry; into method label _PRW parent_label \_SB.PCI0.EHC2 remove_entry; into method label _PRW parent_label \_SB.PCI0.XHC remove_entry; # if _PRW objects are names into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x00140001 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x001F0003 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x00190000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x001F0006 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched; # some _PRW have three entries in the Package into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x00140001 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x001F0003 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x00190000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; into device name_adr 0x001F0006 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\n.*\}\) remove_matched; # seems to work better if _PRW is present, but returns 0 (original was 3) for sleep state # Note: These are methods because some Skylake DSDT call _PRW as a method for no reason into device name_adr 0x00140000 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; into device name_adr 0x00140001 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; into device name_adr 0x001F0003 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; into device name_adr 0x00190000 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; into device name_adr 0x001F0006 insert begin Method(_PRW) { Return(Package() { 0x6D, 0 }) } end; # Insert Apple USB properties into USB 3.0 XHC into method label _DSM parent_adr 0x00140000 remove_entry; into device name_adr 0x00140000 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "subsystem-id", Buffer() { 0x70, 0x72, 0x00, 0x00 },\n "subsystem-vendor-id", Buffer() { 0x86, 0x80, 0x00, 0x00 },\n "AAPL,current-available", 2100,\n "AAPL,current-extra", 2200,\n "AAPL,current-extra-in-sleep", 1600,\n "AAPL,device-internal", 0x02,\n "AAPL,max-port-current-in-sleep", 2100,\n })\n }\n end; #Patch 15 "Rename GFX0 to IGPU" #Maintained by: RehabMan for: Laptop Patches #graphics_Rename-GFX0.txt # Note: Most DSDT/SSDTs use GFX0 for the integrated graphics device, # but there are few renegades that use VID or AGP1. # If your DSDT uses VID or AGP1 instead of GFX0, see the # alternate patch "Rename VID/AGP1 to IGPU" # sometimes there is already IGPU used for other things into_all all code_regex IGPU, replaceall_matched begin IGFX, end; # rename GFX0 -> IGPU for better power management into_all all code_regex GFX0\. replaceall_matched begin IGPU. end; into_all all code_regex \.GFX0 replaceall_matched begin .IGPU end; into_all all code_regex \sGFX0, replaceall_matched begin IGPU, end; into_all all code_regex \(GFX0 replaceall_matched begin (IGPU end; into_all all label GFX0 set_label begin IGPU end; into_all all label _SB.PCI0.GFX0 set_label begin _SB.PCI0.IGPU end; into_all all label \_SB.PCI0.GFX0 set_label begin \_SB.PCI0.IGPU end; into_all all label _SB.PCI0.GFX0.DD02 set_label begin _SB.PCI0.IGPU.DD02 end; into_all all label \_SB.PCI0.GFX0.DD02 set_label begin \_SB.PCI0.IGPU.DD02 end; into_all all label ^^^GFX0 set_label begin ^^^IGPU end; into_all all label ^^GFX0 set_label begin ^^IGPU end; into_all all label ^GFX0 set_label begin ^IGPU end; #Patch 16 “Skylake LPC” #Maintained by: RehabMan for: Laptop Patches #misc_Skylake-LPC.txt # inject "compatible" with recognized series-100 LPC device-id into method label _DSM parent_adr 0x001F0000 remove_entry; into device name_adr 0x001F0000 insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "compatible", "pci8086,9cc1",\n })\n }\n end; #Patch 14 "NullEthernet" patch from RehabMan repo # DSDT patch to enable NullEthernet.kext into device label RMNE remove_entry; into definitionblock code_regex . insert begin Device (RMNE)\n {\n Name (_ADR, Zero)\n // The NullEthernet kext matches on this HID\n Name (_HID, "NULE0000")\n // This is the MAC address returned by the kext. Modify if necessary.\n Name (MAC, Buffer() { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 })\n Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "built-in", Buffer() { 0x00 },\n "IOName", "ethernet",\n "name", Buffer() { "ethernet" },\n "model", Buffer() { "RM-NullEthernet-1001" },\n "device_type", Buffer() { "ethernet" },\n })\n }\n }\n end; #Patch 15 Audio ID 3 #Maintained by: RehabMan for: Laptop Patches #audio_HDEF-layout3.txt # Note: Change your layout ID if you need something different # Note: "hda-gfx" is not needed with Haswell and should probably be removed # Inject Audio info into method label _DSM parent_label HDEF remove_entry; into device label HDEF insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "layout-id", Buffer() { 3, 0x00, 0x00, 0x00 },\n "hda-gfx", Buffer() { "onboard-1" },\n "PinConfigurations", Buffer() { },\n //"MaximumBootBeepVolume", 77,\n })\n }\n end; into method label _DSM parent_label HDAS remove_entry; into device label HDAS insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "layout-id", Buffer() { 3, 0x00, 0x00, 0x00 },\n "hda-gfx", Buffer() { "onboard-1" },\n "PinConfigurations", Buffer() { },\n //"MaximumBootBeepVolume", 77,\n })\n }\n end; #Patch 18 Renam Paches #change HDAS to HDEF into_all all code_regex HDAS replaceall_matched begin HDEF end; into_all all label HDAS set_label begin HDEF end; #change SAT0 to SATA into_all all code_regex SAT0 replaceall_matched begin SATA end; into_all all label SAT0 set_label begin SATA end; into_all all label _SB.PCI0.SAT0.VOL0 set_label begin _SB.PCI0.SATA.VOL0 end; into_all all label _SB.PCI0.SAT0 set_label begin _SB.PCI0.SATA end; #change MEI to IMEI into_all all code_regex MEI replaceall_matched begin IMEI end; into_all all label MEI set_label begin IMEI end;