]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / THERMAL.ASL
diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
new file mode 100644 (file)
index 0000000..e63f5bc
--- /dev/null
@@ -0,0 +1,138 @@
+/**************************************************************************;\r
+;*                                                                        *;\r
+;*                                                                        *;\r
+;*    Intel Corporation - ACPI Reference Code for the Baytrail            *;\r
+;*    Family of Customer Reference Boards.                                *;\r
+;*                                                                        *;\r
+;*                                                                        *;\r
+;*    Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved   *;\r
+;\r
+; This program and the accompanying materials are licensed and made available under\r
+; the terms and conditions of the BSD License that accompanies this distribution.\r
+; The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;*                                                                        *;\r
+;*                                                                        *;\r
+;**************************************************************************/\r
+\r
+\r
+// THERMAL.ASL represents a Thermal Zone to be used for testing on the\r
+// Customer Reference Boards.\r
+\r
+External(\_SB.DPTF.CTOK, MethodObj)\r
+\r
+Scope(\_TZ)\r
+{\r
+\r
+  // Thermal Zone 1 = DTS Thermal Zone.\r
+\r
+  ThermalZone(TZ01)\r
+  {\r
+    // Return the temperature at which the OS must perform a Critcal\r
+    // Shutdown.\r
+\r
+    Method(_CRT,0,Serialized)\r
+    {\r
+      Return(Add(2732,Multiply(CRTT,10)))\r
+    }\r
+\r
+    // Notifies ASL Code the current cooling mode.\r
+    //      0 - Active cooling\r
+    //      1 - Passive cooling\r
+\r
+    Method(_SCP,1,Serialized)\r
+    {\r
+      Store(Arg0,CTYP)\r
+    }\r
+\r
+    // _TMP (Temperature)\r
+    //\r
+    // Return the highest of the CPU temperatures to the OS.\r
+    //\r
+    // Arguments: (0)\r
+    //   None\r
+    // Return Value:\r
+    //   An Integer containing the current temperature of the thermal zone (in tenths of degrees Kelvin)\r
+    //\r
+    Method(_TMP,0,Serialized)\r
+    {\r
+      If(DTSE)\r
+      {\r
+        If(LGreater(DTS2, DTS1))\r
+        {\r
+          Store(DTS2,Local0)\r
+        } else\r
+        {\r
+          Store(DTS1,Local0)\r
+        }\r
+        Return(Add(2732,Multiply(Local0,10)))\r
+        //\r
+        // Else return a static value if both EC and DTS are unavailable.\r
+        //\r
+      } Else\r
+      {\r
+        Return(3000) // (3000-2732)/10 = 26.8 degree C\r
+      }\r
+    }\r
+\r
+    // Return the Processor(s) used for Passive Cooling.\r
+\r
+    Method(_PSL,0,Serialized)\r
+    {\r
+      If(LEqual(MPEN, 4))\r
+      {\r
+        //  CMP - Throttling controls all four logical CPUs.\r
+        Return(Package() {\_PR.CPU0,\_PR.CPU1,\_PR.CPU2,\_PR.CPU3})\r
+      }\r
+\r
+      If(MPEN)\r
+      {\r
+        //  CMP - Throttling controls both CPUs.\r
+\r
+        Return(Package() {\_PR.CPU0,\_PR.CPU1})\r
+      }\r
+\r
+      Return(Package() {\_PR.CPU0})\r
+    }\r
+\r
+    // Returns the temperature at which the OS initiates CPU throttling.\r
+\r
+    Method(_PSV,0,Serialized)\r
+    {\r
+      Return(Add(2732,Multiply(PSVT,10)))\r
+    }\r
+\r
+    // Returns TC1 value used in the passive cooling formula.\r
+\r
+    Method(_TC1,0,Serialized)\r
+    {\r
+      Return(TC1V)\r
+    }\r
+\r
+    // Returns TC2 value used in the passive cooling formula.\r
+\r
+    Method(_TC2,0,Serialized)\r
+    {\r
+      Return(TC2V)\r
+    }\r
+\r
+    // Returns the sampling period used in the passive cooling formula.\r
+\r
+    Method(_TSP,0,Serialized)\r
+    {\r
+      Return(TSPV)\r
+    }\r
+\r
+    // Returns Hot Temperature\r
+\r
+    Method(_HOT,0,Serialized)\r
+    {\r
+      Subtract(CRTT, 5, Local0)\r
+      Return(Add(2732,Multiply(Local0,10)))\r
+    }\r
+  }\r
+}\r