Contribute
Register

[Guide] Native Power Management for Laptops

AppleIntelCPUPowerManagement.kext is not used for the hardware in your profile, therefore not expected.
AppleIntelCPUPowerManagement.kext last enabled for Ivy Bridge. Haswell and later use X86PlatformPlugin and XCPM.

For your sleep issue, open a separate thread.
(although I can see your ACPI setup is wrong. _OSI->XOSI patch is not valid without SSDT-XOSI.aml).
i see, thankyou for your reply now i understand about that,,
ok, i will make separate thread , please help me thankyou rehabman
 
Overview

Power Management should be one of the first things implemented when trying to install OS X on a laptop. Because of heat/noise and battery life issues, using NullCPUPowerManagement is not a realistic option on a laptop.

Fortunately, with Clover, you NullCPUPowerManagement is never needed.

This guide will assume you started by following my Clover guide for laptops:

http://www.tonymacx86.com/el-capita...de-booting-os-x-installer-laptops-clover.html


Custom SSDT.aml using ssdtPRGen.sh

Use the ssdtPRGen.sh script by Pike R. Alpha: https://github.com/Piker-Alpha/ssdtPRGen.sh

Instructions for using it are provided in the README.

The generated SSDT.aml should be placed on the EFI partition at /EFI/Clover/ACPI/patched/SSDT.aml.

Based on the current instructions at the README, what follows is a synopsis...

To prepare, you only need to do the first two commands:
Code:
cd ~
curl -o ./ssdtPRGen.sh https://raw.githubusercontent.com/Piker-Alpha/ssdtPRGen.sh/master/ssdtPRGen.sh
chmod +x ./ssdtPRGen.sh

With newer computers (Broadwell, Skylake, and future), make sure you use the beta branch:
Code:
cd ~
curl -o ./ssdtPRGen.sh https://raw.githubusercontent.com/Piker-Alpha/ssdtPRGen.sh/Beta/ssdtPRGen.sh
chmod +x ./ssdtPRGen.sh

Then you can run the script:
Code:
./ssdtPRGen.sh

Note: If you have a CPU currently unsupported by the script (the Beta branch has more comprehensive data, so this is less likely with the Beta), you may have to provide the data for it.

For example, i7-4720HQ:
Code:
./ssdtPRGen.sh -p 'i7-4710HQ' -f 2600 -turbo 3600

By providing the name 'i7-4710HQ' (similar enough to i7-4720HQ), and overrides for the non-turbo and turbo frequencies, the script is successful. Eventually, it would not be necessary, provided the script is updated with the new CPUs.

When it asks if you want to copy to /Extra just respond 'n'. Same for opening ssdt.dsl... respond 'n'.

The results are at ~/Library/ssdtPRGen/SSDT.aml.

Assuming your EFI partition is mounted at /Volumes/EFI, copy that file to EFI partition, /EFI/Clover/ACPI/patched/SSDT.aml

Code:
cd ~
cp ~/Library/ssdtPRGen/ssdt.aml /Volumes/EFI/EFI/Clover/ACPI/patched/SSDT.aml

Also, be aware that hibernation (suspend to disk or S4 sleep) is not supported on hackintosh.

You should disable it:
Code:
sudo pmset -a hibernatemode 0
sudo rm /var/vm/sleepimage
sudo mkdir /var/vm/sleepimage

Always check your hibernatemode after updates and disable it. System updates tend to re-enable it, although the trick above (making sleepimage a directory) tends to help.

And it may be a good idea to disable the other hibernation related options:
Code:
sudo pmset -a standby 0
sudo pmset -a autopoweroff 0


Testing PM

After installing the custom SSDT, you should reboot and test it. You can test using DPCIManager (1.5) by using the PStates monitor. AppleIntelCPUPowerManagementInfo.kext (now renamed AppleIntelInfo.kext) will generally provide more accurate results.

Note: DPCIManager currently does not work on 10.11. Use AppleIntelInfo.kext instead.

In addition, for Ivy Bridge and later (eg. Ivy, Haswell, Broadwell, Skylake, KabyLake, etc), you should run IORegistryExplorer and verify that X86PlatformPlugin is loading under the CPU0 node.

More information on Native PM is available here: http://www.tonymacx86.com/mountain-...tive-ivy-bridge-cpu-gpu-power-management.html

For Mavericks specific information, read here: http://www.tonymacx86.com/mavericks...vericks-native-cpu-igpu-power-management.html


Checklist

Here is a quick Ivy/Sandy/Haswell+ Power Management checklist.

- SSDT.aml at EFI/Clover/ACPI/patched
- config.plist/KernelAndKextPatches/AsusAICPUPM=true (pre-Haswell)
- config.plist/KernelAndKextPatches/KernelPm=true (Haswell+)
- config.plist/KernelAndKextPatches/KernelLapic=true (for those with Local APIC panic)
- appropriate System Definition (SMBIOS) for your CPU (config.plist/SMBIOS)
- no rollbacks of AppleACPIPlatform.kext
- no NullCPUPowerManagement.kext (usually implies patched AppleIntelCPUPowerManagement)
- Processor objects declared in Scope (_SB) or Scope (_PR) in DSDT (pretty rare not to have them in OEM DSDT)
- Verify that the generated SSDT injects into the same scope as Processor declarations in DSDT (usually _PR)


AppleACPIPlatform and EmbeddedControl

Note: For Sandy Bridge PM, it is possible to run a rollback of AppleACPIPlatform.kext but it is discouraged. Watch out for battery manager packages that include a rolled back AppleACPIPlatform.kext.

Note: Running stock AppleACPIPlatform.kext means any DSDT methods that manipulate EC (EmbeddedControl) registers larger than 8-bits will not work and will cause the method to fail. These methods must be patched. Access to such registers is common in DSDT battery methods. Some patches are provided at my laptop DSDT patch repository at: https://github.com/RehabMan/Laptop-DSDT-Patch


Note on laptops with AMD Radeon

It is sometimes necessary to drop the MCFG table (use config.plist/ACPI/DropTables).


Note on older CPUs

For CPUs older than Sandy Bridge, use config.plist/Generate=true instead of custom SSDT.aml. Since that option causes Clover to generate replacement CPU SSDTs, you will also need to drop the OEM CPU related SSDTs. Usually that means setting config.plist/ACPI/SSDT/DropOem=true, although you may be able to drop the individual tables with DropTables.


Notes on DropOem=true

With older hardware you may need to drop OEM CPU related SSDTs (as mentioned above). Although you can drop individual tables with config.plist/ACPI/DropTables, it is easiest to drop all with config.plist/ACPI/SSDT/DropOem=true.

With modern hardware (Haswell and later), the system almost always works better if you retain all the SSDTs. The newer systems may even have trouble booting if you eliminate them.

As a result, don't use DropOem=true unless you have to. It is needed on certain computers Sandy Bridge and older.

More information regarding DropOem is available in the ACPI patching guide:

http://www.tonymacx86.com/el-capitan-laptop-support/152573-guide-patching-laptop-dsdt-ssdts.html

--

For additional information for earlier versions of OS X and Chameleon/Chimera, see original post here: http://www.tonymacx86.com/yosemite-laptop-support/146870-guide-native-power-management-laptops.html


Experimental technique: XCPM only

If you have a computer with Haswell or later (eg. Haswell, Broadwell, Skylake, KabyLake, etc), you can use a simpler method that does not involve ssdtPRgen.sh. Since power management is in the kernel (XCPM), it appears the custom tables generated by ssdtPRgen.sh are not needed. But we still need X86PlatformPlugin to load.

In order to do that we only need an SSDT that will inject the "plugin-type" property ("plugin-type"=1). The SSDT is available in my hotpatch repo here: https://github.com/RehabMan/OS-X-Clover-Laptop-Config (hotpatch/SSDT-PluginType1.dsl).

Direct link: https://raw.githubusercontent.com/R...p-Config/master/hotpatch/SSDT-PluginType1.dsl

The contents of it are simple:
Code:
// Inject plugin-type=1 on _PR.CPU0
// This is experimental to see how only injecting plugin-type with native CPU PM SSDTs
// works on various platforms.
//
// Results: OK on Haswell+, not so good on Ivy
DefinitionBlock("", "SSDT", 2, "hack", "PluginType", 0)
{
    External(\_PR.CPU0, DeviceObj)
    Method (\_PR.CPU0._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return (Package()
        {
            "plugin-type", 1
        })
    }
}
//EOF

To use it, compile it as AML in MaciASL, then copy to your EFI/Clover/ACPI/patched.

For example, in Terminal (assuming you have iasl installed):
Code:
# download SSDT-PluginType1.dsl and compile it as SSDT-PluginType1.aml
curl -o ./SSDT-PluginType1.dsl https://raw.githubusercontent.com/RehabMan/OS-X-Clover-Laptop-Config/master/hotpatch/SSDT-PluginType1.dsl
iasl SSDT-PluginType1.dsl
# not valid to use both SSDT.aml and SSDT-PluginType1.aml, so remove it
rm /Volumes/EFI/EFI/Clover/ACPI/patched/SSDT.aml
cp SSDT-PluginType1.aml /Volumes/EFI/EFI/Clover/ACPI/patched/SSDT-PluginType1.aml

Testing and verification is the same was when using SSDT.aml generated from ssdtPRgen.sh.


Experimental option for Skylake/Kaby Lake (and later): HWP

In Skylake CPUs, Intel introduced a new power management technology: SpeedShift (aka. SST, aka. HWP).

With HWP enabled, the CPU handles pstate management by itself instead of requiring the OS to do it. The CPU itself will automatically shift to higher and lower pstates depending on CPU demand.

In order to use HWP, use an SMBIOS that is enabled for HWP... currently MacBook9,1, MacBookPro13,x. Also, since HWP tends to cause the xcpm_idle to be invoked, make sure the xcpm_idle patch (courtesy of PikeRAlpha) is enabled. It is default in all current plists provided by my Clover laptop guide. If you're using older than current plists, you may have to copy the patch into your config.plist/KernelAndKextPatches/KernelToPatch section.

You can also enable HWP for other SMBIOS by creating a patched resources injector for X86PlatformPlugin.kext (or by patching the kext itself). But that is a subject for another day.

Note: You still need SSDT.aml from ssdtPRgen.sh or SSDT-PluginType1.aml as discussed earlier.


Problem Reporting

Be precise about the nature of the problem.

Attach ioreg as ZIP: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html. Please, use the IORegistryExplorer v2.1 attached to the post! DO NOT reply with an ioreg from any other version of IORegistryExplorer.app.

Provide output (in Terminal):
Code:
kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu
kextstat|grep -y applelpc
kextstat|grep -y applehda

Attach EFI/Clover folder as ZIP (press F4 at main Clover screen before collecting). Please eliminate 'themes' directory. Provide only EFI/Clover, not the entire EFI folder.

Attach output of (in Terminal):
Code:
sudo touch /System/Library/Extensions && sudo kextcache -u /

Compress all files as ZIP. Do not use external links. Attach all files using site attachments only.
hey so with this ssdt in my patched folder do I now need to add it to my sorted order list? or since it doesn't have a number it will just go first automatically/does it need to go first? thank you
 
hey so with this ssdt in my patched folder do I now need to add it to my sorted order list? or since it doesn't have a number it will just go first automatically/does it need to go first? thank you

For just power management SSDT, SortedOrder not required.
But if you are already using SortedOrder (due to patched ACPI), you must, of course, add SSDT.aml to it (if it is not already present).
Because with SortedOrder specified, only the files listed by SortedOrder are loaded by Clover.
 
Overview

- no rollbacks of AppleACPIPlatform.kext
what does no rollbacks mean? I am under my system/library/extensions folder where my kexts are located. should I not have a AppleACPIPlatform.kext ? because I do have one in that folder. should I delete it? Is that what you mean? sorry if I didn't understand properly.
 
what does no rollbacks mean?

It means to make sure you didn't install AppleACPIPlatform.kext from an older version of OS X.
Common practice a while back was to install the kext from Snow Leopard.
 
It means to make sure you didn't install AppleACPIPlatform.kext from an older version of OS X.
Common practice a while back was to install the kext from Snow Leopard.
ohhhh okay, I understand the lingo now. thank you
 
Back
Top