Debian Codegraph @

src/soc/intel/pantherlake/acpi/tcss.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <intelblocks/tcss.h>
4 #include <soc/iomap.h>
5
6 /*
7 * Type C Subsystem(TCSS) topology provides Runtime D3 support for USB host controller(xHCI),
8 * USB device controller(xDCI), Thunderbolt DMA devices and Thunderbolt PCIe controllers.
9 * PCIe RP0/RP1 is grouped with DMA0 and PCIe RP2/RP3 is grouped with DMA1.
10 */
11 #define TCSS_TBT_PCIE0_RP0 0
12 #define TCSS_TBT_PCIE0_RP1 1
13 #define TCSS_TBT_PCIE0_RP2 2
14 #define TCSS_TBT_PCIE0_RP3 3
15 #define TCSS_XHCI 4
16 #define TCSS_XDCI 5
17 #define TCSS_DMA0 6
18 #define TCSS_DMA1 7
19
20 /*
21 * MAILBOX_BIOS_CMD_TCSS_DEVEN_INTERFACE
22 * Command code 0x15
23 * Description: Gateway command for handling TCSS DEVEN clear/restore.
24 * Field PARAM1[15:8] of the _INTERFACE register is used in this command to select from
25 * a pre-defined set of subcommands.
26 */
27 #define MAILBOX_BIOS_CMD_TCSS_DEVEN_INTERFACE 0x00000015
28 #define TCSS_DEVEN_MAILBOX_SUBCMD_GET_STATUS 0 /* Sub-command 0 */
29 #define TCSS_DEVEN_MAILBOX_SUBCMD_TCSS_CHANGE_REQ 1 /* Sub-command 1 */
30 #define TCSS_IOM_ACK_TIMEOUT_IN_MS 100
31
32 #define MCHBAR_TCSS_DEVEN_OFFSET 0x73a8
33
34 #define REVISION_ID 1
35 #define UNRECOGNIZED_UUID 0x4
36 #define UNRECOGNIZED_REVISION 0x8
37
38 #define USB_TUNNELING 0x1
39 #define DISPLAY_PORT_TUNNELING 0x2
40 #define PCIE_TUNNELING 0x4
41 #define INTER_DOMAIN_USB4_INTERNET_PROTOCOL 0x8
42
43 Scope (\_SB)
44 {
45 /*
46 * Define PCH ACPIBASE IO as an ACPI operating region. The base address can be
47 * found in Device 31, Function 2, Offset 40h.
48 */
49 OperationRegion (PMIO, SystemIO, ACPI_BASE_ADDRESS, 0x80)
50 Field (PMIO, ByteAcc, NoLock, Preserve) {
51 Offset(0x6c), /* 0x6C, General Purpose Event 0 Status [127:96] */
52 , 19,
53 CPWS, 1, /* CPU WAKE STATUS */
54 Offset(0x7c), /* 0x7C, General Purpose Event 0 Enable [127:96] */
55 , 19,
56 CPWE, 1 /* CPU WAKE EN */
57 }
58
59 Name (C2PW, 0) /* Set default value to 0. */
60
61 /*
62 * C2PM (CPU to PCH Method)
63 *
64 * This object is Enable/Disable GPE_CPU_WAKE_EN.
65 * Arguments: (4)
66 * Arg0 - An Integer containing the device wake capability
67 * Arg1 - An Integer containing the target system state
68 * Arg2 - An Integer containing the target device state
69 * Arg3 - An Integer containing the request device type
70 * Return Value:
71 * return 0
72 */
73 Method (C2PM, 4, NotSerialized)
74 {
75 Local0 = 1 << Arg3
76 /* This method is used to enable/disable wake from Tcss Device (WKEN). */
77 If (Arg0 && Arg1)
78 { /* If entering Sx and enabling wake, need to enable WAKE capability. */
79 If (CPWE == 0) { /* If CPU WAKE EN is not set, Set it. */
80 If (CPWS) { /* If CPU WAKE STATUS is set, Clear it. */
81 /* Clear CPU WAKE STATUS by writing 1. */
82 CPWS = 1
83 }
84 CPWE = 1 /* Set CPU WAKE EN by writing 1. */
85 }
86 If ((C2PW & Local0) == 0) {
87 /* Set Corresponding Device En BIT in C2PW. */
88 C2PW |= Local0
89 }
90 } Else { /* If Staying in S0 or Disabling Wake. */
91 If (Arg0 || Arg2) { /* Check if Exiting D0 and arming for wake. */
92 /* If CPU WAKE EN is not set, Set it. */
93 If (CPWE == 0) {
94 /* If CPU WAKE STATUS is set, Clear it. */
95 If (CPWS) {
96 /* Clear CPU WAKE STATUS by writing 1. */
97 CPWS = 1
98 }
99 CPWE = 1 /* Set CPU WAKE EN by writing 1. */
100 }
101 If ((C2PW & Local0) == 0) {
102 /* Set Corresponding Device En BIT in C2PW. */
103 C2PW |= Local0
104 }
105 } Else {
106 /*
107 * Disable runtime PME, either because staying in D0 or
108 * disabling wake.
109 */
110 If ((C2PW & Local0) != 0) {
111 /*
112 * Clear Corresponding Device En BIT in C2PW.
113 */
114 C2PW &= ~Local0
115 }
116 If ((CPWE != 0) && (C2PW == 0)) {
117 /*
118 * If CPU WAKE EN is set, Clear it. Clear CPU WAKE EN
119 * by writing 0.
120 */
121 CPWE = 0
122 }
123 }
124 }
125 Return (0)
126 }
127
128 Method (_OSC, 4, Serialized)
129 {
130 CreateDWordField (Arg3, 0, CDW1)
131 If (Arg0 == ToUUID("0811B06E-4A27-44F9-8D60-3CBBC22E7B48")) {
132 /* Platform-Wide _OSC Capabilities
133 * Arg0: UUID = {0811B06E-4A27-44F9-8D60-3CBBC22E7B48}
134 * Arg1: Revision ID = 1
135 * Arg2: Count of entries (DWORD) in Arge3 (Integer): 3
136 * Arg3: DWORD capabilities buffer:
137 * First DWORD: The standard definition bits are used to return errors.
138 * Second DWORD: See ACPI specification Platform-Wide _OSC Capabilities
139 * DWORD2 table for Bits 0-17. Bit 18 is newly defined as native USB4
140 * support. The OS sets this bit to indicate support for an OSPM-native
141 * USB4 Connection Manager which handles USB4 connection events and
142 * link management.
143 */
144 If (Arg1 != REVISION_ID) {
145 CDW1 |= UNRECOGNIZED_REVISION
146 }
147 Return (Arg3)
148 #if CONFIG(SOFTWARE_CONNECTION_MANAGER)
149 /*
150 * Software Connection Manager doesn't work with Linux 5.13 or later and
151 * results in TBT ports timing out. Not advertising this results in
152 * Firmware Connection Manager being used and TBT works correctly.
153 */
154 } ElseIf (Arg0 == ToUUID("23A0D13A-26AB-486C-9C5F-0FFA525A575A")) {
155 /*
156 * Operating System Capabilities for USB4
157 * Arg0: UUID = {23A0D13A-26AB-486C-9C5F-0FFA525A575A}
158 * Arg1: Revision ID = 1
159 * Arg2: Count of entries (DWORD) in Arg3 (Integer): 3
160 * Arg3: DWORD capabilities buffer:
161 * First DWORD: The standard definition bits are used to return errors.
162 * Second DWORD: OSPM support field for USB4, bits [31:0] reserved.
163 * Third DWORD: OSPM control field for USB4.
164 * bit 0: USB tunneling
165 * bit 1: DisplayPort tunneling
166 * bit 2: PCIe tunneling
167 * bit 3: Inter-domain USB4 internet protocol
168 * bit 31:4: reserved
169 * Return: The platform acknowledges the capabilities buffer by
170 * returning a buffer of DWORD of the same length. Masked/Cleared bits
171 * in the control field indicate that the platform does not permit OSPM
172 * control of the respectively capabilities or features.
173 */
174 CreateDWordField (Arg3, 8, CDW3)
175 Local0 = CDW3
176
177 If (Arg1 != REVISION_ID) {
178 CDW1 |= UNRECOGNIZED_REVISION
179 Return (Arg3)
180 }
181 Local0 |= USB_TUNNELING | DISPLAY_PORT_TUNNELING | PCIE_TUNNELING |
182 INTER_DOMAIN_USB4_INTERNET_PROTOCOL
183 CDW3 = Local0
184 Return (Arg3)
185 #endif
186 } Else {
187 CDW1 |= UNRECOGNIZED_UUID
188 Return (Arg3)
189 }
190 }
191 }
192
193 Scope (_GPE)
194 {
195 /* TCSS PCI Express Hot-Plug wake event */
196 Method (_L77, 0, NotSerialized)
197 {
198 /*
199 * Delay for 100ms to meet the timing requirements of the PCI Express Base
200 * Specification, Revision 1.0A, Section 6.6 ("...software must wait at least
201 * 100ms from the end of reset of one or more device before it is permitted
202 * to issue Configuration Requests to those devices").
203 */
204 Sleep (100)
205
206 If (CondRefOf (\_SB.PCI0.TXHC)) {
207 /* Invoke PCIe root ports wake event handler */
208 \_SB.PCI0.TRP0.HPEV()
209 \_SB.PCI0.TRP1.HPEV()
210 \_SB.PCI0.TRP2.HPEV()
211 \_SB.PCI0.TRP3.HPEV()
212 }
213
214 /* Check Root Port 0 for a Hot Plug Event if the port is enabled */
215 If (((\_SB.PCI0.TRP0.VDID != 0xFFFFFFFF) && \_SB.PCI0.TRP0.HPSX)) {
216 If (\_SB.PCI0.TRP0.PDCX) {
217 /* Clear all status bits */
218 \_SB.PCI0.TRP0.PDCX = 1
219 \_SB.PCI0.TRP0.HPSX = 1
220 /*
221 * Intercept Presence Detect Changed interrupt and make sure
222 * the L0s is disabled on empty slots.
223 */
224 If (!\_SB.PCI0.TRP0.PDSX) {
225 /*
226 * The PCIe slot is empty, so disable L0s on hot unplug.
227 */
228 \_SB.PCI0.TRP0.L0SE = 0
229 }
230 /* Performs proper notification to the OS. */
231 Notify (\_SB.PCI0.TRP0, 0)
232 } Else {
233 /* False event. Clear Hot-Plug status, then exit. */
234 \_SB.PCI0.TRP0.HPSX = 1
235 }
236 }
237
238 /* Check Root Port 1 for a Hot Plug Event if the port is enabled */
239 If (((\_SB.PCI0.TRP1.VDID != 0xFFFFFFFF) && \_SB.PCI0.TRP1.HPSX)) {
240 If (\_SB.PCI0.TRP1.PDCX) {
241 \_SB.PCI0.TRP1.PDCX = 1
242 \_SB.PCI0.TRP1.HPSX = 1
243 If (!\_SB.PCI0.TRP1.PDSX) {
244 \_SB.PCI0.TRP1.L0SE = 0
245 }
246 Notify (\_SB.PCI0.TRP1, 0)
247 } Else {
248 \_SB.PCI0.TRP1.HPSX = 1
249 }
250 }
251
252 /* Check Root Port 2 for a Hot Plug Event if the port is enabled */
253 If (((\_SB.PCI0.TRP2.VDID != 0xFFFFFFFF) && \_SB.PCI0.TRP2.HPSX)) {
254 If (\_SB.PCI0.TRP2.PDCX) {
255 \_SB.PCI0.TRP2.PDCX = 1
256 \_SB.PCI0.TRP2.HPSX = 1
257 If (!\_SB.PCI0.TRP2.PDSX) {
258 \_SB.PCI0.TRP2.L0SE = 0
259 }
260 Notify (\_SB.PCI0.TRP2, 0)
261 } Else {
262 \_SB.PCI0.TRP2.HPSX = 1
263 }
264 }
265
266 /* Check Root Port 3 for a Hot Plug Event if the port is enabled */
267 If (((\_SB.PCI0.TRP3.VDID != 0xFFFFFFFF) && \_SB.PCI0.TRP3.HPSX)) {
268 If (\_SB.PCI0.TRP3.PDCX) {
269 \_SB.PCI0.TRP3.PDCX = 1
270 \_SB.PCI0.TRP3.HPSX = 1
271 If (!\_SB.PCI0.TRP3.PDSX) {
272 \_SB.PCI0.TRP3.L0SE = 0
273 }
274 Notify (\_SB.PCI0.TRP3, 0)
275 } Else {
276 \_SB.PCI0.TRP3.HPSX = 1
277 }
278 }
279 }
280
281 /* TCSS PCI Express power management event */
282 Method (_L76, 0, Serialized)
283 {
284 If (CondRefOf (\_SB.PCI0.TXHC)) {
285 If (\_SB.PCI0.TRP0.HPME() == 1) {
286 Notify (\_SB.PCI0.TDM0, 0x2)
287 Notify (\_SB.PCI0.TRP0, 0x2)
288 }
289
290 If (\_SB.PCI0.TRP1.HPME() == 1) {
291 Notify (\_SB.PCI0.TDM0, 0x2)
292 Notify (\_SB.PCI0.TRP1, 0x2)
293 }
294
295 If (\_SB.PCI0.TRP2.HPME() == 1) {
296 Notify (\_SB.PCI0.TDM1, 0x2)
297 Notify (\_SB.PCI0.TRP2, 0x2)
298 }
299
300 If (\_SB.PCI0.TRP3.HPME() == 1) {
301 Notify (\_SB.PCI0.TDM1, 0x2)
302 Notify (\_SB.PCI0.TRP3, 0x2)
303 }
304 }
305
306 /* Invoke PCIe root ports power management status handler */
307 \_SB.PCI0.TRP0.HPME()
308 \_SB.PCI0.TRP1.HPME()
309 \_SB.PCI0.TRP2.HPME()
310 \_SB.PCI0.TRP3.HPME()
311 }
312 }
313
314 Scope (\_SB.PCI0)
315 {
316 Device (IOM)
317 {
318 Name (_HID, "INTC107A")
319 Name (_DDN, "Intel(R) Panther Lake Input Output Manager(IOM) driver")
320 /* IOM preserved MMIO range from 0x3fff0aa0000 to 0x3fff0aa15ff. */
321 Name (_CRS, ResourceTemplate () {
322 QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
323 NonCacheable, ReadWrite, 0x0,
324 IOM_BASE_ADDR, IOM_BASE_ADDR_MAX, 0x0,
325 IOM_BASE_SIZE,,,)
326 })
327 #if CONFIG(IOM_ACPI_DEVICE_VISIBLE)
328 /* ACPI_STATUS_DEVICE_ALL_ON */
329 Name (_STA, 0xF)
330 #else
331 /* ACPI_STATUS_DEVICE_HIDDEN_ON */
332 Name (_STA, 0xB)
333 #endif
334 }
335
336 /*
337 * Operation region defined to access the TCSS_DEVEN. Get the MCHBAR in offset
338 * 0x48 in B0:D0:F0. TCSS device enable base address is in offset 0x7090 of MCHBAR.
339 */
340 OperationRegion (TDEN, SystemMemory, (GMHB() + MCHBAR_TCSS_DEVEN_OFFSET), 0x4)
341 Field (TDEN, ByteAcc, NoLock, Preserve)
342 {
343 TRE0, 1, /* PCIE0_EN */
344 TRE1, 1, /* PCIE1_EN */
345 TRE2, 1, /* PCIE2_EN */
346 TRE3, 1, /* PCIE3_EN */
347 , 4,
348 THCE, 1, /* XHCI_EN */
349 TDCE, 1, /* XDCI_EN */
350 DME0, 1, /* TBT_DMA0_EN */
351 DME1, 1, /* TBT_DMA1_EN */
352 , 20
353 }
354
355 /*
356 * Operation region defined to access the pCode mailbox interface. Get the MCHBAR
357 * in offset 0x48 in B0:D0:F0. MMIO address is in offset 0x5DA0 of MCHBAR.
358 */
359 OperationRegion (PBAR, SystemMemory, (GMHB() + 0x5DA0), 0x08)
360 Field (PBAR, DWordAcc, NoLock, Preserve)
361 {
362 PMBD, 32, /* pCode MailBox Data, offset 0x5DA0 in MCHBAR */
363 PMBC, 8, /* pCode MailBox Command, [7:0] of offset 0x5DA4 in MCHBAR */
364 PSCM, 8, /* pCode MailBox Sub-Command, [15:8] of offset 0x5DA4 in MCHBAR */
365 , 15, /* Reserved */
366 PMBR, 1 /* pCode MailBox RunBit, [31:31] of offset 0x5DA4 in MCHBAR */
367 }
368
369 /*
370 * Poll pCode MailBox Ready
371 *
372 * Return 0xFF - Timeout
373 * 0x00 - Ready
374 */
375 Method (PMBY, 0)
376 {
377 Local0 = 0
378 While (PMBR && (Local0 < 1000)) {
379 Local0++
380 Stall (1)
381 }
382 If (Local0 == 1000) {
383 Printf("Timeout occurred.")
384 Return (0xFF)
385 }
386 Return (0)
387 }
388
389
390 /* From RegBar Base, IOM_TypeC_SW_configuration_1 is at offset 0x40 */
391 OperationRegion (IOMR, SystemMemory, IOM_BASE_ADDR, 0x100)
392 Field (IOMR, DWordAcc, NoLock, Preserve)
393 {
394 Offset(0x40),
395 , 15,
396 TD3C, 1, /* [15:15] Type C D3 cold bit */
397 TACK, 1, /* [16:16] IOM Acknowledge bit */
398 DPOF, 1, /* [17:17] Set 1 to indicate IOM, all the */
399 /* display is OFF, clear otherwise */
400 Offset(0x44), /* SW_CONFIG_2 */
401 DPHD, 1, /* [0:0] DP_ALT and DP Tunneling HPD assertion */
402 Offset(0x48), /* SW_CONFIG_3 */
403 , 12,
404 INDP, 1, /* [12:12] The capability of monitoring the DP_ALT and DP tunneling */
405 Offset(0x70), /* Physical addr is offset 0x70. */
406 IMCD, 32, /* R_SA_IOM_BIOS_MAIL_BOX_CMD */
407 IMDA, 32 /* R_SA_IOM_BIOS_MAIL_BOX_DATA */
408 }
409
410 /*
411 * TBT Group0 ON method
412 */
413 Method (TG0N, 0)
414 {
415 If (\_SB.PCI0.TDM0.VDID == 0xFFFFFFFF) {
416 Printf("TDM0 does not exist.")
417 } Else {
418 If (\_SB.PCI0.TDM0.STAT == 0) {
419 /* DMA0 is in D3Cold early. */
420 \_SB.PCI0.TDM0.D3CX() /* RTD3 Exit */
421
422 Printf("Bring TBT RPs out of D3Code.")
423 If (\_SB.PCI0.TRP0.VDID != 0xFFFFFFFF) {
424 /* RP0 D3 cold exit. */
425 \_SB.PCI0.TRP0.D3CX()
426 }
427 If (\_SB.PCI0.TRP1.VDID != 0xFFFFFFFF) {
428 /* RP1 D3 cold exit. */
429 \_SB.PCI0.TRP1.D3CX()
430 }
431 } Else {
432 Printf("Drop TG0N due to it is already exit D3 cold.")
433 }
434
435 /* TBT RTD3 exit 10ms delay. */
436 Sleep (10)
437 }
438 }
439
440 /*
441 * TBT Group0 OFF method
442 */
443 Method (TG0F, 0)
444 {
445 If (\_SB.PCI0.TDM0.VDID == 0xFFFFFFFF) {
446 Printf("TDM0 does not exist.")
447 } Else {
448 If (\_SB.PCI0.TDM0.STAT == 1) {
449 /* DMA0 is not in D3Cold now. */
450 \_SB.PCI0.TDM0.D3CE() /* Enable DMA RTD3 */
451
452 Printf("Push TBT RPs to D3Cold together")
453 If (\_SB.PCI0.TRP0.VDID != 0xFFFFFFFF) {
454 /* Put RP0 to D3 cold. */
455 \_SB.PCI0.TRP0.D3CE()
456 }
457 If (\_SB.PCI0.TRP1.VDID != 0xFFFFFFFF) {
458 /* Put RP1 to D3 cold. */
459 \_SB.PCI0.TRP1.D3CE()
460 }
461 }
462 }
463 }
464
465 /*
466 * TBT Group1 ON method
467 */
468 Method (TG1N, 0)
469 {
470 If (\_SB.PCI0.TDM1.VDID == 0xFFFFFFFF) {
471 Printf("TDM1 does not exist.")
472 } Else {
473 If (\_SB.PCI0.TDM1.STAT == 0) {
474 /* DMA1 is in D3Cold early. */
475 \_SB.PCI0.TDM1.D3CX() /* RTD3 Exit */
476
477 Printf("Bring TBT RPs out of D3Code.")
478 If (\_SB.PCI0.TRP2.VDID != 0xFFFFFFFF) {
479 /* RP2 D3 cold exit. */
480 \_SB.PCI0.TRP2.D3CX()
481 }
482 If (\_SB.PCI0.TRP3.VDID != 0xFFFFFFFF) {
483 /* RP3 D3 cold exit. */
484 \_SB.PCI0.TRP3.D3CX()
485 }
486 } Else {
487 Printf("Drop TG1N due to it is already exit D3 cold.")
488 }
489
490 /* TBT RTD3 exit 10ms delay. */
491 Sleep (10)
492 }
493 }
494
495 /*
496 * TBT Group1 OFF method
497 */
498 Method (TG1F, 0)
499 {
500 If (\_SB.PCI0.TDM1.VDID == 0xFFFFFFFF) {
501 Printf("TDM1 does not exist.")
502 } Else {
503 If (\_SB.PCI0.TDM1.STAT == 1) {
504 /* DMA1 is not in D3Cold now */
505 \_SB.PCI0.TDM1.D3CE() /* Enable DMA RTD3. */
506
507 Printf("Push TBT RPs to D3Cold together")
508 If (\_SB.PCI0.TRP2.VDID != 0xFFFFFFFF) {
509 /* Put RP2 to D3 cold. */
510 \_SB.PCI0.TRP2.D3CE()
511 }
512 If (\_SB.PCI0.TRP3.VDID != 0xFFFFFFFF) {
513 /* Put RP3 to D3 cold */
514 \_SB.PCI0.TRP3.D3CE()
515 }
516 }
517 }
518 }
519
520 PowerResource (TBT0, 5, 1)
521 {
522 Method (_STA, 0)
523 {
524 Return (\_SB.PCI0.TDM0.STAT)
525 }
526
527 Method (_ON, 0)
528 {
529 TG0N()
530 }
531
532 Method (_OFF, 0)
533 {
534 If (\_SB.PCI0.TDM0.SD3C == 0) {
535 TG0F()
536 }
537 }
538 }
539
540 PowerResource (TBT1, 5, 1)
541 {
542 Method (_STA, 0)
543 {
544 Return (\_SB.PCI0.TDM1.STAT)
545 }
546
547 Method (_ON, 0)
548 {
549 TG1N()
550 }
551
552 Method (_OFF, 0)
553 {
554 If (\_SB.PCI0.TDM1.SD3C == 0) {
555 TG1F()
556 }
557 }
558 }
559
560 #if CONFIG(D3COLD_SUPPORT)
561 Method (TCON, 0)
562 {
563 /* Reset IOM D3 cold bit if it is in D3 cold now. */
564 If (TD3C == 1) /* It was in D3 cold before. */
565 {
566 /* Reset IOM D3 cold bit. */
567 TD3C = 0 /* Request IOM for D3 cold exit sequence. */
568 Local0 = 0 /* Time check counter variable */
569 /* Wait for ack, the maximum wait time for the ack is 100 msec. */
570 While ((TACK != 0) && (Local0 < TCSS_IOM_ACK_TIMEOUT_IN_MS)) {
571 /*
572 * Wait in this loop until TACK becomes 0 with timeout
573 * TCSS_IOM_ACK_TIMEOUT_IN_MS by default.
574 */
575 Sleep (1) /* Delay of 1ms. */
576 Local0++
577 }
578
579 If (Local0 == TCSS_IOM_ACK_TIMEOUT_IN_MS) {
580 Printf("Error: Timeout occurred.")
581 }
582 Else
583 {
584 Printf("TCSS D3 exit.");
585 }
586 }
587 Else {
588 Printf("Drop TCON due to it is already exit D3 cold.")
589 }
590 }
591
592 Method (TCOF, 0)
593 {
594 If ((\_SB.PCI0.TXHC.SD3C != 0) || (\_SB.PCI0.TDM0.SD3C != 0)
595 || (\_SB.PCI0.TDM1.SD3C != 0))
596 {
597 Printf("Skip D3C entry.")
598 Return
599 }
600
601 /* Request IOM for D3 cold entry sequence. */
602 TD3C = 1
603 }
604
605 PowerResource (D3C, 5, 0)
606 {
607 /*
608 * Variable to save power state
609 * 1 - TC Cold request cleared.
610 * 0 - TC Cold request sent.
611 */
612 Name (STAT, 0x1)
613
614 Method (_STA, 0)
615 {
616 Return (STAT)
617 }
618
619 Method (_ON, 0)
620 {
621 \_SB.PCI0.TCON()
622 STAT = 1
623 }
624
625 Method (_OFF, 0)
626 {
627 \_SB.PCI0.TCOF()
628 STAT = 0
629 }
630 }
631 #endif // D3COLD_SUPPORT
632
633 /*
634 * TCSS xHCI device
635 */
636 Device (TXHC)
637 {
638 Name (_ADR, 0x000D0000)
639 Name (_DDN, "North XHCI controller")
640 Name (_STR, Unicode ("North XHCI controller"))
641 Name (DCPM, TCSS_XHCI)
642
643 Method (_STA, 0x0, NotSerialized)
644 {
645 If (THCE == 1) {
646 Return (0x0F)
647 } Else {
648 Return (0x0)
649 }
650 }
651 #include "tcss_xhci.asl"
652 }
653
654 /*
655 * TCSS DMA0 device
656 */
657 Device (TDM0)
658 {
659 Name (_ADR, 0x000D0002)
660 Name (_DDN, "TBT DMA0 controller")
661 Name (_STR, Unicode ("TBT DMA0 controller"))
662 Name (DUID, 0) /* TBT DMA number */
663 Name (DCPM, TCSS_DMA0)
664
665 Method (_STA, 0x0, NotSerialized)
666 {
667 If (DME0 == 1) {
668 Return (0x0F)
669 } Else {
670 Return (0x0)
671 }
672 }
673 #include "tcss_dma.asl"
674 }
675
676 /*
677 * TCSS DMA1 device
678 */
679 Device (TDM1)
680 {
681 Name (_ADR, 0x000D0003)
682 Name (_DDN, "TBT DMA1 controller")
683 Name (_STR, Unicode ("TBT DMA1 controller"))
684 Name (DUID, 1) /* TBT DMA number */
685 Name (DCPM, TCSS_DMA1)
686
687 Method (_STA, 0x0, NotSerialized)
688 {
689 If (DME1 == 1) {
690 Return (0x0F)
691 } Else {
692 Return (0x0)
693 }
694 }
695 #include "tcss_dma.asl"
696 }
697
698 /*
699 * TCSS PCIE Root Port #00
700 */
701 Device (TRP0)
702 {
703 Name (_ADR, 0x00070000)
704 Name (TUID, 0) /* TBT PCIE RP Number 0 for RP00 */
705 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
706 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
707 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
708 Name (DCPM, TCSS_TBT_PCIE0_RP0)
709
710 Method (_STA, 0x0, NotSerialized)
711 {
712 If (VDID != 0xFFFFFFFF) {
713 Return (0x0F)
714 } Else {
715 Return (0x0)
716 }
717 }
718
719 Method (_INI)
720 {
721 LTEN = 0
722 LMSL = 0x88C8
723 LNSL = 0x88C8
724 }
725 #include "tcss_pcierp.asl"
726 }
727
728 /*
729 * TCSS PCIE Root Port #01
730 */
731 Device (TRP1)
732 {
733 Name (_ADR, 0x00070001)
734 Name (TUID, 1) /* TBT PCIE RP Number 1 for RP01 */
735 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
736 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
737 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
738 Name (DCPM, TCSS_TBT_PCIE0_RP1)
739
740 Method (_STA, 0x0, NotSerialized)
741 {
742 If (VDID != 0xFFFFFFFF) {
743 Return (0x0F)
744 } Else {
745 Return (0x0)
746 }
747 }
748
749 Method (_INI)
750 {
751 LTEN = 0
752 LMSL = 0x88C8
753 LNSL = 0x88C8
754 }
755 #include "tcss_pcierp.asl"
756 }
757
758 /*
759 * TCSS PCIE Root Port #02
760 */
761 Device (TRP2)
762 {
763 Name (_ADR, 0x00070002)
764 Name (TUID, 2) /* TBT PCIE RP Number 2 for RP02 */
765 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
766 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
767 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
768 Name (DCPM, TCSS_TBT_PCIE0_RP2)
769
770 Method (_STA, 0x0, NotSerialized)
771 {
772 If (VDID != 0xFFFFFFFF) {
773 Return (0x0F)
774 } Else {
775 Return (0x0)
776 }
777 }
778
779 Method (_INI)
780 {
781 LTEN = 0
782 LMSL = 0x88C8
783 LNSL = 0x88C8
784 }
785 #include "tcss_pcierp.asl"
786 }
787
788 /*
789 * TCSS PCIE Root Port #03
790 */
791 Device (TRP3)
792 {
793 Name (_ADR, 0x00070003)
794 Name (TUID, 3) /* TBT PCIE RP Number 3 for RP03 */
795 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
796 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
797 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
798 Name (DCPM, TCSS_TBT_PCIE0_RP3)
799
800 Method (_STA, 0x0, NotSerialized)
801 {
802 If (VDID != 0xFFFFFFFF) {
803 Return (0x0F)
804 } Else {
805 Return (0x0)
806 }
807 }
808
809 Method (_INI)
810 {
811 LTEN = 0
812 LMSL = 0x88C8
813 LNSL = 0x88C8
814 }
815 #include "tcss_pcierp.asl"
816 }
817 }