Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
Attached you will find my EFI. I've deleted SN,MBL e SystemUUID from the config.plist ..
At the moment there is some garbage in the ACPI folder because I was messing around with a lot of small adjustment ...

Let me know what you think !

Thanks
Mattia
give this EFI a try
 

Attachments

  • EFI.zip
    12.3 MB · Views: 43
I have everything working on a Lenovo T450s Catalina except for the battery percentage. I've done a hack of a hack, took bits and pieces of other people's files and somehow have a mostly working hackintosh. Could you help a brother out with the battery patch?
your EFI folder is a mess, using files from other's EFI is really bad idea and you will learn absolutely nothing

read opencore guide, make your own EFI and start fixing your problem one by one (believe me that’s much better than stacking SSDTs in your ACPI folder)
 
give this EFI a try
I've tried without luck (I still have the same delay) ... I gave a look to your EFI .. is it possible you just changed the SMBIOS from MacBookPro13,2 to MacBookPro14,1 ?
 
@tmbt
Well I was looking for renaming patches that involves certain method, noticed you disabled ECRD method

so I cleaned up the renaming patches and ACPI folder but looks like to no avail

Yesterday I renamed a method (_QXX where xx is a number but I don’t remember it, this method was responsible for notifying when AC is plugged in or out) so after renaming it I had similar issue like yours where it takes up 1 min to detect battery charging

I think you should look for that method and make some changes to it

I’ll take another look at your dsdt tonight and see if I can come up with something

about SMBIOS I think 14,1 is more suitable to your specs
 
@tmbt
Well I was looking for renaming patches that involves certain method, noticed you disabled ECRD method

so I cleaned up the renaming patches and ACPI folder but looks like to no avail

Yesterday I renamed a method (_QXX where xx is a number but I don’t remember it, this method was responsible for notifying when AC is plugged in or out) so after renaming it I had similar issue like yours where it takes up 1 min to detect battery charging

I think you should look for that method and make some changes to it

I’ll take another look at your dsdt tonight and see if I can come up with something

about SMBIOS I think 14,1 is more suitable to your specs
What you say is quite interesting ... I have spent hours watching my DSDT and have reach the conclusion that something is wrong in there.
I think the method you're referring to are these two :

Code:
Method (_Q0A, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                P80B = 0x0A
                If ((ECWR & One))
                {
                    PWRS = One
                }
                Else
                {
                    PWRS = Zero
                }

                Sleep (0x01F4)
                Notify (BAT0, 0x81) // Information Change
                Sleep (0x01F4)
                Notify (ADP1, 0x80) // Status Change
            }

            Method (_Q0B, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                P80B = 0x0B
                Sleep (0x01F4)
                Notify (BAT0, 0x81) // Information Change
                Sleep (0x01F4)
                Notify (BAT0, 0x80) // Status Change
            }

To me they should be called when I Plug and Unplug the power cord.
The fact is that they are NEVER called ! And that's what I don't 'understand ..

I've used Rehabman EC query debug kext and in the logs there is not a single time these two Method are called.
Another strange which in a way confirm my theory is that I've these other 2 methods :
Code:
Method (_Q0C, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                LIDS = ECRD (RefOf (LSTE))
                ^^^GFX0.GLID (LIDS)
                Notify (LID0, 0x80) // Status Change
            }

            Method (_Q0D, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                LIDS = ECRD (RefOf (LSTE))
                ^^^GFX0.GLID (LIDS)
                Notify (LID0, 0x80) // Status Change
            }

which clearly should notify when I open or close the lid of my laptop and these two are never called too!
In fact when I close the lid I still can see my screen switched on but if I do the same on Windows then the screen goes off.
It's like these vital EC query are never called even if they should have.
The only way to force the lid status to change is using another Rehabman kext called ACPIPoller which force the method you choose to be executed. Basically it add a fake LIDP method which is called from the ACPIPoller every 1 second. The LIDP just call for the LID and force the refresh of the status ... it works but I guess it's quite battery and cpu expensive and anyway I would like to avoid this ...

So I really appreciate any further help you would like to give me ...
Thanks!
Mattia
 
your EFI folder is a mess, using files from other's EFI is really bad idea and you will learn absolutely nothing

read opencore guide, make your own EFI and start fixing your problem one by one (believe me that’s much better than stacking SSDTs in your ACPI folder)

I did read the guide the best I could but there is nothing in there about battery patching. I created a few SSDT's from source but this battery issue is just way beyond my ability. Is my EFI folder really that bad? Maybe there are a few SSDT's and kexts I could do without.
 
I did read the guide the best I could but there is nothing in there about battery patching. I created a few SSDT's from source but this battery issue is just way beyond my ability. Is my EFI folder really that bad? Maybe there are a few SSDT's and kexts I could do without.
it's about bad or good but you got a lot of SSDTs and patches (I'm not sure you need that much)

anyways I'm patching your battery but I think the DSDT you provided is not vanilla
upload vanilla untouched DSDT ( better to dump DSDT using SSDT-Time on windows)
 
it's about bad or good but you got a lot of SSDTs and patches (I'm not sure you need that much)

anyways I'm patching your battery but I think the DSDT you provided is not vanilla
upload vanilla untouched DSDT ( better to dump DSDT using SSDT-Time on windows)

Here you go, attached. BTW: I'm trying to generate EFI from scratch. I cleaned my config.plist and expunged the ACPI and KEXTS folders except for the bare essentials. It's giving me wake failures at boot and such. Anyway, thanks in advance for the patch.
 

Attachments

  • DSDT.aml
    67.9 KB · Views: 44
Here you go, attached. BTW: I'm trying to generate EFI from scratch. I cleaned my config.plist and expunged the ACPI and KEXTS folders except for the bare essentials. It's giving me wake failures at boot and such. Anyway, thanks in advance for the patch.
Here is the patch

copy SSDT-BAT to your ACPI
copy patches to your config.plist (use ProperTree)

untitled folder contain the files that I needed to make the patch (you don't need it but if you wanna learn how to your patch was made then it will be helpful, read [Guide] How to patch DSDT for working battery status and [Guide] Using Clover to "hotpatch" ACPI)

Always keep a backup
It's preferred to reset nvram before booting

Edit: if there is any old battery SSDT or patches then you must delete them all
 

Attachments

  • T450s.zip
    740.6 KB · Views: 55
Here is the patch

copy SSDT-BAT to your ACPI
copy patches to your config.plist (use ProperTree)

untitled folder contain the files that I needed to make the patch (you don't need it but if you wanna learn how to your patch was made then it will be helpful, read [Guide] How to patch DSDT for working battery status and [Guide] Using Clover to "hotpatch" ACPI)

Always keep a backup
It's preferred to reset nvram before booting

Edit: if there is any old battery SSDT or patches then you must delete them all

Thank you, but it's not working, stuck at 100%. I tried disabling all ACPI patches except the four from your patches.plist but no love. I tried to decompile the SSDT and it was giving me 4 warnings? I'm a novice at code so I'm lost with how to resolve those warnings.
 
Status
Not open for further replies.
Back
Top