Contribute
Register

DSDT patching issues with Lenovo T410

Status
Not open for further replies.
Joined
May 23, 2011
Messages
248
Motherboard
Lenovo T440S / Toshiba X205-SLI6 / Toshiba C850 / Dell T110 / Lenovo T410 / MP3,1 / MBP4,1
CPU
i5 4300U / T9300 / i3 3110M / 8x 2.8Ghz Xeon / i5 560m / 8x 3.2Ghz X5482 / T9300
Graphics
HD4400 / 2x 8600M GT / Intel HD4000 / Intel IronLake / HD5770 / 8800GT & GTX650 / 8600M GT
Mac
  1. MacBook Pro
  2. Mac Pro
Classic Mac
  1. eMac
Mobile Phone
  1. iOS
Thanks to this thread I've now been able to get working battery status on my Lenovo T410 (the patch that mentioned a T410 previously didn't work for mine).

Mine is a 2516-DCU (core i5 560 2.66Ghz w/ bios 1.45 w/ whitelist for wlan which is a Dell DW1510 half height card, Intel GPU only)

Stock DSDT and the Modded DSDT (using some patches from your repo and some of my own editing) are attached.
Unfortunately my ability to write it in a patch form wasn't something I could do.
The modded one has a lot of changes, device renames, removed CPU cores I don't have, removed WMI, enabled backlight controls.

I do wonder why Amperage is 0 mA and Voltage seems high but maybe thats fine for mV.

Code:
Battery Information:

  Model Information:
  Serial Number:	42T4791-16240
  Manufacturer:	SANYO
  Device Name:	42T4791
  Charge Information:
  The battery's charge is below the critical level.:	No
  The battery's charge is below the warning level.:	No
  Charge Remaining (mAh):	2891
  Fully Charged:	Yes
  Charging:	No
  Full Charge Capacity (mAh):	2896
  Health Information:
  Cycle Count:	384
  Condition:	Replace Soon
  Battery Installed:	Yes
  Amperage (mA):	0
  Voltage (mV):	12138
And after refreshing the info a few minutes later the values changed...
Code:
  Charge Remaining (mAh):	3109
  Fully Charged:	Yes
  Charging:	No
  Full Charge Capacity (mAh):	3128
 

Attachments

  • t410-dsdt-stock.aml
    61.4 KB · Views: 287
  • t410-DSDT-battery-backlight.aml
    46.2 KB · Views: 268
  • t410-ioreg.ioreg
    3.6 MB · Views: 192
How to patch DSDT for working battery status

Thanks to this thread I've now been able to get working battery status on my Lenovo T410 (the patch that mentioned a T410 previously didn't work for mine).

Mine is a 2516-DCU (core i5 560 2.66Ghz w/ bios 1.45 w/ whitelist for wlan which is a Dell DW1510 half height card, Intel GPU only)

Stock DSDT and the Modded DSDT (using some patches from your repo and some of my own editing) are attached.
Unfortunately my ability to write it in a patch form wasn't something I could do.
The modded one has a lot of changes, device renames, removed CPU cores I don't have, removed WMI, enabled backlight controls.

I do wonder why Amperage is 0 mA and Voltage seems high but maybe thats fine for mV.

Code:
Battery Information:

  Model Information:
  Serial Number:	42T4791-16240
  Manufacturer:	SANYO
  Device Name:	42T4791
  Charge Information:
  The battery's charge is below the critical level.:	No
  The battery's charge is below the warning level.:	No
  Charge Remaining (mAh):	2891
  Fully Charged:	Yes
  Charging:	No
  Full Charge Capacity (mAh):	2896
  Health Information:
  Cycle Count:	384
  Condition:	Replace Soon
  Battery Installed:	Yes
  Amperage (mA):	0
  Voltage (mV):	12138
And after refreshing the info a few minutes later the values changed...
Code:
  Charge Remaining (mAh):	3109
  Fully Charged:	Yes
  Charging:	No
  Full Charge Capacity (mAh):	3128

Amperage reflects the flow of power to/from battery. Amperage is 0 when there is no charge or discharge currently.

I'll look at your stock DSDT to see what additional patches I need for the repo.

Note to others: Using a patched DSDT built for one computer on a different one is not a good idea.

Also, could you re-post ioreg using the instructions here: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html

Are you certain your patched DSDT is derived from the stock one. It looks as if it came from a different computer or at least different BIOS version. Just as an example, I can't see why one would rename VID to GFX0... There are more differences as well that don't look like patches done for OS X...

Off-topic... As far as backlight, you would get better results with:
HD3000/HD4000 Brightness Fix:
DSDT Patches from here: https://github.com/RehabMan/Laptop-DSDT-Patch

Apply:
"Rename GFX0 to IGPU"
"Brightness Fix (HD3000/HD4000)"
- rename patch must be done first and to all DSDT/SSDT that contain references to GFX0 that you're including in your final SSDT set
- Brightness patch must be done to the DSDT or SSDT that contains the definition for Device GFX0 (search for 'Device (GFX0)'
- Place DSDT and SSDT (if necessary) into a place where the bootloader will load them. For Clover, EFI/CLOVER/ACPI/patched (DSDT.aml, SSDT-x.aml where 'x' is a number). For Chameleon, /Extra/ssdt.aml, /Exra/ssdt-1.aml, /Extra/ssdt-2.aml, etc.

Install: https://github.com/RehabMan/OS-X-ACPI-Backlight
 
How to patch DSDT for working battery status

Here is another copy of the ioreg from the older version 2.x of IORegistry (my first one was with 3.x).
I did start with a DSDT that I pulled off of this machine in windows in RW-Everything and then started modding it, its not from a different machine. With all the mods I have in it its likely that its quite true that it may not be a good idea for someone else to use it in its current form.

Side note: how would the backlight change using the HD3000/4000 patch? I get sun/slider (using ScrLk/Pause) but the machine is always full brightness at each boot. I have it set to go down to completely black screen like OSX does on the MBP. I am using Chameleon and your ACPI backlight kext

Edit: the GFX0 -> IGPU rename patch breaks the compile with a pile of errors.
35 patches, 53 changes
22 errors lots of object not found / accessible from scope.

Edit 2:
I had changed the graphics from VID to GFX0 as I was having some issues getting my display to work properly and was grasping at straws a bit in getting it to work... And took out the extra CPU refs as well just to clean things up during boot and removed WMI since OSX has no use for it.
I'm fairly certain that I was on the same 1.45 BIOS version when I gathered the DSDT from windows as I am running now...

I could boot into windows again and pull a fresh copy and see how it compares to what I have.

hmm it would seem you could be correct, the base of my patch is from the old version of the BIOS at least they have a different MD5...
Attached a new DSDT.aml from my current BIOS version ... patched only enough to fix compile errors (_PLD, IRC, asterisk in WMI device name)
Not sure if its really worth anything though, not really feeling like redoing all of the modifications with the new file as I'm not having issues.
More about the VID to GFX0 change, I tried the IGPU rename but that caused a lot of other errors as it seems there are non video devices in the DSDT that use VID in them. So I had gone through and changed to GFX0 hoping it would help get that working.
Maybe I'll manually change to IGPU but I'm not sure of the benefit of it.
I also renamed the EC device to H_EC to make it easier for me to follow along with the guides.
Oh well probably put way more effort than was needed in this but it was a learning experience in the end.
 

Attachments

  • T410-IoReg-redo.ioreg
    1.6 MB · Views: 197
  • DSDT-new.aml
    55.1 KB · Views: 227
How to patch DSDT for working battery status

Here is another copy of the ioreg from the older version 2.x of IORegistry (my first one was with 3.x).
I did start with a DSDT that I pulled off of this machine in windows in RW-Everything and then started modding it, its not from a different machine. With all the mods I have in it its likely that its quite true that it may not be a good idea for someone else to use it in its current form.

It is up to you, but you might want to go back through the process as there is significant differences between the two DSDTs unrelated to patches...

The existing battery patch in the repo appears to produce the same result. It does not appear that any changes need to be done for your DSDT as far as battery patches.

Side note: how would the backlight change using the HD3000/4000 patch? I get sun/slider (using ScrLk/Pause) but the machine is always full brightness at each boot. I have it set to go down to completely black screen like OSX does on the MBP. I am using Chameleon and your ACPI backlight kext

You'd get:
- restore of backlight level across boots (provided nvram is working)
- smooth changes between levels
- additional levels between the major 17 levels (use Option key while tapping brightness keys)

Edit: the GFX0 -> IGPU rename patch breaks the compile with a pile of errors.
35 patches, 53 changes
22 errors lots of object not found / accessible from scope.

The "GFX->IGPU" rename patch is intended to be applied to an unpatched DSDT. It works without tweaks for most DSDTs but yours requires some small hand edits. Just search for the old value and hand replace them (GFX0 or VID depending)... You could also tweak the brightness patch to work with GFX0 (or the original VID from the unpatched DSDT), but you'd lose IGPU power management as a result.
 
How to patch DSDT for working battery status

Here is another copy of the ioreg from the older version 2.x of IORegistry (my first one was with 3.x).
...

You might want to sanity check the DesignCapacity (0x15f0) and MaxCapacity (0xc38). The difference is pushing the estimated CycleCount to high levels resulting in warnings about the battery being ready for replacement.

If your battery is old, then perhaps that is expected...
 
How to patch DSDT for working battery status

Edit 2:
I had changed the graphics from VID to GFX0 as I was having some issues getting my display to work properly and was grasping at straws a bit in getting it to work... And took out the extra CPU refs as well just to clean things up during boot and removed WMI since OSX has no use for it.
I'm fairly certain that I was on the same 1.45 BIOS version when I gathered the DSDT from windows as I am running now...

I was thinking of trying to accommodate your DSDT in the rename patch. But the difficulty is your DSDT has two VID devices, one at _SB.PCI0.VID and another at _SB.PCI0.PEG.VID. You want to rename the first one to _SB.PCI0.IGPU, but not the other one (I think it would likely cause issues). A targeted set of custom patches is appropriate:

Code:
# rename PCI0.VID to PCI0.IGPU
into device label VID parent_label PCI0 set_label begin IGPU end;
into_all all code_regex PCI0.VID replaceall_matched begin PCI0.IGPU end;
into scope label \_SB.PCI0.VID set_label begin \_SB.PCI0.IGPU end;
 
How to patch DSDT for working battery status

You might want to sanity check the DesignCapacity (0x15f0) and MaxCapacity (0xc38). The difference is pushing the estimated CycleCount to high levels resulting in warnings about the battery being ready for replacement.

If your battery is old, then perhaps that is expected...

The battery is kind of old but this laptop was hardly ever off of the charger ...

Battery specs from the back of the battery show:
NOM:
10.8V
5.2Ah
57Wh
PS E:
10.8V
4.67Ah
 
How to patch DSDT for working battery status

The battery is kind of old but this laptop was hardly ever off of the charger ...

Battery specs from the back of the battery show:
NOM:
10.8V
5.2Ah
57Wh
PS E:
10.8V
4.67Ah

Certainly it backs up the 5616 mAh DesignCapacity. But with MaxCapacity at 3128 mAh it means that your battery can only be charged to 55% of its design capacity. Maybe you have some sort of "battery saver" on. Evidently, not charging a battery to 100% and keeping it there is beneficial for the life of the battery. I don't claim to understand the chemistry.
 
How to patch DSDT for working battery status

I was thinking of trying to accommodate your DSDT in the rename patch. But the difficulty is your DSDT has two VID devices, one at _SB.PCI0.VID and another at _SB.PCI0.PEG.VID. You want to rename the first one to _SB.PCI0.IGPU, but not the other one (I think it would likely cause issues). A targeted set of custom patches is appropriate:

Code:
# rename PCI0.VID to PCI0.IGPU
into device label VID parent_label PCI0 set_label begin IGPU end;
into_all all code_regex PCI0.VID replaceall_matched begin PCI0.IGPU end;
into scope label \_SB.PCI0.VID set_label begin \_SB.PCI0.IGPU end;

Tried this caused compile errors so I've manually changed PCI0.VID to PCI0.IGPU and fixed the errors created accordingly.
Looking at it again it looks like they are the same list of errors I got manually changing them...
26 errors
This is where i'm currently at.
 

Attachments

  • 1DSDT-new.aml
    55.3 KB · Views: 210
How to patch DSDT for working battery status

Certainly it backs up the 5616 mAh DesignCapacity. But with MaxCapacity at 3128 mAh it means that your battery can only be charged to 55% of its design capacity. Maybe you have some sort of "battery saver" on. Evidently, not charging a battery to 100% and keeping it there is beneficial for the life of the battery. I don't claim to understand the chemistry.
I've got the bios set to max performance for everything.

This laptop has basically been used plugged in 99% of the time, either in the docking station (which I haven't tested) or plugged in directly.
I've read that this is terrible for batteries so It wouldn't surprise me at all to know that the battery is barely charging to what it was designed to do.
 
Status
Not open for further replies.
Back
Top