blob: 634e2430758f784af6b285a823b2cdad0e092f21 [file] [log] [blame]
Duncan Lauriea802be22018-10-15 15:01:15 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2018 Google LLC
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.
14 */
15
16Device (WLCO)
17{
18 Name (_HID, "GOOG000C")
19 Name (_UID, 1)
20 Name (_DDN, "Wilco EC Command Device")
Duncan Lauriedb48f7e2018-10-29 16:49:02 -070021#ifdef EC_WAKE_PIN
22 Name (_PRW, Package () { EC_WAKE_PIN, 0x5 })
23#endif
Duncan Lauriea802be22018-10-15 15:01:15 -070024
25 Method (_STA)
26 {
27 Return (0xf)
28 }
29
30 Name (_CRS, ResourceTemplate ()
31 {
32 IO (Decode16,
33 CONFIG_EC_BASE_HOST_DATA,
34 CONFIG_EC_BASE_HOST_DATA,
35 4, 4)
36 IO (Decode16,
37 CONFIG_EC_BASE_HOST_COMMAND,
38 CONFIG_EC_BASE_HOST_COMMAND,
39 4, 4)
40 IO (Decode16,
41 CONFIG_EC_BASE_PACKET,
42 CONFIG_EC_BASE_PACKET,
43 16, 16)
44 })
45
46 Name (_PRS, ResourceTemplate ()
47 {
48 StartDependentFn (0, 0) {
49 IO (Decode16,
50 CONFIG_EC_BASE_HOST_DATA,
51 CONFIG_EC_BASE_HOST_DATA,
52 4, 4)
53 IO (Decode16,
54 CONFIG_EC_BASE_HOST_COMMAND,
55 CONFIG_EC_BASE_HOST_COMMAND,
56 4, 4)
57 IO (Decode16,
58 CONFIG_EC_BASE_PACKET,
59 CONFIG_EC_BASE_PACKET,
60 16, 16)
61 }
62 EndDependentFn ()
63 })
64}
Duncan Laurieaaac6782019-02-01 09:37:34 -080065
66Device (WEVT)
67{
68 Name (_HID, "GOOG000D")
69 Name (_UID, 1)
70 Name (_DDN, "Wilco EC Event Interface")
71
72 Method (_STA)
73 {
74 Return (0xB)
75 }
76
77 /* Get Event Buffer */
78 Method (QSET, 0, Serialized)
79 {
80 /* Get count of event bytes */
81 Local0 = R (QSEC)
82 Name (QBUF, Buffer (Local0) {})
83
84 /* Fill QS event buffer with Local0 bytes */
85 For (Local1 = 0, Local1 < Local0, Local1++) {
86 QBUF[Local1] = R (QSEB)
87 }
88
89 Printf ("QS = %o", QBUF)
90 Return (QBUF)
91 }
92}