Stefan Reinauer | 7e56855 | 2013-03-13 17:03:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google Inc. |
| 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 | 7e56855 | 2013-03-13 17:03:04 -0700 | [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) |
| 26 | Name (_GPE, Add(EC_SCI_GPI, 16)) // GPE for Runtime SCI |
| 27 | |
| 28 | // EC RAM fields |
| 29 | OperationRegion(ERAM, EmbeddedControl, 0, 0xFF) |
| 30 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 31 | { |
| 32 | Offset(0x00), // [Configuration Space 0] |
| 33 | , 1, // Reserved bit[0] |
| 34 | ENGA, 1, // Enable Global attention |
| 35 | ENHY, 1, // Enable Hotkey function |
| 36 | HFNE, 1, // Enable Sticky Fn Key |
| 37 | DSEM, 1, // Disable embedded NumPad Emulation |
| 38 | EN3R, 1, // Enable 3rd Host interface and TWR registers |
| 39 | , 1, // Reserved bit[6] |
| 40 | ENTM, 1, // Enable Thermal monitoring |
| 41 | |
| 42 | Offset(0x01), // [Configuration Space 1] |
| 43 | ENBK, 1, // Enable Panel backlight on/ off synchronized with LID state |
| 44 | , 3, // Reserved bits[1:3] |
| 45 | WPSW, 1, // Warning if the power switch is depressed |
| 46 | , 2, // Reserved bits[5:6] |
| 47 | NTKY, 1, // do not ignore any key while Fn key is held down |
| 48 | |
| 49 | Offset(0x02), // [Configuration Space 2] |
| 50 | , 5, // Reserved bits[0:4] |
| 51 | SNLC, 1, // Smart NumLock Enable. 1:Enable 0:Disable |
| 52 | , 1, // Reserved bit[6] |
| 53 | TNKB, 1, // ThinkVantage button function bit |
| 54 | // 0: Scan code (Enter key) |
| 55 | // 1: SMI/SCI attention |
| 56 | |
| 57 | Offset(0x03), // [Configuration Space 3] |
| 58 | DSHP, 1, // Disable to synchronize headphone state with the speaker mute |
| 59 | IGPK, 1, // Ignore phantom keys |
| 60 | , 2, // Reserved bits[2:3] |
| 61 | CBAT, 1, // Change discharge/charge preference to discharge primary battery first and charge secondary battery first if possible |
| 62 | ADO0, 1, // Audio button behavior mode 0 |
| 63 | ADO1, 1, // Audio button behavior mode 1 |
| 64 | , 1, // Enable to use PMH fan functions to get the fan speed |
| 65 | |
| 66 | Offset(0x04), // [Sound Mask 0] |
| 67 | , 1, // reserved |
| 68 | CLBA, 1, // critical low battery alarm |
| 69 | LWBA, 1, // low battery alarm (YELLOW -> RED) |
| 70 | SUBE, 1, // suspend beep |
| 71 | PUBE, 1, // vm_suspend beep |
| 72 | RSBE, 1, // resume beep |
| 73 | DCBE, 1, // DC in/out beep |
| 74 | PFBE, 1, // power off beep |
| 75 | |
| 76 | Offset(0x05), // [Sound Mask 1] |
| 77 | HSPA, 1, // power off alarm |
| 78 | NHDD, 1, // no HDD alarm |
| 79 | DEAD, 1, // dead |
| 80 | B440, 1, // 440 hz beep |
| 81 | B315, 1, // 315 hz beep |
| 82 | T315, 1, // two 315 hz beep |
| 83 | R315, 1, // three 315 hz beep |
| 84 | BYAM, 1, // inhibit swap |
| 85 | |
| 86 | Offset(0x06), // [Sound ID (Write only)] |
| 87 | HSUN, 8, // Sound ID (Write Only) |
| 88 | |
| 89 | Offset(0x07), // [Sound Repeat Interval (unit time 125ms)] |
| 90 | HSRP, 8, // Sound Repeat Interval (Unit time : 125ms ) |
| 91 | |
| 92 | Offset(0x08), // [Sound Mask 2] |
| 93 | Offset(0x09), // [KBD ID] |
| 94 | Offset(0x0A), // [KMC command control] |
| 95 | // Offset 0xOB : reserved |
| 96 | |
| 97 | Offset(0x0C), // [LED On/Off/ Blinking Control (Write only)] |
| 98 | HLCL, 4, // 0: power LED |
| 99 | // 1: battery status 0 |
| 100 | // 2: battery status 1 |
| 101 | // 3: additional Bay LED (Venice) / reserved (Toronto-4) / Slicer LED (Tokyo) |
| 102 | // 4-6: reserved |
| 103 | // 7: suspend LED |
| 104 | // 8: dock LED 1 |
| 105 | // 9: dock LED 2 |
| 106 | // 10-13: reserved |
| 107 | // 14: microphone mute |
| 108 | // 15: reserved |
| 109 | , 1, // Reserved bit[4] |
| 110 | , 1, // Blink gradually |
| 111 | BLIK, 1, // Blinking |
| 112 | TONF, 1, // Turn on/off |
| 113 | |
| 114 | Offset(0x0D), // [Peripheral control 3] |
| 115 | UONE, 1, // Bit0 - Enable to supply power through USB in S3, S4 and S5 state. |
| 116 | , 1, // Reserved bit[1] |
| 117 | , 1, // set USB_AO_SEL0 signal in S3, S4, and S5 state |
| 118 | , 1, // set USB_AO_SEL1 signal in S3, S4, and S5 state |
| 119 | , 4, // Reserved bits[4:7] |
| 120 | |
| 121 | Offset(0x0E), // [Peripheral Status 4] |
| 122 | HFNS, 2, // Bit[1, 0] : Fn Key Status |
| 123 | // [0, 0] ... Unlock |
| 124 | // [0, 1] ... Sticky |
| 125 | // [1, 0] ... Lock |
| 126 | // [1, 1] ... Reserved |
| 127 | GSER, 1, // G-Sensor Diag Error. 1:Error / 0: No error |
| 128 | PSCS, 1, // Inhibit charging |
| 129 | , 1, // External power saving mode |
| 130 | GSUD, 1, // G-Sensor under Diag. 1: Diag is running/0: Diag comp(not running) |
| 131 | GSID, 2, // Bit[7,6] G-Sensor type ID |
| 132 | // [0,0] ... None |
| 133 | // [0,1] ... STMicro |
| 134 | // [1,0] ... Memsic |
| 135 | // [1,1] ... ADI |
| 136 | |
| 137 | Offset(0x0F), // [Peripheral status 5 (read only)] |
| 138 | , 4, // Reserved bits[0:3] |
| 139 | HDSU, 1, // HDD was detached in suspend (this bit is cleared when the system enters into suspend) |
| 140 | BYSU, 1, // Bay HDD was detached in suspend (this bit is cleared when the system enters into suspend) |
| 141 | , 1, // NumLock state of the embedded keyboard |
| 142 | TMOD, 1, // Tablet mode switch |
| 143 | |
| 144 | Offset(0x10), // [Attention Mask (00-127)] |
| 145 | HAM0, 8, // 10 : Attention Mask (00-07) |
| 146 | HAM1, 8, // 11 : Attention Mask (08-0F) |
| 147 | HAM2, 8, // 12 : Attention Mask (10-17) |
| 148 | HAM3, 8, // 13 : Attention Mask (18-1F) |
| 149 | HAM4, 8, // 14 : Attention Mask (20-27) |
| 150 | HAM5, 8, // 15 : Attention Mask (28-2F) |
| 151 | HAM6, 8, // 16 : Attention Mask (30-37) |
| 152 | HAM7, 8, // 17 : Attention Mask (38-3F) |
| 153 | HAM8, 8, // 18 : Attention Mask (40-47) |
| 154 | HAM9, 8, // 19 : Attention Mask (48-4F) |
| 155 | HAMA, 8, // 1A : Attention Mask (50-57) |
| 156 | HAMB, 8, // 1B : Attention Mask (58-5F) |
| 157 | HAMC, 8, // 1C : Attention Mask (60-67) |
| 158 | HAMD, 8, // 1D : Attention Mask (68-6F) |
| 159 | HAME, 8, // 1E : Attention Mask (70-77) |
| 160 | HAMF, 8, // 1F : Attention Mask (78-7F) |
| 161 | |
| 162 | // Offset 0x20 : reserved |
| 163 | Offset(0x21), // [Inhibit Charge timer byte High (00h)] (timer is kicked when high byte is written) |
| 164 | |
| 165 | Offset(0x23), // [Misc. control] |
| 166 | // 01h Reset charge inhibit |
| 167 | // 02h Inhibit to charge |
| 168 | // 03h Reset external power saving mode |
| 169 | // 04h Set to external power saving mode |
| 170 | // 09h Emulate pressing an eject button of optical device in the bay |
| 171 | // 0Ah Reset thermal state to control the fan |
| 172 | // 10h Start gravity sensor diagnostic program |
| 173 | |
| 174 | // Offset 24-26 : reserved |
| 175 | Offset(0x27), // [Passward Scan Code] |
| 176 | // Offset 28-29 : reserved |
| 177 | |
| 178 | Offset(0x2A), // [Attention Request] |
| 179 | HATR, 8, // 2A : Attention request |
| 180 | |
| 181 | Offset(0x2B), // [Trip point of battery capacity] |
| 182 | HT0H, 8, // 2B : MSB of Trip Point Capacity for Battery 0 |
| 183 | HT0L, 8, // 2C : LSB of Trip Point Capacity for Battery 0 |
| 184 | HT1H, 8, // 2D : MSB of Trip Point Capacity for Battery 1 |
| 185 | HT1L, 8, // 2E : LSB of Trip Point Capacity for Battery 1 |
| 186 | |
| 187 | Offset(0x2F), // [Fan Speed Control] |
| 188 | HFSP, 8, // bit 2-0: speed (0: stop, 7:highest speed) |
| 189 | // bit 5-3: reserved (should be 0) |
| 190 | // bit 6: max. speed |
| 191 | // bit 7: Automatic mode (fan speed controlled by thermal level) |
| 192 | |
| 193 | Offset(0x30), // [Audio mute control] |
| 194 | , 7, // Reserved bits[0:6] |
| 195 | SMUT, 1, // Mute |
| 196 | |
| 197 | Offset(0x31), // [Peripheral Control 2] |
| 198 | FANS, 2, // bit 0,1 Fan selector |
| 199 | // 00: Fan 1, 01: Fan 2 |
| 200 | HUWB, 1, // UWB on |
| 201 | ENS4, 1, // Reserved bit[3] |
| 202 | DSEX, 1, // Disable Express Card |
| 203 | AYID, 1, // Always-on Card identified |
| 204 | , 1, // Select USB to Always On card |
| 205 | , 1, // Assert the express card slot power control standby signal |
| 206 | |
| 207 | Offset(0x32), // [EC Event Mask 0] |
| 208 | HWPM, 1, // PME : Not used. PME# is connected to GPE directly. |
| 209 | HWLB, 1, // Critical Low Bat |
| 210 | HWLO, 1, // Lid Open |
| 211 | , 1, // Eject button |
| 212 | HWFN, 1, // FN key |
| 213 | , 1, // Portfino wake up |
| 214 | HWRI, 1, // Ring Indicator (UART) |
| 215 | HWBU, 1, // Bay Unlock |
| 216 | |
| 217 | Offset(0x33), // [EC Event Mask 1] |
| 218 | |
| 219 | Offset(0x34), // [Peripheral status 2 (read only)] |
| 220 | , 1, // Reserved bit[0] |
| 221 | , 1, // Beep is being sounded now |
| 222 | , 1, // SMBus is busy |
| 223 | , 1, // Reserved bit[3] |
| 224 | , 1, // Fan exists |
| 225 | , 1, // Gravity sensors exist |
| 226 | , 1, // Reserved bit[6] |
| 227 | HPLO, 1, // Power consumption warning |
| 228 | |
| 229 | Offset(0x35), // [Peripheral status 3 (Read only)] |
| 230 | , 1, // Input devices (keyboard and mouse) are locked by password |
| 231 | , 1, // Input devices are frozen (input from devices are inhibited) |
| 232 | , 1, // Fan power on Reset is done |
| 233 | , 1, // Attention is disabled temporarily |
| 234 | , 1, // Fan error |
| 235 | , 2, // Reserved bit[5:6] |
| 236 | , 1, // Thermal sensor error |
| 237 | |
| 238 | Offset(0x36), // [Copy register of EC Event Status (0x32)] |
| 239 | Offset(0x37), // [Copy register of EC Event Status (0x33)] |
| 240 | |
| 241 | Offset(0x38), // [Battery 0 status (read only)] |
| 242 | HB0S, 7, // bit 3-0 level |
| 243 | // F: Unknown |
| 244 | // 2-n: battery level |
| 245 | // 1: low level |
| 246 | // 0: (critical low battery, suspend/ hibernate) |
| 247 | // bit 4 error |
| 248 | // bit 5 charge |
| 249 | // bit 6 discharge |
| 250 | MBTS, 1, // bit 7 battery attached |
| 251 | |
| 252 | Offset(0x39), // [Battery 1 status (read only)] |
| 253 | // bit definition is the same as offset(0x38) |
| 254 | |
| 255 | Offset(0x3A), // [Peripheral control 0] |
| 256 | MUTE, 1, // Mute |
| 257 | I2CS, 1, // I2C select ( 0:Dock EEPROM etc, 1:Thermal sensor etc )(Tokyo-2) |
| 258 | PWRF, 1, // Power off |
| 259 | WANO, 1, // H/W Override bit |
| 260 | // (enable to control wireless devices even if the global WAN disable switch is ON) |
| 261 | DCBD, 1, // Bluetooth On |
| 262 | DCWL, 1, // Wireless Lan On |
| 263 | DCWW, 1, // Wireless Wan On |
| 264 | , 1, // 2nd Battery Inhibit (Tokyo) |
| 265 | |
| 266 | Offset(0x3B), // [Peripheral control 1] |
| 267 | SPKM, 1, // Speaker Mute |
| 268 | KBLH, 1, // Keyboard Light |
| 269 | , 1, // Reserved bit[2] |
| 270 | BTDH, 1, // Bluetooth detach |
| 271 | USBN, 1, // USB On |
| 272 | , 1, // Inhibit communication with battery 0 |
| 273 | , 1, // Inhibit communication with battery 1 |
| 274 | S3FG, 1, // Reserved bit[7] |
| 275 | |
| 276 | Offset(0x3C), // [Resume reason (Read only)] |
| 277 | Offset(0x3D), // [Password Control byte] |
| 278 | Offset(0x3E), // [Password data (8 byte)~ offset:45h] |
| 279 | |
| 280 | Offset(0x46), // [sense status 0] |
| 281 | FNKY, 1, // Fn key |
| 282 | , 1, // Reserved bit[1] |
| 283 | HPLD, 1, // LID open |
| 284 | PROF, 1, // Power off |
| 285 | ACPW, 1, // External power (AC status) |
| 286 | , 2, // Reserved bits[5:6] |
| 287 | CALR, 1, // LP mode (power consumption alert) |
| 288 | |
| 289 | Offset(0x47), // [sense status 1] |
| 290 | HPBU, 1, // Bay Unlock |
| 291 | DKEV, 1, // Dock event |
| 292 | BYNO, 1, // Bay is not Attached |
| 293 | HDIB, 1, // HDD in the bay |
| 294 | , 4, // Reserved bits[4:7] |
| 295 | |
| 296 | Offset(0x48), // [sense status 2] |
| 297 | HPHI, 1, // Head Phone In |
| 298 | GSTS, 1, // Global Wan Enable Switch |
| 299 | , 2, // Reserved bits[2:3] |
| 300 | EXGC, 1, // External Graphic Chip |
| 301 | DOKI, 1, // Dock attached |
| 302 | HDDT, 1, // HDD detect |
| 303 | , 1, // Reserved bit[7] |
| 304 | |
| 305 | Offset(0x49), // [sense status 3] |
| 306 | // Offset 0x4A : reserved |
| 307 | |
| 308 | Offset(0x4C), // [MSB of Event Timer] |
| 309 | ETHB, 8, // bit[14:0]=timer counter, bit[15], 0:ms, 1:sec |
| 310 | |
| 311 | Offset(0x4D), // [LSB of Event Timer] |
| 312 | ETLB, 8, // |
| 313 | |
| 314 | Offset(0x4E), // [EC Event Status 0] |
| 315 | Offset(0x4F), // [EC Event Status 1] |
| 316 | |
| 317 | Offset(0x50), // [SMB_PRTCL (protocol register)] |
| 318 | SMPR, 8, // 00: Controller Not In use |
| 319 | // 01: reserved |
| 320 | // 02: Write Quick command |
| 321 | // 03: Read Quick command |
| 322 | // 04: Send Quick command |
| 323 | // 05: Receive Byte |
| 324 | // 06: Write Byte |
| 325 | // 07: Read Byte |
| 326 | // 08: Write Word |
| 327 | // 09: Read Word |
| 328 | // 0A: Write block |
| 329 | |
| 330 | Offset(0x51), // [SMB_STS (status register)] |
| 331 | SMST, 8, // bits[0:4] Status |
| 332 | // bit[5] Reserved |
| 333 | // bit[6] Alarm Received |
| 334 | // bit[7] Done |
| 335 | |
| 336 | Offset(0x52), // [SMB_ADDR (address register)] |
| 337 | SMAD, 8, // |
| 338 | |
| 339 | Offset(0x53), // [SMB_CMD (Command register)] |
| 340 | SMCM, 8, // |
| 341 | |
| 342 | Offset(0x54), // [SMB_DATA (Data Register (32 bytes))~ offset:73h] |
| 343 | SMD0, 100, // |
| 344 | |
| 345 | Offset(0x74), // [SMB_BCNT (Block count register)] |
| 346 | BCNT, 8, // |
| 347 | |
| 348 | Offset(0x75), // [SMB_ALRM_ADDR (Alarm address register)] |
| 349 | SMAA, 8, // |
| 350 | |
| 351 | Offset(0x76), // [SMB_ALRM_DATA (Alarm data register (2 bytes))] |
| 352 | BATD, 16, // |
| 353 | |
| 354 | Offset(0x78), // [Temperature of thermal sensor 0 (centigrade)] |
| 355 | TMP0, 8, // 78 : Temperature of thermal sensor 0 |
| 356 | TMP1, 8, // 79 : Temperature of thermal sensor 1 |
| 357 | TMP2, 8, // 7A : Temperature of thermal sensor 2 |
| 358 | TMP3, 8, // 7B : Temperature of thermal sensor 3 |
| 359 | TMP4, 8, // 7C : Temperature of thermal sensor 4 |
| 360 | TMP5, 8, // 7D : Temperature of thermal sensor 5 |
| 361 | TMP6, 8, // 7E : Temperature of thermal sensor 6 |
| 362 | TMP7, 8, // 7F : Temperature of thermal sensor 7 |
| 363 | |
| 364 | // Offset 79-7F : reserved |
| 365 | Offset(0x80), // [Attention control byte] |
| 366 | |
| 367 | Offset(0x81), // [Battery information ID for 0xA0-0xAF] |
| 368 | HIID, 8, // (this byte is depend on the interface, 62&66 and 1600&1604) |
| 369 | |
| 370 | Offset(0x82), // [Fn Dual function - make time out time (100ms unit)] |
| 371 | |
| 372 | Offset(0x83), // [Fn Dual function ID] |
| 373 | HFNI, 8, // 0: none |
| 374 | // 1-3: Reserved |
| 375 | // 4: ACPI Power |
| 376 | // 5: ACPI Sleep |
| 377 | // 6: ACPI Wake |
| 378 | // 7: Left Ctrl key |
| 379 | |
| 380 | Offset(0x84), // [Fan Speed] |
| 381 | , 16, // |
| 382 | // (I/F Offset 3Bh bit5 => 0:Main Fan , 1:Second Fan) |
| 383 | |
| 384 | Offset(0x86), // [password 0 - 7 status] |
| 385 | Offset(0x87), // [password 8 - 15 status] |
| 386 | Offset(0x88), // [Thermal Status of Level 0 (low)] |
| 387 | Offset(0x89), // [Thermal Status of Level 1 (middle)] |
| 388 | Offset(0x8A), // [Thermal Status of Level 2 (middle high)] |
| 389 | Offset(0x8B), // [Thermal Status of Level 3 (high)] |
| 390 | // Offset 0x8C : reserved |
| 391 | |
| 392 | Offset(0x8D), // [Interval of polling Always-on cards in half minute] |
| 393 | HDAA, 3, // Warning Delay Period |
| 394 | HDAB, 3, // Stolen Delay Period |
| 395 | HDAC, 2, // Sensitivity |
| 396 | |
| 397 | Offset(0x8E), // [Key-number assigned to the ThinkVantage button] |
| 398 | Offset(0x8F), // [EC Internal Use for Fan Duty Table Creation] |
| 399 | Offset(0x90), // [EC internal use] |
| 400 | Offset(0xA0), // [Battery Information Area]~ offset:0AFh |
| 401 | Offset(0xB0), // [Battery 0 charge start capacity] |
| 402 | Offset(0xB1), // [Battery 0 charge stop capacity] |
| 403 | Offset(0xB2), // [Battery 1 charge start capacity] |
| 404 | Offset(0xB3), // [Battery 1 charge stop capacity] |
| 405 | |
| 406 | Offset(0xB4), // [Battery 0 control] |
| 407 | // 01h Stop refreshing the battery |
| 408 | // 02h Refresh the battery |
| 409 | // 07h Set long life span mode |
| 410 | // 08h Set long run time mode |
| 411 | |
| 412 | Offset(0xB5), // [Battery 1 control] |
| 413 | // Offset B6-C7 : reserved |
| 414 | |
| 415 | Offset(0xC8), // [Adaptive Thermal Management (ATM)] |
| 416 | ATMX, 8, // bit 7-4 - Thermal Table & bit 3-0 - Fan Speed Table |
| 417 | |
| 418 | Offset(0xC9), // [Wattage of AC/DC] |
| 419 | AC65, 8, // |
| 420 | |
| 421 | Offset(0xCA), // Reserved - but should be 0 |
| 422 | |
| 423 | Offset(0xCB), // [ATM configuration] |
| 424 | BFUD, 1, // bit 0 - Battery FUD Flag |
| 425 | , 7, // bit 1~7 - Reserved |
| 426 | |
| 427 | Offset(0xCC), // |
| 428 | PWMH, 8, // CC : AC Power Consumption (MSB) |
| 429 | PWML, 8, // CD : AC Power Consumption (LSB) - unit: 100mW |
| 430 | |
| 431 | Offset(0xCE), // [Configuration Space 4] |
| 432 | , 2, // Windows key mode |
| 433 | , 2, // Application key mode |
| 434 | , 1, // Swap the Fn key and the left Ctrl key |
| 435 | , 3, // Reserved bits[5:7] |
| 436 | |
| 437 | Offset(0xCF), // [Configuration Space 5] |
| 438 | HSID, 8, // Hand shaking byte of system information ID |
| 439 | |
| 440 | Offset(0xD0), // [EC Type] |
| 441 | // D1-DF : reserved |
| 442 | |
| 443 | Offset(0xE0), // @@ Mapping to old EC RAM for battery information |
| 444 | ECRC, 16, // BAT1 Sys command [0] RC |
| 445 | ECAC, 16, // BAT1 Sys command [0] AV_I |
| 446 | ECVO, 16, // BAT1 Sys command [0] Voltage |
| 447 | |
| 448 | // E1-E7 : reserved |
| 449 | Offset(0xE8), // [Version 0] |
| 450 | Offset(0xE9), // [Version 1] |
| 451 | Offset(0xEA), // [Machine ID] |
| 452 | Offset(0xEB), // [Function Specification Minor Version] |
| 453 | Offset(0xEC), // [EC capability 0] |
| 454 | Offset(0xED), // [EC capability 1] |
| 455 | |
| 456 | Offset(0xEE), // [Highest battery level] |
| 457 | MBTH, 4, // bit 3-0: battery 0 highest level |
| 458 | SBTH, 4, // bit 7-4: battery 1 highest level |
| 459 | // note: if highest level is 0 or 0xF, it means not defined |
| 460 | // (in this case, use default hightest level, it is 6) |
| 461 | |
| 462 | Offset(0xEF), // [EC Function Specification Major Version] |
| 463 | Offset(0xF0), // [Build ID]~ offset:0F7h |
| 464 | |
| 465 | Offset(0xF8), // [Build Date (F8: MSB, F9:LSB)] |
| 466 | , 4, // bit 3-0: day(1-31) |
| 467 | , 4, // bit 7-4: month(1-12) |
| 468 | , 8, // bit 15-8: year(2000 base) |
| 469 | |
| 470 | Offset(0xFA), // [Build Time (in 2seconds)] |
| 471 | // ex: when index FAh=5Ah and index FBh=ADh, Build Time is 5AADh .. 12:53:46 |
| 472 | |
| 473 | Offset(0xFC), // [reserved]~ offset:0FFh |
| 474 | } // End of ERAM |
| 475 | |
| 476 | // |
| 477 | // Battery Information ID : 00/10 |
| 478 | // |
| 479 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 480 | { |
| 481 | Offset(0xA0), |
| 482 | SBRC, 16, // Remaining Capacity |
| 483 | SBFC, 16, // Fully Charged Capacity |
| 484 | SBAE, 16, // Average Time To Empty |
| 485 | SBRS, 16, // Relative State Of Charge |
| 486 | SBAC, 16, // Average Current |
| 487 | SBVO, 16, // Voltage |
| 488 | SBAF, 16, // Average Time To Full |
| 489 | SBBS, 16, // Battery State |
| 490 | } |
| 491 | |
| 492 | // |
| 493 | // Battery Information ID : 01/11 |
| 494 | // |
| 495 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 496 | { |
| 497 | Offset(0xA0), |
| 498 | // Battery Mode(w) |
| 499 | , 15, |
| 500 | SBCM, 1, // bit 15 - CAPACITY_MODE |
| 501 | // 0: Report in mA/mAh ; 1: Enabled |
| 502 | SBMD, 16, // Manufacture Data |
| 503 | SBCC, 16, // Cycle Count |
| 504 | } |
| 505 | |
| 506 | // |
| 507 | // Battery Information ID : 02/12 |
| 508 | // |
| 509 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 510 | { |
| 511 | Offset(0xA0), |
| 512 | SBDC, 16, // Design Capacity |
| 513 | SBDV, 16, // Design Voltage |
| 514 | SBOM, 16, // Optional Mfg Function 1 |
| 515 | SBSI, 16, // Specification Info |
| 516 | SBDT, 16, // Manufacture Date |
| 517 | SBSN, 16, // Serial Number |
| 518 | } |
| 519 | |
| 520 | // |
| 521 | // Battery Information ID : 04/14 |
| 522 | // |
| 523 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 524 | { |
| 525 | Offset(0xA0), |
| 526 | SBCH, 32, // Device Checmistory (string) |
| 527 | } |
| 528 | |
| 529 | // |
| 530 | // Battery Information ID : 05/15 |
| 531 | // |
| 532 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 533 | { |
| 534 | Offset(0xA0), |
| 535 | SBMN, 128, // Manufacture Name (s) |
| 536 | } |
| 537 | |
| 538 | // |
| 539 | // Battery Information ID : 06/16 |
| 540 | // |
| 541 | Field (ERAM, ByteAcc, NoLock, Preserve) |
| 542 | { |
| 543 | Offset(0xA0), |
| 544 | SBDN, 128, // Device Name (s) |
| 545 | } |
| 546 | |
| 547 | Method (_CRS, 0, NotSerialized) |
| 548 | { |
| 549 | Name (ECMD, ResourceTemplate() |
| 550 | { |
| 551 | IO (Decode16, 0x62, 0x62, 0, 1) |
| 552 | IO (Decode16, 0x66, 0x66, 0, 1) |
| 553 | }) |
| 554 | Return (ECMD) |
| 555 | } |
| 556 | |
| 557 | Method (_REG, 2, NotSerialized) |
| 558 | { |
| 559 | // Initialize AC power state |
| 560 | Store (ACPW, \PWRS) |
| 561 | |
| 562 | // Initialize LID switch state |
| 563 | Store (NOT(HPLD), \LIDS) |
| 564 | |
| 565 | // Enable OS control of fan speed |
| 566 | // TODO Store (One, FCOS) |
| 567 | |
| 568 | // Force a read of CPU temperature |
| 569 | // TODO Which temperature corresponds to the CPU? |
| 570 | Store (TMP0, Local0) |
Vladimir Serbinenko | b27c24f | 2016-02-08 00:10:44 +0100 | [diff] [blame] | 571 | /* So that we don't get a warning that Local0 is unused. */ |
| 572 | Increment (Local0) |
| 573 | |
Stefan Reinauer | 7e56855 | 2013-03-13 17:03:04 -0700 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | /* Attention Codes |
| 577 | * 00h No Event |
| 578 | * 01h-0Fh Reserved for ACPI Events |
| 579 | * 10h-1Fh Hotkey Events |
| 580 | * 22h Critical Low Battery |
| 581 | * 23h Battery Empty |
| 582 | * 24h Trip Point Capacity Event for Battery 0 |
| 583 | * 26h AC Adapter Attached |
| 584 | * 27h AC Adapter Detached |
| 585 | * 28h Power Off Switch Pressed |
| 586 | * 29h Power Off Switch Released |
| 587 | * 2Ah LID Open |
| 588 | * 2Bh LID Close |
| 589 | * 3Eh PME Event |
| 590 | * 40h Thermal Event |
| 591 | * 41h Global Wireless Enable Switch |
| 592 | * 43h Mute State Change |
| 593 | * 4Ah Battery 0 Attach/Detach |
| 594 | * 4Bh Battery 0 State Change |
| 595 | * 66h Mute Button |
| 596 | */ |
| 597 | |
| 598 | // Battery at critical low state |
| 599 | Method (_Q22) |
| 600 | { |
| 601 | If (MBTS) |
| 602 | { |
| 603 | Notify (BATX, 0x80) |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | // AC Power Connected |
| 608 | Method (_Q26, 0, NotSerialized) |
| 609 | { |
| 610 | Store (One, \PWRS) |
| 611 | Notify (AC, 0x80) |
| 612 | Notify (BATX, 0x80) |
| 613 | \PNOT () |
| 614 | } |
| 615 | |
| 616 | // AC Power Removed |
| 617 | Method (_Q27, 0, NotSerialized) |
| 618 | { |
| 619 | Store (Zero, \PWRS) |
| 620 | Notify (AC, 0x80) |
| 621 | \PNOT () |
| 622 | } |
| 623 | |
| 624 | // LID Open |
| 625 | Method (_Q2A) |
| 626 | { |
| 627 | Store (One, \LIDS) |
| 628 | Notify (\_SB.LID0, 0x80) |
| 629 | } |
| 630 | |
| 631 | // LID Close (Suspend Trigger) |
| 632 | Method (_Q2B) |
| 633 | { |
| 634 | Store (Zero, \LIDS) |
| 635 | Notify (\_SB.LID0, 0x80) |
| 636 | } |
| 637 | |
| 638 | // Battery Attach/Detach Event |
| 639 | Method (_Q4A) |
| 640 | { |
| 641 | Notify (BATX, 0x80) |
| 642 | Notify (BATX, 0x81) |
| 643 | \PNOT () |
| 644 | } |
| 645 | |
| 646 | // Battery State Change Event |
| 647 | Method (_Q4B) |
| 648 | { |
| 649 | Notify (BATX, 0x80) |
| 650 | } |
| 651 | |
| 652 | // Global Wireless Disable/Enable Event |
| 653 | Method (_Q41, 0, NotSerialized) |
| 654 | { |
| 655 | IF (DCWL) //if Wlan exist |
| 656 | { |
| 657 | //TODO Store (WLAT, LANE) |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | #include "ac.asl" |
| 662 | #include "battery.asl" |
| 663 | // TODO #include "fan.asl" |
| 664 | } |