]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Vlv2DeviceRefCodePkg/ValleyView2Soc/CPU/PowerManagement/AcpiTables/Ssdt/Cpu0Tst.asl
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / ValleyView2Soc / CPU / PowerManagement / AcpiTables / Ssdt / Cpu0Tst.asl
diff --git a/Vlv2DeviceRefCodePkg/ValleyView2Soc/CPU/PowerManagement/AcpiTables/Ssdt/Cpu0Tst.asl b/Vlv2DeviceRefCodePkg/ValleyView2Soc/CPU/PowerManagement/AcpiTables/Ssdt/Cpu0Tst.asl
new file mode 100644 (file)
index 0000000..e535c93
--- /dev/null
@@ -0,0 +1,241 @@
+/*-----------------------------------------------------------------------------\r
+-------------------------------------------------------------------------------\r
+\r
+\r
+ Intel Silvermont Processor Power Management BIOS Reference Code\r
+\r
+ Copyright (c) 2006 - 2014, Intel Corporation\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
+ Filename:      CPU0TST.ASL\r
+\r
+ Revision:      Refer to Readme\r
+\r
+ Date:          Refer to Readme\r
+\r
+--------------------------------------------------------------------------------\r
+-------------------------------------------------------------------------------\r
+\r
+ This Processor Power Management BIOS Source Code is furnished under license\r
+ and may only be used or copied in accordance with the terms of the license.\r
+ The information in this document is furnished for informational use only, is\r
+ subject to change without notice, and should not be construed as a commitment\r
+ by Intel Corporation. Intel Corporation assumes no responsibility or liability\r
+ for any errors or inaccuracies that may appear in this document or any\r
+ software that may be provided in association with this document.\r
+\r
+ Except as permitted by such license, no part of this document may be\r
+ reproduced, stored in a retrieval system, or transmitted in any form or by\r
+ any means without the express written consent of Intel Corporation.\r
+\r
+ WARNING: You are authorized and licensed to install and use this BIOS code\r
+ ONLY on an IST PC. This utility may damage any system that does not\r
+ meet these requirements.\r
+\r
+        An IST PC is a computer which\r
+        (1) Is capable of seamlessly and automatically transitioning among\r
+        multiple performance states (potentially operating at different\r
+        efficiency ratings) based upon power source changes, end user\r
+        preference, processor performance demand, and thermal conditions; and\r
+        (2) Includes an Intel Pentium II processors, Intel Pentium III\r
+        processor, Mobile Intel Pentium III Processor-M, Mobile Intel Pentium 4\r
+        Processor-M, Intel Pentium M Processor, or any other future Intel\r
+        processors that incorporates the capability to transition between\r
+        different performance states by altering some, or any combination of,\r
+        the following processor attributes: core voltage, core frequency, bus\r
+        frequency, number of processor cores available, or any other attribute\r
+        that changes the efficiency (instructions/unit time-power) at which the\r
+        processor operates.\r
+\r
+-------------------------------------------------------------------------------\r
+-------------------------------------------------------------------------------\r
+\r
+NOTES:\r
+        (1) <TODO> - IF the trap range and port definitions do not match those\r
+        specified by this reference code, this file must be modified IAW the\r
+        individual implmentation.\r
+\r
+--------------------------------------------------------------------------------\r
+------------------------------------------------------------------------------*/\r
+\r
+DefinitionBlock(\r
+        "CPU0TST.aml",\r
+        "SSDT",\r
+        0x01,\r
+        "PmRef",\r
+        "Cpu0Tst",\r
+        0x3000\r
+        )\r
+{\r
+        External(\_PR.CPU0, DeviceObj)\r
+        External(PDC0)\r
+        External(CFGD)\r
+        External(_PSS)\r
+\r
+        Scope(\_PR.CPU0)\r
+        {\r
+                Name(_TPC, 0)   // All T-States are available\r
+\r
+                //\r
+                // T-State Control/Status interface\r
+                //\r
+                Method(_PTC, 0)\r
+                {\r
+                        //\r
+                        // IF OSPM is capable of direct access to MSR\r
+                        //    Report MSR interface\r
+                        // ELSE\r
+                        //    Report I/O interface\r
+                        //\r
+                        //  PDCx[2] = OSPM is capable of direct access to On\r
+                        //              Demand throttling MSR\r
+                        //\r
+                        If(And(PDC0, 0x0004)) {\r
+                                Return(Package() {\r
+                                        ResourceTemplate(){Register(FFixedHW, 0, 0, 0)},\r
+                                        ResourceTemplate(){Register(FFixedHW, 0, 0, 0)}\r
+                                })\r
+                        }\r
+\r
+                }\r
+\r
+                // _TSS package for I/O port based T-State control\r
+                // "Power" fields are replaced with real values by the first\r
+                // call of _TSS method.\r
+                //\r
+                Name(TSSI, Package() {\r
+                                Package(){100, 1000, 0, 0x00, 0},\r
+                                Package(){ 88,  875, 0, 0x0F, 0},\r
+                                Package(){ 75,  750, 0, 0x0E, 0},\r
+                                Package(){ 63,  625, 0, 0x0D, 0},\r
+                                Package(){ 50,  500, 0, 0x0C, 0},\r
+                                Package(){ 38,  375, 0, 0x0B, 0},\r
+                                Package(){ 25,  250, 0, 0x0A, 0},\r
+                                Package(){ 13,  125, 0, 0x09, 0}\r
+                })\r
+\r
+                // _TSS package for MSR based T-State control\r
+                // "Power" fields are replaced with real values by the first\r
+                // call of _TSS method.\r
+                //\r
+                Name(TSSM, Package() {\r
+                                Package(){100, 1000, 0, 0x00, 0},\r
+                                Package(){ 88,  875, 0, 0x1E, 0},\r
+                                Package(){ 75,  750, 0, 0x1C, 0},\r
+                                Package(){ 63,  625, 0, 0x1A, 0},\r
+                                Package(){ 50,  500, 0, 0x18, 0},\r
+                                Package(){ 38,  375, 0, 0x16, 0},\r
+                                Package(){ 25,  250, 0, 0x14, 0},\r
+                                Package(){ 13,  125, 0, 0x12, 0}\r
+                })\r
+\r
+                Name(TSSF, 0)   // Flag for TSSI/TSSM initialization\r
+\r
+                Method(_TSS, 0)\r
+                {\r
+                        // Update "Power" fields of TSSI/TSSM with the LFM\r
+                        // power data IF _PSS is available\r
+                        //\r
+                        IF (LAnd(LNot(TSSF),CondRefOf(_PSS)))\r
+                        {\r
+                                Store(_PSS, Local0)\r
+                                Store(SizeOf(Local0), Local1)   // _PSS size\r
+                                Decrement(Local1)               // Index of LFM\r
+                                Store(DerefOf(Index(DerefOf(Index(Local0,Local1)),1)), Local2)  // LFM Power\r
+\r
+                                Store(0, Local3)\r
+                                While(LLess(Local3, SizeOf(TSSI)))\r
+                                {\r
+                                        Store(Divide(Multiply(Local2, Subtract(8, Local3)), 8),\r
+                                              Local4)           // Power for this TSSI/TSSM entry\r
+                                        Store(Local4,Index(DerefOf(Index(TSSI,Local3)),1))\r
+                                        Store(Local4,Index(DerefOf(Index(TSSM,Local3)),1))\r
+                                        Increment(Local3)\r
+                                }\r
+                                Store(Ones, TSSF)               // TSSI/TSSM are updated\r
+                        }\r
+                        //\r
+                        // IF OSPM is capable of direct access to MSR\r
+                        //    Report TSSM\r
+                        // ELSE\r
+                        //    Report TSSI\r
+                        //\r
+                        If(And(PDC0, 0x0004))\r
+                        {\r
+                                Return(TSSM)\r
+                        }\r
+                        Return(TSSI)\r
+                }\r
+\r
+              Method(_TDL, 0)\r
+              {\r
+                Store ("Cpu0: _TDL Called", Debug)\r
+                Name ( LFMI, 0)\r
+                Store (SizeOf(TSSM), LFMI)\r
+                Decrement(LFMI)    // Index of LFM entry in TSSM\r
+                Return(LFMI)\r
+              }\r
+\r
+                //\r
+                // T-State Dependency\r
+                //\r
+                Method(_TSD, 0)\r
+                {\r
+                        //\r
+      // IF four cores are supported/enabled && !(direct access to MSR)\r
+                        //    Report 4 processors and SW_ANY as the coordination type\r
+      // ELSE IF two cores are supported/enabled && !(direct access to MSR)\r
+                        //    Report 2 processors and SW_ANY as the coordination type\r
+                        // ELSE\r
+                        //   Report 1 processor and SW_ALL as the coordination type\r
+                        //\r
+                        //  CFGD[23] = Four cores enabled\r
+                        //  CFGD[24] = Two or more cores enabled\r
+                        //  PDCx[2] = OSPM is capable of direct access to On\r
+                        //              Demand throttling MSR\r
+                        //\r
+                        If(LAnd(And(CFGD,0x0800000),LNot(And(PDC0,4))))\r
+                        {\r
+                                Return(Package(){       // SW_ANY\r
+                                        Package(){\r
+                                                5,                // # entries.\r
+                                                0,                // Revision.\r
+                                                0,                // Domain #.\r
+                                                0xFD,           // Coord Type- SW_ANY\r
+                                                4                   // # processors.\r
+                                        }\r
+                                })\r
+                        }\r
+                        If(LAnd(And(CFGD,0x1000000),LNot(And(PDC0,4))))\r
+                        {\r
+                                Return(Package(){       // SW_ANY\r
+                                        Package(){\r
+                                                5,                // # entries.\r
+                                                0,                // Revision.\r
+                                                0,                // Domain #.\r
+                                                0xFD,           // Coord Type- SW_ANY\r
+                                                2                   // # processors.\r
+                                        }\r
+                                })\r
+                        }\r
+                        Return(Package(){               // SW_ALL\r
+                                Package(){\r
+                                        5,                        // # entries.\r
+                                        0,                        // Revision.\r
+                                        0,                        // Domain #.\r
+                                        0xFC,                   // Coord Type- SW_ALL\r
+                                        1                           // # processors.\r
+                                }\r
+                        })\r
+                }\r
+        }\r
+} // End of Definition Block\r
+\r