Skip to content

Commit

Permalink
misc.py: Add SPI top case patches
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Jan 30, 2024
1 parent 54b3e17 commit f29c629
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 1.4.0
- Refactor subprocess invocations
- Resolve RecoveryOS support (Regression resolved in OpenCorePkg)
- Restore SPI Keyboard and Trackpad support for macOS 14.4 and newer
- Applicable for MacBook8,1, MacBookPro13,x and MacBookPro14,x
- Increment binaries:
- OpenCorePkg 0.9.7 - release

Expand Down
36 changes: 36 additions & 0 deletions payloads/Config/config.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,42 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>AppleHSSPISupport - SPI Top Case Support</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>23.4.0</string>
<key>BundlePath</key>
<string>AppleHSSPISupport.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleHSSPISupport</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>AppleHSSPIHIDDriver - SPI Top Case Support</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>23.4.0</string>
<key>BundlePath</key>
<string>AppleHSSPIHIDDriver.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleHSSPIHIDDriver</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
</array>
<key>Block</key>
<array>
Expand Down
Binary file not shown.
Binary file added payloads/Kexts/Misc/AppleHSSPISupport-v1.0.0.zip
Binary file not shown.
10 changes: 9 additions & 1 deletion resources/build/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,17 @@ def _firewire_handling(self) -> None:

def _topcase_handling(self) -> None:
"""
USB Top Case Handler
USB/SPI Top Case Handler
"""

# macOS 14.4 Beta 1 strips SPI-based top case support for USB-C Macs pre-T2
if self.model.startswith("MacBook") and self.model in smbios_data.smbios_dictionary:
if self.model == "MacBook8,1" or (cpu_data.CPUGen.skylake <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.CPUGen.kaby_lake):
logging.info("- Enabling SPI-based top case support")
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleHSSPISupport.kext", self.constants.apple_spi_version, self.constants.apple_spi_path)
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleHSSPIHIDDriver.kext", self.constants.apple_spi_hid_version, self.constants.apple_spi_hid_path)


#On-device probing
if not self.constants.custom_model and self.computer.internal_keyboard_type and self.computer.trackpad_type:

Expand Down
10 changes: 10 additions & 0 deletions resources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def __init__(self) -> None:
self.t1_sse_version: str = "1.1.0" # AppleSSE (13.6 - T1 support)
self.t1_key_store_version: str = "1.1.0" # AppleKeyStore (13.6 - T1 support)
self.t1_corecrypto_version: str = "1.0.1" # corecrypto (13.6 - T1 support)
self.apple_spi_version: str = "1.0.0" # AppleHSSPISupport (14.4 Beta 1)
self.apple_spi_hid_version: str = "1.0.0" # AppleHSSPIHIDDriver (14.4 Beta 1)

## Apple - Dortania Modified
self.bcm570_version: str = "1.0.2" # CatalinaBCM5701Ethernet
Expand Down Expand Up @@ -459,6 +461,14 @@ def t1_sse_path(self):
def t1_corecrypto_path(self):
return self.payload_kexts_path / Path(f"Misc/corecrypto_T1-v{self.t1_corecrypto_version}.zip")

@property
def apple_spi_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleHSSPISupport-v{self.apple_spi_version}.zip")

@property
def apple_spi_hid_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleHSSPIHIDDriver-v{self.apple_spi_hid_version}.zip")

@property
def mousse_path(self):
return self.payload_kexts_path / Path(f"SSE/AAAMouSSE-v{self.mousse_version}.zip")
Expand Down

0 comments on commit f29c629

Please sign in to comment.