Contribute
Register

Need help regarding DSDT Patch for battery - Lenovo Yoga 700

Status
Not open for further replies.
Joined
Feb 20, 2015
Messages
269
Motherboard
Asus P6T SE
CPU
2.81 GHz Intel Core i7
Graphics
Nvidia GTX 650 ti 1024 MB
Mac
  1. iMac
  2. MacBook Pro
Mobile Phone
  1. iOS
Hello,

I have recently installed OS X El Capitan on my Lenovo Yoga 700, HD520 & i5 6200u. I am in the process of getting the battery percentage to work using Rehabman's guide: https://www.tonymacx86.com/threads/guide-how-to-patch-dsdt-for-working-battery-status.116102/. All 16 bit conversions went fine, but everything >32 bits (the buffers) confuse me even though I have read (and tried to understand) it multiple times.

Side note: I disassembled my DSDT using iasl from terminal.
Code:
cd "to directory where you placed all SSDT/DSDT"
iasl -da -dl *.aml

What I have done so far:

Created a list with fields that have to be changed (12 items)
FWBT, 64,
BFUD, 16,
SMDA, 256,
BMN0, 72,
BDN0, 64,
B1RC, 16,
B1SN, 16,
B1FV, 16,
B1DV, 16,
B1DC, 16,
B1FC, 16,
B1AC, 16,

Renamed all the 16-bit fields to something that does not conflict with the current DSDT
Was: BFUD, 16

FUD0, 8,

FUD1, 8,



Was: B1RC 16

BRC0, 8,

BRC1, 8,



Was: B1SN, 16

BSN0, 8,

BSN1, 8,



Was: B1FV, 16,

BFV0, 8,

BFV1, 8,



Was: B1DV, 16,

BDV0, 8,

BDV1, 8,



Was: B1DC, 16,

BDC0, 8,

BDC1, 8,



Was: B1FC, 16,

BFX0, 8,

BFX1, 8,



Was: B1AC, 16,

BAX0, 8,

BAX1, 8,

Made appropriate patches for the 16-bit fields
into device label H_EC code_regex BFUD,\s+16, replace_matched begin FUD0,8,FUD1,8, end;

into device label H_EC code_regex B1RC,\s+16, replace_matched begin BRC0,8,BRC1,8, end;

into device label H_EC code_regex B1SN,\s+16, replace_matched begin BSN0,8,BSN1,8, end;

into device label H_EC code_regex B1FV,\s+16, replace_matched begin BFV0,8,BFV1,8, end;

into device label H_EC code_regex B1DV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;

into device label H_EC code_regex B1DC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;

into device label H_EC code_regex B1FC,\s+16, replace_matched begin BFX0,8,BFX1,8, end;

into device label H_EC code_regex B1AC,\s+16, replace_matched begin BAX0,8,BAX1,8, end;

Fixed the methods for the 16-bit fields
into method label GBTI code_regex \(BFUD, replaceall_matched begin (B1B2(FUD0,FUD1), end;

into method label GBTI code_regex \(B1RC, replaceall_matched begin (B1B2(BRC0,BRC1), end;

into method label GBTI code_regex \(B1SN, replaceall_matched begin (B1B2(BSN0,BSN1), end;

into method label GBTI code_regex \(B1FV, replaceall_matched begin (B1B2(BFV0,BFV1), end;

into method label GBTI code_regex \(B1DV, replaceall_matched begin (B1B2(BDV0,BDV1), end;

into method label GBTI code_regex \(B1DC, replaceall_matched begin (B1B2(BDC0,BDC1), end;

into method label GBTI code_regex \(B1FC, replaceall_matched begin (B1B2(BFX0,BFX1), end;

into method label GBTI code_regex \(B1AC, replaceall_matched begin (B1B2(BAX0,BAX1), end;


Up until this point of the guide I get to understand everything. From here it starts to get too complicated for me, therefore I am asking for some help. Next part on post #2.
 
Hello,

I have recently installed OS X El Capitan on my Lenovo Yoga 700, HD520 & i5 6200u. I am in the process of getting the battery percentage to work using Rehabman's guide: https://www.tonymacx86.com/threads/guide-how-to-patch-dsdt-for-working-battery-status.116102/. All 16 bit conversions went fine, but everything >32 bits (the buffers) confuse me even though I have read (and tried to understand) it multiple times.

Side note: I disassembled my DSDT using iasl from terminal.
Code:
cd "to directory where you placed all SSDT/DSDT"
iasl -da -dl *.aml

What I have done so far:

Created a list with fields that have to be changed (12 items)
FWBT, 64,
BFUD, 16,
SMDA, 256,
BMN0, 72,
BDN0, 64,
B1RC, 16,
B1SN, 16,
B1FV, 16,
B1DV, 16,
B1DC, 16,
B1FC, 16,
B1AC, 16,

Renamed all the 16-bit fields to something that does not conflict with the current DSDT
Was: BFUD, 16

FUD0, 8,

FUD1, 8,



Was: B1RC 16

BRC0, 8,

BRC1, 8,



Was: B1SN, 16

BSN0, 8,

BSN1, 8,



Was: B1FV, 16,

BFV0, 8,

BFV1, 8,



Was: B1DV, 16,

BDV0, 8,

BDV1, 8,



Was: B1DC, 16,

BDC0, 8,

BDC1, 8,



Was: B1FC, 16,

BFX0, 8,

BFX1, 8,



Was: B1AC, 16,

BAX0, 8,

BAX1, 8,

Made appropriate patches for the 16-bit fields
into device label H_EC code_regex BFUD,\s+16, replace_matched begin FUD0,8,FUD1,8, end;

into device label H_EC code_regex B1RC,\s+16, replace_matched begin BRC0,8,BRC1,8, end;

into device label H_EC code_regex B1SN,\s+16, replace_matched begin BSN0,8,BSN1,8, end;

into device label H_EC code_regex B1FV,\s+16, replace_matched begin BFV0,8,BFV1,8, end;

into device label H_EC code_regex B1DV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;

into device label H_EC code_regex B1DC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;

into device label H_EC code_regex B1FC,\s+16, replace_matched begin BFX0,8,BFX1,8, end;

into device label H_EC code_regex B1AC,\s+16, replace_matched begin BAX0,8,BAX1,8, end;

Fixed the methods for the 16-bit fields
into method label GBTI code_regex \(BFUD, replaceall_matched begin (B1B2(FUD0,FUD1), end;

into method label GBTI code_regex \(B1RC, replaceall_matched begin (B1B2(BRC0,BRC1), end;

into method label GBTI code_regex \(B1SN, replaceall_matched begin (B1B2(BSN0,BSN1), end;

into method label GBTI code_regex \(B1FV, replaceall_matched begin (B1B2(BFV0,BFV1), end;

into method label GBTI code_regex \(B1DV, replaceall_matched begin (B1B2(BDV0,BDV1), end;

into method label GBTI code_regex \(B1DC, replaceall_matched begin (B1B2(BDC0,BDC1), end;

into method label GBTI code_regex \(B1FC, replaceall_matched begin (B1B2(BFX0,BFX1), end;

into method label GBTI code_regex \(B1AC, replaceall_matched begin (B1B2(BAX0,BAX1), end;


Up until this point of the guide I get to understand everything. From here it starts to get too complicated for me, therefore I am asking for some help. Next part on post #2.

Read guide: https://www.tonymacx86.com/threads/guide-how-to-patch-dsdt-for-working-battery-status.116102/

Chances are there is already a patch for your DSDT in the repo.
 
I renamed the 32-bit+ fields (4 items) to something that does not conflict with the DSDT

into device label H_EC code_regex (FWBT,)\s+(64) replace_matched begin FWBX,%2,//%1%2 end;



into device label H_EC code_regex (SMDA,)\s+(256) replace_matched begin SMDY,%2,//%1%2 end;



into device label H_EC code_regex (BMN0,)\s+(72) replace_matched begin BMNX,%2,//%1%2 end;



into device label H_EC code_regex (BDN0,)\s+(64) replace_matched begin BDNX,%2,//%1%2 end;



I determined the offsets of the 32-bit+ fields

OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF)

Field (ERAM, ByteAcc, Lock, Preserve)

{

Offset (0x12),

FUSL, 8,

FUSH, 8,

FWBT, 64, !!

Offset (0x5D),

EXSI, 8,

EXSB, 8,

EXND, 8,

SMPR, 8,

SMST, 8,

SMAD, 8,

SMCM, 8,

SMDA, 256, !!

Offset (0x8F),

BMN0, 72, !!

BDN0, 64, !!

IBTL, 1,

IBCL, 1,

ISS0, 1,

IRTC, 1,

ISUP, 1,

ISC2, 1,

IWAK, 1,



However, after this I just don’t understand what to do. Can anyone point me in the right direction?
 
Excuse me, I prepared but forgot to add my DSDT to this thread. See attachments.

I understand I have to extract my own - I meant that I did not see a DSDT patch for my Lenovo Yoga 700.
 

Attachments

  • DSDT.dsl
    605 KB · Views: 220
Excuse me, I prepared but forgot to add my DSDT to this thread. See attachments.

I understand I have to extract my own - I meant that I did not see a DSDT patch for my Lenovo Yoga 700.

The patch for "Lenovo Ideapad 100" is pretty close, but some offsets are different (BMN0, BDN0).
 
The patch for "Lenovo Ideapad 100" is pretty close, but some offsets are different (BMN0, BDN0).

Thank you, I will take a look. It's just that I do now know how to implement those buffer patches.

Output:
Code:
Last login: Fri Sep 30 09:10:32 on ttys000

Thijmens-MacBook-Air:~ thijmen$ kextstat|grep -y acpiplat

   13    2 0xffffff7f821b4000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>

Thijmens-MacBook-Air:~ thijmen$ kextstat|grep -y appleintelcpu

Thijmens-MacBook-Air:~ thijmen$ kextstat|grep -y applelpc
 

Attachments

  • CLOVER.zip
    1.7 MB · Views: 135
  • Thijmen’s MacBook Air.zip
    415.5 KB · Views: 146
  • RehabMan.zip
    39.3 KB · Views: 120
Thank you, I will take a look. It's just that I do now know how to implement those buffer patches.

The patches are already in the Ideapad 100 file. You just need to adjust the offsets.

If you look at the comments regarding the offsets in the patch file and compare to your own DSDT, the changes required are obvious. Make the effort.
 
The patches are already in the Ideapad 100 file. You just need to adjust the offsets.

If you look at the comments regarding the offsets in the patch file and compare to your own DSDT, the changes required are obvious. Make the effort.

I understand what I have to change though I do not completely understand how to do it. E.g. in your example dsdt you ask us to come up with the same numbers:

Code:
   Field (ECF2, ByteAcc, Lock, Preserve)
   {
            Offset (0x10),
       BDN0,   56,     //!!0x10
            Offset (0x18),
       BME0,   8,
            Offset (0x20),
       BMN0,   32,     //0x20
       BMN2,   8,     //0x24
       BMN4,   88,    //0x25
       BCT0,   128,     //!! 0x30
       BDN1,   56,     //!! 0x40
            Offset (0x48),
       BME1,   8,
            Offset (0x50),
       BMN1,   32,     //0x50
       BMN3,   8,     //0x54
       BMN5,   88,     //0x55
       BCT1,   128,     //!!0x60

I really try my best but I don't understand how you come up with the numbers behind the slashes.

Edit: https://www.tonymacx86.com/threads/...dt-for-working-battery-status.116102/page-262

So in my case, this:
Code:
#                Offset (0x90),
#                BMN0,   72, //!!0x90
#                BDN0,   56, //!!0x99

Has to be changed to
Code:
#                Offset (0x8F),
#                BMN0,   72, //!!0x8F
#                BDN0,   56, //!!0x98

Is this correct?

Edit2: Attached the patch I currently have for my Lenovo Yoga 700.
 

Attachments

  • Patch for Lenovo Yoga 700.zip
    2.4 KB · Views: 142
Last edited:
Status
Not open for further replies.
Back
Top