Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011-2012 The Chromium OS Authors. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * The mainboard must define a PNOT method to handle power |
| 18 | * state notifications and Notify CPU device objects to |
| 19 | * re-evaluate their _PPC and _CST tables. |
| 20 | */ |
| 21 | |
| 22 | Device (EC0) |
| 23 | { |
| 24 | Name (_HID, EISAID ("PNP0C09")) |
| 25 | Name (_UID, 1) |
Alexandru Gagniuc | fa84067 | 2014-04-09 21:07:43 -0500 | [diff] [blame] | 26 | Name (_GPE, EC_SCI_GPE) // GPE for Runtime SCI |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 27 | |
| 28 | OperationRegion (ERAM, EmbeddedControl, 0x00, 0xff) |
| 29 | Field (ERAM, ByteAcc, Lock, Preserve) |
| 30 | { |
| 31 | // EC Name Space Configuration |
| 32 | Offset(0x00), |
| 33 | , 1, // Reserved ; 00h.0 |
| 34 | LCDS, 1, // 1= BACKLIGHT ON , 0= BACKLIGHT OFF ; 00h.1 |
Elyes HAOUAS | b933109 | 2016-09-05 19:55:34 +0200 | [diff] [blame] | 35 | , 6, // Reserved ; 00h.2 ~ 00h.6 |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 36 | HTBN, 8, // HOTKEY_BUTTON_NUMBER ; 01h For ABO Hot Key Function |
| 37 | HTBT, 8, // HOTKEY_BUTTON_TYPE ; 02h For ABO Hot Key Function |
| 38 | LMEN, 1, // Launch Manager enable .(1=Enable ) ; 03h.0, Lauanch manage |
| 39 | , 7, // Reserved ; 03h.1 ~ 03h.7 |
| 40 | ADAP, 2, // Adaptor Type ; 04h.0 ~ 1 |
| 41 | // 0x00 = default(65w) |
| 42 | // 0x01 = 65w |
| 43 | // 0x02 = 90w |
| 44 | // 0x03 = 120w |
| 45 | , 6, // Reserved ; 04h.2 ~ 04h.7 |
| 46 | Offset(0x08), // Project Common Name space definition ; 08h - 2Ch |
| 47 | Offset(0x2D), |
| 48 | DSPM, 1, // Display Mode.(0=dGPU, 1=iGPU ) ; 2Dh.0 |
| 49 | Offset(0x2E), |
| 50 | EFP1, 4, // Turbo Off P-State ; 2Eh.3-0 |
| 51 | Offset(0x40), // ABO Common Name space definition ; 2F - 5Ch |
| 52 | Offset(0x5D), |
| 53 | ENIB, 16, // Ext_NameSpace_Index ; 5Dh |
| 54 | // Ext_NameSpace_Bank ; 5Eh |
| 55 | ENDD, 8, // Ext_NameSpace_Data ; 5Fh |
| 56 | Offset(0x60), |
| 57 | SMPR, 8, // SMBus protocol register ; 60h |
| 58 | SMST, 8, // SMBus status register ; 61h |
| 59 | SMAD, 8, // SMBus address register ; 62h |
| 60 | SMCM, 8, // SMBus command register ; 63h |
| 61 | SMD0, 0x100, // SMBus data regs (32) ; 64h - 83h |
| 62 | BCNT, 8, // SMBus Block Count ; 84h |
| 63 | SMAA, 24, // SMBus Alarm Address ; 85h - 87h |
| 64 | Offset(0x90), |
| 65 | BMFN, 72, // Battery Manufacture name ; 90h - 98h |
| 66 | BATD, 56, // Battery Device name ; 99h - 9fh |
| 67 | Offset(0xA1), |
| 68 | , 1, // Reserve ; A1h.0 |
| 69 | VIDO, 1, // Video Out Button (1=Pressed) ; A1h.1 |
| 70 | TOUP, 1, // Touch Pad Button (0=On, 1=Off) ; A1h.2 |
| 71 | Offset(0xA2), |
| 72 | ODTS, 8, // OS Shutdown Temp2 (DTS) ; A2h |
| 73 | Offset(0xA3), |
| 74 | OSTY, 3, // OSTYPE : 000- XP ; A3h.0-2 |
| 75 | // 001- Vista |
| 76 | // 010- Linux |
| 77 | // 011- Win7 |
| 78 | , 4, // Reserve ; A3h.3-6 |
| 79 | ADPT, 1, // AC Adapter (0=OffLine, 1=OnLine) ; A3h.7 |
| 80 | Offset(0xA4), |
| 81 | PWAK, 1, // PME Wake Enable(0=Disable, 1=Enable) ; A4h.0 |
| 82 | MWAK, 1, // Modem Wake Enable(0/1=Disable/Enable); A4h.1 |
| 83 | LWAK, 1, // LAN Wake Enable (0=Disable, 1=Enable); A4h.2 |
| 84 | RWAK, 1, // RTC Wake Enable(0=DIsable,1=Enable) ; A4h.3 |
| 85 | WWAK, 1, // WLAN wake Enable (0=Disable,1=Enable); A4h.4 |
| 86 | UWAK, 1, // USB WAKE(0=Disable, 1=Enable) ; A4h.5 |
| 87 | KWAK, 1, // Keyboard WAKE(0=Disable,1=Enable) ; A4h.6 |
| 88 | TWAK, 1, // TouchPad WAKE(0=Disable,1=Enable) ; A4h.7 |
| 89 | Offset(0xA5), |
| 90 | CCAC, 1, // Charge Current (1=AC OFF) ; A5h.0 |
| 91 | AOAC, 1, // Adapter OVP (1=AC OFF) ; A5h.1 |
| 92 | BLAC, 1, // Batt learning (1=AC OFF) ; A5h.2 |
| 93 | PSRC, 1, // Command (1=AC OFF) ; A5h.3 |
| 94 | BOAC, 1, // Batt OVP (1=AC OFF) ; A5h.4 |
| 95 | LCAC, 1, // Leak Current (1=AC OFF) ; A5h.5 |
| 96 | AAAC, 1, // Air Adapter (1=AC OFF) ; A5h.6 |
| 97 | ACAC, 1, // AC Off (1=AC OFF) ; A5h.7 |
| 98 | Offset(0xA6), |
| 99 | S3ST, 1, // System entry S3 State : A6.0 |
| 100 | S3RM, 1, // System resume from S3 State : A6.1 |
| 101 | S4ST, 1, // System entry S4 State : A6.2 |
| 102 | S4RM, 1, // System resume from S4 State : A6.3 |
| 103 | S5ST, 1, // System entry S4 State : A6.4 |
| 104 | S5RM, 1, // System resume from S4 State : A6.5 |
| 105 | , 2, // Reserve ; A6h.6-7 |
| 106 | Offset(0xA7), |
| 107 | OSTT, 8, // OS Throttling Temp ; A7h |
| 108 | OSST, 8, // OS Shutdown Temp ; A8h |
| 109 | THLT, 8, // Throttling Temp ; A9h |
| 110 | TCNL, 8, // Tcontrol Temp ; AAh |
| 111 | MODE, 1, // Mode(0=Local, 1=Remote) ; ABh.0 |
| 112 | , 2, // Reserve ; ABh.1-2 |
| 113 | INIT, 1, // INITOK(0/1=Controlled by OS/EC) ; ABh.3 |
| 114 | FAN1, 1, // FAN1 Active ; ABh.4 |
| 115 | FAN2, 1, // FAN2 Active ; ABh.5 |
| 116 | FANT, 1, // FAN Speed Time OK ; ABh.6 |
| 117 | SKNM, 1, // Skin Mode (0/1=Skin Address 90/92) ; ABh.7 |
| 118 | SDTM, 8, // Shutdown Thermal Temperature ; ACh |
| 119 | FSSN, 4, // Fan Speed Step Number ; ADh.0-3 |
| 120 | // 00 : Fan Off |
| 121 | // 01 : Fan On Speed 1 |
| 122 | // 10 : Fan On Speed 2 |
| 123 | // 11 : Fan On Speed 3 |
| 124 | FANU, 4, // Machine Fan's number ; ADh.4-7 |
| 125 | PCVL, 4, // Throttling Level ; AEh.0-3 |
| 126 | // 0000 : Nothing |
| 127 | // 0001 : Clock throttling 12.5% |
| 128 | // 0010 : Clock throttling 25% |
| 129 | // 0011 : Clock throttling 37.5% |
| 130 | // 0100 : Clock throttling 50% |
| 131 | , 2, // Reserved ; AEh.4-5 |
| 132 | SWTO, 1, // SW Throttling (1=Active) ; AEh.6 |
| 133 | TTHR, 1, // HW (THRM#) Throttling (1=Active) ; AEh.7 |
| 134 | TTHM, 1, // TS_THERMAL(1:Throttling for thermal) ; AFh.0 |
| 135 | THTL, 1, // THROTTLING(1:Ctrl H/W throtting act) ; AFh.1 |
| 136 | , 2, // Reserved ; AFh.2-3 |
| 137 | NPST, 4, // Number of P-State level ; AFh.4-7 |
| 138 | CTMP, 8, // Current CPU Temperature ; B0h |
| 139 | CTML, 8, // CPU local temperature ; B1h |
| 140 | SKTA, 8, // Skin Temperature A ; B2h |
| 141 | SKTB, 8, // GPU Temperature ; B3h |
| 142 | SKTC, 8, // Skin Temperature C ; B4h |
| 143 | , 8, // Reserved ; B5h |
| 144 | NTMP, 8, // North Bridge Diode Temp ; B6h |
| 145 | Offset(0xB7), |
| 146 | , 1, // Reserved ; B7h.0 |
| 147 | SKEY, 1, // Security key event ; B7h.1 |
| 148 | DIGM, 1, // Digital Mode (1=Selected) ; B7h.2 |
| 149 | CDLE, 1, // CD lock mode enable ; B7h.3 |
| 150 | , 4, // Reserved ; B7h.4-7 |
| 151 | , 1, // Reserved ; B8h.0 |
| 152 | LIDF, 1, // LID flag (1=Closed, 0=Opened) ; B8h.1 |
| 153 | PMEE, 1, // PME event (0=off, 1=On) ; B8h.2 |
| 154 | PWBE, 1, // Power button event (0=off, 1=On) ; B8h.3 |
| 155 | RNGE, 1, // Ring in event (0=off, 1=On) ; B8h.4 |
| 156 | BTWE, 1, // Bluetooth wake event (0=off, 1=On) ; B8h.5 |
| 157 | , 2, // Reserved ; B8h.6-7 |
| 158 | Offset(0xB9), |
| 159 | BRTS, 8, // Brightness Value ; B9h |
| 160 | S35M, 1, // S3.5 HotKey test mode ; BAh.0 |
| 161 | S35S, 1, // S3.5 function status ; BAh.1 |
| 162 | , 2, // Reserved ; BAh.2-3 |
| 163 | FFEN, 1, // IRST support bit (1= Support) ; BAh.4 |
| 164 | FFST, 1, // IRST status flag ; BAh.5 |
| 165 | , 2, // Reserved ; BAh.6-7 |
| 166 | WLAT, 1, // Wireless LAN (0=Inactive, 1=Active) ; BBh.0 |
| 167 | BTAT, 1, // BlueTooth (0=Inactive, 1=Active) ; BBh.1 |
| 168 | WLEX, 1, // Wireless LAN (0=Not Exist, 1=Exist) ; BBh.2 |
| 169 | BTEX, 1, // BlueTooth (0=Not Exist, 1=Exist) ; BBh.3 |
| 170 | KLSW, 1, // Kill Switch (0=Off, 1=On) ; BBh.4 |
| 171 | WLOK, 1, // Wireless LAN Initialize OK ; BBh.5 |
| 172 | AT3G, 1, // 3G (0=non-active, 1=active) ; BBh.6 |
| 173 | EX3G, 1, // 3G (0=Not Exist, 1=Exist) ; BBh.7 |
| 174 | PJID, 8, // Project ID ; BCh |
| 175 | CPUJ, 3, // CPU Type ; BDh.0-2 |
| 176 | // 00, Tj85, |
| 177 | // 01, Tj90, |
| 178 | // 02, Tj100, |
| 179 | // 03, Tj105, |
| 180 | // 04 - 07, Reserved |
| 181 | CPNM, 3, // CPU Core number ; BDh.3-5 |
| 182 | // 00, Single Core |
| 183 | // 01, Dual Core |
| 184 | // 02, Quad Core |
| 185 | // 03 - 07, Reserved |
| 186 | GATY, 2, // VGA Type ; BDh.6-7 |
| 187 | // 00, UMA |
| 188 | // 01. Discrete |
| 189 | // 02 - 03, Reserved |
| 190 | Offset(0xBE), |
| 191 | BOL0, 1, // Batt0 (0=OffLine, 1=OnLine) ; BEh.0 |
| 192 | BOL1, 1, // Batt1 (0=OffLine, 1=OnLine) ; BEh.1 |
| 193 | , 2, // Reserved ; BEh.2-3 |
| 194 | BCC0, 1, // Batt0 be charging (1=Charging) ; BEh.4 |
| 195 | BCC1, 1, // Batt1 be charging (1=Charging) ; BEh.5 |
| 196 | , 2, // Reserved ; BEh.6-7 |
| 197 | BPU0, 1, // Batt0 (1=PowerUp) ; BFh.0 |
| 198 | BPU1, 1, // Batt1 (1=PowerUp) ; BFh.1 |
| 199 | , 2, // Reserved ; BFh.2-3 |
| 200 | BOS0, 1, // Batt0 (1=OnSMBUS) ; BFh.4 |
| 201 | BOS1, 1, // Batt1 (1=OnSMBUS) ; BFh.5 |
| 202 | , 2, // Reserved ; BFh.6-7 |
| 203 | Offset(0xC0), |
| 204 | BTY0, 1, // Batt Type (0=NiMh, 1=LiIon) ; C0h.0 |
| 205 | BAM0, 1, // Battery mode (0=mA, 1=mW) ; C0h.1 |
| 206 | BAL0, 1, // Low Battery ; C0h.2 |
| 207 | , 1, // Reserved ; C0h.3 |
| 208 | BMF0, 3, // Battery Manufacturer ; C0h.4-6 |
| 209 | // 001 : Sanyo |
| 210 | // 010 : Sony |
| 211 | // 100 : Pansonic |
| 212 | // 101 : CPT |
| 213 | , 1, // Reserved ; C0h.7 |
| 214 | BST0, 8, // Battery Status ; C1h |
Elyes HAOUAS | b933109 | 2016-09-05 19:55:34 +0200 | [diff] [blame] | 215 | // Bit0 : Discharging |
| 216 | // Bit1 : Charging |
| 217 | // Bit2 : Discharg and Critical Low |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 218 | // Bit3-7 : Reserved |
| 219 | BRC0, 16, // Batt Remaining Capacity ; C2h, C3h |
| 220 | BSN0, 16, // Batt Serial Number ; C4h, C5h |
| 221 | BPV0, 16, // Batt Present Voltage ; C6h, C7h |
| 222 | BDV0, 16, // Batt Design Voltage ; C8h, C9h |
| 223 | BDC0, 16, // Batt Design Capacity ; CAh, CBh |
| 224 | BFC0, 16, // Batt Last Full Charge Capacity ; CCh, CDh |
| 225 | GAU0, 8, // Batt Gasgauge ; CEh |
| 226 | CYC0, 8, // Batt Cycle Counter ; CFh |
| 227 | BPC0, 16, // Batt Current ; D0h, D1h |
| 228 | BAC0, 16, // Batt Average Current ; D2h, D3h |
| 229 | BTW0, 8, // Batt Comsuption ; D4h |
| 230 | BVL0, 8, // Batt Battery Volt ; D5h |
| 231 | BTM0, 8, // Batt Battery Temp ; D6h |
| 232 | BAT0, 8, // Batt Average Temp (Degree C) ; D7h |
| 233 | BCG0, 16, // Batt charge current ; D8h, D9h |
| 234 | BCT0, 8, // Batt Current Temp Semple counter ; DAh |
| 235 | BCI0, 8, // BATT CMD Index for read BATT(SMB) ; DBh |
| 236 | BCM0, 8, // Count up to Communicate BATT ; DCh |
| 237 | BOT0, 8, // Count up if BATT over Temp ; DDh |
| 238 | BSSB, 16, // BATT Battery Status SMB ; DEh, DFh |
| 239 | BOV0, 8, // BATT Over Voltage Count ; E0h |
| 240 | BCF0, 8, // BATT Communication Fail Counter ; E1h |
| 241 | BAD0, 8, // Battery Voltage of ADC ; E2h |
| 242 | BCV1, 16, // Cell Voltage 1 (mV) ; E3h, E4h |
| 243 | BCV2, 16, // Cell Voltage 2 (mV) ; E5h, E6h |
| 244 | BCV3, 16, // Cell Voltage 3 (mV) ; E7h, E8h |
| 245 | BCV4, 16, // Cell Voltage 4 (mV) ; E9h, EAh |
| 246 | Offset(0xF4), |
| 247 | BMD0, 16, // Manufacture Date ; F4h, F5h |
| 248 | // Batt Day ; BIT[4:0] (Day) |
| 249 | // Batt Month ; BIT[9:5] (Month) |
| 250 | // Batt Year ; BIT[15:10] (Year) |
| 251 | BACV, 16, // Charging Voltage ; F6h, F7h |
| 252 | BDN0, 8, // Battery Cell Number ; F8h |
| 253 | , 8 // Last byte for Reserved. |
| 254 | } |
| 255 | |
| 256 | Method (_CRS, 0, NotSerialized) |
| 257 | { |
| 258 | Name (ECMD, ResourceTemplate() |
| 259 | { |
| 260 | IO (Decode16, 0x62, 0x62, 0, 1) |
| 261 | IO (Decode16, 0x66, 0x66, 0, 1) |
| 262 | }) |
| 263 | Return (ECMD) |
| 264 | } |
| 265 | |
| 266 | Method (_REG, 2, NotSerialized) |
| 267 | { |
| 268 | // Initialize AC power state |
| 269 | Store (ADPT, \PWRS) |
| 270 | |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 271 | // Force a read of CPU temperature |
| 272 | Store (CTML, Local0) |
Vladimir Serbinenko | b27c24f | 2016-02-08 00:10:44 +0100 | [diff] [blame] | 273 | /* So that we don't get a warning that Local0 is unused. */ |
| 274 | Increment (Local0) |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | |
| 278 | /* |
| 279 | * EC Query Responses |
| 280 | * |
| 281 | * DTS temperature update 10h |
| 282 | * Decrease brightness event 11h |
| 283 | * Increase brightness event 12h |
| 284 | * Cover lid open 15h |
| 285 | * Cover lid close 16h |
| 286 | * External device plugged 17h |
| 287 | * External device removed 18h |
| 288 | * Bluetooth wake up event 19h |
| 289 | * Scr expand event 1Bh |
| 290 | * Display toggle 1Ch |
| 291 | * CPU fast/slow event 1Dh |
| 292 | * Battery in critical low 22h |
| 293 | * Battery in low state 23h |
| 294 | * Battery pack plug in 25h |
| 295 | * Docking in 2Ah |
| 296 | * Undock 2Bh |
| 297 | * Power button pressed 32h |
| 298 | * AC plug in 37h |
| 299 | * AC removed 38h |
| 300 | * Modem ring in 3Ah |
| 301 | * PME signal active 3Eh |
| 302 | * Hotkey make Function 45h |
| 303 | * Hotkey break Function 46h |
| 304 | */ |
| 305 | |
Alexandru Gagniuc | fa84067 | 2014-04-09 21:07:43 -0500 | [diff] [blame] | 306 | /* Decrease brightness hotkey */ |
| 307 | Method (_Q11, 0, NotSerialized) |
| 308 | { |
| 309 | \_SB.MB.BRTD() |
| 310 | } |
| 311 | |
| 312 | /* Increase brightness hotkey */ |
| 313 | Method (_Q12, 0, NotSerialized) |
| 314 | { |
| 315 | \_SB.MB.BRTU() |
| 316 | } |
| 317 | |
| 318 | /* Lid opened */ |
| 319 | Method (_Q15, 0, NotSerialized) |
| 320 | { |
| 321 | \_SB.MB.LIDO() |
| 322 | } |
| 323 | |
| 324 | /* Lid closed */ |
| 325 | Method (_Q16, 0, NotSerialized) |
| 326 | { |
| 327 | \_SB.MB.LIDC() |
| 328 | } |
| 329 | |
| 330 | /* Switch display hotkey */ |
| 331 | Method (_Q1C, 0, NotSerialized) |
| 332 | { |
| 333 | \_SB.MB.DSPS() |
| 334 | } |
| 335 | |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 336 | // AC Power Connected |
| 337 | Method (_Q37, 0, NotSerialized) |
| 338 | { |
| 339 | Store (One, \PWRS) |
| 340 | Notify (AC, 0x80) |
| 341 | Notify (BATX, 0x80) |
| 342 | // TODO ADD CPU power profile |
| 343 | \PNOT () |
| 344 | } |
| 345 | |
| 346 | // AC Power Removed |
| 347 | Method (_Q38, 0, NotSerialized) |
| 348 | { |
| 349 | Store (Zero, \PWRS) |
| 350 | Notify (AC, 0x80) |
| 351 | Notify (BATX, 0x80) |
| 352 | // TODO ADD CPU power profile |
| 353 | \PNOT () |
| 354 | } |
| 355 | |
Alexandru Gagniuc | fa84067 | 2014-04-09 21:07:43 -0500 | [diff] [blame] | 356 | /* Wireless toggle hotkey */ |
| 357 | Method (_Q40, 0, NotSerialized) |
| 358 | { |
| 359 | \_SB.MB.WLTG() |
| 360 | } |
| 361 | |
Stefan Reinauer | d8a5fd2 | 2012-12-11 15:51:47 -0800 | [diff] [blame] | 362 | // Battery at critical low state |
| 363 | Method (_Q22, 0, NotSerialized) |
| 364 | { |
| 365 | Notify (BATX, 0x80) |
| 366 | } |
| 367 | |
| 368 | // Battery insert |
| 369 | Method(_Q25, 0, NotSerialized) |
| 370 | { |
| 371 | Notify(BATX, 0x81) |
| 372 | Notify(BATX, 0x80) |
| 373 | } |
| 374 | |
| 375 | // Commuation Device Disable/Enable Event |
| 376 | Method(_Q60, 0, NotSerialized) |
| 377 | { |
| 378 | IF(WLEX) //if Wlan exist |
| 379 | { |
| 380 | //TODO Store(WLAT, LANE) |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | #include "ac.asl" |
| 385 | #include "battery.asl" |
| 386 | } |