Contribute
Register

<< Solved >> OpenCore battery patch

Joined
Mar 31, 2017
Messages
20
Motherboard
Lenovo, Chipset Intel Broadwell-U
CPU
Intel Core i5 5300U
Graphics
Intel HD Graphics 5500
It seems ACPIEC is not working.
I tried manually patched the DSDT,and got following error:
ACPI Error: Result stack is empty! State=ffffff902d6d0810 (20160930/dswstate-182)
ACPI Exception: AE_AML_NO_RETURN_VALUE, Missing or null operand (20160930/dsutils-775)
ACPI Exception: AE_AML_NO_RETURN_VALUE, While creating Arg 0 (20160930/dsutils-902) [ECRD] @00015 #0070:
Local1 = -Return Value- ()
Local0: ffffff902cfde640 <Obj> Integer 0000000000000000

Initialized Arguments for Method [ECRD]: (0 arguments defined for method invocation)
Arg0: ffffff902cfde2d0 [RefOf] <Node> Name LSTE Uninitialized

ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.H_EC.ECRD] (Node ffffff99c6abf3c0) , AE_AML_NO_RETURN_VALUE (20160930/psparse-632)
ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.H_EC.LID0._LID] (Node ffffff99c6abe690), AE_AML_NO_RETURN_VALUE

Looks like EC fields are not read at all.
Your DSDT loks to be similar to CHUWI COREBOOK PRO. The problem consists in the conflict between _REG method and _STA from BAT0, LID0 device and _PSR from ADP1. Apparently this methods are attempting to acces ECWR field before _REG method. Windows accepts this but OSX doesn't. I also was forced to modify _BIF and_BST methods because there where a lot of errors according with ACPI specifications. Battery informations will be correctly displayed, but the correct power source is not changing when the power adapter is pluged or unpluged, I couldn't find a way to solve the conflict between _PSR and _REG method.
I allready gave the solution at page 108. You can download the patched DSDT and it will work with CLOVER. Follow the instructions! If you want to use OPENCORE, you will need a dedicated SSDT.BATT.aml, wich has to follow my changes on BAT0 (_STA, _BIF, _BST methods). Good Luck!
 
Joined
Dec 27, 2021
Messages
2
Motherboard
Lenovo E130
CPU
i5-3317U/HM77
Graphics
HD 4000
hello everyone
i am study how to patch ssdt-batt, i make ec field to 8 bit finished
use opencore usb to boot my notebook and see acpi error region embeddedcontrol has no handler
_sta ^^pci0.lpcb.ec.mbts
acpi error method/execution failed \_sb.bat1._sta
i am try ssd-batt set _sta return (zero) or return (00x1F) but can not correct acpi error
i think some thing need to fix the code as follow, but i have no idea , any suggestion ?

in EC
Method (_REG, 2, NotSerialized) // _REG: Region Availability
{
VBRG ()
VBRS (BRNS)
If (LAnd (LEqual (Arg0, 0x03), LEqual (Arg1, One)))
{
Store (One, ECON) /* \ECON */
Store (0xFF, SXFG) /* \SXFG */
Store (Zero, LIDX) /* \LIDX */
Store (ACPW, ACST) /* \ACST */
Store (ACST, PWRS) /* \PWRS */
WGSV (Zero)
^HKEY.WGIN ()
}

Notify (BAT1, Zero) // Bus Check
PNOT ()
}

in SB.BAT1
Method (_STA, 0, NotSerialized) // _STA: Status
{
If (ECON)
{
If (LNotEqual (^^PCI0.LPCB.EC.MBTS, B0ST))
{
Store (One, BASC) /* \_SB_.BASC */
}

Store (^^PCI0.LPCB.EC.MBTS, B0ST) /* \_SB_.BAT1.B0ST */
}
ElseIf (And (RBEC (0x38), 0x80))
{
Store (One, B0ST) /* \_SB_.BAT1.B0ST */
}
Else
{
Store (Zero, B0ST) /* \_SB_.BAT1.B0ST */
}

If (B0ST)
{
Return (0x1F)
}
Else
{
Return (0x0F)
}
}
 
Joined
Jul 28, 2012
Messages
69
Motherboard
Lenovo Z70-80
CPU
i7 5500U
Graphics
HD 5500 - 1920x1080
Mac
  1. iMac
  2. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
Hello everyne in special to @BlvckBytes who create this post about opencore baterry patch. Well, this time I come to request help to create the SSDT-BAT patch for my Lenovo Z70-80 laptop, years ago I used macOS Mojave with the Clover bootloader and managed to make it work almost perfectly until 2020. After several years I decided to use macOS BigSur and for this I used the OpenCore bootloader and was able to do it by creating my EFI folder using the Dortania online guide. I am currently using macOS Monterey 12.3.1 and just like with BigSur I cannot get the sleep and wake function correctly, when I put the computer to sleep it does so without problem but when I press a key the computer restarts. When using macOS Mojave with Clover I didn't have that problem because I fixed my DSDT with RehabMan's patch for a laptop model similar to mine.

I am aware that with OpenCore this DSDT file is no longer used and that SSDT files are used instead for different problems that may exist in the operation of macOS. I am not a programmer but I understand certain code fragments very vaguely and over the years I have been able to solve some problems thanks to the great variety of online guides and the combination of them to create my own EFI folder.

Now with OpenCore I need someone to help me extract the necessary information from my DSDT that I used before in order to create the SSDT-BAT and use it with macOS Monterey and thus solve the problem I have with macOS.

I am attaching my DSDT (used in Clover), my ioreg file, and my current EFI folder.
 

Attachments

  • EFI.zip
    2.8 MB · Views: 24
  • Lubeats’s MacBook Pro.zip
    829.8 KB · Views: 18
  • DSDT.aml.zip
    21.3 KB · Views: 23
Joined
Feb 22, 2020
Messages
166
Motherboard
Dell Precision M4700
CPU
i7-3740QM
Graphics
M4000
You most likely could avoid creating a SSDT-Bat by using ECEnabler.kext + SMCBatteryManager.kext/AcpiBatteryManager.kext. ECEnabler allows bigger fields (> 8 bits in size) to be read.
 
Joined
Feb 22, 2020
Messages
166
Motherboard
Dell Precision M4700
CPU
i7-3740QM
Graphics
M4000
Oh, thats weird. Do you get any panic information on reboot?
 
Joined
Mar 8, 2017
Messages
763
Motherboard
Dell XPS 9700 4K (OpenCore)
CPU
i7-10875H
Graphics
UHD 630, 3840x2400
Mobile Phone
  1. Android
@BeatsMan286

Just to make sure... do you get a properly working battery indicator by making use of ECEnabler? Seems like we're maybe kind of mixing up two different problems here, which may have different root causes.
 
Joined
Jul 28, 2012
Messages
69
Motherboard
Lenovo Z70-80
CPU
i7 5500U
Graphics
HD 5500 - 1920x1080
Mac
  1. iMac
  2. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
@BlvckBytes Yes. I have battery indicator using ECEnabler + SMCBatteryManager.kext or AcpiBatteryManager.kext. I could notice when I use SMCBatteryManager.kext the internal info of battery is difference if I use AcpiBatteryManager.kext, for example I get 170 cycles/83 health of use and 74 cycles/83 health respectively .
 
Top