blob: 728d09478d1af6aa7aae8640bfac35d440c39396 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Shawn Nematbakhsh3bad4cb2015-08-25 18:03:31 -07002
3#ifndef DPTF_CPU_PASSIVE
4#define DPTF_CPU_PASSIVE 80
5#endif
6
7#ifndef DPTF_CPU_CRITICAL
8#define DPTF_CPU_CRITICAL 90
9#endif
10
11#ifndef DPTF_CPU_ACTIVE_AC0
12#define DPTF_CPU_ACTIVE_AC0 90
13#endif
14
15#ifndef DPTF_CPU_ACTIVE_AC1
16#define DPTF_CPU_ACTIVE_AC1 80
17#endif
18
19#ifndef DPTF_CPU_ACTIVE_AC2
20#define DPTF_CPU_ACTIVE_AC2 70
21#endif
22
23#ifndef DPTF_CPU_ACTIVE_AC3
24#define DPTF_CPU_ACTIVE_AC3 60
25#endif
26
27#ifndef DPTF_CPU_ACTIVE_AC4
28#define DPTF_CPU_ACTIVE_AC4 50
29#endif
30
Christian Walterbe3979c2019-12-18 15:07:59 +010031External (\_SB.CP00._TSS, MethodObj)
32External (\_SB.CP00._TPC, MethodObj)
33External (\_SB.CP00._PTC, PkgObj)
34External (\_SB.CP00._TSD, PkgObj)
35External (\_SB.CP00._PSS, MethodObj)
Lee Leahy77ff0b12015-05-05 15:07:29 -070036
Lee Leahy32471722015-04-20 15:20:28 -070037Device (B0DB)
Lee Leahy77ff0b12015-05-05 15:07:29 -070038{
Lee Leahy32471722015-04-20 15:20:28 -070039 Name (_ADR, 0x000B0000) /* Bus 0, Device B, Function 0 */
Lee Leahy77ff0b12015-05-05 15:07:29 -070040
41 Method (_STA)
42 {
Felix Singer7b8ac002022-12-26 08:45:56 +010043 If (\DPTE == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070044 Return (0xF)
45 } Else {
46 Return (0x0)
47 }
48 }
49
50 /*
51 * Processor Throttling Controls
52 */
53
54 Method (_TSS)
55 {
Christian Walterbe3979c2019-12-18 15:07:59 +010056 If (CondRefOf (\_SB.CP00._TSS)) {
57 Return (\_SB.CP00._TSS)
Lee Leahy77ff0b12015-05-05 15:07:29 -070058 } Else {
59 Return (Package ()
60 {
61 Package () { 0, 0, 0, 0, 0 }
62 })
63 }
64 }
65
66 Method (_TPC)
67 {
Christian Walterbe3979c2019-12-18 15:07:59 +010068 If (CondRefOf (\_SB.CP00._TPC)) {
69 Return (\_SB.CP00._TPC)
Lee Leahy77ff0b12015-05-05 15:07:29 -070070 } Else {
71 Return (0)
72 }
73 }
74
75 Method (_PTC)
76 {
Christian Walterbe3979c2019-12-18 15:07:59 +010077 If (CondRefOf (\_SB.CP00._PTC)) {
78 Return (\_SB.CP00._PTC)
Lee Leahy77ff0b12015-05-05 15:07:29 -070079 } Else {
80 Return (Package ()
81 {
82 Buffer () { 0 },
83 Buffer () { 0 }
84 })
85 }
86 }
87
88 Method (_TSD)
89 {
Christian Walterbe3979c2019-12-18 15:07:59 +010090 If (CondRefOf (\_SB.CP00._TSD)) {
91 Return (\_SB.CP00._TSD)
Lee Leahy77ff0b12015-05-05 15:07:29 -070092 } Else {
93 Return (Package ()
94 {
95 Package () { 5, 0, 0, 0, 0 }
96 })
97 }
98 }
99
100 Method (_TDL)
101 {
Christian Walterbe3979c2019-12-18 15:07:59 +0100102 If (CondRefOf (\_SB.CP00._TSS)) {
Felix Singer84e61232022-12-12 07:39:15 +0100103 Local0 = SizeOf (\_SB.CP00._TSS ())
Felix Singer43b57302022-12-11 21:46:42 +0100104 Local0--
Lee Leahy77ff0b12015-05-05 15:07:29 -0700105 Return (Local0)
106 } Else {
107 Return (0)
108 }
109 }
110
111 /*
112 * Processor Performance Control
113 */
114
115 Method (_PPC)
116 {
117 Return (0)
118 }
119
120 Method (SPPC, 1)
121 {
Felix Singer84e61232022-12-12 07:39:15 +0100122 \PPCM = Arg0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700123
124 /* Notify OS to re-read _PPC limit on each CPU */
125 \PPCN ()
126 }
127
128 Method (_PSS)
129 {
Christian Walterbe3979c2019-12-18 15:07:59 +0100130 If (CondRefOf (\_SB.CP00._PSS)) {
131 Return (\_SB.CP00._PSS)
Lee Leahy77ff0b12015-05-05 15:07:29 -0700132 } Else {
133 Return (Package ()
134 {
135 Package () { 0, 0, 0, 0, 0, 0 }
136 })
137 }
138 }
139
140 Method (_PDL)
141 {
142 /* Check for mainboard specific _PDL override */
143 If (CondRefOf (\_SB.MPDL)) {
144 Return (\_SB.MPDL)
Christian Walterbe3979c2019-12-18 15:07:59 +0100145 } ElseIf (CondRefOf (\_SB.CP00._PSS)) {
Felix Singer84e61232022-12-12 07:39:15 +0100146 Local0 = SizeOf (\_SB.CP00._PSS ())
Felix Singer43b57302022-12-11 21:46:42 +0100147 Local0--
Lee Leahy77ff0b12015-05-05 15:07:29 -0700148 Return (Local0)
149 } Else {
150 Return (0)
151 }
152 }
153
154 /* Return PPCC table defined by mainboard */
155 Method (PPCC)
156 {
157 Return (\_SB.MPPC)
158 }
Shawn Nematbakhsh3bad4cb2015-08-25 18:03:31 -0700159
Lee Leahy77ff0b12015-05-05 15:07:29 -0700160 Method (_CRT)
161 {
Lee Leahy32471722015-04-20 15:20:28 -0700162 Return (\_SB.DPTF.CTOK(DPTF_CPU_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700163 }
Lee Leahy77ff0b12015-05-05 15:07:29 -0700164
Lee Leahy77ff0b12015-05-05 15:07:29 -0700165 Method (_PSV)
166 {
Lee Leahy32471722015-04-20 15:20:28 -0700167 Return (\_SB.DPTF.CTOK(DPTF_CPU_PASSIVE))
168 }
Lee Leahy32471722015-04-20 15:20:28 -0700169
Lee Leahy32471722015-04-20 15:20:28 -0700170 Method (_AC0)
171 {
172 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC0))
173 }
Lee Leahy32471722015-04-20 15:20:28 -0700174
Lee Leahy32471722015-04-20 15:20:28 -0700175 Method (_AC1)
176 {
177 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC1))
178 }
Lee Leahy32471722015-04-20 15:20:28 -0700179
Lee Leahy32471722015-04-20 15:20:28 -0700180 Method (_AC2)
181 {
182 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC2))
183 }
Lee Leahy32471722015-04-20 15:20:28 -0700184
Lee Leahy32471722015-04-20 15:20:28 -0700185 Method (_AC3)
186 {
187 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC3))
188 }
Lee Leahy32471722015-04-20 15:20:28 -0700189
Lee Leahy32471722015-04-20 15:20:28 -0700190 Method (_AC4)
191 {
192 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC4))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700193 }
Lee Leahy77ff0b12015-05-05 15:07:29 -0700194}