tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / soc / intel / braswell / acpi / dptf / cpu.asl
blobfafd438cca4836c66733e1f2c8bb9e1f942a339a
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2015 Google Inc.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; version 2 of
9  * the License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
17 #ifndef DPTF_CPU_PASSIVE
18 #define DPTF_CPU_PASSIVE        80
19 #endif
21 #ifndef DPTF_CPU_CRITICAL
22 #define DPTF_CPU_CRITICAL       90
23 #endif
25 #ifndef DPTF_CPU_ACTIVE_AC0
26 #define DPTF_CPU_ACTIVE_AC0     90
27 #endif
29 #ifndef DPTF_CPU_ACTIVE_AC1
30 #define DPTF_CPU_ACTIVE_AC1     80
31 #endif
33 #ifndef DPTF_CPU_ACTIVE_AC2
34 #define DPTF_CPU_ACTIVE_AC2     70
35 #endif
37 #ifndef DPTF_CPU_ACTIVE_AC3
38 #define DPTF_CPU_ACTIVE_AC3     60
39 #endif
41 #ifndef DPTF_CPU_ACTIVE_AC4
42 #define DPTF_CPU_ACTIVE_AC4     50
43 #endif
45 External (\_PR.CP00._TSS, MethodObj)
46 External (\_PR.CP00._TPC, MethodObj)
47 External (\_PR.CP00._PTC, PkgObj)
48 External (\_PR.CP00._TSD, PkgObj)
49 External (\_PR.CP00._PSS, MethodObj)
50 External (\_SB.DPTF.CTOK, MethodObj)
52 Device (B0DB)
54         Name (_ADR, 0x000B0000)  /* Bus 0, Device B, Function 0 */
56         Method (_STA)
57         {
58                 If (LEqual (\DPTE, One)) {
59                         Return (0xF)
60                 } Else {
61                         Return (0x0)
62                 }
63         }
65         /*
66          * Processor Throttling Controls
67          */
69         Method (_TSS)
70         {
71                 If (CondRefOf (\_PR.CP00._TSS)) {
72                         Return (\_PR.CP00._TSS)
73                 } Else {
74                         Return (Package ()
75                         {
76                                 Package () { 0, 0, 0, 0, 0 }
77                         })
78                 }
79         }
81         Method (_TPC)
82         {
83                 If (CondRefOf (\_PR.CP00._TPC)) {
84                         Return (\_PR.CP00._TPC)
85                 } Else {
86                         Return (0)
87                 }
88         }
90         Method (_PTC)
91         {
92                 If (CondRefOf (\_PR.CP00._PTC)) {
93                         Return (\_PR.CP00._PTC)
94                 } Else {
95                         Return (Package ()
96                         {
97                                 Buffer () { 0 },
98                                 Buffer () { 0 }
99                         })
100                 }
101         }
103         Method (_TSD)
104         {
105                 If (CondRefOf (\_PR.CP00._TSD)) {
106                         Return (\_PR.CP00._TSD)
107                 } Else {
108                         Return (Package ()
109                         {
110                                 Package () { 5, 0, 0, 0, 0 }
111                         })
112                 }
113         }
115         Method (_TDL)
116         {
117                 If (CondRefOf (\_PR.CP00._TSS)) {
118                         Store (SizeOf (\_PR.CP00._TSS ()), Local0)
119                         Decrement (Local0)
120                         Return (Local0)
121                 } Else {
122                         Return (0)
123                 }
124         }
126         /*
127          * Processor Performance Control
128          */
130         Method (_PPC)
131         {
132                 Return (0)
133         }
135         Method (SPPC, 1)
136         {
137                 Store (Arg0, \PPCM)
139                 /* Notify OS to re-read _PPC limit on each CPU */
140                 \PPCN ()
141         }
143         Method (_PSS)
144         {
145                 If (CondRefOf (\_PR.CP00._PSS)) {
146                         Return (\_PR.CP00._PSS)
147                 } Else {
148                         Return (Package ()
149                         {
150                                 Package () { 0, 0, 0, 0, 0, 0 }
151                         })
152                 }
153         }
155         Method (_PDL)
156         {
157                 /* Check for mainboard specific _PDL override */
158                 If (CondRefOf (\_SB.MPDL)) {
159                         Return (\_SB.MPDL)
160                 } ElseIf (CondRefOf (\_PR.CP00._PSS)) {
161                         Store (SizeOf (\_PR.CP00._PSS ()), Local0)
162                         Decrement (Local0)
163                         Return (Local0)
164                 } Else {
165                         Return (0)
166                 }
167         }
169         /* Return PPCC table defined by mainboard */
170         Method (PPCC)
171         {
172                 Return (\_SB.MPPC)
173         }
175         Method (_CRT)
176         {
177                 Return (\_SB.DPTF.CTOK(DPTF_CPU_CRITICAL))
178         }
180         Method (_PSV)
181         {
182                 Return (\_SB.DPTF.CTOK(DPTF_CPU_PASSIVE))
183         }
185         Method (_AC0)
186         {
187                 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC0))
188         }
190         Method (_AC1)
191         {
192                 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC1))
193         }
195         Method (_AC2)
196         {
197                 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC2))
198         }
200         Method (_AC3)
201         {
202                 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC3))
203         }
205         Method (_AC4)
206         {
207                 Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC4))
208         }