Created
February 17, 2018 02:58
-
-
Save maz-1/0e23e2a34c6d8ec0c6a3021e8cd920f8 to your computer and use it in GitHub Desktop.
USB TYPE-C FIX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/10.12/Advanced/DSDT-HotPatches/Patches/SSDT-XE42.dsl b/10.12/Advanced/DSDT-HotPatches/Patches/SSDT-XE42.dsl | |
new file mode 100644 | |
index 0000000..0631dc2 | |
--- /dev/null | |
+++ b/10.12/Advanced/DSDT-HotPatches/Patches/SSDT-XE42.dsl | |
@@ -0,0 +1,106 @@ | |
+// An alternate USB-hotplug interrupt method that is non-recursive - dpassmor | |
+ | |
+DefinitionBlock ("", "SSDT", 1, "hack", "XE42", 0) | |
+{ | |
+ External (_GPE.WWAK, MethodObj) | |
+ External (_GPE.WSUB, MethodObj) | |
+ External (_GPE.PGWA, MethodObj) | |
+ External (_GPE.RSMI, MethodObj) | |
+ External (_GPE.DMSI, MethodObj) | |
+ External (_GPE.GNIS, MethodObj) | |
+ External (_GPE.PGWA, MethodObj) | |
+ External (_GPE.TBUF, MethodObj) | |
+ External (_GPE.NTFY, MethodObj) | |
+ External (_GPE.TBFF, MethodObj) | |
+ External (ADBG, MethodObj) | |
+ External (\_SB_.CAGS, MethodObj) | |
+ External (P8XH, MethodObj) | |
+ External (TNAT, FieldUnitObj) | |
+ External (CF2T, FieldUnitObj) | |
+ External (DPTF, FieldUnitObj) | |
+ External (CPGN, FieldUnitObj) | |
+ External (SOHP, FieldUnitObj) | |
+ External (TBSW, FieldUnitObj) | |
+ External (OSUM, MutexObj) | |
+ | |
+ Scope (\_GPE) | |
+ { | |
+ Method (XE42, 0, NotSerialized) // _Exx: Edge-Triggered GPE | |
+ { | |
+ Return (Zero) | |
+ ADBG ("_E42") | |
+ If (LEqual (CF2T, One)) | |
+ { | |
+ ADBG ("Clear") | |
+ ADBG ("GPI_GPE_STS") | |
+ \_SB.CAGS (CPGN) | |
+ } | |
+ | |
+ WWAK () | |
+ WSUB () | |
+ If (LEqual (TNAT, One)) | |
+ { | |
+ Store (RSMI (), Local0) | |
+ If (LNot (Local0)) | |
+ { | |
+ Return (Zero) | |
+ } | |
+ | |
+ If (DMSI ()) | |
+ { | |
+ Return (Zero) | |
+ } | |
+ } | |
+ | |
+ If (GNIS ()) | |
+ { | |
+ Return (Zero) | |
+ } | |
+ | |
+ OperationRegion (SPRT, SystemIO, 0xB2, 0x02) | |
+ Field (SPRT, ByteAcc, Lock, Preserve) | |
+ { | |
+ SSMP, 8 | |
+ } | |
+ | |
+ ADBG ("TBT-HP-Handler") | |
+ ADBG ("PEG WorkAround") | |
+ PGWA () | |
+ Acquire (OSUM, 0xFFFF) | |
+ Store (TBFF (), Local1) | |
+ If (LEqual (Local1, One)) | |
+ { | |
+ Sleep (0x10) | |
+ Release (OSUM) | |
+ ADBG ("OS_Up_Received") | |
+ If (LEqual (DPTF, One)) | |
+ { | |
+ XE42 () | |
+ } | |
+ | |
+ Return (Zero) | |
+ } | |
+ | |
+ If (LEqual (Local1, 0x02)) | |
+ { | |
+ NTFY () | |
+ Sleep (0x10) | |
+ Release (OSUM) | |
+ P8XH (Zero, 0x7D) | |
+ ADBG ("Disconnect") | |
+ Return (Zero) | |
+ } | |
+ | |
+ If (LEqual (SOHP, One)) | |
+ { | |
+ ADBG ("TBT SW SMI") | |
+ Store (TBSW, SSMP) | |
+ } | |
+ | |
+ NTFY () | |
+ Sleep (0x10) | |
+ Release (OSUM) | |
+ ADBG ("End-of-_E42") | |
+ } | |
+ } | |
+} | |
\ No newline at end of file | |
diff --git a/10.12/CLOVER/ACPI/patched/SSDT-XE42.aml b/10.12/CLOVER/ACPI/patched/SSDT-XE42.aml | |
new file mode 100644 | |
index 0000000..d9df7b8 | |
Binary files /dev/null and b/10.12/CLOVER/ACPI/patched/SSDT-XE42.aml differ | |
diff --git a/10.12/Post-Install/CLOVER/config.plist b/10.12/Post-Install/CLOVER/config.plist | |
index 97639e2..bd023dc 100755 | |
--- a/10.12/Post-Install/CLOVER/config.plist | |
+++ b/10.12/Post-Install/CLOVER/config.plist | |
@@ -457,6 +457,20 @@ | |
WFJNVg== | |
</data> | |
</dict> | |
+ <dict> | |
+ <key>Comment</key> | |
+ <string>Redirect _E42 call to solve recursion issue for USB-C hotplug, pair with SSDT-XE42 - dpassmor</string> | |
+ <key>Disabled</key> | |
+ <false/> | |
+ <key>Find</key> | |
+ <data> | |
+ RFBURgFfRTQy | |
+ </data> | |
+ <key>Replace</key> | |
+ <data> | |
+ RFBURgFYRTQy | |
+ </data> | |
+ </dict> | |
</array> | |
</dict> | |
<key>DropTables</key> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment