Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
Good day @BlvckBytes , Still no time to look at my files? Asking just to make sure u didnt forget about em, im totally fine with waiting, appreciation for what you do to community)
Did you try to add SMCBatteryManager to your kexts ?

I see no registers above 8-bits under EmbeddedController so I assume you don't need a patch
 
hi i have an Dell Inspiron 15 3521 with macOS Catalina installed with almost all patches done except battery and bluetooth i=and i cant figure out how to patch the battery as i am bit of a noob tried reading all the documents related acpi but to no avail please if you can patch it for me i have attached the dsdt and efi folder if you require anything else i will provide thanks so much in advance
 

Attachments

  • EFI.zip
    8.7 MB · Views: 61
  • DSDT.aml
    36.8 KB · Views: 33
hi i have an Dell Inspiron 15 3521 with macOS Catalina installed with almost all patches done except battery and bluetooth i=and i cant figure out how to patch the battery as i am bit of a noob tried reading all the documents related acpi but to no avail please if you can patch it for me i have attached the dsdt and efi folder if you require anything else i will provide thanks so much in advance

your SSDT-EC disables your native embeddedcontroller (EC0), you should NOT disable it in laptops
anyways you probably don't need a patch, just use the SSDT-EC in this comment and add SMCBatteryManager to your kexts and config plist

Edit: always keep a backup of your currently working EFI
 
Last edited:
@truvalerich

I'm very sorry, I actually forgot about your request :/. Had a look at your DSDT, and as @moh.96 suggested, there are no fields > 8 bit in EC mem regions. Have you tried using ACPIBatteryManager *or* SMCBatteryManager? Using VirtualSMC, of course.

But I don't quite get why your EC mem region is that small. That kind of suggests that, maybe, your SystemMemory region needs the patching here. I've never seen such a case, it's totally new to me. So please first try out the kexts, before I start to think about SystemMemory patches.

@Killuminati91

Wow, did you write that patch up yourself? There were some quite challenging parts in it, really have to say that. Just saw that you sometimes also patched EC fields that are not in use, or just skipped some, without using the proper Offset call before that, so the offsets match. I think this is important, because the ACPI-devs might be accessing those fields just by addresses somewhere else, which would be ruined if you scramble their layout up.

If the patch from @moh.96 works out for you, that's fine, otherwise I'd like to try to patch it too, just to make sure those small mistakes are gone and you're safe for the future.
 
@BvlckBytes Glad to hear from you, yeah I just tried SMCBatteryManager and it seems to work, thanks to @moh.96 ! was just going to report that here.
I don't understand much about EC mem. if SMC worked then I don't have to worry about it? or its still can affect system? the only complain so far about my hac laptop is that my screen rendering with sort of washed out colors, like gradients are visible where they shouldn't be. and colors transitions are not smooth.
 
@Killuminati91

I'm having a look at how ECWT works, which you've used to first write the MSB of Local0 into CAL1 on _QA9, and then the LSB, after shifting, if I get that correctly.

But why have you overridden ECWT, to get rid of the _REV check? Was it not working otherwise?

That's what I'm talking about:
Code:
Method (ECWT, 2, Serialized)
{
    If (ECTK)
    {
        If (LGreaterEqual (_REV, 0x02))
        {
            Store (One, ECAV)
        }

        Store (Zero, ECTK)
    }

    Store (Acquire (ECMT, 0x03E8), Local0)
    If (LEqual (Local0, Zero))
    {
        If (ECAV)
        {
            Store (Arg0, Arg1)
        }

        Release (ECMT)
    }
}

vs.

Code:
Method (ECWT, 2, Serialized)
{
    If (_OSI ("Darwin"))
    {
        If (ECTK)
        {
            Store (Zero, ECTK)
        }

        Store (Acquire (ECMT, 0x03E8), Local0)
        If (LEqual (Local0, Zero))
        {
            If (ECAV)
            {
                Store (Arg0, Arg1)
            }

            Release (ECMT)
        }
    }
    Else
    {
        XCWT (Arg0, Arg1)
    }
}

Just trying to learn here :p
 
Last edited:
@truvalerich

I'd say that if it works, you're fine. I also had that gradient-issue on the HP Zbook I owned for two months, didn't figure out how to change it. All you can try is to have a look at your framebuffer patches, check if they're correct and optimizable, or just have a look through the system pref color profiles, maybe they'll change something.
 
@BlvckBytes

I think he messed up the offset too

@Killuminati91

in case the patch didn't work use the one below (I made it from scratch)

I believe your offset calculating was wrong, idk why you modified ECWT, ECRD and ECWT methods (just like @BlvckBytes said I'm trying to learn not to criticise you :) )
 

Attachments

  • Matebook X Pro 2020-Battery-Patch.zip
    6 KB · Views: 37
@moh.96

I'd use this SSDT, or the one you provided, didn't yet look into it, but you probably did a great job again.

BTW, just kind of want to share this. I started working on the automated patcher, and I'm still worlds away from something working. I just took like 30 minutes last night to experiment with interpreting ASL code, and I tried to automatically get all fields that need patching, with their offset, from EC mem.

This is what I currently have: https://github.com/BlvckBytes/AcpiHelper

I don't know if you have knowledge about programming, but it would be nice if you can execute it from time to time and just check if the offsets are actually correct. If not, no worries, I'll do so myself anyways. Maybe I should provide an executable for easier use... Later! :p. Btw, it needs a *untouched* DSDT.dsl as an input, it relies on the standard formatting.

As soon as I will find more time, I will start working on the next steps, to come closer to automated patching...
 

Attachments

  • SSDT-BATT.aml
    3.1 KB · Views: 33
your SSDT-EC disables your native embeddedcontroller (EC0), you should NOT disable it in laptops
anyways you probably don't need a patch, just use the SSDT-EC in this comment and add SMCBatteryManager to your kexts and config plist

Edit: always keep a backup of your currently working EFI
Thank you for the quick reply!
Should I also follow the steps mentioned or just add the ssdt file and reconfigure config.plist?
 
Status
Not open for further replies.
Back
Top