Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
@1Revenger1

Wow, so are you saying you've just eliminated all further needs of ACPI-Patching regarding EC-Regions with that small amount of code? Damn, that's an ingenious way of solving things! Happy to see such big changes for laptop-users.
Sort of - you still need to combine the data from two batteries if you have those.
I haven't really seen any other situation in which ACPI patching for the battery is needed though, yeah. Completely got rid of all my battery patching on my laptop.
 
@1Revenger1 This new kext of yours is revolutionary, but I find it's creating a glitch in my system compared to my Battery patches.

Code:
[ PCI configuration begin ]
kPEDisableScreen -1
ACPI Exception: AE_BAD_PARAMETER, ACPI Exception: AE_BAD_PARAMETER, Returned by Handler for [EmbeddedControl]Returned by Handler for [EmbeddedControl] (20160930/evregion-388)
 (20160930/evregion-388)
[ITLB] @00001 #002D:  [ITLB] @00001 #002D:  BBFFCC

No Local Variables are initialized for method [ITLB]
No Local Variables are initialized for method [ITLB]


No Arguments are initialized for method [ITLB]
No Arguments are initialized for method [ITLB]


ACPI Error: ACPI Error: Method parse/execution failed Method parse/execution failed [\134_SB.PCI0.LPCB.EC.ITLB] (Node ffffff80535f57e0)[\134_SB.PCI0.LPCB.EC.ITLB] (Node ffffff80535f57e0), AE_BAD_PARAMETER, AE_BAD_PARAMETER (20160930/psparse-632)
 (20160930/psparse-632)
ACPI Error: ACPI Error: Method parse/execution failed Method parse/execution failed [\134_SB.PCI0.LPCB.EC.ECRI] (Node ffffff80535f2570)[\134_SB.PCI0.LPCB.EC.ECRI] (Node ffffff80535f2570), AE_BAD_PARAMETER, AE_BAD_PARAMETER (20160930/psparse-632)
 (20160930/psparse-632)
ACPI Error: ACPI Error: Method parse/execution failed Method parse/execution failed [\134_SB.PCI0.LPCB.EC._REG] (Node ffffff80535f2540)[\134_SB.PCI0.LPCB.EC._REG] (Node ffffff80535f2540), AE_BAD_PARAMETER, AE_BAD_PARAMETER (20160930/psparse-632)
 (20160930/psparse-632)
ACPI: no ECDT
Lilu       rtc: @ rtc read failure 1 bytes from 180 E00002C2

Using manual battery patch:
Code:
[ PCI configuration begin ]
kPEDisableScreen -1
Lilu       rtc: @ rtc read failure 1 bytes from 180 E00002C2

Following the DSDT Rabbit...
Screen Shot 2021-05-11 at 5.18.09 PM.png

Screen Shot 2021-05-11 at 5.17.21 PM.png

So... _REG executes ECRI, then ECRI excutes ITLB and ITLB doesn't work with ECEnabler but that doesn't happen with the old patch.

That said, the Battery does show up and seems to be working.

Thoughts?
 
@1Revenger1 This new kext of yours is revolutionary, but I find it's creating a glitch in my system compared to my Battery patches.

Code:
[ PCI configuration begin ]
kPEDisableScreen -1
ACPI Exception: AE_BAD_PARAMETER, ACPI Exception: AE_BAD_PARAMETER, Returned by Handler for [EmbeddedControl]Returned by Handler for [EmbeddedControl] (20160930/evregion-388)
 (20160930/evregion-388)
[ITLB] @00001 #002D:  [ITLB] @00001 #002D:  BBFFCC

No Local Variables are initialized for method [ITLB]
No Local Variables are initialized for method [ITLB]


No Arguments are initialized for method [ITLB]
No Arguments are initialized for method [ITLB]


ACPI Error: ACPI Error: Method parse/execution failed Method parse/execution failed [\134_SB.PCI0.LPCB.EC.ITLB] (Node ffffff80535f57e0)[\134_SB.PCI0.LPCB.EC.ITLB] (Node ffffff80535f57e0), AE_BAD_PARAMETER, AE_BAD_PARAMETER (20160930/psparse-632)
 (20160930/psparse-632)
ACPI Error: ACPI Error: Method parse/execution failed Method parse/execution failed [\134_SB.PCI0.LPCB.EC.ECRI] (Node ffffff80535f2570)[\134_SB.PCI0.LPCB.EC.ECRI] (Node ffffff80535f2570), AE_BAD_PARAMETER, AE_BAD_PARAMETER (20160930/psparse-632)
 (20160930/psparse-632)
ACPI Error: ACPI Error: Method parse/execution failed Method parse/execution failed [\134_SB.PCI0.LPCB.EC._REG] (Node ffffff80535f2540)[\134_SB.PCI0.LPCB.EC._REG] (Node ffffff80535f2540), AE_BAD_PARAMETER, AE_BAD_PARAMETER (20160930/psparse-632)
 (20160930/psparse-632)
ACPI: no ECDT
Lilu       rtc: @ rtc read failure 1 bytes from 180 E00002C2

Using manual battery patch:
Code:
[ PCI configuration begin ]
kPEDisableScreen -1
Lilu       rtc: @ rtc read failure 1 bytes from 180 E00002C2

Following the DSDT Rabbit...
View attachment 518305
View attachment 518306
So... _REG executes ECRI, then ECRI excutes ITLB and ITLB doesn't work with ECEnabler but that doesn't happen with the old patch.

That said, the Battery does show up and seems to be working.

Thoughts?
Looks like it happens fairly early at boot, before Lilu and friends load up - so seems normal. The battery probably still appears because SMCBatteryManager manually checks _STA and stuff later. Am not exactly sure what the _REG method does or how it effects AppleACPIEC tbh. Seems to show availability of the region, that's about as far as I know.
 
Looks like it happens fairly early at boot, before Lilu and friends load up - so seems normal.
Yeah can't find any other errors in the log, so it must happen before lilu does the patch.
The battery probably still appears because SMCBatteryManager manually checks _STA and stuff later. Am not exactly sure what the _REG method does or how it effects AppleACPIEC tbh. Seems to show availability of the region, that's about as far as I know.
No idea TBH, there's another reference to ITLB in the HWAK method, but that's about it. Functionally your kext behaves the same as the old patch other than that early error.
 
After about a week of using ECEnabler, I can confirm it works and is a gamechanger, I still get early errors in the bootlog but battery status works and cycle count now properly displays the correct data.

(Edit - staying with my manual patches)
 
Last edited:
ECEnabler is partially working on my HP zbook 15u G4 (Kaby Lake). The battery status sits around 82% at all times and the drop down menus states that the battery isn't charging even though it is.

If anyone has any experience patching up DSDTs to get the battery status to work properly, I'd appreciate the help.
 

Attachments

  • DSDT.dsl
    956.9 KB · Views: 33
ECEnabler is partially working on my HP zbook 15u G4 (Kaby Lake). The battery status sits around 82% at all times and the drop down menus states that the battery isn't charging even though it is.

If anyone has any experience patching up DSDTs to get the battery status to work properly, I'd appreciate the help.
had a similar issue and was due to a faulty battery

same happened on windows linux, wouldn't charge over 87%

replaced battery, performed EC reset on laptop and now works fine
 
ECEnabler works much better and isn't a dumpster fire. Thanks!

@1Revenger1,

Have only just come across your ECEnabler kext today ....

Just tried it on my 15" 2017 HP Spectre X360 laptop (specs in sig) and it seems to work very well.
This kext replaces a whole bunch of ACPI renames and a somewhat cobbled together battery SSDT.

Booting macOS Big Sur 11.5.1 via OpenCore 0.7.1 + latest 3rd party kext's.

My only observation is that for me cycle count is not working but I was also unable to get it working with the old method so maybe it's a HP specific thing ?

As other have mentioned this is a game changer for laptop hacks and a fantastic addition to the community toolbox.

Great work buddy ...
Cheers
Jay
 
had a similar issue and was due to a faulty battery

same happened on windows linux, wouldn't charge over 87%

replaced battery, performed EC reset on laptop and now works fine
This is a new install. Apparently my bios was set to favor battery health over performance, so that 20% cut is normal.

In any case, I still prefer to use a SSDT patch if it were possible.
 

Attachments

  • DSDT.dsl
    956.9 KB · Views: 36
@ganthore

So you're saying that the kext does work as it should? Why would you like to use an SSDT then? I could help you, but it's like... wasted effort, I guess?
 
Status
Not open for further replies.
Back
Top