blob: 67944487665b50298c649bb8f1c53b669d35940b [file] [log] [blame]
Stefan Reinauerd3801f42012-03-30 15:12:22 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 The ChromiumOS 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 Reinauerd3801f42012-03-30 15:12:22 -070014 */
15
16// Scope is \_SB.PCI0.LPCB
17
18Device (SIO) {
Martin Roth56033a92015-11-23 14:34:51 -070019 Name (_ADR, 0x2E)
Stefan Reinauerd3801f42012-03-30 15:12:22 -070020 OperationRegion (SIOA, SystemIO, 0x2E, 0x02)
21 Field (SIOA, ByteAcc, NoLock, Preserve)
22 {
23 SI2E, 8,
24 SI2F, 8,
25 }
26
27 IndexField (SI2E, SI2F, ByteAcc, NoLock, Preserve)
28 {
29 Offset (0x07),
30 SLDN, 8, /* Logical Device Number */
31 Offset (0x30),
32 SACT, 8, /* Activate */
33 Offset (0x60),
34 IO0H, 8, /* Base Address 0 MSB */
35 IO0L, 8, /* Base Address 0 LSB */
36 Offset (0x62),
37 IO1H, 8, /* Base Address 1 MSB */
38 IO1L, 8, /* Base Address 1 LSB */
39 Offset (0x70),
40 IQ00, 8, /* Interrupt Select */
41 }
42
43 Name (LPM1, 1) /* ACPI PM1 */
44 Name (LEC1, 2) /* EC 1 */
45 Name (LEC2, 3) /* EC 2 */
46 Name (LSP1, 4) /* Serial Port */
47 Name (LKBC, 7) /* Keyboard */
48 Name (LEC0, 8) /* EC 0 */
49 Name (LMBX, 9) /* Mailbox */
50
51 Method (ENTR, 0, NotSerialized)
52 {
53 Store (0x55, SI2E)
54 }
55
56 Method (EXIT, 0, NotSerialized)
57 {
58 Store (0xaa, SI2E)
59 }
60
61 /* Parse activate register for an LDN */
62 Method (ISEN, 1, NotSerialized)
63 {
64 ENTR ()
65 Store (Arg0, SLDN)
66 Store (SACT, Local0)
67 EXIT ()
68
69 /* Check if it exists */
70 If (LEqual (Local0, 0xFF))
71 {
72 Return (0x00)
73 }
74
75 /* Check if activated */
76 If (LEqual (Local0, One))
77 {
78 Return (0x0F)
79 }
80 Else
81 {
82 Return (0x0D)
83 }
84 }
85
86 /* Enable an LDN via the activate register */
87 Method (SENA, 1, NotSerialized)
88 {
89 ENTR ()
90 Store (Arg0, SLDN)
91 Store (One, SACT)
92 EXIT ()
93 }
94
95 /* Disable an LDN via the activate register */
96 Method (SDIS, 1, NotSerialized)
97 {
98 ENTR ()
99 Store (Arg0, SLDN)
100 Store (Zero, SACT)
101 EXIT ()
102 }
103
104#ifdef SIO_ENABLE_SPM1
105 Device (SPM1) {
106 Name (_HID, EISAID ("PNP0C02"))
107 Name (_UID, 1)
108
109 Method (_STA, 0, NotSerialized) {
110 Return (ISEN (LPM1))
111 }
112
113 Name (_CRS, ResourceTemplate ()
114 {
115 IO (Decode16, SIO_SPM1_IO0, SIO_SPM1_IO0, 0x08, 0x08)
116 })
117
118 Name (_PRS, ResourceTemplate ()
119 {
120 IO (Decode16, SIO_SPM1_IO0, SIO_SPM1_IO0, 0x08, 0x08)
121 })
122 }
123#endif
124
125#ifdef SIO_ENABLE_SEC1
126 Device (SEC1) {
127 Name (_HID, EISAID ("PNP0C09"))
128 Name (_UID, 2)
129
130 Method (_STA, 0, NotSerialized) {
131 Return (ISEN (LEC1))
132 }
133
134 Name (_CRS, ResourceTemplate ()
135 {
136 IO (Decode16, SIO_SEC1_IO0, SIO_SEC1_IO0, 0x04, 0x04)
137 })
138
139 Name (_PRS, ResourceTemplate ()
140 {
141 IO (Decode16, SIO_SEC1_IO0, SIO_SEC1_IO0, 0x04, 0x04)
142 })
143 }
144#endif
145
146#ifdef SIO_ENABLE_SEC2
147 Device (SEC2) {
148 Name (_HID, EISAID ("PNP0C09"))
149 Name (_UID, 3)
150
151 Method (_STA, 0, NotSerialized) {
152 Return (ISEN (LEC2))
153 }
154
155 Name (_CRS, ResourceTemplate ()
156 {
157 IO (Decode16, SIO_SEC2_IO0, SIO_SEC2_IO0, 0x04, 0x04)
158 })
159
160 Name (_PRS, ResourceTemplate ()
161 {
162 IO (Decode16, SIO_SEC2_IO0, SIO_SEC2_IO0, 0x04, 0x04)
163 })
164 }
165#endif
166
167#ifdef SIO_ENABLE_SSP1
168 Device (SSP1) {
169 Name (_HID, EISAID ("PNP0501"))
170 Name (_UID, 4)
171
172 Method (_STA, 0, NotSerialized) {
173 Return (ISEN (LSP1))
174 }
175
176 Name (_CRS, ResourceTemplate ()
177 {
178 IO (Decode16, SIO_SSP1_IO0, SIO_SSP1_IO0, 0x08, 0x08)
179 IRQNoFlags () {SIO_SSP1_IRQ}
180 })
181
182 Name (_PRS, ResourceTemplate ()
183 {
184 IO (Decode16, SIO_SSP1_IO0, SIO_SSP1_IO0, 0x08, 0x08)
185 IRQNoFlags () {SIO_SSP1_IRQ}
186 })
187 }
188#endif
189
190#ifdef SIO_ENABLE_SKBC
191 Device (SKBC) // Keyboard
192 {
193 Name (_HID, EISAID("PNP0303"))
194 Name (_CID, EISAID("PNP030B"))
195
196 Method (_STA, 0, NotSerialized) {
197 Return (ISEN (LKBC))
198 }
199
200 Name (_CRS, ResourceTemplate()
201 {
202 IO (Decode16, 0x60, 0x60, 0x01, 0x01)
203 IO (Decode16, 0x64, 0x64, 0x01, 0x01)
204 IRQNoFlags () {1}
205 })
206
207 Name (_PRS, ResourceTemplate()
208 {
209 IO (Decode16, 0x60, 0x60, 0x01, 0x01)
210 IO (Decode16, 0x64, 0x64, 0x01, 0x01)
211 IRQNoFlags () {1}
212 })
213 }
214#endif
215
216#ifdef SIO_ENABLE_SEC0
217 Device (SEC0) {
218 Name (_HID, EISAID ("PNP0C09"))
219 Name (_UID, 8)
220
221 Method (_STA, 0, NotSerialized) {
222 Return (ISEN (LEC0))
223 }
224
225 Name (_CRS, ResourceTemplate ()
226 {
227 IO (Decode16, SIO_SEC0_IO0, SIO_SEC0_IO0, 0x04, 0x04)
228 })
229
230 Name (_PRS, ResourceTemplate ()
231 {
232 IO (Decode16, SIO_SEC0_IO0, SIO_SEC0_IO0, 0x04, 0x04)
233 })
234 }
235#endif
236
237#ifdef SIO_ENABLE_SMBX
238 Device (SMBX) // Mailbox
239 {
240 Name (_HID, EISAID("PNP0C02"))
241 Name (_UID, 9)
242
243 Method (_STA, 0, NotSerialized) {
244 Return (ISEN (LMBX))
245 }
246
247 Name (_CRS, ResourceTemplate()
248 {
Martin Roth56033a92015-11-23 14:34:51 -0700249 IO (Decode16, SIO_SMBX_IO0, SIO_SMBX_IO0 + 0x34, 0x01, 0x34)
Stefan Reinauerd3801f42012-03-30 15:12:22 -0700250 })
251
252 Name (_PRS, ResourceTemplate()
253 {
Martin Roth56033a92015-11-23 14:34:51 -0700254 IO (Decode16, SIO_SMBX_IO0, SIO_SMBX_IO0 + 0x34, 0x01, 0x34)
Stefan Reinauerd3801f42012-03-30 15:12:22 -0700255 })
256 }
257#endif
258}