Contribute
Register

[Guide] How to patch DSDT for working battery status

I see no multibyte EC access in SSDT-0.aml. Do you?
Sorry,it's my fault.
The first question:
There are some multibyte EC access in SSDT-0.aml.
(BFCC, 16 and MCUR, 16)
Should I
Change
Code:
External (_SB_.PCI0.LPCB.EC0_.BFCC, IntObj)
External (_SB_.PCI0.LPCB.EC0_.MCUR, IntObj)
Store (\_SB.PCI0.LPCB.EC0.BFCC, Local1)
Store (\_SB.PCI0.LPCB.EC0.MCUR, Local2)
To
Code:
External (_SB_.PCI0.LPCB.EC0_.FCC0, IntObj)
External (_SB_.PCI0.LPCB.EC0_.FCC1, IntObj)
External (_SB_.PCI0.LPCB.EC0_.CUR0, IntObj)
External (_SB_.PCI0.LPCB.EC0_.CUR1, IntObj)
Store (B1B2(\_SB.PCI0.LPCB.EC0.FCC0,\_SB.PCI0.LPCB.EC0.FCC1), Local1)
Store (B1B2(\_SB.PCI0.LPCB.EC0.CUR0,\_SB.PCI0.LPCB.EC0.CUR1), Local2)

The second question:
In my SSDT-4.aml,There are many object like this:
"_SB_.PCI0.LPCB.H_EC.XXXX"
Should I rename H_EC to EC0?

Thx!
 

Attachments

  • original DSDT&SSDT.zip
    45.1 KB · Views: 244
Last edited:
Sorry,it's my fault.
The first question:
There are some multibyte EC access in SSDT-2.aml.

You did not attach SSDT-2.aml this time.
No references to MCUR or BFCC in the SSDT-2.aml that you attached in post #3501.

Should I rename H_EC to EC0?

Not related to battery status. That SSDT is likely PTID... will not be used by OS X. H_EC is provided by Windows only (my guess... likely stands for "Host EC").
 
You did not attach SSDT-2.aml this time.
No references to MCUR or BFCC in the SSDT-2.aml that you attached in post #3501.
Oh,sorry.
I mean,There are some multibyte EC access in SSDT-0.aml.
 
Oh,sorry.
I mean,There are some multibyte EC access in SSDT-0.aml.

These are related to WMI. Will not be used by OS X/macOS... WMI only used by Windows.
Patch them at your option.
 
Not related to battery status. That SSDT is likely PTID... will not be used by OS X. H_EC is provided by Windows only (my guess... likely stands for "Host EC").
These are related to WMI. Will not be used by OS X/macOS... WMI only used by Windows.
Patch them at your option.

I know, thank you!
 
Hi RehabMan, fantastic guide btw
I've come up with this patch for the Razer Blade Stealth (Kaby-Lake). It is very similar to the Razer Blade 2014 patch in your repo, but I've added a buffer register to get it working properly.
Thanks for your awesome work!
 

Attachments

  • DSDT+Patch.zip
    36.6 KB · Views: 282
Hi RehabMan, fantastic guide btw
I've come up with this patch for the Razer Blade Stealth (Kaby-Lake). It is very similar to the Razer Blade 2014 patch in your repo, but I've added a buffer register to get it working properly.
Thanks for your awesome work!

Thanks... I just added it to the Razer Blade 2014 patch (with a couple of fixes).

How is progress with the Razer Blade Stealth?
 
How is progress with the Razer Blade Stealth?
ATM I've got half the audio working, internal speakers need a bit of tweaking, it uses ALC298
Wifi is a no go I think, it has a Qualcomm Atheros QCA6174. I'm thinking of trying to replace it but just leaving it for now.
The graphics are all good, even if About This Mac says Intel Unknown. I'm using 10.11 for this because of all the problems for laptops in sierra, I though it would be safer.
The trackpad doesn't work, it uses i2c so I'm trying to use Voodooi2c to get it to work. The touchscreen worked straight away perfectly for some reason though...
 
Hi Rehabman,, I make new patch for Acer one 14 z1402g, Intel Core i3-5005U (Broadwell Generations)

Here is the patch
Code:
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 EC0 code_regex XIF1,\s+16, replace_matched begin IF10,8,IF11,8, end;
into device label EC0 code_regex XIF2,\s+16, replace_matched begin IF20,8,IF21,8, end;
into device label EC0 code_regex XIF3,\s+16, replace_matched begin IF30,8,IF31,8, end;
into device label EC0 code_regex XIF4,\s+16, replace_matched begin IF40,8,IF41,8, end;
into device label EC0 code_regex XIF7,\s+16, replace_matched begin IF70,8,IF71,8, end;
into device label EC0 code_regex XST0,\s+16, replace_matched begin ST00,8,ST01,8, end;
into device label EC0 code_regex XST1,\s+16, replace_matched begin ST10,8,ST11,8, end;
into device label EC0 code_regex XST2,\s+16, replace_matched begin ST20,8,ST21,8, end;
into device label EC0 code_regex XST3,\s+16, replace_matched begin ST30,8,ST31,8, end;
into device label EC0 code_regex BIF1,\s+16, replace_matched begin BIA0,8,BIA1,8, end;
into device label EC0 code_regex BIF1,\s+16, replace_matched begin BIB0,8,BIB1,8, end;
into device label EC0 code_regex BST1,\s+16, replace_matched begin BSA0,8,BSA1,8, end;

# fix 16-bit methods
into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.XIF1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF10,^^PCI0.LPCB.EC0.IF11), end;
into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.XIF2, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF20,^^PCI0.LPCB.EC0.IF21), end;
into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.XIF3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF30,^^PCI0.LPCB.EC0.IF31), end;
into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.XIF4, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF40,^^PCI0.LPCB.EC0.IF41), end;
into method label _BIF code_regex \(\^\^PCI0\.LPCB\.EC0\.XIF7, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF70,^^PCI0.LPCB.EC0.IF71), end;
into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.XST0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST00,^^PCI0.LPCB.EC0.ST01), end;
into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.XST1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST10,^^PCI0.LPCB.EC0.ST11), end;
into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.XST2, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST20,^^PCI0.LPCB.EC0.ST21), end;
into method label _BST code_regex \(\^\^PCI0\.LPCB\.EC0\.XST3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST30,^^PCI0.LPCB.EC0.ST31), 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
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\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
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;
into method label WE1B parent_label EC0 remove_entry;
into method label WECB parent_label EC0 remove_entry;
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
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
// Arg2 - value to write\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;

I hope you can check it and add to your repository
Sukses.png
Sukses1.png
 

Attachments

  • Original DSDT.aml
    98 KB · Views: 297
  • Patched DSDT.aml
    98.4 KB · Views: 321
ATM I've got half the audio working, internal speakers need a bit of tweaking, it uses ALC298
Wifi is a no go I think, it has a Qualcomm Atheros QCA6174. I'm thinking of trying to replace it but just leaving it for now.
The graphics are all good, even if About This Mac says Intel Unknown. I'm using 10.11 for this because of all the problems for laptops in sierra, I though it would be safer.
The trackpad doesn't work, it uses i2c so I'm trying to use Voodooi2c to get it to work. The touchscreen worked straight away perfectly for some reason though...

Hopefully WiFi is replaceable (eg. no BIOS whitelist).
You can inject "model" to fix the graphics name cosmetics.
Did you need to use the minStolenSize patch or is DVMT-prealloc changeable in BIOS (or large enough by default)?
 
Back
Top