Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Shawn Nematbakhsh | 3bad4cb | 2015-08-25 18:03:31 -0700 | [diff] [blame] | 2 | |
| 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 Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 31 | External (\_SB.CP00._TSS, MethodObj) |
| 32 | External (\_SB.CP00._TPC, MethodObj) |
| 33 | External (\_SB.CP00._PTC, PkgObj) |
| 34 | External (\_SB.CP00._TSD, PkgObj) |
| 35 | External (\_SB.CP00._PSS, MethodObj) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 36 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 37 | Device (B0DB) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 38 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 39 | Name (_ADR, 0x000B0000) /* Bus 0, Device B, Function 0 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 40 | |
| 41 | Method (_STA) |
| 42 | { |
Felix Singer | 7b8ac00 | 2022-12-26 08:45:56 +0100 | [diff] [blame^] | 43 | If (\DPTE == 1) { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 44 | Return (0xF) |
| 45 | } Else { |
| 46 | Return (0x0) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /* |
| 51 | * Processor Throttling Controls |
| 52 | */ |
| 53 | |
| 54 | Method (_TSS) |
| 55 | { |
Christian Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 56 | If (CondRefOf (\_SB.CP00._TSS)) { |
| 57 | Return (\_SB.CP00._TSS) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 58 | } Else { |
| 59 | Return (Package () |
| 60 | { |
| 61 | Package () { 0, 0, 0, 0, 0 } |
| 62 | }) |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | Method (_TPC) |
| 67 | { |
Christian Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 68 | If (CondRefOf (\_SB.CP00._TPC)) { |
| 69 | Return (\_SB.CP00._TPC) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 70 | } Else { |
| 71 | Return (0) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | Method (_PTC) |
| 76 | { |
Christian Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 77 | If (CondRefOf (\_SB.CP00._PTC)) { |
| 78 | Return (\_SB.CP00._PTC) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 79 | } Else { |
| 80 | Return (Package () |
| 81 | { |
| 82 | Buffer () { 0 }, |
| 83 | Buffer () { 0 } |
| 84 | }) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | Method (_TSD) |
| 89 | { |
Christian Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 90 | If (CondRefOf (\_SB.CP00._TSD)) { |
| 91 | Return (\_SB.CP00._TSD) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 92 | } Else { |
| 93 | Return (Package () |
| 94 | { |
| 95 | Package () { 5, 0, 0, 0, 0 } |
| 96 | }) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | Method (_TDL) |
| 101 | { |
Christian Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 102 | If (CondRefOf (\_SB.CP00._TSS)) { |
Felix Singer | 84e6123 | 2022-12-12 07:39:15 +0100 | [diff] [blame] | 103 | Local0 = SizeOf (\_SB.CP00._TSS ()) |
Felix Singer | 43b5730 | 2022-12-11 21:46:42 +0100 | [diff] [blame] | 104 | Local0-- |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 105 | 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 Singer | 84e6123 | 2022-12-12 07:39:15 +0100 | [diff] [blame] | 122 | \PPCM = Arg0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 123 | |
| 124 | /* Notify OS to re-read _PPC limit on each CPU */ |
| 125 | \PPCN () |
| 126 | } |
| 127 | |
| 128 | Method (_PSS) |
| 129 | { |
Christian Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 130 | If (CondRefOf (\_SB.CP00._PSS)) { |
| 131 | Return (\_SB.CP00._PSS) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 132 | } 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 Walter | be3979c | 2019-12-18 15:07:59 +0100 | [diff] [blame] | 145 | } ElseIf (CondRefOf (\_SB.CP00._PSS)) { |
Felix Singer | 84e6123 | 2022-12-12 07:39:15 +0100 | [diff] [blame] | 146 | Local0 = SizeOf (\_SB.CP00._PSS ()) |
Felix Singer | 43b5730 | 2022-12-11 21:46:42 +0100 | [diff] [blame] | 147 | Local0-- |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 148 | 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 Nematbakhsh | 3bad4cb | 2015-08-25 18:03:31 -0700 | [diff] [blame] | 159 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 160 | Method (_CRT) |
| 161 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 162 | Return (\_SB.DPTF.CTOK(DPTF_CPU_CRITICAL)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 163 | } |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 164 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 165 | Method (_PSV) |
| 166 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 167 | Return (\_SB.DPTF.CTOK(DPTF_CPU_PASSIVE)) |
| 168 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 169 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 170 | Method (_AC0) |
| 171 | { |
| 172 | Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC0)) |
| 173 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 174 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 175 | Method (_AC1) |
| 176 | { |
| 177 | Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC1)) |
| 178 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 179 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 180 | Method (_AC2) |
| 181 | { |
| 182 | Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC2)) |
| 183 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 184 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 185 | Method (_AC3) |
| 186 | { |
| 187 | Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC3)) |
| 188 | } |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 189 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 190 | Method (_AC4) |
| 191 | { |
| 192 | Return (\_SB.DPTF.CTOK(DPTF_CPU_ACTIVE_AC4)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 193 | } |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 194 | } |