Angel Pons | 2de6bdf | 2020-04-05 13:21:00 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 2 | |
| 3 | #define DPTF_TSR0_SENSOR_ID 0 |
| 4 | #define DPTF_TSR0_SENSOR_NAME "TMP432_CPU" |
| 5 | |
| 6 | #define DPTF_TSR1_SENSOR_ID 1 |
| 7 | #define DPTF_TSR1_SENSOR_NAME "TMP432_WLAN" |
| 8 | |
| 9 | #define DPTF_TSR2_SENSOR_ID 2 |
| 10 | #define DPTF_TSR2_SENSOR_NAME "TMP432_CHARGER" |
| 11 | |
| 12 | #define DPTF_TERRA2_TSR0_PASSIVE 60 |
| 13 | #define DPTF_TERRA2_TSR0_CRITICAL 75 |
| 14 | |
| 15 | #define DPTF_TERRA2_TSR1_PASSIVE 53 |
| 16 | #define DPTF_TERRA2_TSR1_CRITICAL 75 |
| 17 | |
| 18 | #define DPTF_TERRA2_TSR2_PASSIVE 53 |
| 19 | #define DPTF_TERRA2_TSR2_CRITICAL 75 |
| 20 | |
| 21 | #define DPTF_TERRA3_TSR0_PASSIVE 50 |
| 22 | #define DPTF_TERRA3_TSR0_CRITICAL 75 |
| 23 | |
| 24 | #define DPTF_TERRA3_TSR1_PASSIVE 52 |
| 25 | #define DPTF_TERRA3_TSR1_CRITICAL 75 |
| 26 | |
| 27 | #define DPTF_TERRA3_TSR2_PASSIVE 53 |
| 28 | #define DPTF_TERRA3_TSR2_CRITICAL 75 |
| 29 | |
| 30 | #define DPTF_ENABLE_CHARGER |
| 31 | |
| 32 | /* Terra2 - Charger performance states, board-specific values from charger and EC */ |
| 33 | Name (CPT2, Package () { |
| 34 | Package () { 0, 0, 0, 0, 255, 0x6a4, "mA", 0 }, /* 1.7A (MAX) */ |
| 35 | Package () { 0, 0, 0, 0, 24, 0x320, "mA", 0 }, /* 0.8A */ |
| 36 | Package () { 0, 0, 0, 0, 16, 0x258, "mA", 0 }, /* 0.6A */ |
| 37 | Package () { 0, 0, 0, 0, 8, 0x190, "mA", 0 }, /* 0.4A */ |
| 38 | Package () { 0, 0, 0, 0, 0, 0x64, "mA", 0 }, /* 0.1A */ |
| 39 | }) |
| 40 | |
| 41 | /* Terra3 - Charger performance states, board-specific values from charger and EC */ |
| 42 | Name (CPT3, Package () { |
| 43 | Package () { 0, 0, 0, 0, 255, 0x6a4, "mA", 0 }, /* 1.7A (MAX) */ |
| 44 | Package () { 0, 0, 0, 0, 24, 0x320, "mA", 0 }, /* 0.8A */ |
| 45 | Package () { 0, 0, 0, 0, 16, 0x258, "mA", 0 }, /* 0.6A */ |
| 46 | Package () { 0, 0, 0, 0, 8, 0x190, "mA", 0 }, /* 0.4A */ |
| 47 | Package () { 0, 0, 0, 0, 0, 0x64, "mA", 0 }, /* 0.1A */ |
| 48 | }) |
| 49 | |
| 50 | /* Mainboard specific _PDL is 1GHz */ |
| 51 | Name (MPDL, 8) |
| 52 | |
| 53 | /* Terra2 - Thermal Relationship Table for method _TRT */ |
| 54 | Name (TRT2, Package () { |
| 55 | /* CPU Throttle Effect on CPU */ |
| 56 | Package () { \_SB.PCI0.B0DB, \_SB.PCI0.B0DB, 100, 10, 0, 0, 0, 0 }, |
| 57 | #ifdef DPTF_ENABLE_CHARGER |
| 58 | /* Charger Effect on Temp Sensor 0 */ |
| 59 | Package () { \_SB.DPTF.TCHG, \_SB.DPTF.TSR0, 200, 100, 0, 0, 0, 0 }, |
| 60 | #endif |
| 61 | /* CPU Effect on Temp Sensor 0 */ |
| 62 | Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR0, 100, 100, 0, 0, 0, 0 }, |
| 63 | #ifdef DPTF_ENABLE_CHARGER |
| 64 | /* Charger Effect on Temp Sensor 1 */ |
| 65 | Package () { \_SB.DPTF.TCHG, \_SB.DPTF.TSR1, 100, 100, 0, 0, 0, 0 }, |
| 66 | #endif |
| 67 | /* CPU Effect on Temp Sensor 1 */ |
| 68 | Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR1, 200, 100, 0, 0, 0, 0 }, |
| 69 | #ifdef DPTF_ENABLE_CHARGER |
| 70 | /* Charger Effect on Temp Sensor 2 */ |
| 71 | Package () { \_SB.DPTF.TCHG, \_SB.DPTF.TSR2, 100, 100, 0, 0, 0, 0 }, |
| 72 | #endif |
| 73 | /* CPU Effect on Temp Sensor 2 */ |
| 74 | Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR2, 200, 100, 0, 0, 0, 0 }, |
| 75 | }) |
| 76 | |
| 77 | /* Terra3 - Thermal Relationship Table for method _TRT */ |
| 78 | Name (TRT3, Package () { |
| 79 | /* CPU Throttle Effect on CPU */ |
| 80 | Package () { \_SB.PCI0.B0DB, \_SB.PCI0.B0DB, 100, 10, 0, 0, 0, 0 }, |
| 81 | |
| 82 | /* CPU Effect on Temp Sensor 0 */ |
| 83 | Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR0, 100, 100, 0, 0, 0, 0 }, |
| 84 | #ifdef DPTF_ENABLE_CHARGER |
| 85 | /* Charger Effect on Temp Sensor 1 */ |
| 86 | Package () { \_SB.DPTF.TCHG, \_SB.DPTF.TSR1, 100, 100, 0, 0, 0, 0 }, |
| 87 | #endif |
| 88 | |
| 89 | /* CPU Effect on Temp Sensor 1 */ |
| 90 | Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR1, 200, 100, 0, 0, 0, 0 }, |
| 91 | |
| 92 | /* Charger Effect on Temp Sensor 2 */ |
| 93 | Package () { \_SB.DPTF.TCHG, \_SB.DPTF.TSR2, 100, 100, 0, 0, 0, 0 }, |
| 94 | }) |
| 95 | |
| 96 | /* Terra2 - PPCC table defined by mainboard for method PPCC */ |
| 97 | Name (PPT2, Package () |
| 98 | { |
| 99 | 0x2, /* Revision */ |
| 100 | Package () { /* Power Limit 1 */ |
| 101 | 0, /* PowerLimitIndex, 0 for Power Limit 1 */ |
| 102 | 1600, /* PowerLimitMinimum */ |
| 103 | 10000, /* PowerLimitMaximum */ |
| 104 | 1000, /* TimeWindowMinimum */ |
| 105 | 1000, /* TimeWindowMaximum */ |
| 106 | 200 /* StepSize */ |
| 107 | }, |
| 108 | Package () { /* Power Limit 2 */ |
| 109 | 1, /* PowerLimitIndex, 1 for Power Limit 2 */ |
| 110 | 8000, /* PowerLimitMinimum */ |
| 111 | 8000, /* PowerLimitMaximum */ |
| 112 | 1000, /* TimeWindowMinimum */ |
| 113 | 1000, /* TimeWindowMaximum */ |
| 114 | 1000 /* StepSize */ |
| 115 | } |
| 116 | }) |
| 117 | |
| 118 | /* Terra3 - PPCC table defined by mainboard for method PPCC */ |
| 119 | Name (PPT3, Package () |
| 120 | { |
| 121 | 0x2, /* Revision */ |
| 122 | Package () { /* Power Limit 1 */ |
| 123 | 0, /* PowerLimitIndex, 0 for Power Limit 1 */ |
| 124 | 1600, /* PowerLimitMinimum */ |
| 125 | 10000, /* PowerLimitMaximum */ |
| 126 | 1000, /* TimeWindowMinimum */ |
| 127 | 1000, /* TimeWindowMaximum */ |
| 128 | 200 /* StepSize */ |
| 129 | }, |
| 130 | Package () { /* Power Limit 2 */ |
| 131 | 1, /* PowerLimitIndex, 1 for Power Limit 2 */ |
| 132 | 8000, /* PowerLimitMinimum */ |
| 133 | 8000, /* PowerLimitMaximum */ |
| 134 | 1000, /* TimeWindowMinimum */ |
| 135 | 1000, /* TimeWindowMaximum */ |
| 136 | 1000 /* StepSize */ |
| 137 | } |
| 138 | }) |
| 139 | |
| 140 | Device (DPTF) |
| 141 | { |
| 142 | Name (_HID, EISAID ("INT3400")) |
| 143 | Name (_UID, 0) |
| 144 | |
| 145 | Name (IDSP, Package() |
| 146 | { |
| 147 | /* DPPM Passive Policy 1.0 */ |
| 148 | ToUUID ("42A441D6-AE6A-462B-A84B-4A8CE79027D3"), |
| 149 | |
| 150 | /* DPPM Critical Policy */ |
| 151 | ToUUID ("97C68AE7-15FA-499c-B8C9-5DA81D606E0A"), |
| 152 | |
| 153 | /* DPPM Cooling Policy */ |
| 154 | ToUUID ("16CAF1B7-DD38-40ED-B1C1-1B8A1913D531"), |
| 155 | }) |
| 156 | |
| 157 | Method (_STA) |
| 158 | { |
Felix Singer | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame^] | 159 | If (\DPTE == 1) { |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 160 | Return (0xF) |
| 161 | } Else { |
| 162 | Return (0x0) |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | /* |
| 167 | * Arg0: Buffer containing UUID |
| 168 | * Arg1: Integer containing Revision ID of buffer format |
| 169 | * Arg2: Integer containing count of entries in Arg3 |
| 170 | * Arg3: Buffer containing list of DWORD capabilities |
| 171 | * Return: Buffer containing list of DWORD capabilities |
| 172 | */ |
| 173 | Method (_OSC, 4, Serialized) |
| 174 | { |
| 175 | /* Check for Passive Policy UUID */ |
Felix Singer | 096158d | 2022-12-11 23:02:09 +0100 | [diff] [blame] | 176 | If (DeRefOf (IDSP[0]) == Arg0) { |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 177 | /* Initialize Thermal Devices */ |
| 178 | ^TINI () |
| 179 | |
| 180 | #ifdef DPTF_ENABLE_CHARGER |
| 181 | /* Initialize Charger Device */ |
| 182 | ^TCHG.INIT () |
| 183 | #endif |
| 184 | } |
| 185 | |
| 186 | Return (Arg3) |
| 187 | } |
| 188 | |
| 189 | /* Priority based _TRT */ |
| 190 | Name (TRTR, 1) |
| 191 | |
| 192 | /* Return TRT table defined by Terra2 or Terra3 mainboard */ |
| 193 | Method (_TRT) |
| 194 | { |
Felix Singer | 096158d | 2022-12-11 23:02:09 +0100 | [diff] [blame] | 195 | If (\_SB.GPID == TERRA2_PROJECT_ID) |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 196 | { |
| 197 | Return (\_SB.TRT2) |
| 198 | } Else { |
| 199 | Return (\_SB.TRT3) |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | /* Convert from Degrees C to 1/10 Kelvin for ACPI */ |
| 204 | Method (CTOK, 1) { |
| 205 | /* 10th of Degrees C */ |
Felix Singer | cc62b50 | 2022-01-01 23:43:11 +0100 | [diff] [blame] | 206 | Local0 = Arg0 * 10 |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 207 | |
| 208 | /* Convert to Kelvin */ |
Felix Singer | 4aab487 | 2021-12-30 01:36:58 +0100 | [diff] [blame] | 209 | Local0 += 2732 |
Matt DeVillier | 2f7813f | 2017-08-24 16:31:41 -0500 | [diff] [blame] | 210 | |
| 211 | Return (Local0) |
| 212 | } |
| 213 | |
| 214 | /* Include Thermal Participants */ |
| 215 | #include "thermal.asl" |
| 216 | |
| 217 | #ifdef DPTF_ENABLE_CHARGER |
| 218 | /* Include Charger Participant */ |
| 219 | #include "charger.asl" |
| 220 | #endif |
| 221 | } |