Skip to content

Commit

Permalink
SSDTTime pages Updated & DMAR Table Patch Guide (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krazy-Killa authored Dec 31, 2023
1 parent 97003ad commit d01ce9b
Show file tree
Hide file tree
Showing 16 changed files with 182 additions and 26 deletions.
24 changes: 24 additions & 0 deletions Laptops/backlight-methods/ssdttime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fixing Backlight: SSDTTime Method

This method involves using SSDTTime which automates most of the process. See here on how to use it: [SSDTs: Easy Way](/ssdt-methods/ssdt-easy.md)

To begin, you must have a valid `DSDT.aml` dump. If you do not, you will have to run SSDTTime in either Windows or Linux booted outside of OpenCore or with the debug version of OpenCore utilizing the `SysReport` quirk. Once you have your `DSDT.aml` file, follow these steps:

* Select `0. PNLF`, then it will ask a series of questions regarding what platform you have. Once you choose a proper `_UID`, SSDTTime will find your GPU's ACPI path, and properly create a PNLF device at that location. An added bonus of SSDTTime is that it will search your entire DSDT for any references to PNLF anywhere and rename them so that any conflicts are removed as well.

![](/images/Laptops/backlight-md/ssdttime_pnlf.png)

Once done, SSDTTime will create several files inside its Results folder. A SSDT-PNLF.**aml**, SSDT-PNLF.**dsl** and may create two plist files: `patches_OC.plist` and `patches_Clover.plist`.

The `patches_OC(Clover).plist` file contains the necessary patch required for your `SSDT-PNLF.aml` to function, so it must not be skipped.

The main things to note with this method:

* Doesn't really teach you anything
* For most, this doesn't matter. But to some knowing what makes your hackintosh tick is part of the journey

## Wrapping up

Once you're done making your SSDT, either head to the next page to finish the rest of the SSDTs or head here if you're ready to wrap up:

* [**Cleanup**](/cleanup.md)
3 changes: 2 additions & 1 deletion Laptops/backlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The purpose of this SSDT is to create a PNLF device for macOS to play with, spec

## Methods to make this SSDT

For the backlight fix, there are 2 methods you can choose from:
For the backlight fix, there are several methods you can choose from:

* [Prebuilt](/Laptops/backlight-methods/prebuilt.md)
* [SSDTTime](/Laptops/backlight-methods/ssdttime.md)
* [Manual](/Laptops/backlight-methods/manual.md)
5 changes: 4 additions & 1 deletion Laptops/trackpad-methods/prebuilt.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Fixing Trackpads: Prebuilt

This is a one-size fits all solution where we basically trick our hardware into thinking it's booting Windows. The problem with this method is that it's common to break Windows booting so avoid unless troubleshooting.
This is a one-size fits all solution where we basically trick our hardware into thinking it's booting Windows. The problem with this method is that it's common to break Windows booting if abused so avoid unless troubleshooting.

* [SSDT-XOSI](https://github.com/dortania/Getting-Started-With-ACPI/blob/master/extra-files/compiled/SSDT-XOSI.aml)
* If you require a GPI0 stub, this must still be done manually.

* XOSI Rename(add this under config.plist -> ACPI -> Patch):

Expand All @@ -13,3 +14,5 @@ This is a one-size fits all solution where we basically trick our hardware into
| Limit | Number | 0 |
| Find | Data | 5f4f5349 |
| Replace | Data | 584f5349 |

**NOTE** This table only includes the fields that have been modified. You still must include every field that OpenCore expects within the `ACPI->Patch` scheme. Refer to the [Configuration Document](https://dortania.github.io/docs/latest/Configuration.html) for these fields and their failsafe values.
24 changes: 24 additions & 0 deletions Laptops/trackpad-methods/ssdttime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fixing Trackpads: SSDTTime Method

This method involves using SSDTTime which automates most of the process. See here on how to use it: [SSDTs: Easy Way](/ssdt-methods/ssdt-easy.md)

To begin, you must have a valid `DSDT.aml` dump. If you do not, you will have to run SSDTTime in either Windows or Linux booted outside of OpenCore or with the debug version of OpenCore, utilizing the `SysReport` quirk. Once you have your `DSDT.aml` file, follow these steps:

* Select `A. XOSI`, then either the earliest version of Windows your system shipped with, or choose the Auto option.

Once done, SSDTTime will create several files inside its Results folder. A SSDT-XOSI.**aml**, SSDT-XOSI.**dsl** and two plist files: `patches_OC.plist` and `patches_Clover.plist`.

The `patches_OC(Clover).plist` file contains the necessary patch required for your `SSDT-XOSI.aml` to function, so it must not be skipped.

The main things to note with this method:

* Doesn't really teach you anything
* For most, this doesn't matter. But to some knowing what makes your hackintosh tick is part of the journey
* Can only make SSDT-XOSI
* If you need SSDT-GPI0, then you still need to make it [manually](/Laptops/trackpad-methods/manual.md).

## Wrapping up

Once you're done making your SSDT, either head to the next page to finish the rest of the SSDTs or head here if you're ready to wrap up:

* [**Cleanup**](/cleanup.md)
4 changes: 3 additions & 1 deletion Laptops/trackpad.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ This section assumes that macOS is already installed. You may need to use a USB

## Methods to make this SSDT

For the trackpad fix, there are only one method to choose from:
For the trackpad fix, there are several methods to choose from:

* [SSDTTime](/Laptops/trackpad-methods/ssdttime.md)
* [Prebuilt](/Laptops/trackpad-methods/prebuilt.md)
* [Manual](/Laptops/trackpad-methods/manual.md)
2 changes: 2 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* [Prebuilt](/Universal/ec-methods/prebuilt.md)
* [SSDTTime](/Universal/ec-methods/ssdttime.md)
* [Manual](/Universal/ec-methods/manual.md)
* [DMAR Table (VT-d)](/Universal/dmar.md)
* [Manual](/Universal/dmar-methods/manual.md)
* [CPU Power Management](/Universal/plug.md)
* [Prebuilt](/Universal/plug-methods/prebuilt.md)
* [SSDTTime](/Universal/plug-methods/ssdttime.md)
Expand Down
65 changes: 65 additions & 0 deletions Universal/dmar-methods/manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Patching DMAR Table: Manual

What we will be doing is removing the Reserved Memory Regions to allow this table to load without conflicts in macOS - which is necessary for the following hardware devices:
* Intel I225 based Ethernet Controllers
* Aquantia Ethernet Controllers
* Some WiFi devices

## Preparation

First we need to gather files necessary to patch our DMAR Table. If you've used the `SysReport` Quirk that is included with the Debug version of OpenCore, then you should have a `DMAR-1.aml` file residing inside your EFI Partition `SysReport/ACPI` folder, otherwise please follow the procedure [here](/Manual/dump.html#sysreport-quirk) to get started. Once you have the file, it is best to store it in a safe location for easy access later on in this section.

## Manipulation

### Creating our Customized DMAR Table

Easiest way to manipulate the DMAR table is to use the GUI program MaciASL, this is a macOS only program, which can be acquired [here](https://github.com/acidanthera/MaciASL). It is time to create our customized version of our original DMAR table with the Reserved Memory Regions removed. So to start, we will open the copy of our `DMAR-1.aml` file we extracted from our system.

![](../../images/Universal/dmar-md/dmar-example-rmr.png) | ![](../../images/Universal/dmar-md/dmar-example-normr.png)
:-------------------------------:|:------------------:
Example of a DMAR Table with Reserved Memory Regions. | Example of a DMAR Table without Reserved Memory Regions

If your DMAR Table looks like Example #2 which has no Reserved Memory Regions, you can skip this guide and merely disable `DisableIoMapper` in your `config.plist`, and enable VT-d in your BIOS.

Now if your DMAR Table looks like Example #1, please continue below.

With our `DMAR-1.aml` file open, it is time to begin patching it, and do not worry this is pretty easy to do. All we are doing is highlighting every section that is labelled `Reserved Memory Region` or Subtable Type of `0001` until you reach the next non-`0001` Subtable Type or when you reach the end of the file just like in the example below, and remove the entries entirely.

![](../../images/Universal/dmar-md/dmar-rmr-selected.png)
::: details Learn More

To learn more, you can read up on [DMA Remapping Table: "Intel® Virtualization Technology for Directed I/O"](https://software.intel.com/content/dam/develop/external/us/en/documents-tps/vt-directed-io-spec.pdf).

:::

The information starting with `Raw Table Data` at the end of the table is safe to remove as well if you choose to, this is merely raw binary table data and is only there for display. When you Compile and Save as a new `ACPI Machine Language Binary`, this data is changed to reflect the new information in the binary table.

::: warning

**NOTE**: Do not confuse this with a SSDT, as that is a `Secondary System Description Table` which provides extra details for the actual DSDT.

:::

### Dropping the DMAR Table

Now you will need to prepare your `config.plist` for deleting or "dropping" the DMAR table. This is done in the `ACPI->Delete` section.

::: tip Delete Code

| Comment | String | Drop DMAR Table |
| :------ | :------ | :-------------- |
| All | Boolean | YES |
| Enabled | Boolean | YES |
| TableSignature | Data | 444D4152 |

::: warning

You must still conform to the OpenCore's `config.plist` schema, so make sure to consult with the [OpenCore Configuration](https://dortania.github.io/docs/release/Configuration.html) document for all required fields that must be present within `ACPI->Delete` and fill them in with their failsafe values.

:::

## Cleaning Up

Of course make sure your new patched `DMAR.aml` file is in your EFI Partition's `EFI/OC/ACPI` folder and also added to your `config.plist`. Then disable `DisableIoMapper` under `Kernel->Quirks` and reboot.

If you are using a I225 based Ethernet Controller, and are utilizing `e1000=0` or `dk.e1000=0` for macOS 12.2.1 and below. You will need to remove this boot-arg before rebooting so that `com.apple.DriverKit-AppleEthernetE1000` can match to your Intel I225-V Ethernet controller.
16 changes: 16 additions & 0 deletions Universal/dmar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Patching DMAR Table (DMAR.aml)

* [What this ACPI Table does](#what-this-acpi-table-does)
* [Methods to make this ACPI Table](#methods-to-make-this-acpi-table)

## What this ACPI Table does

The purpose of patching the DMAR table is to remove any Reserved Memory Regions within it. This is necessary as `VT-d` is now required in Big Sur and newer for certain ethernet controllers utilizing DriverKit extensions; including but not limited to I225 based controllers, Aquantia Ethernet Controllers and some WiFi devices. Now, in order for our patched ACPI Table to load properly we must also drop the current DMAR table residing in our firmware to allow our patched ACPI Table to take its place.

This is for any CPU that supports `VT-d` or Intel Virtualization Technology for Directed I/O.

## Methods to make this ACPI Table

To create this ACPI Table, there is currently 1 method available.

* [Manual](/Universal/dmar-methods/manual.md)
1 change: 1 addition & 0 deletions Universal/plug-methods/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ Original | Cleaned Up
Once you're done making your SSDT, either head to the next page to finish the rest of the SSDTs or head here if you're ready to wrap up:

* [**Cleanup**](/cleanup.md)

Binary file added images/Laptops/backlight-md/ssdttime_pnlf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Universal/dmar-md/dmar-example-normr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Universal/dmar-md/dmar-example-rmr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Universal/dmar-md/dmar-rmr-selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ssdt-easy-md/patchmerge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssdt-easy-md/ssdttime.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 41 additions & 23 deletions ssdt-methods/ssdt-easy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ What this tool does is, it dumps your DSDT from your firmware, and then creates

## 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.
* **RTC0 RANGE SSDT**:
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 +21,73 @@ 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`
* `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`
* `2. FakeEC - OS-aware Fake EC`
* This is the SSDT-EC, required for Catalina and newer users
* `3. FakeEC Laptop - OS-aware Fake EC - Leaves Existing Untouched`
* This is the SSDT-EC, but the laptop version only Builds Fake EC and leaves the existing EC devices untouched, again required for Catalina and newer users
* `4. USBX - Power properties for USB on SKL and newer SMBIOS`
* This is the SSDT-USBX. The prebuilt version can be used if desired, but SSDTTime can build a customizable version of SSDT-USBX.
* `5. PluginType - Sets plugin-type = 1 on First ProcessorObj`
* This is the SSDT-PLUG, and can be used on Haswell and newer. Will also check and redefine processor objects for 12th generation and newer Intel and AMD systems.
* `6. 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`
* `7. RTCAWAC - Context-Aware AWAC Disable and RTC Enable/Fake/Range Fix`
* This is the SSDT-AWAC/RTC0, its purpose is to fix the system clocks found on newer hardware, and also enable, fake, and/or fix the RTC range.
* `8. 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`
* `9. PCI Bridge - Create missing PCI bridges for passed device path`
* This will create missing PCI bridges necessary for passing device path.
* `0. PNLF - Sets up a PNLF device for laptop backlight control.`
* This a customized SSDT-PNLF, tailored for the specific system. This is not automatic and you must specify the generation of the iGPU.
* `A. XOSI - _OSI rename and patch to return true for a range of Windows versions - also checks for OSID`
* This is SSDT-XOSI, can also create a patch for OSID and keep it in the correct order.
* `B. Fix DMAR - Remove Reserved Memory Regions from the DMAR Table`
* This is primarily needed for devices that require VT-d functionality such as: I225 based ethernet controllers, Aquantia Ethernet Controllers and some WiFi Devices.
* `P. 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 we want to do is select option `P. 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**.
For Skylake and newer plus AMD, you can either build SSDT-USBX with SSDTTime or 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**.

**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**:
### Manual Method

Don't forget that SSDTs need to be added to OpenCore, reminder that .aml is compiled, .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.

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:
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:

* [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
Users of `FixHPET`, `XOSI`, and `RTCAWAC` 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

### PatchMerge method

**NOTE:** This method does require that you have your `config.plist` already created. If you have not done so, please start on the [OpenCore Install guide](https://dortania.github.io/OpenCore-Install-Guide/) before running this tool.

SSDTTime now includes a separate script called PatchMerge. This script will automatically merge the patches you selected previously into your `config.plist`.

Run `PatchMerge.bat` you will be presented with this screen:

![](../images/ssdt-easy-md/patchmerge.png)

Select option `1. Select config.plist` to begin the process. Once done, your patches will be stored in a `config.plist` inside the Results folder. You will need to verify that copy of your `config.plist` with your existing one, making sure everything is intact and the patches inserted properly. Then copy both the `config.plist` and the SSDTs from the Results folder to your `EFI/OC` and `EFI/OC/ACPI` folders respectively.

0 comments on commit d01ce9b

Please sign in to comment.