Jump to content
Allan

Power Management for your Hackintosh

Recommended Posts

Initial Setup

?

This guide is for the supported versions of Intel CPU - 1-4th

?

SSDT

?

Clover = Open the config.plist and setup in this way. Generate P and C states and DropOEM, AICPMpatch (only for Sandy and Ivy CPUs).

Chameleon = Open the org.chameleon.Boot.plist?and setup in this way. For the 1st generation, mark P and C states, and for Sandy/Ivy use P and C states and DropSSDT, now the?Haswell CPUs uses a different power management, is the XNU Kernel?(XCPM). If necessary use a modified SSDT.

?

DSDT

?

Clover = EFI/CLOVER/ACPI/patched

Chameleon = Extra/ -?Open the?org.chameleon.Boot.plist, and mark this option DSDT.aml and address the path where the file is.

?

Thanks for the help:?kyndder?and?Piker R. Alpha

Share this post


Link to post
Share on other sites

How to use ssdtPRGen.sh script for generate SSDTs


?


?


You can download the latest revision of ssdtPRGen.sh by entering the following command in a Terminal:



curl -o ~/ssdtPRGen.sh https://raw.githubusercontent.com/Piker-Alpha/ssdtPRGen.sh/master/ssdtPRGen.sh

That will download ssdtPRGen.sh to your user directory. The next step is to change the file mode (+x) with:



chmod +x ~/ssdtPRGen.sh

Please note that ssdtPRGen.sh v15.1 and greater requires a working Internet connection, to download configuration data and command line tools, but you can download a complete zip archive by entering the following in a terminal window:



curl -o ~/Library/ssdtPRGen.zip https://codeload.github.com/Piker-Alpha/ssdtPRGen.sh/zip/master
unzip -qu ~/Library/ssdtPRGen.zip -d ~/Library/
mv ~/Library/ssdtPRGen.sh-master ~/Library/ssdtPRGen
rm ~/Library/ssdtPRGen.zip

Or you can use a simple way to create a SSDT


?


Go in the Piker’s website and make a download of the file, you can see this in the right side of the website. Click on “Download ZIP”, extract the zip.


Now open Terminal and run this commands:



cd Downloads/ssdtPRGen.sh-master


sudo chmod 755 ssdtPRGen.sh

Now you can complement the use of the script using some references that Pike shows


?


But if you don’t want to use this “workgraunds” just run the next command, and the script database will recognize your CPU and (SMBios) model, and will generate a SSDT for you.



./ssdtPRGen.sh

Complementing the script:


?


$ ~/ssdtPRGen.sh -h


?


Usage: ./ssdtPRGen.sh [-abcdfhlmptwx]


?? ? ? -acpi Processor name (example: CPU0, C000)


?? ? ? -bclk frequency (base clock frequency)


?? ? ? -board-id (example: Mac-F60DEB81FF30ACF6)


?? ? ? -cpu type [0/1/2/3]


? ? ? ? ? 0 = Sandy Bridge


? ? ? ? ? 1 = Ivy Bridge


? ? ? ? ? 2 = Haswell


? ? ? ? ? 3 = Broadwell


?? ? ? -debug output [0/1/3]


? ? ? ? ? 0 = no debug injection/debug output


? ? ? ? ? 1 = inject debug statements in: ssdt.dsl


? ? ? ? ? 2 = show debug output


? ? ? ? ? 3 = both


?? ? ? -frequency (clock frequency)


?? ? ? -help info (this)


?? ? ? -lfmode, lowest idle frequency


?? ? ? -logical processors [2-128]


?? ? ? -model (example: MacPro6,1)


?? ? ? -open the previously generated SSDT


?? ? ? -processor model (example: 'E3-1285L v3')


?? ? ? -show supported board-id and model combinations:


?? ? ? ? ? Haswell


?? ? ? ? ? Ivy Bridge


?? ? ? ? ? Sandy Bridge


?? ? ? -turbo maximum (turbo) frequency:


? ? ? ? ? 6300 for Sandy Bridge and Ivy Bridge


? ? ? ? ? 8000 for Haswell and Broadwell


?? ? ? -tdp [11.5 - 150]


?? ? ? -workarounds for Ivy Bridge [0/1/2/3]


? ? ? ? ? 0 = no workarounds


? ? ? ? ? 1 = inject extra (turbo) P-State at the top with maximum (turbo) frequency + 1 MHz


? ? ? ? ? 2 = inject extra P-States at the bottom


? ? ? ? ? 3 = both


?? ? ? -xcpm mode [0/1]


? ? ? ? ? 0 = XCPM mode disabled


? ? ? ? ? 1 = XCPM mode enabled


?


An example:



./ssdtPRGen.sh -w 3 -x 1

All possible bugs (so called 'issues') should be filed at:


https://github.com/P...PRGen.sh/issues


Share this post


Link to post
Share on other sites

XCPM - Should I use? How?


?


Before we beginning. You should understand that the XCPM is started and controlled by this following instructions inside?XNU?(Xnu?CPU?Power?Management)?or (mach_kernel) - Eliminating the use and loading of AppleIntelCPUPowerManagment.kext


?


Apple began the use of this kernel from 10.9.2 version of OS X (Mavericks).


?


Who can use?


?


This feature is available to the users that have Ivybridge/Haswell and Broadwell.


?


Will be more successful for those using Haswell and Broadwell, is not a problem using on Ivy, but let's say that the use of XCPM would be a test, than really a solution in Ivy Bridge CPUs.


?


How to use?


?


May remember that many laptops or motherboards have the BIOS with the MSR 0xE2 locked.


And to correct it was necessary to patch the kext AppleIntelCPUPowerManagement, avoiding KP (Kernel Panic).


Now using the XNU, he is responsible for power management, applying a patch on it, we will avoid possible KP or instant reboots.


?


Going back to Ivy CPUs, the resource plugin-type enabled is required. Because Apple uses a specific _DSM in the ACPI tables.


Using Pike script to generate the SSDTs, this method is automatically entered in the ACPIs table.


You must use this plugin to (X86PlatformPlugin.kext and X86PlatformShim.kext) is loaded. If not used, will these error messages at boot:



ACPI_SMC_PlatformPlugin::start – waitForService(resourceMatching(AppleIntelCPUPowerManagement) timed out
WARNING: IOPlatformPluginUtil : getCPUIDInfo: this is an unknown CPU model 0x3c — power management may be incomplete or unsupported

Setting up the bootloader - Clover or Chameleon


?


For Haswell and Broadwell CPUs, just insert the -xcpm flag in your .plist.


?


Clover


Config.plist> Arguments> -xcpm


?


Chameleon


org.chameleon.Boot> Kernel Flags> -xcpm


?


Applying kernel patch:


?


Clover


KernelAndKextPatches> KernelPm


?


Chameleon


It is necessary to run a patch to apply to the Kernel:


?


For?OS X 10.10 and 10.10.1:



perl -pi -e 's|\xe2\x00\x00\x00\x02\x00\x00\x00|\x00\x00\x00\x00\x02\x00\x00\x00|g' kernel
perl -pi -e 's|\xe2\x00\x00\x00\x4c\x00\x00\x00|\x00\x00\x00\x00\x4c\x00\x00\x00|g' kernel
perl -pi -e 's|\xe2\x00\x00\x00\x90\x01\x00\x00|\x00\x00\x00\x00\x90\x01\x00\x00|g' kernel

OS X 10.9:



perl -pi -e 's|\x74\x6c(\x48\x83\xc7\x28\x90\x8b\x05..\x5e\x00\x85\x47\xdc)\x74\x54(\x8b\x4f\xd8\x45\x85\xc0\x74\x08\x44\x39\xc1\x44\x89\xc1)\x75\x44(\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x57\xf8\x48\x8b\x47\xe8\x48\x85\xc0\x74\x06\x48\xf7\xd0\x48\x21\xc2\x48\x0b\x57\xf0\x49\x89\xd1\x49\xc1\xe9\x20\x89\xd0\x8b\x4f\xd8\x4c\x89\xca)(\x0f\x30\x8b\x4f\xd8\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x17\x48\x83\xc7\x30\xff\xce)\x75\x99(\x5d\xc3)\x90{7}|\x74\x73${1}\x74\x5b${2}\x75\x4b${3}\x66\x81\xf9\xe2\x00\x74\x02${4}\x75\x92${5}|g' mach_kernel

OS X 10.8.5:



perl -pi -e 's|\x74\x69(\x48\x83\xc7\x28\x90\x8b\x05\xfe\xce\x5f\x00\x85\x47\xdc)\x74\x51(\x8b\x4f\xd8\x45\x85\xc0\x74\x05\x44\x39\xc1)\x75\x44(\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x57\xf8\x48\x8b\x47\xe8\x48\x85\xc0\x74\x06\x48\xf7\xd0\x48\x21\xc2\x48\x0b\x57\xf0\x49\x89\xd1\x49\xc1\xe9\x20\x89\xd0\x8b\x4f\xd8\x4c\x89\xca)(\x0f\x30\x8b\x4f\xd8\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x17\x48\x83\xc7\x30\xff\xce)\x75\x9c(\x5d\xc3)\x90{7}(\x90{3})|\x74\x70${1}\x74\x58${2}\x75\x4b${3}\x66\x81\xf9\xe2\x00\x74\x02${4}\x75\x95${5}${6}|g' mach_kernel

Note:?If you using Clover, just check the KernelPM option, it is not necessary to apply the patches recommended for Chameleon.


?


Some boot arguments that may be used with XCPM:



-xcpm
-xcpm_assert (configura o machdep.asserts para 1)
-xcpm_assert_trace (configura o? machdep.asserts_traced para 1)
-xcpm_ignore_fv (ignora os vetores de frequência)
-xcpm_ipi
idlehalt
cstates

Necessary settings for some UEFI Motherboards


?


To take better advantage of -xcpm usage, disable the EIST feature, Turbo and CST of your UEFI BIOS.


?


I will now list what hardware you have the native XCPM power management (if enabled):


?


MacBookAir, iMac, MacMini, MacBook Pro and MacPro


?


And some board-id's supported:



Mac-00BE6ED71E35EB86 – iMac13,1
Mac-031AEE4D24BFF0B1 – Macmini6,1
Mac-031B6874CF7F642A – iMac14,1 (Haswell/FrequencyVectors)
Mac-189A3D4F975D5FFC – MacBookPro11,1 (Haswell/FrequencyVectors)
Mac-27ADBB7B4CEE8E61 – iMac14,2 (Haswell/FrequencyVectors)
Mac-2E6FAB96566FE58C – MacBookAir5,2
Mac-35C1E88140C3E6CF – MacBookAir6,1 (Haswell/FrequencyVectors)
Mac-3CBD00234E554E41 – MacBookPro11,2 (Haswell/FrequencyVectors)
Mac-2BD1B31983FE1663 – MacBookPro11,3 (Haswell/FrequencyVectors)
Mac-4B7AC7E43945597E – MacBookPro9,1
Mac-66F35F19FE2A0D05 – MacBookAir5,1
Mac-6F01561E16C75D06 – MacBookPro9,2
Mac-77EB7D7DAF985301 – iMac14,3 (Haswell/FrequencyVectors)
Mac-7DF21CB3ED6977E5 – MacBookAir6,2 (Haswell/FrequencyVectors)
Mac-7DF2A3B5E5D671ED – Mac??? (2012 model)
Mac-AFD8A9D944EA4843 – MacBookPro10,2
Mac-C3EC7CD22292981F – MacBookPro10,1
Mac-F60DEB81FF30ACF6 – MacPro6,1
Mac-F65AE981FFA204ED – Macmini6,2
Mac-FC02E91DDD3FA6A4 – iMac13,2

This means that the -xcpm_ignore_fv argument is only supported in a few board-id's models. This argument disables all P-States (generated) in the SSDT. And in some cases the information may appear means "strange" when we run the AICPMInfo.kext



CPU P-States [ 8 34 35 (36) 37 ]
iGPU P-States [ 4 7 8 9 (10) 11 12 14 15 16 17 25 ]

But this means that a limited number of P-States is used. This does not say that the low C-States values are not being used. When we are more information, we will make this clearer for everyone.


?


And for check if XCPM are loaded, go in Console and search for XCPM.


?


You will see this result:



kernel[0] XCPM: registered
kernel[0] IOPPF: XCPM mode

Edited by Allan
Console.

Share this post


Link to post
Share on other sites

Problems with AppleLPC.kext - How to solve?

?

?

Download these apps:

?

DPCIManager

IORegistryExplorer

MaciASL

?

Double check before if the .kext really is loaded or not.

Open Terminal and type: kextstat

?

And search for AppleLPC.kext

?

rGc.png

?

?

?

If you are not charging, we can use two ways:

?

Patch in DSDT

?

First open the DPCIManager, and search for your device and vendor ID:

?

sGc.png

?

Now open MaciASL.app, and in patch section add this patch below, but with the values of your device and vendor ID:

?

qGc.png

?

After you put the proper patch for your Hack, click in "Apply", and save your DSDT.

?

Note: It is necessary insert your Dev and Ven ID in the following sections:

name,IOname,compatibility e device-id
Method (_DSM, 4, NotSerialized)? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? Store (Package (0x08)? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? "device-id",?? ? ? ? ? ? ? ? ? ? ? ? ? ? Buffer (0x04)? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x59, 0x1E, 0x00, 0x00? ? ? ? ? ? ? ? ? ? ? ? ? ? },?? ? ? ? ? ? ? ? ? ? ? ? ? ? "compatible",?? ? ? ? ? ? ? ? ? ? ? ? ? ? Buffer (0x0D)? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "pci8086,1e59"? ? ? ? ? ? ? ? ? ? ? ? ? ? },?? ? ? ? ? ? ? ? ? ? ? ? ? ? "IOName",?? ? ? ? ? ? ? ? ? ? ? ? ? ? Buffer (0x0D)? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "pci8086,1e59"? ? ? ? ? ? ? ? ? ? ? ? ? ? },?? ? ? ? ? ? ? ? ? ? ? ? ? ? "name",?? ? ? ? ? ? ? ? ? ? ? ? ? ? Buffer (0x0D)? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "pci8086,1e59"? ? ? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ? ? ? }, Local0)? ? ? ? ? ? ? ? ? ? DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))? ? ? ? ? ? ? ? ? ? Return (Local0)

Restart, and then open the IORegistryExplorer in the "Search" section type:?LPCB, and see if it was loaded.

tGc.png

?

Clover

?

Download the Clover Configurator, and set this in ACPI section - DSDT (old way) > Fixes.

xGc.png

?

You can see in this way in you config.plist:

<key>FakeLPC_0020</key><true/>

Restart and see if it was loaded.

?

?

Note: Use one or the other, never both at the same time.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.