• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3// Thermal Zone
4
5Scope (\_TZ)
6{
7	ThermalZone (THRM)
8	{
9		// TODO These could/should be read from the
10		// GNVS area, so they can be controlled by
11		// coreboot
12		Name(TC1V, 0x00)
13		Name(TC2V, 0x0a)
14		Name(TSPV, 0x32)
15
16
17		// Convert from °C to 1/10 Kelvin
18		Method(DEGR, 1, NotSerialized)
19		{
20			Local0 = Arg0
21			// 10ths of degrees
22			Local0 *= 10
23			// 0°C is 273.15 K, we need to round it.
24			Local0 += 2732
25			Return(Local0)
26		}
27
28		// At which temperature should the OS start
29		// active cooling?
30		Method (_AC0, 0, Serialized)
31		{
32			Return (0xf5c) // Value for Rocky
33		}
34
35		// Critical shutdown temperature
36		Method (_CRT, 0, Serialized)
37		{
38			Local0 = \_SB.PCI0.LPCB.EC0.CRTT
39			Local0 = DEGR (Local0)
40			Return(Local0)
41		}
42
43		// CPU throttling start temperature
44		Method (_PSV, 0, Serialized)
45		{
46			Local0 = \_SB.PCI0.LPCB.EC0.CTRO
47			Local0 = DEGR (Local0)
48			Return(Local0)
49		}
50
51		// Get DTS Temperature
52		Method (_TMP, 0, Serialized)
53		{
54			Local0 = \_SB.PCI0.LPCB.EC0.CTMP
55			Local0 = DEGR (Local0)
56			Return(Local0)
57		}
58
59		// Processors used for active cooling
60		Method (_PSL, 0, Serialized)
61		{
62			If (MPEN) {
63				Return (Package() {\_SB.CP00, \_SB.CP01})
64			}
65			Return (Package() {\_SB.CP00})
66		}
67
68		// TC1 value for passive cooling
69		Method (_TC1, 0, Serialized)
70		{
71			Return (TC1V)
72		}
73
74		// TC2 value for passive cooling
75		Method (_TC2, 0, Serialized)
76		{
77			Return (TC2V)
78		}
79
80		// Sampling period for passive cooling
81		Method (_TSP, 0, Serialized)
82		{
83			Return (TSPV)
84		}
85	}
86}
87