Skip to content

Commit

Permalink
add new patches for discrete disable guide/general use
Browse files Browse the repository at this point in the history
  • Loading branch information
RehabMan committed May 12, 2015
1 parent 0d070d3 commit 0c8b12c
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .maciasl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[syn] Fix *pnp/pnp lower case Error syntax/fix_HID_pnp.txt
[syn] Fix PARSEOP_ZERO Error syntax/fix_PARSEOP_ZERO.txt
[syn] Remove _DSM methods syntax/remove_DSM.txt
[syn] Remove _PSS placeholders syntax/fix_PSS.txt
[igpu] --> Intel Graphics Patches NullPatch.txt
[igpu] HD3000 Low Resolution graphics/graphics_HD3K_low.txt
[igpu] HD3000 High Resolution graphics/graphics_HD3K_high.txt
Expand All @@ -26,6 +27,7 @@
[igpu] Rename VID/ADP1 to IGPU graphics/graphics_Rename-VID_AGP1.txt
[igpu] Rename PCI0.VID to PCI0.IGPU graphics/graphics_Rename-PCI0_VID.txt
[igpu] Rename PCI0.GFX0 to PCI0.IGPU graphics/graphics_Rename-PCI0_GFX0.txt
[igpu] Rename B0D3 to HDAU graphics/graphics_Rename-B0D3.txt
[gfx0] --> Disable Nvidia/Radeon NullPatch.txt
[gfx0] Cleanup/Fix Errors (SSDT) graphics/graphics_SSDT-disable-cleanup.txt
[gfx0] Disable from _INI (SSDT) graphics/graphics_INI-disable.txt
Expand All @@ -35,6 +37,8 @@
[usb] 6-series USB usb/usb_6-series.txt
[usb] 7-series/8-series USB usb/usb_7-series.txt
[usb] 7-series USB3 Multiplex usb/usb_7-series-multiplex.txt
[usb] USB3 _PRW(0x6D) and Rename XHC to XHC1 usb/usb_prw_0x6d_xhc.txt
[usb] USB3 _PRW(0x0D) and Rename XHC to XHC1 usb/usb_prw_0x0d_xhc.txt
[bat] --> Battery Patches NullPatch.txt
[bat] Acer Aspire E1-571 battery/battery_Acer-Aspire-E1-571.txt
[bat] Acer 3820tg battery/battery_Acer-3820tg.txt
Expand Down Expand Up @@ -125,6 +129,7 @@
[sys] Add MCHC system/system_MCHC.txt
[sys] Fix _WAK Arg0 v1 system/system_WAK1.txt
[sys] Fix _WAK Arg0 v2 system/system_WAK2.txt
[sys] Fix _WAK IAOE system/system_IAOE.txt
[sys] Fix Mutex with non-zero SyncLevel system/system_Mutex.txt
[sys] Fix PNOT/PPNT system/system_PNOT.txt
[sys] Add IMEI system/system_IMEI.txt
Expand Down
10 changes: 10 additions & 0 deletions Patches.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
EDCD54641A2E10550009F438 /* graphics_REG-disable.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_REG-disable.txt"; path = "graphics/graphics_REG-disable.txt"; sourceTree = "<group>"; };
EDCD54651A2E11EA0009F438 /* graphics_INI-disable.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_INI-disable.txt"; path = "graphics/graphics_INI-disable.txt"; sourceTree = "<group>"; };
EDDD15E51A72C7C80093ACE1 /* graphics_nvidia_gt520m.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = graphics_nvidia_gt520m.txt; sourceTree = "<group>"; };
EDE3BCB71B018ED700475630 /* fix_PSS.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fix_PSS.txt; path = syntax/fix_PSS.txt; sourceTree = "<group>"; };
EDE3BCB81B018F8800475630 /* usb_prw_0x6d_xhc.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = usb_prw_0x6d_xhc.txt; path = usb/usb_prw_0x6d_xhc.txt; sourceTree = "<group>"; };
EDE3BCB91B018FCF00475630 /* usb_prw_0x0d_xhc.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = usb_prw_0x0d_xhc.txt; path = usb/usb_prw_0x0d_xhc.txt; sourceTree = "<group>"; };
EDE3BCBA1B01900700475630 /* system_IAOE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = system_IAOE.txt; path = system/system_IAOE.txt; sourceTree = "<group>"; };
EDE3BCBB1B01904E00475630 /* graphics_Rename-B0D3.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_Rename-B0D3.txt"; path = "graphics/graphics_Rename-B0D3.txt"; sourceTree = "<group>"; };
EDF0829E1A0BC52C00DD15A5 /* battery_Clevo-M860TU.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "battery_Clevo-M860TU.txt"; path = "battery/battery_Clevo-M860TU.txt"; sourceTree = "<group>"; };
EDFBE3951A3767DF00F61E48 /* graphics_SSDT-disable-cleanup.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "graphics_SSDT-disable-cleanup.txt"; path = "graphics/graphics_SSDT-disable-cleanup.txt"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -160,6 +165,7 @@
84CAF68C1926C305000EF232 /* fix_HID_pnp.txt */,
8475976F1943A347009F3026 /* remove_DSM.txt */,
84FEF29C196D8B7D0061DF5A /* fix_PARSEOP_ZERO.txt */,
EDE3BCB71B018ED700475630 /* fix_PSS.txt */,
);
name = "Syntax Errors";
sourceTree = "<group>";
Expand All @@ -186,6 +192,7 @@
84EF939D18916DED0027D192 /* graphics_PNLF-Lenovo-Ux10a.txt */,
84EF939E189175440027D192 /* graphics_PNLF-Lenovo-Ux10b.txt */,
84A7391A19464C0E000B4B6E /* graphics_PNLF-ACPI100.txt */,
EDE3BCBB1B01904E00475630 /* graphics_Rename-B0D3.txt */,
);
name = "Intel Graphics";
sourceTree = "<group>";
Expand All @@ -208,6 +215,7 @@
8498961A1811D4A80086DF6C /* system_Mutex.txt */,
843F7BE518B901CB00567F87 /* system_PNOT.txt */,
841978D1191C77880045C15B /* system_IMEI.txt */,
EDE3BCBA1B01900700475630 /* system_IAOE.txt */,
);
name = System;
sourceTree = "<group>";
Expand Down Expand Up @@ -326,6 +334,8 @@
84F42CD51809F576003AE042 /* usb_6-series-id.txt */,
84F42CD61809F585003AE042 /* usb_7-series-id.txt */,
849B7B29180B859900B76D3C /* usb_7-series-multiplex.txt */,
EDE3BCB81B018F8800475630 /* usb_prw_0x6d_xhc.txt */,
EDE3BCB91B018FCF00475630 /* usb_prw_0x0d_xhc.txt */,
);
name = "USB (EHCI-XHCI)";
sourceTree = "<group>";
Expand Down
1 change: 1 addition & 0 deletions battery/battery_ASUS-N55SL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# ASUS K550JD-XX003H
# ASUS G53SX
# ASUS K56CB
# ASUS UX305

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
Expand Down
40 changes: 40 additions & 0 deletions graphics/graphics_Rename-B0D3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#Maintained by: RehabMan for: Laptop Patches
#graphics_Rename-B0D3.txt

# for DSDT

into method label _WAK code_regex B0D3 replaceall_matched begin HDAU end;
into definitionblock code_regex B0D3 replaceall_matched begin HDAU end;

# for GFX0 SSDT

# inject "hda-gfx"="onboard-1" into IGPU (GFX0 originally)
into method label _DSM parent_adr 0x00020000 remove_entry;
into device name_adr 0x00020000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"hda-gfx", Buffer() { "onboard-1" },\n
})\n
}\n
end;

# inject "hda-gfx"="onboard-1" into HDAU (B0D3 originally)
into method label _DSM parent_adr 0x00030000 remove_entry;
into device name_adr 0x00030000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n
Return (Package()\n
{\n
"hda-gfx", Buffer() { "onboard-1" },\n
})\n
}\n
end;

into device label B0D3 set_label begin HDAU end;
into method label SBCB code_regex B0D3 replaceall_matched begin HDAU end;
19 changes: 19 additions & 0 deletions syntax/fix_PSS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Maintained by: RehabMan for: Laptop Patches
#fix_PSS.txt

# for one of the CPU SSDTs...

# remove bogus:
#
# Package (0x06)
# {
# 0x80000000,
# 0x80000000,
# 0x80000000,
# 0x80000000,
# 0x80000000,
# 0x80000000
# }

into_all all code_regex Package\s+\(0x06\)\n.*\{\n(.*0x80000000.*\n){6}.*\} removeall_matched;

32 changes: 32 additions & 0 deletions system/system_IAOE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#Maintained by: RehabMan for: Laptop Patches
#system_IAOE.txt

# _PTS and _WAK in this DSDT tend to manipulate externals
# in the IAOE device. Some manipulates are protected with
# CondRefOf, and some not. Because of the unprotected
# references, the IAOE SSDT must be included for sleep to
# work.

# This patch is an attempt to fix _PTS/_WAK such that IAOE is
# not required.

# _PTS fixes
into method label _PTS code_regex If\s+\(And\s+\(ICNF,\s+One\)\) replace_matched
begin
If (LAnd(CondRefOf(\\_SB.IAOE), And(ICNF,One)))
end;

# _WAK fixes
into method label _WAK code_regex If\s+\(And\s+\(\\_SB\.PCI0\.GFX0\.TCHE,\s+0x0100\)\) replace_matched
begin
If (LAnd(CondRefOf(\\_SB.IAOE), And(\\_SB.PCI0.GFX0.TCHE, 0x0100)))
end;
ze
into method label _WAK code_regex (If\s+\(LEqual\s+\(\\_SB\.IAOE\.ITMR,\s+Zero\)\)(\n.*){9}) replace_matched
begin
If (CondRefOf(\\_SB.IAOE)) {\n
%1\n
}
end;

into method label _WAK code_regex If\s+\(LEqual\s+\(\\_SB\.IAOE\.ITMR,\s+(Zero|0x00)\)\)\s+\{\} remove_matched;
108 changes: 108 additions & 0 deletions usb/usb_prw_0x0d_xhc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#Maintained by: RehabMan for: Laptop Patches
#usb_prw_0x0d_xhc.txt

# remove _PRW methods to prevent instant wake

# delete any existing XHC1 device
into device label XHC1 name_adr 0x00140000 remove_entry;
# delete any existing USB2 device
into device label USB2 name_adr 0x001D0000 remove_entry;

# if _PRW objects are methods
into method label _PRW parent_adr 0x001D0000 remove_entry;
into method label _PRW parent_adr 0x001A0000 remove_entry;
into method label _PRW parent_adr 0x00140000 remove_entry;
into method label _PRW parent_adr 0x001B0000 remove_entry;
# some other LAN cards use 0x00190000
into method label _PRW parent_adr 0x00190000 remove_entry;

# if _PRW objects are names
into device name_adr 0x001D0000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched;
into device name_adr 0x001A0000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched;
into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched;
into device name_adr 0x001B0000 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;

# seems to work better if _PRW is present, but returns 0 (original was 3) for sleep state
into device name_adr 0x001D0000 insert begin Name(_PRW, Package() { 0x0D, 0 }) end;
into device name_adr 0x001A0000 insert begin Name(_PRW, Package() { 0x0D, 0 }) end;
into device name_adr 0x00140000 insert begin Name(_PRW, Package() { 0x0D, 0 }) end;
into device name_adr 0x001B0000 insert begin Name(_PRW, Package() { 0x0D, 0 }) end;
into device name_adr 0x00190000 insert begin Name(_PRW, Package() { 0x0D, 0 }) end;

# rename XHC to XHC1

into device label XHC set_label begin XHC1 end;
into_all all code_regex XHC\. replaceall_matched begin XHC1. end;
into_all all code_regex XHC_\. replaceall_matched begin XHC1. end;
into_all all code_regex \.XHC, replaceall_matched begin .XHC1, end;

#Maintained by: RehabMan for: Laptop Patches
#usb_USB_7-series.txt

# USB property injection for 7-series boards (originally HM76)

# Insert Apple USB properties into EHC1
into method label _DSM parent_adr 0x001D0000 remove_entry;
into device name_adr 0x001D0000 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;

# Insert Apple USB properties into EHC2
into method label _DSM parent_adr 0x001A0000 remove_entry;
into device name_adr 0x001A0000 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;

# 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;


# special cases... (not in u430 DSDT)
into scope label _SB.PCI0.XHC.RHUB.HS05 set_label begin _SB.PCI0.XHC1.RHUB.HS05 end;

108 changes: 108 additions & 0 deletions usb/usb_prw_0x6d_xhc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#Maintained by: RehabMan for: Laptop Patches
#usb_prw_0x6d_xhc.txt

# remove _PRW methods to prevent instant wake

# delete any existing XHC1 device
into device label XHC1 name_adr 0x00140000 remove_entry;
# delete any existing USB2 device
into device label USB2 name_adr 0x001D0000 remove_entry;

# if _PRW objects are methods
into method label _PRW parent_adr 0x001D0000 remove_entry;
into method label _PRW parent_adr 0x001A0000 remove_entry;
into method label _PRW parent_adr 0x00140000 remove_entry;
into method label _PRW parent_adr 0x001B0000 remove_entry;
# some other LAN cards use 0x00190000
into method label _PRW parent_adr 0x00190000 remove_entry;

# if _PRW objects are names
into device name_adr 0x001D0000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched;
into device name_adr 0x001A0000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched;
into device name_adr 0x00140000 code_regex Name.*_PRW.*\n.*\n.*\n.*\n.*\}\) remove_matched;
into device name_adr 0x001B0000 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;

# seems to work better if _PRW is present, but returns 0 (original was 3) for sleep state
into device name_adr 0x001D0000 insert begin Name(_PRW, Package() { 0x6D, 0 }) end;
into device name_adr 0x001A0000 insert begin Name(_PRW, Package() { 0x6D, 0 }) end;
into device name_adr 0x00140000 insert begin Name(_PRW, Package() { 0x6D, 0 }) end;
into device name_adr 0x001B0000 insert begin Name(_PRW, Package() { 0x6D, 0 }) end;
into device name_adr 0x00190000 insert begin Name(_PRW, Package() { 0x6D, 0 }) end;

# rename XHC to XHC1

into device label XHC set_label begin XHC1 end;
into_all all code_regex XHC\. replaceall_matched begin XHC1. end;
into_all all code_regex XHC_\. replaceall_matched begin XHC1. end;
into_all all code_regex \.XHC, replaceall_matched begin .XHC1, end;

#Maintained by: RehabMan for: Laptop Patches
#usb_USB_7-series.txt

# USB property injection for 7-series boards (originally HM76)

# Insert Apple USB properties into EHC1
into method label _DSM parent_adr 0x001D0000 remove_entry;
into device name_adr 0x001D0000 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;

# Insert Apple USB properties into EHC2
into method label _DSM parent_adr 0x001A0000 remove_entry;
into device name_adr 0x001A0000 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;

# 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;


# special cases... (not in u430 DSDT)
into scope label _SB.PCI0.XHC.RHUB.HS05 set_label begin _SB.PCI0.XHC1.RHUB.HS05 end;

0 comments on commit 0c8b12c

Please sign in to comment.