blob: da495b8279447b2132d916614c00df722cf35685 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lee Leahy77ff0b12015-05-05 15:07:29 -07002
Kane Chen54093e42015-10-26 13:02:33 +08003/* The below definitions are used for customization
4 * Some boards/devices may need different data hold time
5 */
6#ifndef BOARD_I2C1_DATA_HOLD_TIME
7#define BOARD_I2C1_DATA_HOLD_TIME 6
8#endif
9
10#ifndef BOARD_I2C2_DATA_HOLD_TIME
11#define BOARD_I2C2_DATA_HOLD_TIME 6
12#endif
13
14#ifndef BOARD_I2C3_DATA_HOLD_TIME
15#define BOARD_I2C3_DATA_HOLD_TIME 6
16#endif
17
18#ifndef BOARD_I2C4_DATA_HOLD_TIME
19#define BOARD_I2C4_DATA_HOLD_TIME 6
20#endif
21
22#ifndef BOARD_I2C5_DATA_HOLD_TIME
23#define BOARD_I2C5_DATA_HOLD_TIME 6
24#endif
25
26#ifndef BOARD_I2C6_DATA_HOLD_TIME
27#define BOARD_I2C6_DATA_HOLD_TIME 6
28#endif
29
30#ifndef BOARD_I2C7_DATA_HOLD_TIME
31#define BOARD_I2C7_DATA_HOLD_TIME 6
32#endif
33
Lee Leahy77ff0b12015-05-05 15:07:29 -070034Device (SDM1)
35{
36 Name (_HID, "INTL9C60")
37 Name (_UID, 1)
38 Name (_DDN, "DMA Controller #1")
39
40 Name (RBUF, ResourceTemplate()
41 {
42 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
43 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
44 {
45 LPSS_DMA1_IRQ
46 }
47 })
48
49 Method (_CRS)
50 {
51 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +010052 RBAS = \S0B0
Lee Leahy77ff0b12015-05-05 15:07:29 -070053 Return (^RBUF)
54 }
55
56 Method (_STA)
57 {
Felix Singeredec4d92022-12-11 21:25:32 +010058 If (\S0EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070059 Return (0xF)
60 } Else {
61 Return (0x0)
62 }
63 }
64}
65
66Device (SDM2)
67{
68 Name (_HID, "INTL9C60")
69 Name (_UID, 2)
70 Name (_DDN, "DMA Controller #2")
71
72 Name (RBUF, ResourceTemplate()
73 {
74 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
75 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
76 {
77 LPSS_DMA2_IRQ
78 }
79 })
80
81 Method (_CRS)
82 {
83 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +010084 RBAS = \S8B0
Lee Leahy77ff0b12015-05-05 15:07:29 -070085 Return (^RBUF)
86 }
87
88 Method (_STA)
89 {
Felix Singeredec4d92022-12-11 21:25:32 +010090 If (\S8EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070091 Return (0xF)
92 } Else {
93 Return (0x0)
94 }
95 }
96}
97
98Device (I2C1)
99{
Lee Leahy32471722015-04-20 15:20:28 -0700100 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700101 Name (_UID, 1)
102 Name (_DDN, "I2C Controller #1")
103
104 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800105 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C1_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700106
107 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800108 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C1_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700109
110 Name (RBUF, ResourceTemplate()
111 {
112 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
113 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
114 {
115 LPSS_I2C1_IRQ
116 }
117 FixedDMA (0x10, 0x0, Width32Bit, )
118 FixedDMA (0x11, 0x1, Width32Bit, )
119 })
120
121 Method (_CRS)
122 {
123 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100124 RBAS = \S1B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700125 Return (^RBUF)
126 }
127
128 Method (_STA)
129 {
Felix Singeredec4d92022-12-11 21:25:32 +0100130 If (\S1EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700131 Return (0xF)
132 } Else {
133 Return (0x0)
134 }
135 }
136
137 OperationRegion (KEYS, SystemMemory, S1B1, 0x100)
138 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
139 {
140 Offset (0x84),
141 PSAT, 32,
142 }
143
144 Method (_PS3)
145 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100146 PSAT |= 3
147 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700148 }
149
150 Method (_PS0)
151 {
152 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100153 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700154 }
155}
156
157Device (I2C2)
158{
Lee Leahy32471722015-04-20 15:20:28 -0700159 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700160 Name (_UID, 2)
161 Name (_DDN, "I2C Controller #2")
162
163 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800164 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C2_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700165
166 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800167 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C2_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700168
169 Name (RBUF, ResourceTemplate()
170 {
171 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
172 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
173 {
174 LPSS_I2C2_IRQ
175 }
Matt DeVillierf6cfa712017-06-02 14:33:22 -0500176 FixedDMA (0x12, 0x2, Width32Bit, )
177 FixedDMA (0x13, 0x3, Width32Bit, )
Lee Leahy77ff0b12015-05-05 15:07:29 -0700178 })
179
180 Method (_CRS)
181 {
182 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100183 RBAS = \S2B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700184 Return (^RBUF)
185 }
186
187 Method (_STA)
188 {
Felix Singeredec4d92022-12-11 21:25:32 +0100189 If (\S2EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700190 Return (0xF)
191 } Else {
192 Return (0x0)
193 }
194 }
195
196 OperationRegion (KEYS, SystemMemory, S2B1, 0x100)
197 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
198 {
199 Offset (0x84),
200 PSAT, 32,
201 }
202
203 Method (_PS3)
204 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100205 PSAT |= 3
206 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700207 }
208
209 Method (_PS0)
210 {
211 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100212 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700213 }
214}
215
216Device (I2C3)
217{
Lee Leahy32471722015-04-20 15:20:28 -0700218 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700219 Name (_UID, 3)
220 Name (_DDN, "I2C Controller #3")
221
222 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800223 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C3_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700224
225 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800226 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C3_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700227
228 Name (RBUF, ResourceTemplate()
229 {
230 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
231 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
232 {
233 LPSS_I2C3_IRQ
234 }
Matt DeVillierf6cfa712017-06-02 14:33:22 -0500235 FixedDMA (0x14, 0x4, Width32Bit, )
236 FixedDMA (0x15, 0x5, Width32Bit, )
Lee Leahy77ff0b12015-05-05 15:07:29 -0700237 })
238
239 Method (_CRS)
240 {
241 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100242 RBAS = \S3B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700243 Return (^RBUF)
244 }
245
246 Method (_STA)
247 {
Felix Singeredec4d92022-12-11 21:25:32 +0100248 If (\S3EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700249 Return (0xF)
250 } Else {
251 Return (0x0)
252 }
253 }
254
255 OperationRegion (KEYS, SystemMemory, S3B1, 0x100)
256 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
257 {
258 Offset (0x84),
259 PSAT, 32,
260 }
261
262 Method (_PS3)
263 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100264 PSAT |= 3
265 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700266 }
267
268 Method (_PS0)
269 {
270 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100271 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700272 }
273}
274
275Device (I2C4)
276{
Lee Leahy32471722015-04-20 15:20:28 -0700277 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700278 Name (_UID, 4)
279 Name (_DDN, "I2C Controller #4")
280
281 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800282 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C4_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700283
284 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800285 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C4_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700286
287 Name (RBUF, ResourceTemplate()
288 {
289 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
290 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
291 {
292 LPSS_I2C4_IRQ
293 }
Matt DeVillierf6cfa712017-06-02 14:33:22 -0500294 FixedDMA (0x16, 0x6, Width32Bit, )
295 FixedDMA (0x17, 0x7, Width32Bit, )
Lee Leahy77ff0b12015-05-05 15:07:29 -0700296 })
297
298 Method (_CRS)
299 {
300 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100301 RBAS = \S4B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700302 Return (^RBUF)
303 }
304
305 Method (_STA)
306 {
Felix Singeredec4d92022-12-11 21:25:32 +0100307 If (\S4EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700308 Return (0xF)
309 } Else {
310 Return (0x0)
311 }
312 }
313
314 OperationRegion (KEYS, SystemMemory, S4B1, 0x100)
315 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
316 {
317 Offset (0x84),
318 PSAT, 32,
319 }
320
321 Method (_PS3)
322 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100323 PSAT |= 3
324 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700325 }
326
327 Method (_PS0)
328 {
329 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100330 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700331 }
332}
333
334Device (I2C5)
335{
Lee Leahy32471722015-04-20 15:20:28 -0700336 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700337 Name (_UID, 5)
338 Name (_DDN, "I2C Controller #5")
339
340 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800341 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C5_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700342
343 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800344 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C5_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700345
346 Name (RBUF, ResourceTemplate()
347 {
348 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
349 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
350 {
351 LPSS_I2C5_IRQ
352 }
Matt DeVillierf6cfa712017-06-02 14:33:22 -0500353 FixedDMA (0x18, 0x0, Width32Bit, )
354 FixedDMA (0x19, 0x1, Width32Bit, )
Lee Leahy77ff0b12015-05-05 15:07:29 -0700355 })
356
357 Method (_CRS)
358 {
359 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100360 RBAS = \S5B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700361 Return (^RBUF)
362 }
363
364 Method (_STA)
365 {
Felix Singeredec4d92022-12-11 21:25:32 +0100366 If (\S5EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700367 Return (0xF)
368 } Else {
369 Return (0x0)
370 }
371 }
372
373 OperationRegion (KEYS, SystemMemory, S5B1, 0x100)
374 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
375 {
376 Offset (0x84),
377 PSAT, 32,
378 }
379
380 Method (_PS3)
381 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100382 PSAT |= 3
383 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700384 }
385
386 Method (_PS0)
387 {
388 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100389 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700390 }
391}
392
393Device (I2C6)
394{
Lee Leahy32471722015-04-20 15:20:28 -0700395 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700396 Name (_UID, 6)
397 Name (_DDN, "I2C Controller #6")
398
399 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800400 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C6_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700401
402 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800403 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C6_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700404
405 Name (RBUF, ResourceTemplate()
406 {
407 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
408 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
409 {
410 LPSS_I2C6_IRQ
411 }
Matt DeVillierf6cfa712017-06-02 14:33:22 -0500412 FixedDMA (0x1A, 0x2, Width32Bit, )
413 FixedDMA (0x1B, 0x3, Width32Bit, )
Lee Leahy77ff0b12015-05-05 15:07:29 -0700414 })
415
416 Method (_CRS)
417 {
418 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100419 RBAS = \S6B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700420 Return (^RBUF)
421 }
422
423 Method (_STA)
424 {
Felix Singeredec4d92022-12-11 21:25:32 +0100425 If (\S6EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700426 Return (0xF)
427 } Else {
428 Return (0x0)
429 }
430 }
431
432 OperationRegion (KEYS, SystemMemory, S6B1, 0x100)
433 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
434 {
435 Offset (0x84),
436 PSAT, 32,
437 }
438
439 Method (_PS3)
440 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100441 PSAT |= 3
442 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700443 }
444
445 Method (_PS0)
446 {
447 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100448 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700449 }
450}
451
452Device (I2C7)
453{
Lee Leahy32471722015-04-20 15:20:28 -0700454 Name (_HID, "808622C1")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700455 Name (_UID, 7)
456 Name (_DDN, "I2C Controller #7")
457
458 /* Standard Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800459 Name (SSCN, Package () { 0x200, 0x200, BOARD_I2C7_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700460
461 /* Fast Mode: HCNT, LCNT, SDA Hold Time */
Kane Chen54093e42015-10-26 13:02:33 +0800462 Name (FMCN, Package () { 0x55, 0x99, BOARD_I2C7_DATA_HOLD_TIME })
Lee Leahy77ff0b12015-05-05 15:07:29 -0700463
464 Name (RBUF, ResourceTemplate()
465 {
466 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
467 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
468 {
469 LPSS_I2C7_IRQ
470 }
Matt DeVillierf6cfa712017-06-02 14:33:22 -0500471 FixedDMA (0x1C, 0x4, Width32Bit, )
472 FixedDMA (0x1D, 0x5, Width32Bit, )
Lee Leahy77ff0b12015-05-05 15:07:29 -0700473 })
474
475 Method (_CRS)
476 {
477 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100478 RBAS = \S7B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700479 Return (^RBUF)
480 }
481
482 Method (_STA)
483 {
Felix Singeredec4d92022-12-11 21:25:32 +0100484 If (\S7EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700485 Return (0xF)
486 } Else {
487 Return (0x0)
488 }
489 }
490
491 OperationRegion (KEYS, SystemMemory, S7B1, 0x100)
492 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
493 {
494 Offset (0x84),
495 PSAT, 32,
496 }
497
498 Method (_PS3)
499 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100500 PSAT |= 3
501 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700502 }
503
504 Method (_PS0)
505 {
506 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100507 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700508 }
509}
510
Lee Leahy77ff0b12015-05-05 15:07:29 -0700511Device (UAR1)
512{
Lee Leahy32471722015-04-20 15:20:28 -0700513 Name (_HID, "8086228A")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700514 Name (_UID, 1)
515 Name (_DDN, "HS-UART Controller #1")
516
517 Name (RBUF, ResourceTemplate()
518 {
519 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
520 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
521 {
522 LPSS_HSUART1_IRQ
523 }
524 FixedDMA (0x2, 0x2, Width32Bit, )
525 FixedDMA (0x3, 0x3, Width32Bit, )
526 })
527
528 Method (_CRS)
529 {
530 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100531 RBAS = \SCB0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700532 Return (^RBUF)
533 }
534
535 Method (_STA)
536 {
Felix Singeredec4d92022-12-11 21:25:32 +0100537 If (\SCEN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700538 Return (0xF)
539 } Else {
540 Return (0x0)
541 }
542 }
543
544 OperationRegion (KEYS, SystemMemory, SCB1, 0x100)
545 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
546 {
547 Offset (0x84),
548 PSAT, 32,
549 }
550
551 Method (_PS3)
552 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100553 PSAT |= 3
554 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700555 }
556
557 Method (_PS0)
558 {
559 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100560 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700561 }
562}
563
564Device (UAR2)
565{
Lee Leahy32471722015-04-20 15:20:28 -0700566 Name (_HID, "8086228A")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700567 Name (_UID, 2)
568 Name (_DDN, "HS-UART Controller #2")
569
570 Name (RBUF, ResourceTemplate()
571 {
572 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
573 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
574 {
575 LPSS_HSUART2_IRQ
576 }
577 FixedDMA (0x4, 0x4, Width32Bit, )
578 FixedDMA (0x5, 0x5, Width32Bit, )
579 })
580
581 Method (_CRS)
582 {
583 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100584 RBAS = \SDB0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700585 Return (^RBUF)
586 }
587
588 Method (_STA)
589 {
Felix Singeredec4d92022-12-11 21:25:32 +0100590 If (\SDEN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700591 Return (0xF)
592 } Else {
593 Return (0x0)
594 }
595 }
596
597 OperationRegion (KEYS, SystemMemory, SDB1, 0x100)
598 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
599 {
600 Offset (0x84),
601 PSAT, 32,
602 }
603
604 Method (_PS3)
605 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100606 PSAT |= 3
607 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700608 }
609
610 Method (_PS0)
611 {
612 And (PSAT, 0xfffffffc, PSAT)
Felix Singer86bc2e72022-12-16 04:40:39 +0100613 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700614 }
615}