Contribute
Register

Battery status on Lenovo t431s

Status
Not open for further replies.
Joined
Oct 29, 2013
Messages
12
Mac
  1. 0
Classic Mac
  1. 0
Mobile Phone
  1. 0
Dear all,
after a lot of playing, kernel panics and broken startup sequences I'm almost done configuring Mavericks on my Ivy Bridge Lenovo t431s. Audio, ps2 keyboard and trackpad, hd4000, bluetooth, wireless (got a usb adapter), screen brightness, speedstep.. everything seems to be working fine except one thing: battery status.
I was able to make it work using voodoo battery but then I would have problems making speedstep work under AppleACPIPlatform 1.3.x.
So I decided to take the more complex but apparently better route of keeping AppleACPIPlatform 2.0 and editing the DSDT, but after trying all the Lenovo patches in RehabMan's repository I can't find any that works.
I'm not sure I really understand how to convert all those DSDT registers to 8 bit manually so my question is.. has anybody generated a patch for the t431s? I would be so grateful if you could share on the forum!!
Thank you, Sergio
 
Dear all,
after a lot of playing, kernel panics and broken startup sequences I'm almost done configuring Mavericks on my Ivy Bridge Lenovo t431s. Audio, ps2 keyboard and trackpad, hd4000, bluetooth, wireless (got a usb adapter), screen brightness, speedstep.. everything seems to be working fine except one thing: battery status.
I was able to make it work using voodoo battery but then I would have problems making speedstep work under AppleACPIPlatform 1.3.x.
So I decided to take the more complex but apparently better route of keeping AppleACPIPlatform 2.0 and editing the DSDT, but after trying all the Lenovo patches in RehabMan's repository I can't find any that works.
I'm not sure I really understand how to convert all those DSDT registers to 8 bit manually so my question is.. has anybody generated a patch for the t431s? I would be so grateful if you could share on the forum!!
Thank you, Sergio

You might try following my instructions for creating a patch: http://www.tonymacx86.com/mavericks-laptop-support/116102-how-patch-dsdt-working-battery-status.html
 
I might try but it sounds quite complicated and I'm an advanced user but not a programmer.
For now I isolated these registers that need to be converted as part of "ECOR"..
HWAK, 16,
SBRC, 16,
SBFC, 16,
SBAC, 16,
SBVO, 16,
SBBM, 16,
SBDC, 16,
SBDV, 16,
SBSN, 16
SBCH, 32
SBMN, 128
SBDN, 128

Now I'm reading the rest of the documentation but I'm a bit lost for now to be honest..!
 
I might try but it sounds quite complicated and I'm an advanced user but not a programmer.
For now I isolated these registers that need to be converted as part of "ECOR"..
HWAK, 16,
SBRC, 16,
SBFC, 16,
SBAC, 16,
SBVO, 16,
SBBM, 16,
SBDC, 16,
SBDV, 16,
SBSN, 16
SBCH, 32
SBMN, 128
SBDN, 128

Now I'm reading the rest of the documentation but I'm a bit lost for now to be honest..!

Yours will be more complicated than some, but give it a try. Work through the example DSDT first, then move on to your own. Use some of the other Lenovo ones for ideas/code.
 
Ok, I started and I think I'm very close with the 16 and 32 bit registers; when you have a moment would you mind taking a quick look and my files and giving me a little hint for the compile errors?
I currently get these 3 errors even if I think the patch is correct..

14080, 4064, Object does not exist (\_SB.PCI0.LPC.EC.HWAK)
5837, 4064, Object does not exist (SBDV)
5839, 4064, Object does not exist (SBDV)View attachment untouchedDSDT.aml.zip

And this is the patch..

#16 bit registers
into device label EC code_regex HWAK,\s+16, replace_matched begin WAK0,8,WAK1,8, end;
into method label _L1D code_regex \(HWAK, replaceall_matched begin (B1B2(WAK0,WAK1), end;
into device label EC code_regex SBRC,\s+16, replace_matched begin BRC0,8,BRC1,8, end;
into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into device label EC code_regex SBFC,\s+16, replace_matched begin BFC0,8,BFC1,8, end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into device label EC code_regex SBAC,\s+16, replace_matched begin BAC0,8,BAC1,8, end;
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into device label EC code_regex SBVO,\s+16, replace_matched begin BVO0,8,BVO1,8, end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;
into device label EC code_regex SBBM,\s+16, replace_matched begin BBM0,8,BBM1,8, end;
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into device label EC code_regex SBDC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label SBDC code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into device label EC code_regex SBDV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;
into method label GBIF code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into device label EC code_regex SBSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;
#32 bit register
into device label EC code_regex SBCH,\s+32 replace_matched begin BCH0,8,BCH1,8,BCH2,8,BCH3,8 end;
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;


I still haven't started on the two 128 registers.. I read that art of your documentation many times but I don't think I understand really :(
 
Ok.. SORRY.. I figured out those 3 compile errors, I just had to play with the functions a bit.
If you don't mind could you just put me in the right direction with those 2 128 bit registers? I really get lost in that part of the documentation. Hope you can help and thanks in advance!
 
Ok, I started and I think I'm very close with the 16 and 32 bit registers; when you have a moment would you mind taking a quick look and my files and giving me a little hint for the compile errors?
I currently get these 3 errors even if I think the patch is correct..

14080, 4064, Object does not exist (\_SB.PCI0.LPC.EC.HWAK)
5837, 4064, Object does not exist (SBDV)
5839, 4064, Object does not exist (SBDV)View attachment 74096

And this is the patch..

#16 bit registers
into device label EC code_regex HWAK,\s+16, replace_matched begin WAK0,8,WAK1,8, end;
into method label _L1D code_regex \(HWAK, replaceall_matched begin (B1B2(WAK0,WAK1), end;
into device label EC code_regex SBRC,\s+16, replace_matched begin BRC0,8,BRC1,8, end;
into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into device label EC code_regex SBFC,\s+16, replace_matched begin BFC0,8,BFC1,8, end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into device label EC code_regex SBAC,\s+16, replace_matched begin BAC0,8,BAC1,8, end;
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into device label EC code_regex SBVO,\s+16, replace_matched begin BVO0,8,BVO1,8, end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;
into device label EC code_regex SBBM,\s+16, replace_matched begin BBM0,8,BBM1,8, end;
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into device label EC code_regex SBDC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label SBDC code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into device label EC code_regex SBDV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;
into method label GBIF code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
into device label EC code_regex SBSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;
#32 bit register
into device label EC code_regex SBCH,\s+32 replace_matched begin BCH0,8,BCH1,8,BCH2,8,BCH3,8 end;
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;


I still haven't started on the two 128 registers.. I read that art of your documentation many times but I don't think I understand really :(

Here is the corrected set of patches:
Code:
[B]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;
[/B]

#16 bit registers
into device label EC code_regex HWAK,\s+16, replace_matched begin WAK0,8,WAK1,8, end;
[B]into method label _L1D code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.WAK0,\\_SB.PCI0.LPC.EC.WAK1), end;[/B]
into device label EC code_regex SBRC,\s+16, replace_matched begin BRC0,8,BRC1,8, end;
into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(BRC0,BRC1), end;
into device label EC code_regex SBFC,\s+16, replace_matched begin BFC0,8,BFC1,8, end;
into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(BFC0,BFC1), end;
into device label EC code_regex SBAC,\s+16, replace_matched begin BAC0,8,BAC1,8, end;
into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(BAC0,BAC1), end;
into device label EC code_regex SBVO,\s+16, replace_matched begin BVO0,8,BVO1,8, end;
into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BVO0,BVO1), end;
into device label EC code_regex SBBM,\s+16, replace_matched begin BBM0,8,BBM1,8, end;
into method label GBIF code_regex \(SBBM, replaceall_matched begin (B1B2(BBM0,BBM1), end;
into device label EC code_regex SBDC,\s+16, replace_matched begin BDC0,8,BDC1,8, end;
into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into method label SBDC code_regex \(SBDC, replaceall_matched begin (B1B2(BDC0,BDC1), end;
into device label EC code_regex SBDV,\s+16, replace_matched begin BDV0,8,BDV1,8, end;
into method label GBIF code_regex \(SBDV, replaceall_matched begin (B1B2(BDV0,BDV1), end;
[B]into method label GBIF code_regex \(SBDV\) replaceall_matched begin (B1B2(BDV0,BDV1)) end;
into method label GBIF code_regex \sSBDV, replaceall_matched begin B1B2(BDV0,BDV1), end;[/B]
into device label EC code_regex SBSN,\s+16 replace_matched begin BSN0,8,BSN1,8 end;
into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(BSN0,BSN1), end;

#32 bit register
into device label EC code_regex SBCH,\s+32 replace_matched begin BCH0,8,BCH1,8,BCH2,8,BCH3,8 end;
into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(BCH0,BCH1,BCH2,BCH3), end;

I'll let you work through the SBMN and SBDN. Although do realize they are very similar to some other patches already present in the repo.
 
Ok I'll read the documentation again and try.. thanks!
 
Ok.. SORRY.. I figured out those 3 compile errors, I just had to play with the functions a bit.
If you don't mind could you just put me in the right direction with those 2 128 bit registers? I really get lost in that part of the documentation. Hope you can help and thanks in advance!

It is good that you're going through this, but I think the patches in "Lenovo X220" are an exact match.
 
Thanks so much, you are correct and those really are a match; at this point I have completed patching the DSDT and for the first time to OS sees a battery! The problem is it's always showing 0% charge.. do you know what could be causing that? I really think I covered all the resters and I see AppleSmartBatteryManager 1.40 was loaded by the kernel. It looks like I'm really close but I must miss something I guess..
 
Status
Not open for further replies.
Back
Top