Contribute
Register

Lenovo Ideapad U410 Mountain Lion 90% working

Status
Not open for further replies.
They have to be created for each unique DSDT as it depends on what the DSDT does in the battery methods.



It does not. No doubt the battery methods will fail when called from AppleSmartBatteryManager.kext with non-rollback AppleACPIPlatform.kext.

If you look at _BIF method in Device (BAT0), you will see it calls method UPBI (probably stands for update battery info). And if you look at UPBI , you'll see it access 16-bit registers in EC (EmbeddedControl), B1FC, DICP, DIVO, 128-bit access to SBDN, SBMN.

Same for _BST in Device (BAT0)... calls UPBS (update battery status), which has 16-bit access to MCUR, MBRM, MBVG.

You can look at the ProBook battery patches to see how this kind of access is converted to 8-bit access. For the 128-bit access, it is probably easier to fill in the values with static values and just remove the code that is trying to retrieve from EC. See the PBIF Package inside BAT1 device (it is the package once modified by _BIF that is returned by _BIF).

More information on battery methods can be found in the ACPI spec: http://www.acpi.info/

.
Thanks
I'm assuming you are referring to #6 in your probook guides right. I'll look into it but I think I may just be a bit too ambitious on this one.
 
Thanks
I'm assuming you are referring to #6 in your probook guides right. I'll look into it but I think I may just be a bit too ambitious on this one.

From a quick look at it, here is a start:
Code:
# Need this utility method B1B2(lowbyte, hibyte)... returns ((hibyte << 8) | lowbyte)
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized)\n
{\n
	ShiftLeft (Arg1, 8, Local0)\n
	Or (Arg0, Local0, Local0)\n
	Return (Local0)\n
}\n
end;

# Change EC register declarations from 16-bit to 8-bit
into device label EC0 code_regex B1FC,\s+16 replace_matched begin B1F0, 8, B1F1, 8 end;
into device label EC0 code_regex DICP,\s+16 replace_matched begin DIC0, 8, DIC1, 8 end;
into device label EC0 code_regex DIVO,\s+16 replace_matched begin DIV0, 8, DIV1, 8 end;
into device label EC0 code_regex MCUR,\s+16 replace_matched begin MCU0, 8, MCU1, 8 end;
into device label EC0 code_regex MBRM,\s+16 replace_matched begin MBR0, 8, MBR1, 8 end;
into device label EC0 code_regex MBVG,\s+16 replace_matched begin MBV0, 8, MBV1, 8 end;

# Change access (reads) to those registers from 16-bit to 8-bit
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.B1FC, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.B1F0, ^^PCI0.LPCB.EC0.B1F1), end;
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.DICP, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.DIC0, ^^PCI0.LPCB.EC0.DIC1), end;
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.DIVO, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.DIV0, ^^PCI0.LPCB.EC0.DIV1), end;

into_all method label UPBS code_regex \^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.MCU0, ^^PCI0.LPCB.EC0.MCU1), end;
into_all method label UPBS code_regex \^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.MBR0, ^^PCI0.LPCB.EC0.MBR1), end;
into_all method label UPBS code_regex \^\^PCI0\.LPCB\.EC0\.MBVG, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.MBV0, ^^PCI0.LPCB.EC0.MBV1), end;

into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.SBDN, replaceall_matched begin "L1234", end;
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.SBMN, replaceall_matched begin "S12345678", end;
 
From a quick look at it, here is a start:
Code:
# Need this utility method B1B2(lowbyte, hibyte)... returns ((hibyte << 8) | lowbyte)
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized)\n
{\n
    ShiftLeft (Arg1, 8, Local0)\n
    Or (Arg0, Local0, Local0)\n
    Return (Local0)\n
}\n
end;

# Change EC register declarations from 16-bit to 8-bit
into device label EC0 code_regex B1FC,\s+16 replace_matched begin B1F0, 8, B1F1, 8 end;
into device label EC0 code_regex DICP,\s+16 replace_matched begin DIC0, 8, DIC1, 8 end;
into device label EC0 code_regex DIVO,\s+16 replace_matched begin DIV0, 8, DIV1, 8 end;
into device label EC0 code_regex MCUR,\s+16 replace_matched begin MCU0, 8, MCU1, 8 end;
into device label EC0 code_regex MBRM,\s+16 replace_matched begin MBR0, 8, MBR1, 8 end;
into device label EC0 code_regex MBVG,\s+16 replace_matched begin MBV0, 8, MBV1, 8 end;

# Change access (reads) to those registers from 16-bit to 8-bit
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.B1FC, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.B1F0, ^^PCI0.LPCB.EC0.B1F1), end;
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.DICP, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.DIC0, ^^PCI0.LPCB.EC0.DIC1), end;
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.DIVO, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.DIV0, ^^PCI0.LPCB.EC0.DIV1), end;

into_all method label UPBS code_regex \^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.MCU0, ^^PCI0.LPCB.EC0.MCU1), end;
into_all method label UPBS code_regex \^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.MBR0, ^^PCI0.LPCB.EC0.MBR1), end;
into_all method label UPBS code_regex \^\^PCI0\.LPCB\.EC0\.MBVG, replaceall_matched begin B1B2 (^^PCI0.LPCB.EC0.MBV0, ^^PCI0.LPCB.EC0.MBV1), end;

into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.SBDN, replaceall_matched begin "L1234", end;
into_all method label UPBI code_regex \^\^PCI0\.LPCB\.EC0\.SBMN, replaceall_matched begin "S12345678", end;

thanks for the assistance. TBH, I have no idea how to tell if something is 16 or 8 bit (or 128bit for that matter). Is it if the "Store (xxx, INdex ((yyy, Zero))" ends in Zero then it's 8 bit? or if the store does not have a separate index eg "Store (0x06, ^^PCI0.LPCB.EC0.HIID)" then it's 8bit?

I also noticed that in the _BIF and _BST methods, there are IF commands that also lead to IVBI and IVBS. Do I need to look at those and change those registers from 16bit to 8bit (if any)?

Other than that, I think you've covered all the bases. Am I missing something?
I'll try applying the patch and replace the AppleACPIBatteryManager.kext and AppleACPIPlatform.kext and see if it works.
 
thanks for the assistance. TBH, I have no idea how to tell if something is 16 or 8 bit (or 128bit for that matter). Is it if the "Store (xxx, INdex ((yyy, Zero))" ends in Zero then it's 8 bit? or if the store does not have a separate index eg "Store (0x06, ^^PCI0.LPCB.EC0.HIID)" then it's 8bit?

I also noticed that in the _BIF and _BST methods, there are IF commands that also lead to IVBI and IVBS. Do I need to look at those and change those registers from 16bit to 8bit (if any)?

Other than that, I think you've covered all the bases. Am I missing something?
I'll try applying the patch and replace the AppleACPIBatteryManager.kext and AppleACPIPlatform.kext and see if it works.

Definition of EmbeddedControl fields:
Code:
            OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF)
            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                DSBY,   1, 
                ENGA,   1, 
.
.
.

                MCUR,   16, 
                MBRM,   16, 
                MBVG,   16, 
...
            }

            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                Offset (0xA0), 
                DICP,   16, 
                DIVO,   16
            }

            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                Offset (0xA0), 
                SBDN,   128
            }

            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                Offset (0xA0), 
                SBMN,   128
            }

If you look at the definitions of those things you'll find that ECOK is defined as Name. That means it is a global variable and is in RAM (managed by ACPI interpreter/virtual machine engine, AppleACPIPlatform.kext), not EC registers. And MBTS is a 1-bit EC register so it is fine too.
 
Thanks.

Somehow I don't have the latest apple version of AppleACPIBatteryManager.kext and I can't find it in the combo update. Does anyone know what the latest version of this kext is and which release it came from?



Definition of EmbeddedControl fields:
Code:
            OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF)
            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                DSBY,   1, 
                ENGA,   1, 
.
.
.

                MCUR,   16, 
                MBRM,   16, 
                MBVG,   16, 
...
            }

            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                Offset (0xA0), 
                DICP,   16, 
                DIVO,   16
            }

            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                Offset (0xA0), 
                SBDN,   128
            }

            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                Offset (0xA0), 
                SBMN,   128
            }

If you look at the definitions of those things you'll find that ECOK is defined as Name. That means it is a global variable and is in RAM (managed by ACPI interpreter/virtual machine engine, AppleACPIPlatform.kext), not EC registers. And MBTS is a 1-bit EC register so it is fine too.
 
Thanks.

Somehow I don't have the latest apple version of AppleACPIBatteryManager.kext and I can't find it in the combo update. Does anyone know what the latest version of this kext is and which release it came from?

AppleACPIBatteryManager.kext is not part of OS X. But... don't use AppleACPIBatteryManager.kext.

Replace the Apple provided AppleSmartBatteryManager.kext with the ACPI compliant version. Current version is my kext: https://github.com/RehabMan/OS-X-ACPI-Battery-Driver
 
AppleACPIBatteryManager.kext is not part of OS X. But... don't use AppleACPIBatteryManager.kext.

Replace the Apple provided AppleSmartBatteryManager.kext with the ACPI compliant version. Current version is my kext: https://github.com/RehabMan/OS-X-ACPI-Battery-Driver


got it. thanks for your help.
1) will delete AppleACPIBatteryManager.kext
2) replace AppleSmartBatteryManager.kext with yours
3) use the 10.8.4 AppleACPIPlatform.kext

One thing I noticed is the fan being louder (or used more frequently) after applying these changes.

getting closer to a 'vanilla' install.
 
got it. thanks for your help.
1) will delete AppleACPIBatteryManager.kext
2) replace AppleSmartBatteryManager.kext with yours
3) use the 10.8.4 AppleACPIPlatform.kext

One thing I noticed is the fan being louder (or used more frequently) after applying these changes.

Probably just spotlight re-indexing things.

getting closer to a 'vanilla' install.

Yes, it is best to keep things clean using the minimum number of patches and especially rollbacks...
 
Yes, it is best to keep things clean using the minimum number of patches and especially rollbacks...

Yes, I know i cant get to pure vanilla with just dsdt changes but i'm hoping the upgrade to mavericks will be smoother.

You mentioned that AppleIntelCPUPowerManagement.kext is patched. I'd it a generic patch where anyone can use or specific to a machine.
 
Status
Not open for further replies.
Back
Top