2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
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
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24 Name (_HID, EISAID("PNP0C09"))
27 Name (_GPE, 23) // GPI07 / GPE23 -> Runtime SCI
29 OperationRegion(ERAM, EmbeddedControl, 0x00, 0x37)
30 Field (ERAM, ByteAcc, NoLock, Preserve)
32 MODE, 1, // Thermal Policy (Quiet/Perform)
33 FAN, 1, // Fan Power (On/Off)
34 LIDS, 1, // LID Status (0=Open/1=Close)
35 LSW0, 1, // LCD Power Switch
37 BTYP, 1, // Battery Type (0=LiIon/1=NiMh)
38 MWKE, 1, // Enable Wakeup from RI
39 ADP, 1, // AC Adapter (0=Offline/1=Online)
40 BAT, 1, // Battery (0=Not Present/1=Present)
41 SLPT, 3, // Set Sleep Type on SLP enter (1=S1...4=S4)
42 CHRG, 1, // 0=Battery not charging/1=Battery charging
43 RI_W, 1, // Wake-up event source is RI
44 KB_W, 1, // Wake-up event source is keyboard
45 BATW, 1, // Wake-up event source is Battery Low
46 PMEW, 1, // Wake-up event source is PME
48 // Battery 0 Registers
49 // Battery Life = BRC0/BPR0
50 // Battery percentage = BRC0/BFC0 * 100
51 BDC0, 16, // Designed Capacity
52 BFC0, 16, // Last Full Charge Capacity
53 BDV0, 16, // Design Voltage
54 BPR0, 16, // Battery Present Rate
55 BRC0, 16, // Battery Remaining Capacity
56 BPV0, 16, // Battery Present Voltage
59 CTMP, 8, // CPU Temperature
61 CTRO, 8, // EC throttling on trip point
62 CRTT, 8, // Critical Shut-down Temperature
64 BKLL, 8, // Backlight Level
66 // Battery 2 Registers
69 BTY2, 1, // Battery Type (0=LiIon/1=NiMh)
71 BAT2, 1, // Battery (0=Not Present/1=Present)
73 CRG2, 1, // 0=Battery not charging/1=Battery charging
75 BDC2, 16, // Designed Capacity
76 BFC2, 16, // Last Full Charge Capacity
77 BDV2, 16, // Design Voltage
78 BPR2, 16, // Battery Present Rate
79 BRC2, 16, // Battery Remaining Capacity
80 BPV2, 16, // Battery Present Voltage
81 BTP2, 16, // Trip Point
83 PBMO, 2, // PBMO power control method
84 ECO, 1, // ECO on/off status
85 SUN, 1, // Sunlight Readable
86 RF, 1, // RF Enable/Disable status
87 DOCK, 1, // Dock In/Out status
88 CBAT, 1, // Car Battery status
89 APPS, 1, // OSD utility status
96 Name (ECMD, ResourceTemplate()
98 IO (Decode16, 0x62, 0x62, 1, 1)
99 IO (Decode16, 0x66, 0x66, 1, 1)
105 // EC Query methods, called upon SCI interrupts.
108 Notify (\_PR.CPU0, 0x80)
110 Store(1, \_SB.AC.ACST)
115 Store(0, \_SB.AC.ACST)
116 Notify(\_SB.AC, 0x80)
117 Notify(\_SB.BAT0, 0x80)
128 Notify(\_SB.BAT0, 0x00)
129 Notify(\_SB.AC, 0x80)
131 Notify(\_SB.AC, 0x80)
132 Notify(\_SB.BAT0, 0x01)
148 If (LEqual(RTCF, 0x00)) {
163 Notify(\_TZ.THRM, 0x80)
168 Notify(\_SB.ECO, 0x81)
173 Notify(\_SB.ECO, 0x82)
178 Notify(\_SB.ECO, 0x83)
183 Notify(\_SB.ECO, 0x84)
194 Notify (\_SB.ECO, 0x85)
201 Notify(\_SB.ECO, 0x86)
208 Notify(\_SB.ECO, 0x87)
213 Notify(\_SB.ECO, 0x88)
218 Notify(\_SB.ECO, 0x89)
223 Notify(\_SB.ECO, 0x8a)
230 Notify(\_SB.ECO, 0x8b)
236 Notify(\_SB.ECO, 0x8c)
258 Notify(\_SB.ECO, 0x93)
264 Notify(\_SB.ECO, 0x93)
270 Notify(\_SB.ECO, 0x92)
276 Notify(\_SB.ECO, 0x92)
279 /* Enable RF device */
285 /* Disable RF device */
291 /* ACBS LAN Power On */
299 /* ACBS LAN Power Off */
317 TRAP(0xd2) // Check AC Status
319 Notify(\_SB.ECO, 0x90)
324 TRAP(0xd2) // Check AC Status
326 Notify(\_SB.ECO, 0x90)
332 Notify(\_SB.ECO, 0x94)
337 Notify(\_SB.ECO, 0x95)
348 Notify(\_SB.ECO, 0x95)
354 Notify(\_SB.ECO, 0x94)
359 Notify(\_SB.ECO, 0x96)
364 Notify(\_SB.ECO, 0x97)
367 // TODO Scope _SB devices for AC power, LID, Power button
372 /* This device is used by the GETAC P470 Windows drivers. */
376 Name(_HID, "MTC0303") // MTC0303 BIOS Service Provider
377 Method (GDPD, 0, Serialized)
379 // Set flag byte to zero
382 If (And(BRTL, 0x01)) {
383 Or(Local0, 0x01, Local0)
386 If (And(BRTL, 0x02)) {
387 Or(Local0, 0x04, Local0)
390 If (And(BRTL, 0x04)) {
391 Or(Local0, 0x02, Local0)
394 If (And(BRTL, 0x30)) {
395 Or(Local0, 0x10, Local0)
398 If (And(BRTL, 0x40)) {
399 Or(Local0, 0x40, Local0)
405 Method (GDPC, 0, Serialized)
409 If (And(BRTL, 0x10)) {
410 Or(Local0, 0x04, Local0)
413 If (And( BRTL, 0x20)) {
414 Or(Local0, 0x01, Local0)
417 If (And(BRTL, 0x40)) {
418 Or(Local0, 0x02, Local0)
424 /* Set Brightness Level */
425 Method(SBLL, 1, Serialized)
428 TRAP(0xd5) // See mainboard_smi.c
432 /* Get Brightness Level */
433 Method(GBLL, 0, Serialized)
435 TRAP(0xd6) // See mainboard_smi.c
439 /* Get Brightness Level Medium? */
440 Method(GBLM, 0, Serialized)
443 // XXX don't we have to set the brightness?
448 Method(SUTE, 1, Serialized)
450 If (And(Arg0, 0x01)) {
459 Method(GECO, 0, Serialized)
466 Method(GBSL, 0, Serialized)
472 /* ??? Get LED/Device Enable Status */
473 Method(GRFD, 0, Serialized)
475 /* Let coreboot update the flags */
479 If(And(RFDV, 0x01)) {
480 Or(Local0, 0x01, Local0)
482 If(And(RFDV, 0x02)) {
483 Or(Local0, 0x02, Local0)
485 If(And(RFDV, 0x02)) {
486 Or(Local0, 0x02, Local0)
488 If(And(RFDV, 0x04)) {
489 Or(Local0, 0x04, Local0)
491 If(And(RFDV, 0x08)) {
492 Or(Local0, 0x08, Local0)
494 If(And(GP15, 0x01)) { // GDIS
495 Or(Local0, 0x10, Local0)
497 If(And(GP12, 0x01)) { // WIFI Led (WLED)
498 Or(Local0, 0x20, Local0)
500 If(And(BTEN, 0x01)) { // BlueTooth Enable
501 Or(Local0, 0x40, Local0)
503 If(And(GP10, 0x01)) { // GPS Enable
504 Or(Local0, 0x80, Local0)
511 Method(SRFD, 1, Serialized)
513 If (And(Arg0, 0x01)) {
514 Store (1, GP14) // GLED
515 Store (1, GP15) // GDIS
522 If (And(Arg0, 0x02)) {
523 Store (1, GP12) // WLED
524 Store (1, GP25) // WLAN
531 If (And(Arg0, 0x04)) {
532 Store (1, GP13) // BLED
535 Store (0, GP13) // BLED
542 Method(GDKD, 0, Serialized)
549 Method(SDKD, 1, Serialized)
555 /* Set IGD (Graphics) */
556 Method(SIGD, 1, Serialized)
558 If (And(Arg0, 0x01)) {
566 /* SMI-C? Set Mic? */
567 Method (SMIC, 1, Serialized)
569 If (And(Arg0, 0x01)) {
578 Method(GTSD, 0, Serialized)
580 Return (GP19) // TSDT
583 /* Not even decent function names anymore? */
584 Method(S024, 1, Serialized)
586 If (And(Arg0, 0x01)) {
595 Method(GCVD, 0, Serialized)
601 /* ??? Something with PATA */
602 Method(S025, 1, Serialized)
604 If(And(Arg0, 0x01)) {
607 Store (1, GP33) // CREN
610 Store (1, GP34) // CRRS
613 Notify(^^PCI0.PATA, 0)
614 Notify(^^PCI0.PATA.PRID, 0)
618 Store(0, GP33) // CREN
620 Notify(^^PCI0.PATA, 0)
621 Notify(^^PCI0.PATA.PRID, 0)
622 Notify(^^PCI0.PATA.PRID.DSK1, 1)
623 Notify(^^PCI0.PATA.PRID.DSK0, 1)
629 Method(G021, 0, Serialized)
632 If (LEqual(ACIN, 0)) {
635 If (LEqual(ODDS, 1)) {
637 Notify(^^PCI0.PATA, 0)
638 Notify(^^PCI0.PATA.PRID.DSK1, 1)
639 Notify(^^PCI0.PATA.PRID.DSK0, 1)
641 Store (0, GP33) // CREN
643 Notify(^^PCI0.PATA, 0)
644 Notify(^^PCI0.PATA.PRID.DSK1, 1)
645 Notify(^^PCI0.PATA.PRID.DSK0, 1)
655 Method(GRFS, 0, Serialized)
662 Method(S00B, 1, Serialized)