Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements, updates, and refactorizations #85

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,32 @@

## A quick explainer on ACPI

So what are DSDTs and SSDTs? Well, these are tables present in your firmware that outline hardware devices like USB controllers, CPU threads, embedded controllers, system clocks and such. A DSDT(Differentiated System Description Table) can be seen as the body holding most of the info with smaller bits of info being passed by the SSDT(Secondary System Description Table). You can think of the DSDT as the building blueprints with SSDTs being sticky notes outlining extra details to the project
So what are DSDTs and SSDTs? Well, these are tables present in your firmware that outline hardware devices like USB controllers, CPU threads, embedded controllers, system clocks, and such. A DSDT(Differentiated System Description Table) can be seen as the body holding most of the info with smaller bits of info being passed by the SSDT(Secondary System Description Table). You can think of the DSDT as the building blueprints with SSDTs being sticky notes outlining extra details to the project

You can read more about ACPI and it's spec here: [ACPI 6.4 Manual](https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf)
You can read more about ACPI and its spec here: [ACPI 6.4 Manual](https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf)

> So why do we care about these tables?

macOS can be very picky about the devices present in the DSDT and so our job is to correct it. The main devices that need to be corrected for macOS to work properly:

* Embedded controllers(EC)
* All semi-modern Intel machines have an EC (usually called H\_EC, ECDV, EC0, etc...) exposed in their DSDT, with many AMD systems also having it exposed. These controllers are generally not compatible with macOS and can cause panics, so then need to be hidden from macOS. macOS Catalina requires a device named `EC` to be present though, so a dummy EC is created.
* With laptops, the actual embedded controller still needs to be enabled for battery and hotkeys to work, and renaming the EC can additionally cause issues with windows, so creating a fake EC without disabling the real embedded controller is preferable.
* All semi-modern Intel machines and most AMD systems have an EC (usually called H\_EC, ECDV, EC0, etc...) exposed in their DSDT. These controllers are generally not compatible with macOS and can cause panics, so they need to be hidden from macOS. macOS Catalina requires a device named `EC` to be present though, so a dummy EC is created.
* To ensure that the battery and hotkeys work properly on laptops, it is important to keep the real embedded controller enabled. Renaming the EC can cause problems with Windows, so creating a fake EC while still keeping the real one active is a better option.
* Plugin type
* This allows the use of XCPM providing native CPU power management on **Intel** Haswell and newer CPUs, the SSDT will connect to the first thread of the CPU. Not meant for AMD
* This feature enables the utilization of XCPM, which facilitates the natural use of CPU power management on Intel Haswell and newer processors. The SSDT will connect to the first thread of the CPU. However, please note that this feature is not intended for use on AMD CPUs.
* AWAC system clock.
* This applies to all 300 series motherboards including many Z370 boards, the specific issue is that newer boards ship with AWAC clock enabled. This is a problem because macOS cannot communicate with AWAC clocks, so this requires us to either force on the legacy RTC clock or if unavailable create a fake one for macOS to play with
* NVRAM SSDT
* True 300 series motherboards(non-Z370) don't declare the FW chip as MMIO in ACPI and so the kernel ignores the MMIO region declared by the UEFI memory map. This SSDT brings back NVRAM support
* Motherboards in the True 300 series (excluding Z370) do not classify the FW chip as MMIO in ACPI, causing the kernel to overlook the MMIO area specified in the UEFI memory map. This SSDT brings back NVRAM support.
* Backlight SSDT
* Used for fixing backlight control support on laptops
* This is used to fix the backlight control support on laptops.
* GPIO SSDT
* Used for creating a stub to allow VoodooI2C to connect onto, for laptops only
* This tool is specifically used for creating a stub that enables VoodooI2C to connect, **For laptops *only***
* XOSI SSDT
* Used for rerouting OSI calls to this SSDT, mainly used for tricking our hardware into thinking its booting Windows so we get better trackpad support. This is a very hacky solution known for breaking Windows boot, use the GPIO SSDT instead. Usage of XOSI will not be covered in this guide
* This method redirects OSI calls to the SSDT and is primarily utilized to deceive our hardware into believing that it is running Windows, thereby improving trackpad support. However, this is a rather unreliable and unstable solution that can potentially cause issues with Windows boot. It is recommended to use the GPIO SSDT instead. Please note that the usage of XOSI will not be discussed in this guide.
* IRQ SSDT and ACPI patches
* Needed for fixing IRQ conflicts within the DSDT, for laptops mainly. SSDTTime exclusive
* Note Skylake and newer systems rarely have IRQ conflicts, this is mainly prevalent on Broadwell and older

Now head to the next page on what SSDTs do your systems need:
* This is Needed for fixing IRQ conflicts within the DSDT, mainly for laptops. SSDTTime exclusive
* It is rare for Skylake and newer systems to experience IRQ conflicts. This issue is more commonly experienced on Broadwell and older systems.
Proceed to the next page to determine which SSDTs your system needs.

## [Choosing the SSDTs](ssdt-platform.md)
14 changes: 7 additions & 7 deletions cleanup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cleanup

So you've made all your SSDTs but now there's one thing left: Adding them to OpenCore
Once you have created all your SSDTs, the final step is to add them to OpenCore.

The 2 main locations:

Expand All @@ -9,15 +9,15 @@ The 2 main locations:

You can save yourself some work with the config.plist by running Cmd/Ctrl+R in ProperTree. **Reminder do not add your DSDT.aml to your EFI**

For those who do not yet have a config.plist, you'll want to next head back to your respective OpenCore guides and create the config.plist:
If you don't have a config.plist yet, please go back to the OpenCore guide for your hardware and create one.

* [OpenCore Install guide](https://dortania.github.io/OpenCore-Install-Guide/)

Users of `FixHPET` will also need to merge oc_patches.plist into their config.plist

Steps to do this:
To achieve this, follow the steps below:

* Open both files,
* Delete the `ACPI -> Patch` section from config.plist
* Copy the `ACPI -> Patch` section from patches.plist
* Paste into where old patches were in config.plist
1. Open both files.
2. Remove the `ACPI -> Patch` section from the config.plist file.
3. Copy the `ACPI -> Patch` section from the patches.plist file.
4. Paste it into the location where the old patches were in the config.plist file.
Binary file modified images/ssdt-easy-md/ssdttime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 40 additions & 39 deletions ssdt-methods/ssdt-easy.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# SSDTs: The easy way

So here we'll be using a super simple tool made by CorpNewt: [SSDTTime](https://github.com/corpnewt/SSDTTime)

What this tool does is, it dumps your DSDT from your firmware, and then creates SSDTs based off your DSDT. **This must be done on the target machine running either Windows or Linux**
The purpose of this tool is to extract your DSDT from your firmware and generate SSDTs using it. Please note that this process can only be done on machines running either Windows or Linux.

## So what **CAN'T** SSDTTime do

* **SSDT-PNLF**:
* Need to be configured to your system
* **SSDT-GPI0**:
* Need to be configured to your system
* **USBX SSDT**:
* This is included on sample SSDTs but SSDTTime only makes the SSDT-EC part, Skylake and newer users can grab a pre-built here: [SSDT-USBX.aml](https://github.com/dortania/OpenCore-Post-Install/blob/master/extra-files/SSDT-USBX.aml)

* **IMEI SSDT**:
* If you have either a Sandy bridge CPU with 7 series motherboard or Ivy Bridge with 6 series motherboard, you'll need to either use the prebuilt or manually create it.
* If you have either a Sandy Bridge CPU with a 7 series motherboard or Ivy Bridge with a 6 series motherboard, you'll need to either use the prebuilt or manually create it.

* **RTC0 RANGE SSDT**:
If you have X99 or X299, you'll need to configure it to your system
* If you have X99 or X299, you'll need to configure it to your system.

For users who don't have all the options available to them in SSDTTime, you can follow the "SSDTs: The long way" section. You can still use SSDTTime for SSDTs it does support.

Expand All @@ -27,49 +24,53 @@ Run the `SSDTTime.bat` file as Admin on the target machine and you should see so

What are all these options?:

* `1. FixHPET - Patch out IRQ Conflicts`
* IRQ patching, mainly needed for X79, X99 and laptop users(use option `C` to omit conflicting legacy IRQs)
* `2. FakeEC - OS-aware Fake EC`
* This is the SSDT-EC, required for Catalina users
* `3. FakeEC Laptop - OS-aware Fake EC`
* This is the SSDT-EC, but the laptop version only Builds Fake EC and leaves the existing EC devices untouched, again required for Catalina users
* `4. PluginType - Sets plugin-type = 1 on First ProcessorObj`
* This is the SSDT-PLUG, for Intel only
* `5. PMC - Sets Power Management controller status`
* This is the SSDT-PMC, for Intel true 300+ series only, this device is missing from ACPI in recent boards and helps to bring back NVRAM support.
* `6. AWAC - Context-Aware AWAC Disable and RTC Fake`
* This is the SSDT-AWAC/RTC0, its purpose is to fix the system clocks found on newer hardware
* `7. USB Reset - Reset USB controllers to allow hardware mapping`
* This is SSDT-RHUB, used for resetting USB ports in macOS for Asus's Z490 motherboards
* `8. Dump DSDT - Automatically dump the system DSDT`
* Dumps your DSDT from your firmware

What we want to do is select option `8. Dump DSDT` first, then select the appropriate option(s) for your system.

> What about USBX?

For Skylake and newer plus AMD, you can grab a pre-built file here: [SSDT-USBX.aml](https://github.com/dortania/OpenCore-Post-Install/blob/master/extra-files/SSDT-USBX.aml). This file is plug and play and requires no device configuration, **do not use on Broadwell and older**.
* `1. FixHPET`
* Patch Out IRQ Conflicts
* `2. FakeEC`
* OS-Aware Fake EC
* `3. FakeEC Laptop`
* Only Builds Fake EC - Leaves Existing Untouched
* `4. USBX`
* Power properties for USB on SKL and newer SMBIOS
* `5. PluginType`
* Redefines CPU Objects as Processor and sets plugin-type = 1
* `6. PMC`
* Enables Native NVRAM on True 300-Series Boards
* `7. RTCAWAC`
* Context-Aware AWAC Disable and RTC Enable/Fake/Range Fix
* `8. USB Reset`
* Reset USB controllers to allow hardware mapping
* `9. PCI Bridge`
* Create missing PCI bridges for passed device path
* `0. PNLF`
* Sets up a PNLF device for laptop backlight control
* `A. XOSI`
* _OSI rename and patch to return true for a range of Windows versions - also checks for OSID
* P. `Dump DSDT`
* Automatically dump the system DSDT

What we want to do is select the option `P. Dump DSDT` first, then select the appropriate option(s) for your system.


**Troubleshooting note**: See [General Troubleshooting](https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/troubleshooting.html) if you're having issues running SSDTTime

## Adding to OpenCore

Don't forget that SSDTs need to be added to OpenCore, reminder that .aml is complied, .dsl is code. **Add only the .aml file**:
Don't forget that SSDTs need to be added to OpenCore, a reminder that .aml is compiled, and .dsl is code. **Add only the .aml file**:

* EFI/OC/ACPI
* config.plist -> ACPI -> Add

Reminder that Cmd/Ctrl+R with ProperTree pointed at your OC folder will add all your SSDTs, kexts and .efi drivers to the config for you. **Do not add your DSDT to OpenCore, its already in your firmware**. If you are unsure what this is referring to, go back to the OpenCore guide and select your config based of the architecture of your CPU.
A reminder that Cmd/Ctrl+R with ProperTree pointed at your OC folder will add all your SSDTs, kexts, and .efi drivers to the config for you. **Do not add your DSDT to OpenCore, it's already in your firmware**. If you are unsure what this is referring to, go back to the OpenCore guide and select your config based on the architecture of your CPU.

For those who do not yet have a config.plist, you'll want to next head back to your respective OpenCore guides and create the config.plist:
If you haven't made a config.plist yet, you should go back to the OpenCore guide and make one.

* [OpenCore Install guide](https://dortania.github.io/OpenCore-Install-Guide/)

Users of `FixHPET` will also need to merge oc_patches.plist into their config.plist

Steps to do this:

* Open both files,
* Delete the `ACPI -> Patch` section from config.plist
* Copy the `ACPI -> Patch` section from patches.plist
* Paste into where old patches were in config.plist
To accomplish this task, follow these steps:
1. Open both files.
2. Remove the `ACPI -> Patch` section from the config.plist file.
3. Copy the `ACPI -> Patch` section from the patches.plist file.
4. Paste it in the location where the old patches were in the config.plist file.
2 changes: 1 addition & 1 deletion ssdt-methods/ssdt-long.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SSDTs: The long way

Well sadly some things are not handled by SSDTTime, well have no fear as making SSDTs is super easy. The basic process:
Unfortunately, some things aren't handled by SSDTTime, but have no fear as making SSDTs is super easy. The basic process:

* Dump DSDT(the one SSDTTime did for us will work)
* Decompile DSDT
Expand Down
2 changes: 1 addition & 1 deletion ssdt-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Please see the **specific ACPI section of your config.plist**, all SSDTs needed
| AMD (15/16h) | N/A | ^^ | N/A | ^^ | N/A |
| AMD (17h) | [SSDT-CPUR for B550 and A520](https://github.com/dortania/Getting-Started-With-ACPI/blob/master/extra-files/compiled/SSDT-CPUR.aml) | ^^ | ^^ | ^^ | ^^ |

## High End Desktop
## High-End Desktop

| Platforms | **CPU** | **EC** | **RTC** | **PCI** |
| :-------: | :-----: | :----: | :-----: | :-----: |
Expand Down
12 changes: 6 additions & 6 deletions troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Fixing SSDTTime: `Could not locate or download iasl!`

This is usually due to an outdated version of Python, try either updating Python or add iasl to the scripts folder for SSDTTime:
This is usually due to an outdated version of Python, try either updating Python or adding iasl to the scripts folder for SSDTTime:

* [iasl macOS version](https://bitbucket.org/RehabMan/acpica/downloads/iasl.zip)
* [iasl Windows version](https://acpica.org/downloads/binary-tools)
Expand All @@ -19,12 +19,12 @@ This is usually due to an outdated version of Python, try either updating Python

Grab [OpenShell](https://github.com/acidanthera/OpenCorePkg/releases) and add it to EFI/OC/Tools and config.plist -> Misc -> Tools.

Next, call upon OpenCore shell and enter the following:
Next, call upon the OpenCore shell and enter the following:

```
shell> fs0: //replace with proper drive

fs0:\> dir //to verify this is the right directory
fs0:\> dir //to verify this is the correct directory

Directory of fs0:\

Expand Down Expand Up @@ -59,16 +59,16 @@ Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
```

This is a common error on DSDTs that have methods that aren't supported by MaciASL, the easiest way is to delete MaciASL and make sure you grab it from Acidanthera's repo: [MaciASL](https://github.com/acidanthera/MaciASL/releases)
If you encounter an error on DSDTs due to unsupported methods in MaciASL, the simplest solution is to uninstall MaciASL and download it from Acidanthera's repository. Here's the link: [MaciASL](https://github.com/acidanthera/MaciASL/releases)

## Invalid character (0x3D), expecting ASL keyword or name

![](./images/troubleshooting-md/invalid-parse.png)

Similar to the above error, you're running an outdated copy of MaciASL. Make sure you're using the latest from Acidanthera's repo: [MaciASL](https://github.com/acidanthera/MaciASL/releases)
Like the above error, you're running an outdated copy of MaciASL. Make sure you're using the latest from Acidanthera's repo: [MaciASL](https://github.com/acidanthera/MaciASL/releases)

## Syntax error, unexpected PARSEOP_ONE, expecting '('

![](./images/troubleshooting-md/invalid-parse.png)

Similar to the above 2 errors, you're running an outdated copy of MaciASL. Make sure you're using the latest from Acidanthera's repo: [MaciASL](https://github.com/acidanthera/MaciASL/releases)
Like the above 2 errors, you're running an outdated copy of MaciASL. Make sure you're using the latest from Acidanthera's repo: [MaciASL](https://github.com/acidanthera/MaciASL/releases)