Created
November 9, 2012 16:39
-
-
Save Lekensteyn/4046743 to your computer and use it in GitHub Desktop.
ACPI UBIX fix for Toshiba Satellite L750D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ACPI UBIX fix for Toshiba Satellite L750D | |
* https://bbs.archlinux.org/viewtopic.php?id=152543 | |
* | |
* Symptoms: | |
* ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x0000000000000011) is beyond end of object (20120320/exoparg2-418) | |
* ACPI Error: Method parse/execution failed [\_SB_.BAT1.UBIX] (Node ffff880203e8a168), AE_AML_PACKAGE_LIMIT (20120320/psparse-536) | |
* ACPI Error: Method parse/execution failed [\_SB_.BAT1._BIX] (Node ffff880203e8a0f0), AE_AML_PACKAGE_LIMIT (20120320/psparse-536) | |
* ACPI Exception: AE_AML_PACKAGE_LIMIT, Evaluating _BIX (20120320/battery-419) | |
* | |
* Compile with: iasl fix-UBIF-typo.dsl | |
* This will create a fix-UBIF-typo.aml file (from DefinitionBlock below) | |
* modprobe custom_method and mount debugfs. Then write the contents of that | |
* aml file to /sys/kernel/debug/acpi/custom_method. After this, you may safely | |
* rmmod custom_method again. Note: do this before toshiba_laptop or some other | |
* user attempts to access the _BIX method. Also, your kernel will be marked as | |
* tainted. | |
* | |
* Fix by Lekensteyn <[email protected]> | |
*/ | |
DefinitionBlock("fix-UBIF-typo.aml", "SSDT", 1, "", "TOSH BAT", 0x20121109) { | |
External(\_SB.ECOK) | |
External(\_SB.PCI0.LPC0.EC0.BTDC) | |
External(\_SB.PCI0.LPC0.EC0.LFCC) | |
External(\_SB.PCI0.LPC0.EC0.MBVG) | |
External(\_SB.PCI0.LPC0.EC0.BTSN) | |
External(\_SB.PCI0.LPC0.EC0.LION) | |
External(\_SB.PCI0.LPC0.EC0.MCLC) | |
External(\_SB.PCI0.LPC0.EC0.MBPN) | |
External(\_SB.PCI0.LPC0.EC0.MBMN) | |
External(\_SB.BAT1.PBIX) | |
//External(\_SB.BAT1.PBIF) | |
External(\_SB.BAT1.LFCC) | |
External(\ITOS, MethodObj) | |
Method (\_SB.BAT1.UBIX, 0, NotSerialized) { | |
If (ECOK) { | |
Store (^^PCI0.LPC0.EC0.BTDC, Index (PBIX, 0x02)) | |
Store (^^PCI0.LPC0.EC0.LFCC, Index (PBIX, 0x03)) | |
Store (^^PCI0.LPC0.EC0.MBVG, Index (PBIX, 0x05)) | |
Store (^^PCI0.LPC0.EC0.LFCC, Local1) | |
Store (^^PCI0.LPC0.EC0.BTSN, Local5) | |
Store (Local1, LFCC) | |
If (LLess (Local1, 0x0FA0)) { | |
Store (0x64, Index (PBIX, 0x07)) | |
} Else { | |
Store (0xC8, Index (PBIX, 0x07)) | |
} | |
Store (^^PCI0.LPC0.EC0.LION, Local6) | |
If (Local6) { | |
Store ("NiMH", Index (PBIX, 0x12)) | |
} Else { | |
Store ("LION", Index (PBIX, 0x12)) | |
} | |
Store (^^PCI0.LPC0.EC0.MCLC, Index (PBIX, 0x08)) | |
Store (^^PCI0.LPC0.EC0.MBPN, Index (PBIX, 0x10)) | |
Store (^^PCI0.LPC0.EC0.BTSN, Local5) | |
// Fix typo: PBIF -> PBIX, see ACPI spec v5 10.2.2.2 | |
// old: Store (ITOS (ToBCD (Local5)), Index (PBIF, 0x11)) | |
Store (ITOS (ToBCD (Local5)), Index (PBIX, 0x11)) | |
Store (^^PCI0.LPC0.EC0.MBMN, Index (PBIX, 0x13)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment