Jump to content
onemanosx

[Guide] Laptop Battery Indicator - The DSDT Patching Horror

Recommended Posts

HP Elitebook 8440P - Success



#16 bits registers

 

into device label EC0 code_regex CVLT,\s+16, replace_matched begin TLV0,8,TLV1,8, end;
into device label EC0 code_regex CCUR,\s+16, replace_matched begin RUC0,8,RUC1,8, end;
into device label EC0 code_regex BDC,\s+16, replace_matched begin CDB0,8,CDB1,8, end;
into device label EC0 code_regex BFC,\s+16, replace_matched begin CFB0,8,CFB1,8, end;
into device label EC0 code_regex BME,\s+16, replace_matched begin EMB0,8,EMB1,8, end;
into device label EC0 code_regex BDV,\s+16, replace_matched begin VDB0,8,VDB1,8, end;
into device label EC0 code_regex BCV1,\s+16, replace_matched begin V1B0,8,V1B1,8, end;
into device label EC0 code_regex BCV2,\s+16, replace_matched begin V2B0,8,V2B1,8, end;
into device label EC0 code_regex BCV3,\s+16, replace_matched begin V3B0,8,V3B1,8, end;
into device label EC0 code_regex BCV4,\s+16, replace_matched begin V4B0,8,V4B1,8, end;
into device label EC0 code_regex BPR,\s+16, replace_matched begin RPB0,8,RPB1,8, end;
into device label EC0 code_regex BCR,\s+16, replace_matched begin RCB0,8,RCB1,8, end;
into device label EC0 code_regex BRC,\s+16, replace_matched begin CRB0,8,CRB1,8, end;
into device label EC0 code_regex BCC,\s+16, replace_matched begin CCB0,8,CCB1,8, end;
into device label EC0 code_regex BPV,\s+16, replace_matched begin VPB0,8,VPB1,8, end;
into device label EC0 code_regex BCL,\s+16, replace_matched begin LCB0,8,LCB1,8, end;
into device label EC0 code_regex BSTS,\s+16, replace_matched begin STS0,8,STS1,8, end;
into device label EC0 code_regex BSN,\s+16, replace_matched begin NSB0,8,NSB1,8, end;
into device label EC0 code_regex BDAT,\s+16, replace_matched begin TAD0,8,TAD1,8, end;

 

#FIX 16 BITS REGISTERS (Manual Patch)

 


BDC - B1B2(\_SB.PCI0.LPCB.EC0.CDB0,\_SB.PCI0.LPCB.EC0.CDB1)
BFC - B1B2(\_SB.PCI0.LPCB.EC0.CFB0,\_SB.PCI0.LPCB.EC0.CFB1)
BME - B1B2(\_SB.PCI0.LPCB.EC0.EMB0,\_SB.PCI0.LPCB.EC0.EMB1)
BDV - B1B2(\_SB.PCI0.LPCB.EC0.VDB0,\_SB.PCI0.LPCB.EC0.VDB1)
BCV1 - B1B2(\_SB.PCI0.LPCB.EC0.V1B0,\_SB.PCI0.LPCB.EC0.V1B1)
BCV2 - B1B2(\_SB.PCI0.LPCB.EC0.V2B0,\_SB.PCI0.LPCB.EC0.V2B1)
BCV3 - B1B2(\_SB.PCI0.LPCB.EC0.V3B0,\_SB.PCI0.LPCB.EC0.V3B1)
BCV4 - B1B2(\_SB.PCI0.LPCB.EC0.V4B0,\_SB.PCI0.LPCB.EC0.V4B1)
BPR - B1B2(\_SB.PCI0.LPCB.EC0.RPB0,\_SB.PCI0.LPCB.EC0.RPB1)
BCR - B1B2(\_SB.PCI0.LPCB.EC0.RCB0,\_SB.PCI0.LPCB.EC0.RCB1)
BRC - B1B2(\_SB.PCI0.LPCB.EC0.CRB0,\_SB.PCI0.LPCB.EC0.CRB1)
BCC - B1B2(\_SB.PCI0.LPCB.EC0.CCB0,\_SB.PCI0.LPCB.EC0.CCB1)
BPV - B1B2(\_SB.PCI0.LPCB.EC0.VPB0,\_SB.PCI0.LPCB.EC0.VPB1)
BSN - B1B2(\_SB.PCI0.LPCB.EC0.NSB0,\_SB.PCI0.LPCB.EC0.NSB1)
BDAT - B1B2(\_SB.PCI0.LPCB.EC0.TAD0,\_SB.PCI0.LPCB.EC0.TAD1)

 

#32 BITS Registers

 

into device label EC0 code_regex S0PW,\s+32 replace_matched begin WP00,8,WP01,8,WP02,8,WP03,8 end;
into device label EC0 code_regex S0CT,\s+32 replace_matched begin TC00,8,TC01,8,TC02,8,TC03,8 end;
into device label EC0 code_regex SXPW,\s+32 replace_matched begin WPX0,8,WPX1,8,WPX2,8,WPX3,8 end;
into device label EC0 code_regex SXCT,\s+32 replace_matched begin TCX0,8,TCX1,8,TCX2,8,TCX3,8 end;
into device label EC0 code_regex M1CT,\s+32 replace_matched begin TC10,8,TC11,8,TC12,8,TC13,8 end;
into device label EC0 code_regex MOCT,\s+32 replace_matched begin TCM0,8,TCM1,8,TCM2,8,TCM3,8 end;
into device label EC0 code_regex BTY,\s+32 replace_matched begin YTB0,8,YTB1,8,YTB2,8,YTB3,8 end;

 

#FIX 32 BITS Registers

 

S0PW - B1B4(^^PCI0.LPCB.EC0.WP00,^^PCI0.LPCB.EC0.WP01,^^PCI0.LPCB.EC0.WP02,^^PCI0.LPCB.EC0.WP03)
S0CT - B1B4(^^PCI0.LPCB.EC0.TC00,^^PCI0.LPCB.EC0.TC01,^^PCI0.LPCB.EC0.TC02,^^PCI0.LPCB.EC0.TC03)
SXPW - B1B4(^^PCI0.LPCB.EC0.WPX0,^^PCI0.LPCB.EC0.WPX1,^^PCI0.LPCB.EC0.WPX2,^^PCI0.LPCB.EC0.WPX3)
SXCT - B1B4(^^PCI0.LPCB.EC0.TCX0,^^PCI0.LPCB.EC0.TCX1,^^PCI0.LPCB.EC0.TCX2,^^PCI0.LPCB.EC0.TCX3)
M1CT - B1B4(^^PCI0.LPCB.EC0.TC10,^^PCI0.LPCB.EC0.TC11,^^PCI0.LPCB.EC0.TC12,^^PCI0.LPCB.EC0.TC13)
MOCT - B1B4(^^PCI0.LPCB.EC0.TCM0,^^PCI0.LPCB.EC0.TCM1,^^PCI0.LPCB.EC0.TCM2,^^PCI0.LPCB.EC0.TCM3)
BTY - B1B4(^^PCI0.LPCB.EC0.YTB0,^^PCI0.LPCB.EC0.YTB1,^^PCI0.LPCB.EC0.YTB2,^^PCI0.LPCB.EC0.YTB3)

 

#Standard Patching Methods

 


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 B1B4 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B4, 4, NotSerialized)\n
{\n
   Store(Arg3, Local0)\n
   Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
   Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
   Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
   Return(Local0)\n
}\n
end;

#utility methods to read/write buffers from/to EC

into method label RE1B parent_label EC0 remove_entry;
into method label RECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (RE1B, 1, NotSerialized)\n
{\n
OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Add(Arg0, Arg1, Arg1)\n
Store(0, Local0)\n
While (LLess(Arg0, Arg1))\n
{
	Store(RE1B(Arg0), Index(TEMP, Local0))\n
	Increment(Arg0)\n
	Increment(Local0)\n
}\n
Return(TEMP)\n
}\n
end;

into device label EC0 insert
begin
Method (WE1B, 2, NotSerialized)\n
{\n
   OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
   Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
   Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
{\n
   ShiftRight(Arg1, 3, Arg1)\n
   Name(TEMP, Buffer(Arg1) { })\n
   Store(Arg2, TEMP)\n
   Add(Arg0, Arg1, Arg1)\n
   Store(0, Local0)\n
   While (LLess(Arg0, Arg1))\n
   {\n
       WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
       Increment(Arg0)\n
       Increment(Local0)\n
   }\n
}\n
end;

 

Added in 7 minutes 7 seconds:

Lenovo Ideapad 310 - Success


#16-bit registers

 

into device label EC0 code_regex BFUD,\s+16, replace_matched begin DUF0,8,DUF1,8, end;
into device label EC0 code_regex B1RC,\s+16, replace_matched begin CR10,8,CR11,8, end;
into device label EC0 code_regex B1SN,\s+16, replace_matched begin NS10,8,NS11,8, end;
into device label EC0 code_regex B1FV,\s+16, replace_matched begin VF10,8,VF11,8, end;
into device label EC0 code_regex B1DV,\s+16, replace_matched begin VD10,8,VD11,8, end;
into device label EC0 code_regex B1DC,\s+16, replace_matched begin CD10,8,CD11,8, end;
into device label EC0 code_regex B1FC,\s+16, replace_matched begin CF10,8,CF11,8, end;
into device label EC0 code_regex B1CR,\s+16, replace_matched begin RC10,8,RC11,8, end;
into device label EC0 code_regex B1AC,\s+16, replace_matched begin CA10,8,CA11,8, end;
into device label EC0 code_regex B1CC,\s+16, replace_matched begin CC10,8,CC11,8, end;
into device label EC0 code_regex B1SM,\s+16, replace_matched begin MS10,8,MS11,8, end;
into device label EC0 code_regex B1C1,\s+16, replace_matched begin AC10,8,AC11,8, end;
into device label EC0 code_regex B1C2,\s+16, replace_matched begin BC10,8,BC11,8, end;
into device label EC0 code_regex B1C3,\s+16, replace_matched begin CC10,8,CC11,8, end;
into device label EC0 code_regex B1C4,\s+16, replace_matched begin DC10,8,DC11,8, end;
into device label EC0 code_regex B1DA,\s+16, replace_matched begin AD10,8,AD11,8, end;

 

#FIX 16 BIT REGISTERS - Manual Patching

 

BFUD - B1B2(\_SB.PCI0.LPCB.EC0.DUF0,\_SB.PCI0.LPCB.EC0.DUF1)
B1RC - B1B2(\_SB.PCI0.LPCB.EC0.CR10,\_SB.PCI0.LPCB.EC0.CR11)
B1SN - B1B2(\_SB.PCI0.LPCB.EC0.NS10,\_SB.PCI0.LPCB.EC0.NS11)
B1FV - B1B2(\_SB.PCI0.LPCB.EC0.VF10,\_SB.PCI0.LPCB.EC0.VF11)
B1DV - B1B2(\_SB.PCI0.LPCB.EC0.VD10,\_SB.PCI0.LPCB.EC0.VD11)
B1DC - B1B2(\_SB.PCI0.LPCB.EC0.CD10,\_SB.PCI0.LPCB.EC0.CD11)
B1FC - B1B2(\_SB.PCI0.LPCB.EC0.CF10,\_SB.PCI0.LPCB.EC0.CF11)
B1CR - B1B2(\_SB.PCI0.LPCB.EC0.RC10,\_SB.PCI0.LPCB.EC0.RC11)
B1AC - B1B2(\_SB.PCI0.LPCB.EC0.CA10,\_SB.PCI0.LPCB.EC0.CA11)
B1CC - B1B2(\_SB.PCI0.LPCB.EC0.CC10,\_SB.PCI0.LPCB.EC0.CC11)
B1SM - B1B2(\_SB.PCI0.LPCB.EC0.MS10,\_SB.PCI0.LPCB.EC0.MS11)
B1C1 - B1B2(\_SB.PCI0.LPCB.EC0.AC10,\_SB.PCI0.LPCB.EC0.AC11)
B1C2 - B1B2(\_SB.PCI0.LPCB.EC0.BC10,\_SB.PCI0.LPCB.EC0.BC11)
B1C3 - B1B2(\_SB.PCI0.LPCB.EC0.CC10,\_SB.PCI0.LPCB.EC0.CC11)
B1C4 - B1B2(\_SB.PCI0.LPCB.EC0.DC10,\_SB.PCI0.LPCB.EC0.DC11)
B1DA - B1B2(\_SB.PCI0.LPCB.EC0.AD10,\_SB.PCI0.LPCB.EC0.AD11)

 

#LARGER THAN 32 BIT REGISTERS

 

into device label EC0 code_regex (FWBT,)\s+(64) replace_matched begin FWBX,%2,//%1%2 end;
into device label EC0 code_regex (SMDA,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end;
into device label EC0 code_regex (BMN0,)\s+(72) replace_matched begin BMNX,%2,//%1%2 end;
into device label EC0 code_regex (BDN0,)\s+(64) replace_matched begin BDNX,%2,//%1%2 end;

 

#FIX LARGER THAN 32 BIT REGISTERS - Manual Patching

 

FWBT -  \_SB.PCI0.LPCB.EC0.RECB(0X14,64)
SMDA -  \_SB.PCI0.LPCB.EC0.RECB(0X64,256)
BMN0 -  \_SB.PCI0.LPCB.EC0.RECB(0X8F,72)
BDN0 -  \_SB.PCI0.LPCB.EC0.RECB(0X98,64)

 

#Standard Patching Methods

 

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

#Standard utility methods to read/write buffers from/to EC

into device label EC0 insert
begin
Method (RE1B, 1, NotSerialized)\n
{\n
OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Add(Arg0, Arg1, Arg1)\n
Store(0, Local0)\n
While (LLess(Arg0, Arg1))\n
{
	Store(RE1B(Arg0), Index(TEMP, Local0))\n
	Increment(Arg0)\n
	Increment(Local0)\n
}\n
Return(TEMP)\n
}\n
end;

into device label EC0 insert
begin
Method (WE1B, 2, NotSerialized)\n
{\n
   OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
   Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
   Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
{\n
   ShiftRight(Arg1, 3, Arg1)\n
   Name(TEMP, Buffer(Arg1) { })\n
   Store(Arg2, TEMP)\n
   Add(Arg0, Arg1, Arg1)\n
   Store(0, Local0)\n
   While (LLess(Arg0, Arg1))\n
   {\n
       WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
       Increment(Arg0)\n
       Increment(Local0)\n
   }\n
}\n
end;

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

  • Administrators

[ref]onemanosx[/ref], :guitar:guitar:guitar

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

Sorry for the question, but where do I get my AML when my notebook is not on the list? When I use just some generic file, will it work?

if your notebook is not in the list, you will then need to do your own custom patch

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

Okay, so I can get my DSDT.aml from RunMe app, right? I tried to patch it accorging to guide, but do not have battery status yet. What could be wrong?

No idea. For a start you can upload a full dump using run.me app and try to explain in steps what you did.

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

This is my older dump, I think it is the same as the latest. I just followed the instructions and had no compile errors.

no compile errors doesnt mean patch is done correctly. I cant help if you wont share what exactly you did. Maybe you can share your 16 bit integers and how you solved them.

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

This is my older dump, I think it is the same as the latest. I just followed the instructions and had no compile errors.



You did not have patched DSDT in clover/acpi/patched folder. Neither do you have any battery kext in your clover/kexts other folder.

Cant expect things to work without these 2 items.

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

[ref]Wizzard[/ref], place DSDT in clover/acpi/patched folder. Reboot and generate new send_me.


https://drive.google.com/file/d/185MFYOYsGKyrBpJmq4GENm4fkdWqL9ur/view?fbclid=IwAR1npQJEpyjMIALNelyy5rKPnSIxZRPNe1scLq-dqN2qNezMuRmmZ5XfV5A

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

onemanosx, where is generally lenovo about this battery and also the lenovo G570 works...

see rehabman repo or patch your own

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

[ref]Wizzard[/ref], try rebuild cache and permissions. Battery is detected well as per shown in ioreg though.


https://imgur.com/75NQgSa

https://imgur.com/82O5LYy

Donate

Gitter Chat


Acer Aspire V15 Nitro- Black Edition VN7-592G/HM170 Chipset

Intel i7-6700HQ, 8GB RAM (UEFI Clover Catalina)


MSI B360 Gaming Arctic

Intel i5-8600 16GB RAM Asus Radeon RX580 8GB (UEFI Clover Catalina)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.





×
  • Create New...