[Guide] How to Patch Laptop DSDT and SSDTs



EliteMacx86

Administrator
Staff member
To enable macOS features and enable various hardware and maintain stability, DSDT and SSDT patching is required. By patching the DSDT and SSTDs, it makes the perfect functioning of the laptop and also avoid issues and conflicts with the hardware.

This guide covers the basic DSDT and SSDT patching for Laptops.

Before you start the process, here are some notes.

Using someones else's DSDT and SSDT will not result in any benefit, since each hardware is unique, even if it's from the same manufacturer. Every laptop has different ACPI tables which might not match your laptop and the results may not be as expected. Sometimes you might even fail to boot or have few restarts/panics or crashes. The hardware would not be stable and cause error to the functions.

Even if you tend to use the same model from the same manufacturer, the tables may be different than yours. The reason is that the other laptop may have a different BIOS version than yours, different RAM size, BIOS options, WiFi hardware can make a difference resulting in unstable hardware and other bugs. So it's better to patch to patch your specific DSDT and SSTDs.

You need to re-extract and re-patch your DSDT and SSDTs if any of the following events takes place.
  • BIOS Update
  • Changing Memory size
  • Changing BIOS options
  • Changing any other hardware such as WiFi
The patching involves 6 different steps which includes:
  1. Extracting ACPI files
  2. Disassembling
  3. Patching
  4. Compiling
  5. Saving
  6. Installing
Extracting ACPI Files
The very first step is to extract the native ACPI files. The ACPI files can be extracted using Clover Bootloader, macOS, Linux or even Windows. But the only recommended method is using the Clover Bootloader.

The Clover method is recommended due to the ease of extraction of ACPI files and avoiding any further errors and corruption.
Follow the steps below to extract your ACPI files using Clover.

To begin with the process of extraction, make sure the Clover bootloader has been installed either on your installation USB or the system drive. If you haven't installed, make sure to install it.

Boot to boot menu using your USB or the system drive.
When at Clover main screen, press F4 to extract the ACPI files.
It will take some time, typically few minutes to extract the files.

Notes:
  • Some laptops use Fn+Fx function so make sure which one is handled by your laptop.
  • There's no any progress on the screen while extraction. The process runs in the background.
  • It might feel like stuck/hang but at that time, the Clover dumps/writes the files to your USB or the system drive.
After extracting the ACPI files, boot back to macOS and verify the ACPI files.
The dumped/extracted ACPI files are located/saved under EFI/Clover/ACPI/origin.
If the files are present there, it means the extraction is successful.

Download the tools for the disassembly
Before you start to disassemble the ACPI files, you'll need to prepare the tools for the disassembly

To disassemble the extracted files, you'll need the iasl compiler

Download iasl compiler
  1. Visit https://bitbucket.org/RehabMan/acpica/downloads
  2. Download the latest version, the latest version is recommended to avoid any errors during disassembly.
  3. Once downloaded, you'll get the compiler from the zip.
Copy compiler
The next step is to copy the compiler to the /usr/bin so that it can be easily accessed from safe location.

To copy the compiler, follow the steps below.
1. Open Terminal
2. Type:
Code:
cd Downloads
3. Type:
Code:
sudo cp iasl /usr/bin
When prompted, enter your password.
You can also do without terminal using Finder. To do so, follow the steps below
1. Go to Finder
2. Click on Go/Go to Folder
3. Type:
Code:
/usr/bin
4. Copy iasl compiler, which has been extracted and place it over here.

Disassembling the ACPI Files
The next step is to disassemble the extracted files.
The extracted files can be opened using MaciASL but when compiling, it will be left with many errors. Some can be fixed and some might be hard and cannot be fixed easily. So it's recommended that you disassemble your native ACPI files properly.

Notes :
  • Whenever you start the disassembly, make sure that you disassemble all the files at a time.
  • Do not disassemble specific files only. It will be prone to error.
Follow the steps below to disassemble the extracted files.
1. Copy the complete origin folder to your desktop
2. Make sure all the files are present as original when extracted. The extracted files will have a *.aml extension.
3. Create a refs.txt file where you've placed the DSDT and SSDTs. The advantage of using the refs.txt when disassembling the files is, it will remove several errors while disassembly resulting in saving time to fix the common errors.
Code:
External(MDBG, MethodObj, 1)
External(_GPE.MMTB, MethodObj, 0)
External(_SB.PCI0.LPCB.H_EC.ECWT, MethodObj, 2)
External(_SB.PCI0.LPCB.H_EC.ECRD, MethodObj, 1)
External(_SB.PCI0.LPCB.H_EC.ECMD, MethodObj, 1)
External(_SB.PCI0.PEG0.PEGP.SGPO, MethodObj, 2)
External(_SB.PCI0.GFX0.DD02._BCM, MethodObj, 1)
External(_SB.PCI0.SAT0.SDSM, MethodObj, 4)
External(_GPE.VHOV, MethodObj, 3)
External(_SB.PCI0.XHC.RHUB.TPLD, MethodObj, 2)
4. Open Terminal
5. Type:
Code:
iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml
This will disassemble all of your extracted ACI files.(DSDT and SSDTs)

The disassembled files will have a *.dsl extension.
If you directly open the .aml files using MaciASL and then click on compile button then you're doing it wrong. Doing so will not only cause errors while compiling but also wasting time in fixing the common errors due improper disassembly.

Notes:
  • Sometimes you might get error while disassembling the native files. The reason is due the duplicate SSDTs.
  • If there's any such errors, find the duplicated SSDT and remove it and then disassemble it.
Fixing Errors
After the disassembly, you might get some errors and you'll need to fix them, otherwise the files will not be compiled and saved further.
The errors can be due to changes in iasl compiler itself, and the OEM.

Downloads
Copy MaciASL
  • Download the MaciASL.
  • Extract the MaciASL and move it to Applications folder.
Before you start patching your DSDT/SSDTs, it would be good if you compile the disassembled files and look for the errors, if any.
This is because when you apply some patches, it might not be suitable for your DSDT and it can cause errors when compiling. So determining either the specific patches are causing the errors or the native disassembled DSDT, can be difficult.
Once you compile the disassembled files, and if there's no any error, you can continue to apply the patches.

Notes:
  • Some errors can be fixed using RehabMan patches for the Laptops.
  • Others can be removed by uncommenting/removing the lines causing the errors.
  • The syntax/error problems begin with "[syn]" in the patches. You can use it to fix the errors.
  • You should get all the disassembled files(.dsl) without any errors. Warnings/Remarks and Optimizations can be there which can be ignored.
A very common error with some Dell DSDT files are due to the ECRW. It's a common error caused by the iasl itself

Replace this code:
Code:
If (LEqual (PM6H, One))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW (If (PM0H)
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                            }))
                }
with this one :
Code:
If (LEqual (PM6H, One))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW)
                }
If (PM0H)
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                            }
Patching the DSDT
After fixing the disassembled files, (errors free), the next step is to patch the DSDT.
Once you disassemble the native files, create a folder and place all the disassembled DSDT and SSDTs.
There are some common patches for the DSDT and SSDTs which needs to be applied. The common patches are listed below.

Common Patches (DSDT)
  • Layout ID
  • Rename GFX0 to IGPU
  • Fix _WAK Arg0 v2
  • Fix Mutex with non-zero SyncLevel
  • HPET Fix
  • IRQ Fix
  • OS Check Fix
  • RTC Fix
  • SMBUS Fix
  • Rename B0D3 to HDAU
  • Fix PNOT/PPNT (use only if you're dropping CPU related SSDTs)
  • Haswell LPC
  • Add IMEI (do not use if your DSDT or SSDTs already have IMEI/HECI/MEI device)
  • 6-series USB
  • 7-series/8-series USB
Common Patches (SSDTs)
  • Rename GFX0 to IGPU
  • Rename B0D3 to HDAU
  • Cleanup/Fix Errors (SSDT)
  • Remove _PSS placeholders
Notes:
  • Depending on the AppleHDA or the other Audio method you use, change the layout ID in the DSDT.
  • Use "Rename B0D3 to HDAU" only if you're having a Sandy/Ivy/Haswell/Broadwell
  • Don't use "Fix PNOT/PPNT" patch if you're including all OEM SSDTs. It only applies in case if you exclude the OEM CPU related SSDTs.
  • If you're having a 6 or 7-series or 8 series laptop, you'll need to inject the power properties for the USB:
    • 6-series USB
    • 7-series/8-series USB
  • To fix the sleep/wake function, you need to use "instant wake" patches. The scenario is like the laptop will not go to sleep and the power LED/indicator continues to glow after few seconds. Use only "USB _PRW 0x6D (instant wake)" or "USB _PRW 0x0D (instant wake)" as it relates to an existing code in your DSDT. The specific patches are also included for skylake and later. You should examine your DSDT to determine what _PRW methods is used in your DSDT and then applying the appropriate patch.
  • If you have a Haswell CPU(8-series chipset), and AppleLPC.kext is not loading, you should use "Haswell LPC" to inject a compatible ID which will allow it to load.
  • If you have a Skylake CPU/100-series chipset, and AppleLPC.kext is not loading, you should use this patch to inject a compatible ID that will allow it to load:
Note:
  • AppleLPC is not likely needed with Skylake and later.
Applying the Patches
To Apply the patch, follow the steps below.

1. Open your disassembled DSDT or SSDT using MaciASL.
2. Click on Patch button.
3. Find and select the patch from the left pane.
4. Click on Apply.
5. Click on Close.

Compiling
After patching the DSDT and SSDTs, you need to compile the files.
Simply click on compile and look for errors. If there's any error, fix it and again click on Compile.
If there's no error, the files will be compiled successfully.

Saving the ACPI files
After compiling, the next step is to save the file for the installation.

1. Go to File
2. Select Save as
3. A dialogue box will appear asking the location and the file extension to save the file.
4. Select ACPI(ACPI Machine Language)
5. Click on Save

Note:
  • It's a good idea to save the patched DSDT and SSDTs in any other location than the original.
Installing the DSDT and SSDT
After finishing all the steps, you need to install the DSDT and SSDT.

1. Copy all the patched DSDT and SSDTs
2. Mount your EFI partition
3. Navigate to : EFI/Clover/ACPI/patched
4. Place all the patched files over here

Recommended configurations for using DSDT and SSDTs
The following configurations are the only valid configurations. Anything else is likely wrong and should not be used. I prefer the full patched DSDT+SSDTs

Full patched DSDT + SSDTs:
- Patched DSDT.aml in ACPI/patched
- Full set of patched OEM SSDTs in ACPI/patched (SSDTs names must be same as in ACPI/origin)
- Add-on SSDTs also placed in ACPI/patched
- SortedOrder required to set SSDT load order(SSDTs order must be same as in ACPI/origin)
- DropOem=True

Partial Hotpatch:
- Patched DSDT.aml in ACPI/patched
- Only add-on SSDTs in ACPI/patched (eg. no patched SSDTs)
- SortedOrder left unspecified
- DropOem=False


Credits:
RehabMan
 

Shekhar Kausalye

New member
Booting problem solved, means I replaced the config.plist file form bootable media and copied it in the EFI partition of the PC. Now I am able to boot. I have patched the DSDT & SSDTs.

From following Guide, first two steps are done and I am not able to understand how I can do Add-on SSD patching. When the above error comes I have done DropOem=True and for "SortedOrder required to set SSDT load order" this step previously I entered the names of the SSDT in the sorted order field (Please refer the attachment) of the config.plist file . The order of names are same as same as in ACPI/origin.

Full patched DSDT + SSDTs:
- Patched DSDT.aml in ACPI/patched
- Full set of patched OEM SSDTs in ACPI/patched (SSDTs names must be same as in ACPI/origin)
- Add-on SSDTs also placed in ACPI/patched
- SortedOrder required to set SSDT load order(SSDTs order must be same as in ACPI/origin)
- DropOem=True
 

Attachments

Shekhar Kausalye

New member
Booting problem solved, means I replaced the config.plist file form bootable media and copied it in the EFI partition of the PC. Now I am able to boot. I have patched the DSDT & SSDTs.

From following Guide, first two steps are done and I am not able to understand how I can do Add-on SSD patching. When the above error comes I have done DropOem=True and for "SortedOrder required to set SSDT load order" this step previously I entered the names of the SSDT in the sorted order field (Please refer the attachment) of the config.plist file . The order of names are same as same as in ACPI/origin.

Full patched DSDT + SSDTs:
- Patched DSDT.aml in ACPI/patched
- Full set of patched OEM SSDTs in ACPI/patched (SSDTs names must be same as in ACPI/origin)
- Add-on SSDTs also placed in ACPI/patched
- SortedOrder required to set SSDT load order(SSDTs order must be same as in ACPI/origin)
- DropOem=True
Its done. I again followed the above guide of Full patched DSDT + SSDTs: and now the system booted. I can I confirm that the patched are applied successfully?
 

EliteMacx86

Administrator
Staff member
Booting problem solved, means I replaced the config.plist file form bootable media and copied it in the EFI partition of the PC. Now I am able to boot. I have patched the DSDT & SSDTs.

From following Guide, first two steps are done and I am not able to understand how I can do Add-on SSD patching. When the above error comes I have done DropOem=True and for "SortedOrder required to set SSDT load order" this step previously I entered the names of the SSDT in the sorted order field (Please refer the attachment) of the config.plist file . The order of names are same as same as in ACPI/origin.

Full patched DSDT + SSDTs:
- Patched DSDT.aml in ACPI/patched
- Full set of patched OEM SSDTs in ACPI/patched (SSDTs names must be same as in ACPI/origin)
- Add-on SSDTs also placed in ACPI/patched
- SortedOrder required to set SSDT load order(SSDTs order must be same as in ACPI/origin)
- DropOem=True
Still no PR files attached. Read here: https://www.elitemacx86.com/threads/faq-read-first-questions-related-to-laptop.175/
 

Shekhar Kausalye

New member
In previous reply I want to ask How can I conform that patched are applied successfully?
PR files are attached.
There are no details in SMBIOS. How to do it?
 

Attachments

EliteMacx86

Administrator
Staff member
In previous reply I want to ask How can I conform that patched are applied successfully?
You can search for the patch in your DSDT and SSDTs.
PR files are attached.
IOReg is corrupt. The issue you're having is due to the "DSDT" is not in the sorted order list. Probably you've excluded it. Only SSDTs are there. Once you include the DSDT, it should be fixed.
There are no details in SMBIOS. How to do it?
That's normal. As per the guide, after the installation, you should generate a new SMBIOS for your hardware.
 

Similar threads



Top