Contribute
Register

[Guide] How to patch DSDT for working battery status

Feartech

Moderator
Joined
Aug 3, 2013
Messages
22,078
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
@Feartech Sorry for the trouble, I'm using OpenCore and booting from USB. What information I should extract from USB EFI for you ?
ahh, ok, then that debug script doesn't work for OC

you will have to zip and upload your OC folder
 
Joined
May 20, 2020
Messages
22
Motherboard
HP DSC i5-4210U Laptop motherboard
CPU
Inte Core i5 4210U
Graphics
Nvidia GeForce820M
Mobile Phone
  1. iOS
This is my OC folder. Thank you for your interest . @Feartech
 

Attachments

  • OC.zip
    2 MB · Views: 35

Feartech

Moderator
Joined
Aug 3, 2013
Messages
22,078
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
This is my OC folder. Thank you for your interest . @Feartech
you may want to check over:
 
Joined
May 20, 2020
Messages
22
Motherboard
HP DSC i5-4210U Laptop motherboard
CPU
Inte Core i5 4210U
Graphics
Nvidia GeForce820M
Mobile Phone
  1. iOS
@Feartech Thanks for the quick reply. I will go through it and let you know my result. Thank you once again.
 
Joined
May 20, 2020
Messages
22
Motherboard
HP DSC i5-4210U Laptop motherboard
CPU
Inte Core i5 4210U
Graphics
Nvidia GeForce820M
Mobile Phone
  1. iOS
@Feartech I've followed the guide you suggested and created a SSDT-BATT. But my battery still stuck at 1% and status is not getting updated. I'm attaching my updated PR zip. It would be great if you can have a look at it and share your thoughts on it. Thank you.
 

Attachments

  • debug_27768.zip
    2.7 MB · Views: 84

Feartech

Moderator
Joined
Aug 3, 2013
Messages
22,078
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
@Feartech I've followed the guide you suggested and created a SSDT-BATT. But my battery still stuck at 1% and status is not getting updated. I'm attaching my updated PR zip. It would be great if you can have a look at it and share your thoughts on it. Thank you.
thinking that you are getting some excellent advice on the other thread :)
 
Joined
May 20, 2020
Messages
22
Motherboard
HP DSC i5-4210U Laptop motherboard
CPU
Inte Core i5 4210U
Graphics
Nvidia GeForce820M
Mobile Phone
  1. iOS
thinking that you are getting some excellent advice on the other thread :)

Yes, indeed. We are trying various methods to fix the issue. Still my battery hesitates to open up. It's under serious trauma that I installed MacOS in my machine, and it had to leave its beloved companions Windows and Linux. I need to counsel more :)
 
Joined
May 13, 2020
Messages
5
Motherboard
Dell Latitude 3480
CPU
i3-6006U
Graphics
520
Mobile Phone
  1. Android
hi, guys! i've try some patches for my latitude 3480, but none work(( maybe, somebody of you knows, wihtch patch is exactly can be applied on my laptop? thank you! aaand i use catalina
 
Last edited:
Joined
May 4, 2020
Messages
35
Motherboard
HP 8537
CPU
i5-8265U
Graphics
UHD 620
I made a patch for my HP ProBook 430 G6. Seems to be working normally, haven't tested extensively yet though. Here it is in case anyone is interested:
Code:
into device label EC0 code_regex BDC,\s+16 replace_matched begin DC0,8,DC1,8 end;
into device label EC0 code_regex BFC,\s+16 replace_matched begin FC0,8,FC1,8 end;
into device label EC0 code_regex BRTE,\s+16 replace_matched begin RTE0,8,RTE1,8 end;
into device label EC0 code_regex BME,\s+16 replace_matched begin ME0,8,ME1,8 end;
into device label EC0 code_regex BDV,\s+16 replace_matched begin DV0,8,DV1,8 end;
into device label EC0 code_regex BCV1,\s+16 replace_matched begin CV10,8,CV11,8 end;
into device label EC0 code_regex BATE,\s+16 replace_matched begin ATE0,8,ATE1,8 end;
into device label EC0 code_regex BPR,\s+16 replace_matched begin BPR0,8,BPR1,8 end;
into device label EC0 code_regex BCR,\s+16 replace_matched begin CR0,8,CR1,8 end;
into device label EC0 code_regex BRC,\s+16 replace_matched begin RC0,8,RC1,8 end;
into device label EC0 code_regex BCC,\s+16 replace_matched begin CC0,8,CC1,8 end;
into device label EC0 code_regex BPV,\s+16 replace_matched begin PV0,8,PV1,8 end;
into device label EC0 code_regex BCV2,\s+16 replace_matched begin CV20,8,CV21,8 end;
into device label EC0 code_regex BCV3,\s+16 replace_matched begin CV30,8,CV31,8 end;
into device label EC0 code_regex BCV4,\s+16 replace_matched begin CV40,8,CV41,8 end;
into device label EC0 code_regex BATF,\s+16 replace_matched begin ATF0,8,ATF1,8 end;
into device label EC0 code_regex BCL,\s+16 replace_matched begin BCL0,8,BCL1,8 end;
into device label EC0 code_regex MAXC,\s+16 replace_matched begin AXC0,8,AXC1,8 end;
into device label EC0 code_regex BSTS,\s+16 replace_matched begin BST0,8,BST1,8 end;
into device label EC0 code_regex BSN,\s+16 replace_matched begin SN0,8,SN1,8 end;
into device label EC0 code_regex BDAT,\s+16 replace_matched begin BDA0,8,BDA1,8 end;
into device label EC0 code_regex CCBQ,\s+16 replace_matched begin CBQ0,8,CBQ1,8 end;
into device label EC0 code_regex CBT,\s+16 replace_matched begin CBT0,8,CBT1,8 end;
into device label EC0 code_regex ACPR,\s+16 replace_matched begin CPR0,8,CPR1,8 end;

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label GACW code_regex \(ACPR, replaceall_matched begin (B1B2(CPR0,CPR1), end;
into method label GBAW code_regex \(BDV, replaceall_matched begin (B1B2(DV0,DV1), end;
into method label GBAW code_regex \(BDC, replaceall_matched begin (B1B2(DC0,DC1), end;
into method label BTIF code_regex \(BFC, replaceall_matched begin (B1B2(FC0,FC1), end;
into method label BTIF code_regex \(BDV, replaceall_matched begin (B1B2(DV0,DV1), end;
into method label BTIF code_regex \(BSN, replaceall_matched begin (B1B2(SN0,SN1), end;
into method label BTIF code_regex \(BDAT, replaceall_matched begin (B1B2(BDA0,BDA1), end;
into method label BTST code_regex \(BPR, replaceall_matched begin (B1B2(BPR0,BPR1), end;
into method label BTST code_regex \(BRC, replaceall_matched begin (B1B2(RC0,RC1), end;
into method label BTST code_regex \(BPV, replaceall_matched begin (B1B2(PV0,PV1), end;
into method label ITLB code_regex \(BFC, replaceall_matched begin (B1B2(FC0,FC1), end;
into method label GBTI code_regex \(BDC, replaceall_matched begin (B1B2(DC0,DC1), end;
into method label GBTI code_regex \(BFC, replaceall_matched begin (B1B2(FC0,FC1), end;
into method label GBTI code_regex \(BRC, replaceall_matched begin (B1B2(RC0,RC1), end;
into method label GBTI code_regex \(BME, replaceall_matched begin (B1B2(ME0,ME1), end;
into method label GBTI code_regex \(BCC, replaceall_matched begin (B1B2(CC0,CC1), end;
into method label GBTI code_regex \(CBT, replaceall_matched begin (B1B2(CBT0,CBT1), end;
into method label GBTI code_regex \(BPV, replaceall_matched begin (B1B2(PV0,PV1), end;
into method label GBTI code_regex \(BPR, replaceall_matched begin (B1B2(BPR0,BPR1), end;
into method label GBTI code_regex \(BSTS, replaceall_matched begin (B1B2(BST0,BST1), end;
into method label GBTI code_regex \(BDV, replaceall_matched begin (B1B2(DV0,DV1), end;
into method label GBTI code_regex \(BCV1, replaceall_matched begin (B1B2(CV10,CV11), end;
into method label GBTI code_regex \(BCV2, replaceall_matched begin (B1B2(CV20,CV21), end;
into method label GBTI code_regex \(BCV3, replaceall_matched begin (B1B2(CV30,CV31), end;
into method label GBTI code_regex \(BCV4, replaceall_matched begin (B1B2(CV40,CV41), end;
into method label GBTI code_regex \(BSN, replaceall_matched begin (B1B2(SN0,SN1), end;
into method label GBTI code_regex \(BDAT, replaceall_matched begin (B1B2(BDA0,BDA1), end;
into method label GBTI code_regex BDAT replaceall_matched begin B1B2(BDA0,BDA1) end;
into method label GBTI code_regex \(BCR, replaceall_matched begin (B1B2(CR0,CR1), end;
into method label GBTI code_regex \(BRTE, replaceall_matched begin (B1B2(RTE0,RTE1), end;
into method label GBTI code_regex \(BATE, replaceall_matched begin (B1B2(ATE0,ATE1), end;
into method label GBTI code_regex \(BATF, replaceall_matched begin (B1B2(ATF0,ATF1), end;
into method label GBTC code_regex \(MAXC, replaceall_matched begin (B1B2(AXC0,AXC1), end;
into method label SBTC code_regex MAXC\) replaceall_matched begin B1B2(AXC0,AXC1)) end;
into method label GCGC code_regex \(\\\_SB\.PCI0\.LPCB\.EC0\.BPR, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.BPR0,\\_SB.PCI0.LPCB.EC0.BPR1), end;

EDIT: patch currently has a bug where the "estimated time remaining" isn't calculated and you get somewhat frequent "low battery" warnings. Charge % seems to be accurate though and it's just mildlly annoying. I'll update this when I find a fix.
EDIT 2: the above issue was caused by having EC0 -> EC patch on Clover. Disabling it and using SSDT-EC seems to have fixed it.
EDIT 3: It wasn't actually fixed (though the warnings seem less frequent). I'll investigate further.

@anor4k, hi there!
have you managed to fix those "low battery warnings"? I've got the same warings on HP 440 G6 and they are quite annoying )))
 
Top