From 51cf39a2645598474988d33d92e65488bb23a3bb Mon Sep 17 00:00:00 2001
From: Tsanie Lily <tsorgy@gmail.com>
Date: Fri, 1 Nov 2019 23:51:37 +0800
Subject: [PATCH] fix the USB Power using a kext, and upgrade drivers and
 kexts.

---
 OC/ACPI/SSDT-EC-USBX.aml                      | Bin 349 -> 0 bytes
 OC/Drivers/ApfsDriverLoader.efi               | Bin
 OC/Drivers/FwRuntimeServices.efi              | Bin
 OC/Drivers/VirtualSmc.efi                     | Bin
 OC/Kexts/AppleALC.kext/Contents/Info.plist    |   0
 OC/Kexts/Lilu.kext/Contents/Info.plist        |   0
 .../SMCProcessor.kext/Contents/Info.plist     |   0
 OC/Kexts/SMCSuperIO.kext/Contents/Info.plist  |   0
 OC/Kexts/USBPorts.kext/Contents/Info.plist    |   4 +-
 OC/Kexts/USBPower.kext/Contents/Info.plist    |  49 ++++++++++++++++++
 OC/Kexts/VirtualSMC.kext/Contents/Info.plist  |   0
 .../WhateverGreen.kext/Contents/Info.plist    |   0
 OC/OpenCore.efi                               | Bin
 OC/config.plist                               |  28 +++++-----
 14 files changed, 66 insertions(+), 15 deletions(-)
 delete mode 100755 OC/ACPI/SSDT-EC-USBX.aml
 mode change 100644 => 100755 OC/Drivers/ApfsDriverLoader.efi
 mode change 100644 => 100755 OC/Drivers/FwRuntimeServices.efi
 mode change 100644 => 100755 OC/Drivers/VirtualSmc.efi
 mode change 100644 => 100755 OC/Kexts/AppleALC.kext/Contents/Info.plist
 mode change 100644 => 100755 OC/Kexts/Lilu.kext/Contents/Info.plist
 mode change 100644 => 100755 OC/Kexts/SMCProcessor.kext/Contents/Info.plist
 mode change 100644 => 100755 OC/Kexts/SMCSuperIO.kext/Contents/Info.plist
 create mode 100755 OC/Kexts/USBPower.kext/Contents/Info.plist
 mode change 100644 => 100755 OC/Kexts/VirtualSMC.kext/Contents/Info.plist
 mode change 100644 => 100755 OC/Kexts/WhateverGreen.kext/Contents/Info.plist
 mode change 100644 => 100755 OC/OpenCore.efi

diff --git a/OC/ACPI/SSDT-EC-USBX.aml b/OC/ACPI/SSDT-EC-USBX.aml
deleted file mode 100755
index 75e4b1597b1187080db5b932da9827da1141cdf8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 349
zcmWFzb_t1PWME+0?&$0i!oUz*oKoWI%)r1Pz`)??7viJNBB8KAi$OF-pE*9*DL%m2
z)4(Ud*@+D#!h$T~5%22E#vovTMOZ{SJ~+gYVF7=<f3PR7OJY%ZW*);5hJ`FkxcCKp
zcw<1uL^t_!ga$iBaKt;h1Tly>am2d>`?4(HoSen5M39-0d5Mre8wYPTP)Tr3YHC41
zetBw9aA`q7P9+2P8)0OLq7vuQqN3Ei5}(Z6%n}A}6Nt9(#OzdTx*+11ngpC#(EJ?T
lWZ>!?AI}l*;pxKb=<MlYU|?X#0P~yxis!ia7cwtl008RvVF3UD

diff --git a/OC/Drivers/ApfsDriverLoader.efi b/OC/Drivers/ApfsDriverLoader.efi
old mode 100644
new mode 100755
diff --git a/OC/Drivers/FwRuntimeServices.efi b/OC/Drivers/FwRuntimeServices.efi
old mode 100644
new mode 100755
diff --git a/OC/Drivers/VirtualSmc.efi b/OC/Drivers/VirtualSmc.efi
old mode 100644
new mode 100755
diff --git a/OC/Kexts/AppleALC.kext/Contents/Info.plist b/OC/Kexts/AppleALC.kext/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/OC/Kexts/Lilu.kext/Contents/Info.plist b/OC/Kexts/Lilu.kext/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/OC/Kexts/SMCProcessor.kext/Contents/Info.plist b/OC/Kexts/SMCProcessor.kext/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/OC/Kexts/SMCSuperIO.kext/Contents/Info.plist b/OC/Kexts/SMCSuperIO.kext/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/OC/Kexts/USBPorts.kext/Contents/Info.plist b/OC/Kexts/USBPorts.kext/Contents/Info.plist
index bd92f3d..197194e 100755
--- a/OC/Kexts/USBPorts.kext/Contents/Info.plist
+++ b/OC/Kexts/USBPorts.kext/Contents/Info.plist
@@ -22,7 +22,7 @@
 	<string>1.0</string>
 	<key>IOKitPersonalities</key>
 	<dict>
-		<key>iMacPro1,1-XHC</key>
+		<key>iMac19,1-XHC</key>
 		<dict>
 			<key>CFBundleIdentifier</key>
 			<string>com.apple.driver.AppleUSBMergeNub</string>
@@ -189,7 +189,7 @@
 				</dict>
 			</dict>
 			<key>model</key>
-			<string>iMacPro1,1</string>
+			<string>iMac19,1</string>
 		</dict>
 	</dict>
 	<key>OSBundleRequired</key>
diff --git a/OC/Kexts/USBPower.kext/Contents/Info.plist b/OC/Kexts/USBPower.kext/Contents/Info.plist
new file mode 100755
index 0000000..16c983f
--- /dev/null
+++ b/OC/Kexts/USBPower.kext/Contents/Info.plist
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.dynamix.IOKitPersonalitiesPatch</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>IOKitPatches</string>
+	<key>CFBundlePackageType</key>
+	<string>KEXT</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	<key>IOKitPersonalities_x86_64</key>
+	<dict>
+		<key>iMac19,1</key>
+		<dict>
+			<key>CFBundleIdentifier</key>
+			<string>com.apple.driver.AppleUSBHostMergeProperties</string>
+			<key>IOClass</key>
+			<string>AppleUSBHostMergeProperties</string>
+			<key>IOProviderClass</key>
+			<string>AppleBusPowerController</string>
+			<key>IOProviderMergeProperties</key>
+			<dict>
+				<key>kUSBSleepPortCurrentLimit</key>
+				<integer>2100</integer>
+				<key>kUSBSleepPowerSupply</key>
+				<integer>5100</integer>
+				<key>kUSBWakePortCurrentLimit</key>
+				<integer>2100</integer>
+				<key>kUSBWakePowerSupply</key>
+				<integer>5100</integer>
+			</dict>
+			<key>model</key>
+			<string>iMac19,1</string>
+		</dict>
+	</dict>
+	<key>OSBundleRequired</key>
+	<string>Root</string>
+</dict>
+</plist>
diff --git a/OC/Kexts/VirtualSMC.kext/Contents/Info.plist b/OC/Kexts/VirtualSMC.kext/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/OC/Kexts/WhateverGreen.kext/Contents/Info.plist b/OC/Kexts/WhateverGreen.kext/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/OC/OpenCore.efi b/OC/OpenCore.efi
old mode 100644
new mode 100755
diff --git a/OC/config.plist b/OC/config.plist
index e1d167b..37aaf1d 100755
--- a/OC/config.plist
+++ b/OC/config.plist
@@ -14,14 +14,6 @@
 				<key>Path</key>
 				<string>SSDT-PLUG.aml</string>
 			</dict>
-			<dict>
-				<key>Comment</key>
-				<string>Fix EC and USB Power</string>
-				<key>Enabled</key>
-				<true/>
-				<key>Path</key>
-				<string>SSDT-EC-USBX.aml</string>
-			</dict>
 			<dict>
 				<key>Comment</key>
 				<string>300 series RTC patch</string>
@@ -252,6 +244,16 @@
 				<key>PlistPath</key>
 				<string>Contents/Info.plist</string>
 			</dict>
+			<dict>
+				<key>BundlePath</key>
+				<string>USBPower.kext</string>
+				<key>Comment</key>
+				<string>USB Power</string>
+				<key>Enabled</key>
+				<true/>
+				<key>PlistPath</key>
+				<string>Contents/Info.plist</string>
+			</dict>
 		</array>
 		<key>Patch</key>
 		<array>
@@ -449,17 +451,17 @@
 		<key>Generic</key>
 		<dict>
 			<key>MLB</key>
-			<string>M000000000001</string>
+			<string></string>
 			<key>ROM</key>
-			<data>ESIzAAAA</data>
+			<data></data>
 			<key>SpoofVendor</key>
 			<true/>
 			<key>SystemProductName</key>
-			<string>iMacPro1,1</string>
+			<string>iMac19,1</string>
 			<key>SystemSerialNumber</key>
-			<string>W0000000001</string>
+			<string></string>
 			<key>SystemUUID</key>
-			<string>00000000-0000-0000-0000-000000000000</string>
+			<string></string>
 		</dict>
 		<key>UpdateDataHub</key>
 		<true/>