User Tools

Site Tools


asusformulahacking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

asusformulahacking [2018/09/01 08:50] (current)
Ondřej Lysoněk Copied content from lm-sensors.org
Line 1: Line 1:
 +===== Hacking right formulas for ASUS boards =====
 +
 +***This article needs to be extended/​fixed Please help! ***
 +
 +***Please note: this page is essentially obsolete, these days you really should use the asus_atk0110 driver for these Asus motherboards implementing the ATK0110 ACPI device.***
 +
 +Recent ASUS motherboards contain special acpi device ATK110. ASUS has implemented ACPI methods for obtaining the temps, voltages and fanspeeds plus smart fan control plus overclocking stuff.
 +
 +It seems those features are in all ASUS AI NOS or proactive motherboards.
 +
 +There is one virtual device in APCI namespace called ASOC
 +
 +<​code>​
 +Device (ASOC)
 +            {
 +                Name (_HID, "​ATK0110"​)
 +                Name (_UID, 0x01010110)
 +</​code>​
 +
 +When this device is present it exposes some methods to read the monitored values and also to ENUMERATE what is
 +supported on that motheboard.
 +
 +We can read the conversion formulas and labels from the disassembled ACPI bytecode. Here is how to get the ACPI methods.
 +
 +  - You need ACPI compiler/​disassembler. Get it [[http://​www.acpica.org/​downloads/​|here]]
 +  - downloand and compile. ''​cd compiler; make;''​ "​iasl"​ binary will be created.
 +  - The DSDT table from motherboard. ''​cat /​proc/​acpi/​dsdt > /​tmp/​dsdt.bin''​
 +  - Run the ''​./​iasl''​ with ''​-dc''​ parameter
 +
 +<​code>​
 +./iasl -dc dsdt.bin
 +</​code>​
 +
 +It will produce output file called dsdt.dsl. There are those ACPI methods. I will present it for voltages (for fans, temps it is similar)
 +<​code>​
 +Method (VSIF, 0, NotSerialized)
 +</​code>​
 +Returns a structure of suppored monitoring objects
 +<​code>​
 + Name (VBUF, Package (0x05)
 +                {
 +                    0x04,
 +                    VCRE,
 +                    V333,
 +                    V500,
 +                    V120 }
 +</​code>​
 +Like this.
 +
 +Each member has following fields:
 +<​code>​
 +Name (V500, Package (0x05)
 +                {
 +                    0x06020002,
 +                    " +5.0 Voltage",​
 +                    0x1194,
 +                    0x157C,
 +                    0x01
 +                })
 +</​code>​
 +You can see ID, label, limits
 +
 +So when you know the IDS and names you can just call a method that will give you actual value:
 +<​code>​
 +Method (RVLT, 1, NotSerialized)
 +</​code>​
 +
 +Like this Just call with ID.
 +Return value is integer in mV with the actual value. As you can see it is not complicated.
 +
 +You can use this RVLT method to dig for the conversion formulas, because they are there too:
 +
 +<​code>​
 +  Store (DerefOf (Index (V120, 0x00)), Local0)
 +                    If (LEqual (Arg0, Local0))
 +                    {
 +                        Store (V12V, Local0)
 +                        Store (0x38, Local1)
 +                        Add (0x0A, Local1, Local1)
 +                        Multiply (Local1, 0x08, Local1)
 +                        Multiply (Local0, Local1, Local0)
 +                        Divide (Local0, 0x0A, Local3, Local0)
 +                        Return (Local0)
 +                    }
 +</​code>​
 +This is the formula for 12V. V12V is register name. Some hints:
 +<​code>​
 +Store (0x38, Local1) -> Local1 = 0x38
 +Add (0x0A, Local1, LocalX) -> LocalX = Local1 + 0xA
 +Divide (Local0, 0x0A, Local3, LocalX) -> LocalX = Local0 / 0xA (FIXME local3)
 +</​code>​
 +
 +
 +
 +
 +
 +
 +
 +
 +You may find in other place of the file in a register mapping structure. Looks like:
 +<​code>​
 +...
 +                           ​Offset (0x20), ​                                                         ​
 +                    VCOR,   ​8, ​                                                                     ​
 +                    V33V,   ​8, ​                                                                     ​
 +                            Offset (0x23), ​                                                         ​
 +                    V50V,   ​8, ​                                                                     ​
 +                    V12V,   ​8, ​                                                                     ​
 +                       ​Offset (0x29), ​
 +...
 +</​code>​
 +
 +So V12V is is in register 0x24.
  
asusformulahacking.txt · Last modified: 2018/09/01 08:50 by Ondřej Lysoněk