Contribute
Register

[Guide] How to patch DSDT for working battery status

Hi all! :)

About battery patch, I've done this:

Code:
# This patch solve possibly the battery status
# TOSHIBA SATELLITE L50 A 18-r

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


# 16-bit registers
into device label IEC code_regex B0VL,\s+16, replace_matched begin VL00,8,VL01,8, end;
into device label IEC code_regex B0RC,\s+16, replace_matched begin RC00,8,RC01,8, end;
into device label IEC code_regex B0FC,\s+16, replace_matched begin FC00,8,FC01,8, end;
into device label IEC code_regex B0ST,\s+16, replace_matched begin ST00,8,ST01,8, end;
into device label IEC code_regex B0CC,\s+16, replace_matched begin CC00,8,CC01,8, end;


into device label IEC code_regex B1VL,\s+16, replace_matched begin VL10,8,VL11,8, end;
into device label IEC code_regex B1RC,\s+16, replace_matched begin RC10,8,RC11,8, end;
into device label IEC code_regex B1FC,\s+16, replace_matched begin FC10,8,FC11,8, end;
into device label IEC code_regex B1ST,\s+16, replace_matched begin ST10,8,ST11,8, end;
into device label IEC code_regex B1CC,\s+16, replace_matched begin CC10,8,CC11,8, end;


into device label IEC code_regex B0DC,\s+16, replace_matched begin DC00,8,DC01,8, end;
into device label IEC code_regex B0DV,\s+16, replace_matched begin DV00,8,DV01,8, end;
into device label IEC code_regex B0SN,\s+16, replace_matched begin SN00,8,SN01,8, end;
into device label IEC code_regex B0MD,\s+16, replace_matched begin MD00,8,MD01,8, end;


into device label IEC code_regex B1DC,\s+16, replace_matched begin DC10,8,DC11,8, end;
into device label IEC code_regex B1DV,\s+16, replace_matched begin DV10,8,DV11,8, end;
into device label IEC code_regex B1SN,\s+16, replace_matched begin SN10,8,SN11,8, end;
into device label IEC code_regex B1MD,\s+16, replace_matched begin MD10,8,MD11,8, end;


into device label IEC code_regex F0TS,\s+16, replace_matched begin TS00,8,TS01,8, end;
into device label IEC code_regex F1TS,\s+16, replace_matched begin TS10,8,TS11,8, end;


# fix 16-bit methods


into method label BVOT code_regex \(B0VL, replaceall_matched begin (B1B2(VL00,VL01), end;
into method label BRCP code_regex \(B0RC, replaceall_matched begin (B1B2(RC00,RC01), end;
into method label BIF2 code_regex \(B0FC, replaceall_matched begin (B1B2(FC00,FC01), end;
into method label BSTS code_regex \(B0ST, replaceall_matched begin (B1B2(ST00,ST01), end;
into method label BCRT code_regex \(B0CC, replaceall_matched begin (B1B2(CC00,CC01), end;




into method label BVOT code_regex \(B1VL, replaceall_matched begin (B1B2(VL10,VL11), end;
into method label BRCP code_regex \(B1RC, replaceall_matched begin (B1B2(RC10,RC11), end;
into method label BIF2 code_regex \(B1FC, replaceall_matched begin (B1B2(FC10,FC11), end;
into method label BSTS code_regex \(B1ST, replaceall_matched begin (B1B2(ST10,ST11), end;
into method label BCRT code_regex \(B1CC, replaceall_matched begin (B1B2(CC10,CC11), end;


into method label BIF1 code_regex \(B0DC, replaceall_matched begin (B1B2(DC00,DC01), end;
into method label BIF4 code_regex \(B0DV, replaceall_matched begin (B1B2(DV00,DV01), end;
into method label BIFA code_regex \(B0SN, replaceall_matched begin (B1B2(SN00,SN01), end;
into method label BIF3 code_regex \(B0MD, replaceall_matched begin (B1B2(MD00,MD01), end;
into method label BIF0 code_regex \(B0MD, replaceall_matched begin (B1B2(MD00,MD01), end;


into method label BIF1 code_regex \(B1DC, replaceall_matched begin (B1B2(DC10,DC11), end;
into method label BIF4 code_regex \(B1DV, replaceall_matched begin (B1B2(DV10,DV11), end;
into method label BIFA code_regex \(B1SN, replaceall_matched begin (B1B2(SN10,SN11), end;
into method label BIF3 code_regex \(B1MD, replaceall_matched begin (B1B2(MD10,MD11), end;
into method label BIF0 code_regex \(B1MD, replaceall_matched begin (B1B2(MD10,MD11), end;


into method label M633 code_regex \(F0TS, replaceall_matched begin (B1B2(TS00,TS01), end;
into method label M633 code_regex \(F1TS, replaceall_matched begin (B1B2(TS10,TS11), end;


Also I attach my DSDT because I not sure if I am doing wrong

View attachment DSDT.dsl.zip

Thanks people!

 
Hi all! :)

About battery patch, I've done this:

Code:
# This patch solve possibly the battery status
# TOSHIBA SATELLITE L50 A 18-r

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


# 16-bit registers
into device label IEC code_regex B0VL,\s+16, replace_matched begin VL00,8,VL01,8, end;
into device label IEC code_regex B0RC,\s+16, replace_matched begin RC00,8,RC01,8, end;
into device label IEC code_regex B0FC,\s+16, replace_matched begin FC00,8,FC01,8, end;
into device label IEC code_regex B0ST,\s+16, replace_matched begin ST00,8,ST01,8, end;
into device label IEC code_regex B0CC,\s+16, replace_matched begin CC00,8,CC01,8, end;


into device label IEC code_regex B1VL,\s+16, replace_matched begin VL10,8,VL11,8, end;
into device label IEC code_regex B1RC,\s+16, replace_matched begin RC10,8,RC11,8, end;
into device label IEC code_regex B1FC,\s+16, replace_matched begin FC10,8,FC11,8, end;
into device label IEC code_regex B1ST,\s+16, replace_matched begin ST10,8,ST11,8, end;
into device label IEC code_regex B1CC,\s+16, replace_matched begin CC10,8,CC11,8, end;


into device label IEC code_regex B0DC,\s+16, replace_matched begin DC00,8,DC01,8, end;
into device label IEC code_regex B0DV,\s+16, replace_matched begin DV00,8,DV01,8, end;
into device label IEC code_regex B0SN,\s+16, replace_matched begin SN00,8,SN01,8, end;
into device label IEC code_regex B0MD,\s+16, replace_matched begin MD00,8,MD01,8, end;


into device label IEC code_regex B1DC,\s+16, replace_matched begin DC10,8,DC11,8, end;
into device label IEC code_regex B1DV,\s+16, replace_matched begin DV10,8,DV11,8, end;
into device label IEC code_regex B1SN,\s+16, replace_matched begin SN10,8,SN11,8, end;
into device label IEC code_regex B1MD,\s+16, replace_matched begin MD10,8,MD11,8, end;


into device label IEC code_regex F0TS,\s+16, replace_matched begin TS00,8,TS01,8, end;
into device label IEC code_regex F1TS,\s+16, replace_matched begin TS10,8,TS11,8, end;


# fix 16-bit methods


into method label BVOT code_regex \(B0VL, replaceall_matched begin (B1B2(VL00,VL01), end;
into method label BRCP code_regex \(B0RC, replaceall_matched begin (B1B2(RC00,RC01), end;
into method label BIF2 code_regex \(B0FC, replaceall_matched begin (B1B2(FC00,FC01), end;
into method label BSTS code_regex \(B0ST, replaceall_matched begin (B1B2(ST00,ST01), end;
into method label BCRT code_regex \(B0CC, replaceall_matched begin (B1B2(CC00,CC01), end;




into method label BVOT code_regex \(B1VL, replaceall_matched begin (B1B2(VL10,VL11), end;
into method label BRCP code_regex \(B1RC, replaceall_matched begin (B1B2(RC10,RC11), end;
into method label BIF2 code_regex \(B1FC, replaceall_matched begin (B1B2(FC10,FC11), end;
into method label BSTS code_regex \(B1ST, replaceall_matched begin (B1B2(ST10,ST11), end;
into method label BCRT code_regex \(B1CC, replaceall_matched begin (B1B2(CC10,CC11), end;


into method label BIF1 code_regex \(B0DC, replaceall_matched begin (B1B2(DC00,DC01), end;
into method label BIF4 code_regex \(B0DV, replaceall_matched begin (B1B2(DV00,DV01), end;
into method label BIFA code_regex \(B0SN, replaceall_matched begin (B1B2(SN00,SN01), end;
into method label BIF3 code_regex \(B0MD, replaceall_matched begin (B1B2(MD00,MD01), end;
into method label BIF0 code_regex \(B0MD, replaceall_matched begin (B1B2(MD00,MD01), end;


into method label BIF1 code_regex \(B1DC, replaceall_matched begin (B1B2(DC10,DC11), end;
into method label BIF4 code_regex \(B1DV, replaceall_matched begin (B1B2(DV10,DV11), end;
into method label BIFA code_regex \(B1SN, replaceall_matched begin (B1B2(SN10,SN11), end;
into method label BIF3 code_regex \(B1MD, replaceall_matched begin (B1B2(MD10,MD11), end;
into method label BIF0 code_regex \(B1MD, replaceall_matched begin (B1B2(MD10,MD11), end;


into method label M633 code_regex \(F0TS, replaceall_matched begin (B1B2(TS00,TS01), end;
into method label M633 code_regex \(F1TS, replaceall_matched begin (B1B2(TS10,TS11), end;


Also I attach my DSDT because I not sure if I am doing wrong

View attachment 155659

Thanks people!


Your DSDT has no EC fields that need patching.

B0VL,etc is not in EC, it is in SystemMemory.
 
Hi rehabman i need your help here. I was wondering is this blank space 15 and BSCM 1 maybe somehow related?? Because for this past few days, i've been reading your repo and post 1 but to no avail. I've tried replacing those 128 bit field in the GBIF with RECB(0xE0,128) but to no avail. I've even implemented l1l4 instead of RECB to dealt with those 128 bit register too but to no avail :(. I've appended my latest patch with the L1L4 implementation, a clean dsdt(no edit) and a screenshot of what I'm saying. Thank you very much. Also can i check with you why my 128 bit is different than yours. Because according to post 1 your 128 bit under field definition ECF2 is in each different offset like 0x20 and 0x50 whereas mine 128 bit offset is all the same 0xE0. I have attached a screenshot to explain what I'm saying. Thank you
 

Attachments

  • offset128.jpg
    offset128.jpg
    281.3 KB · Views: 92
  • Screen Shot 2015-10-13 at 1.14.53 AM.png
    Screen Shot 2015-10-13 at 1.14.53 AM.png
    2.1 KB · Views: 155
  • dsdt_dv2000.aml
    39.3 KB · Views: 81
  • battery_HP-DV2-2500.txt
    7 KB · Views: 102
Hi again!, When I click the battery icon show I get this in the console:

13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: pollingTimeOut called
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: pollBatteryState: path = 2
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: pollBatteryState: path = 1
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: getBatterySTA called
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: setBatterySTA: battery_status = 0x1f
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: getBatteryBIF called
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: validateObject return 0x0

what does this mean? What I have to do to fix it?

Thanks you!
 
Hi rehabman i need your help here. I was wondering is this blank space 15 and BSCM 1 maybe somehow related?? Because for this past few days, i've been reading your repo and post 1 but to no avail. I've tried replacing those 128 bit field in the GBIF with RECB(0xE0,128) but to no avail. I've even implemented l1l4 instead of RECB to dealt with those 128 bit register too but to no avail :(. I've appended my latest patch with the L1L4 implementation, a clean dsdt(no edit) and a screenshot of what I'm saying. Thank you very much. Also can i check with you why my 128 bit is different than yours. Because according to post 1 your 128 bit under field definition ECF2 is in each different offset like 0x20 and 0x50 whereas mine 128 bit offset is all the same 0xE0. I have attached a screenshot to explain what I'm saying. Thank you

Your offset calculations look correct (quick glance).
 
Hi again!, When I click the battery icon show I get this in the console:

13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: pollingTimeOut called
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: pollBatteryState: path = 2
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: pollBatteryState: path = 1
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: getBatterySTA called
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: setBatterySTA: battery_status = 0x1f
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: getBatteryBIF called
13/10/15 0:03:20,000 kernel[0]: ACPIBatteryManager: validateObject return 0x0

what does this mean? What I have to do to fix it?

Thanks you!

That looks normal.
 
I think the error is in the appleacpiplatform.kext. When used Yosemite had to get patched version 3.1 appleacpiplatform.kext. Do you know anything about it? i attach the file.
 

Attachments

  • AppleACPIPlatform.kext.zip
    421.4 KB · Views: 72
I think the error is in the appleacpiplatform.kext. When used Yosemite had to get patched version 3.1 appleacpiplatform.kext. Do you know anything about it? i attach the file.

No patched AppleACPIPlatform.kext necessary with correct DSDT patches for battery.

No idea what's been done to that file.
 
Hi RehabMan, my EC fields only contain 8 bit, how can i deal with them? I'm using dell m4700.
Please take a look my attach.
 

Attachments

  • DSDT.zip
    94.7 KB · Views: 93
Back
Top