Contribute
Register

[Guide] How to patch DSDT for working battery status

Went ahead and added the discrete graphics off to SSDT-7 and DSDT. See attached. Should battery life remain the same? Still shows 1:17m at full charge. Seems a bit unusual, or should that improve over time?

Your ioreg shows discrete graphics is not disabled.

Discrete graphics disabling is off-topic here. This topic is only for battery status.
 
Mm.. I wonder where I went wrong. I included the methods as described in the other thread. Perhaps I will move the conversation there. No sense in mixing up threads.

Out of curiosity where do you see Discrete graphics in IOReg?
 
Mm.. I wonder where I went wrong. I included the methods as described in the other thread. Perhaps I will move the conversation there. No sense in mixing up threads.

Hint: _OFF calls SGOF. SGOF has EC references. You have to move EC related code to be executed at _REG as _INI is too early. It is covered in the guide.

Out of curiosity where do you see Discrete graphics in IOReg?

PCI0->PEG0->PEGP, you find IONDRVFramebuffer. It means the device is still active on the PCI bus.
 
Hi there,

HWMonitor displays battery status ok but energy saver says current battery charge is 0% and doesn't permit displaying the battery status in menu bar (when checking "Show battery status in menu bar" nothing happens).


I've enabled the debug version - does anyone see anything wrong with these values:

6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::pollingTimeOut called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::pollBatteryState: path = 1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatterySTA called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
6/15/16 10:19:22.000 PM kernel[0]: ACPIDebug: "Battery 0 present"
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: acpibat_bif size = 13
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fPowerUnit = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity = 5405
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity = 2821
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fBatteryTech = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignVoltage = 11100
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fCapacityWarning = 540
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fLowWarning = 163
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fDeviceName = 'DELL 5G67C16'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fSerialNumber = '2899'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fType = 'LION'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fManufacturer = 'SMP'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatteryBST called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 1139
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 1680
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage = 11293
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 1244
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery: Battery is discharging.
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::constructAppleSerialNumber called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called



Thanks, Harry.
 
Hi there,

HWMonitor displays battery status ok but energy saver says current battery charge is 0% and doesn't permit displaying the battery status in menu bar (when checking "Show battery status in menu bar" nothing happens).


I've enabled the debug version - does anyone see anything wrong with these values:

6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::pollingTimeOut called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::pollBatteryState: path = 1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatterySTA called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatteryBIF called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatteryBIF: validateObject return 0x0
6/15/16 10:19:22.000 PM kernel[0]: ACPIDebug: "Battery 0 present"
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: acpibat_bif size = 13
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fPowerUnit = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignCapacity = 5405
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fMaxCapacity = 2821
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fBatteryTech = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fDesignVoltage = 11100
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fCapacityWarning = 540
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fLowWarning = 163
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fDeviceName = 'DELL 5G67C16'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fSerialNumber = '2899'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fType = 'LION'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBIF: fManufacturer = 'SMP'
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBatteryManager::getBatteryBST called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus = 0x1
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 1139
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 1680
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage = 11293
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 1244
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery: Battery is discharging.
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::constructAppleSerialNumber called
6/15/16 10:19:22.000 PM kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called



Thanks, Harry.

Read post #1, "Problem Reporting".
 
Hi @RehabMan. I did what you said in this guide, but battery status doesn't show up in preference and menu bar.
I just modified in my DSDT like this:
Code:
OperationRegion (ECF3, EmbeddedControl, Zero, 0xFF)
            Field (ECF3, ByteAcc, Lock, Preserve)
            {
                .......
                //BDCA,   16,
                CA00,   8,
                CA01,   8,
                Offset (0x92),
                //BPVO,   16,
                PV00,   8,
                PV01,   8,
                //PRRL,   16,
                RL00,   8,
                RL01,   8,
                Offset (0x98),
                //BRCA,   16,
                RC00,   8,
                RC01,   8,
                //BLFC,   16,
                FC00,   8,
                FC01,   8,
                Offset (0x9E),
                BSTA,   16,  // not used
                //BDVO,   16,
                DV00,   8,
                DV01,   8,
                Offset (0xA4),
                //BACU,   16,
                CU00,   8,
                CU01,   8,
                ......
            }

and add method B1B2:
Code:
Scope (_SB.PCI0.LPCB.TPM)
{
    Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }
}

Put DSDT.aml to /EFI/CLOVER/ACPI/patched/, reboot, AppleIntelCPU is not loaded:
Code:
$  kextstat|grep -y acpiplat
  13  2 0xffffff7f826f5000 0x60000  0x60000  com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
$  kextstat|grep -y appleintelcpu
$  kextstat|grep -y applelpc
  94  0 0xffffff7f8210a000 0x3000  0x3000  com.apple.driver.AppleLPC (3.1) 32BDCF9F-0473-32D4-9DAE-F523EFB2D244 <83 12 5 4 3>
$  sudo touch /System/Library/Extensions && sudo kextcache -u /
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Trackpad.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Mouse.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Keyboard.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext VoodooPS2Controller.kext

Did I miss something? And another question, after a long sleep, the screen can't wake up by moving mouse or pressing keyboard. I have to shutdown by long press the power button. Can patch in this post fix this problem?
 

Attachments

  • ioreg.zip
    489.2 KB · Views: 90
  • patchmatic.zip
    24.1 KB · Views: 84
  • CLOVER.zip
    2.7 MB · Views: 88
Hi @RehabMan. I did what you said in this guide, but battery status doesn't show up in preference and menu bar.
I just modified in my DSDT like this:
Code:
OperationRegion (ECF3, EmbeddedControl, Zero, 0xFF)
            Field (ECF3, ByteAcc, Lock, Preserve)
            {
                .......
                //BDCA,   16,
                CA00,   8,
                CA01,   8,
                Offset (0x92),
                //BPVO,   16,
                PV00,   8,
                PV01,   8,
                //PRRL,   16,
                RL00,   8,
                RL01,   8,
                Offset (0x98),
                //BRCA,   16,
                RC00,   8,
                RC01,   8,
                //BLFC,   16,
                FC00,   8,
                FC01,   8,
                Offset (0x9E),
                BSTA,   16,  // not used
                //BDVO,   16,
                DV00,   8,
                DV01,   8,
                Offset (0xA4),
                //BACU,   16,
                CU00,   8,
                CU01,   8,
                ......
            }
...
Did I miss something?

Your _STA method is returning "battery not present".

ACPI is not patched correctly.

See guide: http://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/

And another question, after a long sleep, the screen can't wake up by moving mouse or pressing keyboard. I have to shutdown by long press the power button. Can patch in this post fix this problem?

Off-topic. This thread is only for battery status.
 
Your _STA method is returning "battery not present".
Do you mean the _STA method of H_EC.BAT0? It checks if BATI is true then return whether the battery is present. Is it OK just modify it to 1?
Code:
Method (_STA, 0, NotSerialized)  // _STA: Status
{
  If (ECON)
  {
  If (BATI)
  {
  Return (0x1F)
  }
  Else
  {
  Return (0x0F)
  }
  }

  Return (0x0F)
}
Which means I just get or compile the dsl file wrongly?
 
Back
Top