Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
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.
According to original dsdt,BAT0 _STA will return 0x0 when it fails to read EC region.I tried to hook it and return 0x1f always,still can't read battery percentage,same as before.
 
@tingyichen

How did you check that _STA actually returned 0xF? Did you ensure in IOReg? Just wanting to make sure.
 
hey im getting non hp battery eroor on boot maschine isnt booting without adpter
battery status is there but isnt correct battery isnt charging
THE SPECS:
- CPU : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
- iGPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] 1536MB
- dGPU : Nvdia GTX 1650Ti Disabled
- RAM : 2x 16GB DDR4 2667MHz
- Audio Codec : Realtek ALC 295
- Touchpad : Synaptics SMBus Touchpad
- Ethernet : Realtek Gaming GBe Lan RTL 8111
- Wifi/Bluetooth : Intel® Wireless-AC 9560 802.11b Wi-Fi® and Bluetooth®
- Display: 1x 1920x1080@60Hz
- Storage : 1x WD S550 Blue 500GB; 1x Toshiba 1 TB SATA HDD
- Bootloader : OpenCore r0.7.6
- macOS Version : macOS Big Sur Version 11.6.2 (Build 20G314)

Like



Comment
 

Attachments

  • Send me Ankurs-MBP.zip
    26.9 MB · Views: 52
I think it can happen if AppleACPIEC hasn't attached yet? Possibly? I'm not quite sure tbh.
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.
 
Hey! I been in army so i havent had that much time to work on this, etc etc.. but here is an update in my case! I have two disks in my laptop so i managed to format one of them to be the bootloader/efi and it works. Now i just need to partition it so i can use rest of the drive cause i think 500gb is littlebit too much just for efi partition xD
 
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!
 
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)
}
}
 
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: 67
  • Lubeats’s MacBook Pro.zip
    829.8 KB · Views: 44
  • DSDT.aml.zip
    21.3 KB · Views: 58
Status
Not open for further replies.
Back
Top