Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
@BlvckBytes
Tried this EFI,same as before,battery showing 1% percentage and have _STA acpi error in log
 
@tingyichen

I'm not yet sure why your system tripped up on _STA, since it only uses an 8 bit sized field inside the if-statement. I now patched _BST and _BIF by creating a custom SSDT-BATT, please give this a try. If it still trips up, re-attach the *current* output of Hackintool from boot, since at least EC should have changed to H_EC inside the error log. I just want to see things change and apply.
 

Attachments

  • EFI.zip
    32.1 MB · Views: 64
@BlvckBytes Just tried,_STA errors still present,and _BIF and _BST generated AE_BAD_PARAMETER errors. with following errors :B1DC/B1FV/B1FC/XX15/B1ST/B1CR/B1RCB1VT Namespace lookup failure, AE_ALREADY_EXISTS
For that _STA error,I believe it is caused by insufficient code as per ACPI spec:
The OS runs _REG control methods to inform AML code of a change in the availability of an operation region. When an operation region handler is unavailable, AML cannot access data fields in that region. (Operation region writes will be ignored and reads will return indeterminate data.
The _STA tried to access ECWR before _REG method in EC,but I don't know why it still fails to read battery stats after boot up.
 
@tingyichen

I'm sorry, I totally messed up on the region patch using duplicate names, please try again. Now, those AE_ALREADY_EXISTS errors should be gone. If you still experience the _STA issues, it would be interesting to know if they only appear on boot, since the region handler should now be available.
 

Attachments

  • EFI.zip
    32.1 MB · Views: 64
@BlvckBytes
Still not working,I got these errors:
kernel[0]: (AppleSmartBatteryManager) <AppleSmartBatteryManager`AppleSmartBattery::_smcKeyInfo(unsigned int, int*, bool*) const> Failed to read keyInfo . rc:0x84
kernel[0]: (AppleSmartBatteryManager) <AppleSmartBatteryManager`AppleSmartBattery::smcKeysToDictionary(smcToRegistry*) const> SMC Key is not supported.
I think ec memory regions are broken and system can't read correct info from it..
 
@tingyichen

Is there a way you could provide more lines of the log, as that is just too little info to make sense of anything?

// Edit: Found another typo, updated attached files
 

Attachments

  • EFI.zip
    32.1 MB · Views: 75
Last edited:

Attachments

  • boot1.txt
    932 KB · Views: 58
@tingyichen

I'm not yet sure why your system tripped up on _STA, since it only uses an 8 bit sized field inside the if-statement. I now patched _BST and _BIF by creating a custom SSDT-BATT, please give this a try. If it still trips up, re-attach the *current* output of Hackintool from boot, since at least EC should have changed to H_EC inside the error log. I just want to see things change and apply.
I think it can happen if AppleACPIEC hasn't attached yet? Possibly? I'm not quite sure tbh.
 
I think it can happen if AppleACPIEC hasn't attached yet? Possibly? I'm not quite sure tbh.
ioreg shows ACPIEC already attached to H_EC device..
 
Last edited:
ioreg shows ACPIEC already attached to H_EC device..
This would be during early boot, when _STA is being initially read. I don't think SMCBatteryManager/ACPIBatteryManager care though since they both check the ACPI Plane in IORegistry instead of the IOService plane, which should show devices even if _STA errors out. They will check _STA themselves later during the boot process, when AppleACPIEC should've attached.
 
Status
Not open for further replies.
Back
Top