Jump to content

Thinkpad e490 Opencore Catalina -- battery patching


4 posts in this topic

Recommended Posts

I've done a few hackintoshes before, but never DSDT patching before, so i'm still n00b with that.

 

My thinkpad e490 currently has UHD 620 GPU working, sound working.  No battery yet, and wifi is intel so not much hope there.

 

I have no problem getting my DSDT, and have tried patching with a bunch of other thinkpad and lenovo patches from Rehabman's repo: https://github.com/RehabMan/Laptop-DSDT-Patch/tree/master/battery

 

When I load ACPIBatterManager, it shows 0% battery left, and wont charge.  I read somewhere that if you are using VirtualSMC, that you should use SMCBatteryManager instead, so I tried that as well, but that just doesn't load at all.  

 

I am sure that I need a new custom patch for my system, but haven't been able to find enough time to wrap my brain around the process in guide-how-to-patch-dsdt-for-working-batt

 

Does anybody have any advice on a set of DSDT patches for this laptop or similar ?

 

In case anybody is willing to help, i've attached my unmodified DSDT.aml here.

 

Thanks! 

DSDT.aml

  • 2 weeks later...
  • 3 months later...

Just finally had some time to try again.  I grabbed most of the ACPI patches from your config.plist, using these SSDTs, and still no luck.  I am now working with a big sur installation, and got the intel wifi card working. So right now the only two things not working are battery and HDMI.  Not sure when I'll have time again, but I supposed I need to start going through the DSDT patching again.  Or maybe I'll write a python script to automate the process...

  • 3 weeks later...
Posted (edited)

Ok, finally had success to get everything working.  I found no shortcuts to get the DSDT patched.  Apparently the DSDT changes with different versions of the system bios, so I just decided to dig in and figure it out.  Here are a few of my notes:

 

Battery Patching:

 

Lots of ppl say don't ever open your DSDT.aml directly in MaciAsl. Whatever.  I could never get the command line disassembler to properly use all the files and give me DSDTs etc. so I opened it direct in MaciAsl. Worked fine.

 

Tip: find a stating point battery patch, and then make a working copy of it, preferably versioned.  I had to do a crapton of tries/searches to get to a working version.

 

I started with Thinkpad x220 patch from Rehabman, because somebody said they had luck with it.  Maybe 1/2 of the patches were helpful, the rest just caused problems.

 

Take the time to understand what is going on or else you will be lost.  The tutorials are accurate, but written for non-n00bs.  The short short is: you have to change certain variables into function calls.  Any variables > 8bit need patched.

Most patches create new functions that help you get this done.  Keep and don't break the B1B2, B1B4, RE1B and RECB functions.

 

Here is the most simple example of what is going on (no explanations of 'why' -- i dont have that much time haha)

 

In the unpatched/original DSDT, you will have some code like this:

 

Local1 = (SBFC * 0x0A)
 

If we search for SBFC, we will find this definition:

 

SBFC,   16, 

 

This says SBFC is a 16 bit, and so it needs converted to 8 bit.

 

So the patch code looks like this:

 

into device label EC code_regex SBFC,\s+16 replace_matched begin BFC0,8,BFC1,8 end;
 

which changes the definition line to become this:

 

BFC0,8,BFC1,8

 

Now that the variable has been redefined, we need to change all the places where the original variable was defined and replace it with our custom helper function.  So this patch code:

 

into_all method label XBIF code_regex \(SBFC, replaceall_matched begin (B1B2 (BFC0, BFC1), end;
 

looks inside the XBIF function for any reference to variable "SBFC" and replaces it with a B1B2 helper function.  

 

So now the reference we saw above becomes this:

 

Local1 = (B1B2 (BFC0, BFC1) * 0x0A)
 

Intel UHD 620

 

There are a bunch of sites that help you get the correct ig-platform-id and device, but the HDMI port never worked for me.  here is what got it going for me:

 

- smBios MacBookPro15,2

- disable external gpu

- patch framebuffer to define port 1 as type hdmi

 

Intel Wifi

 

I got intel wifi card working.  its a new kext project, and only worked with Big Sur for me.

 

Edited by aschwabe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...