Debian Codegraph @

src/soc/intel/alderlake/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 0x7090
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 /* PCI Express Hot-Plug wake event */
196 Method (_L61, 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 /* PCI Express power management event */
282 Method (_L69, 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)
315 {
316 Device (IOM)
317 {
318 Name (_HID, "INTC1079")
319 Name (_DDN, "Intel(R) Alder Lake Input Output Manager(IOM) driver")
320 /* IOM preserved MMIO range from 0xFBC10000 to 0xFBC11600. */
321 Name (_CRS, ResourceTemplate () {
322 Memory32Fixed (ReadWrite, IOM_BASE_ADDRESS, IOM_BASE_SIZE)
323 })
324 #if CONFIG(IOM_ACPI_DEVICE_VISIBLE)
325 /* ACPI_STATUS_DEVICE_ALL_ON */
326 Name (_STA, 0xF)
327 #else
328 /* ACPI_STATUS_DEVICE_HIDDEN_ON */
329 Name (_STA, 0xB)
330 #endif
331 }
332 }
333
334 Scope (\_SB.PCI0)
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 IOM REGBAR. Get the MCHBAR in offset
357 * 0x48 in B0:D0:F0. REGBAR Base address is in offset 0x7110 of MCHBAR.
358 */
359 OperationRegion (MBAR, SystemMemory, (GMHB() + 0x7100), 0x1000)
360 Field (MBAR, ByteAcc, NoLock, Preserve)
361 {
362 Offset(0x10),
363 RBAR, 64 /* RegBar, offset 0x7110 in MCHBAR */
364 }
365
366 /*
367 * Operation region defined to access the pCode mailbox interface. Get the MCHBAR
368 * in offset 0x48 in B0:D0:F0. MMIO address is in offset 0x5DA0 of MCHBAR.
369 */
370 OperationRegion (PBAR, SystemMemory, (GMHB() + 0x5DA0), 0x08)
371 Field (PBAR, DWordAcc, NoLock, Preserve)
372 {
373 PMBD, 32, /* pCode MailBox Data, offset 0x5DA0 in MCHBAR */
374 PMBC, 8, /* pCode MailBox Command, [7:0] of offset 0x5DA4 in MCHBAR */
375 PSCM, 8, /* pCode MailBox Sub-Command, [15:8] of offset 0x5DA4 in MCHBAR */
376 , 15, /* Reserved */
377 PMBR, 1 /* pCode MailBox RunBit, [31:31] of offset 0x5DA4 in MCHBAR */
378 }
379
380 /*
381 * Poll pCode MailBox Ready
382 *
383 * Return 0xFF - Timeout
384 * 0x00 - Ready
385 */
386 Method (PMBY, 0)
387 {
388 Local0 = 0
389 While (PMBR && (Local0 < 1000)) {
390 Local0++
391 Stall (1)
392 }
393 If (Local0 == 1000) {
394 Printf("Timeout occurred.")
395 Return (0xFF)
396 }
397 Return (0)
398 }
399
400 /*
401 * IOM REG BAR Base address is in offset 0x7110 in MCHBAR.
402 */
403 Method (IOMA, 0)
404 {
405 Return (^RBAR & ~0x1)
406 }
407
408 /*
409 * From RegBar Base, IOM_TypeC_SW_configuration_1 is in offset 0xC10040, where
410 * 0x40 is the register offset.
411 */
412 OperationRegion (IOMR, SystemMemory, (IOMA() + 0xC10000), 0x100)
413 Field (IOMR, DWordAcc, NoLock, Preserve)
414 {
415 Offset(0x40),
416 , 15,
417 TD3C, 1, /* [15:15] Type C D3 cold bit */
418 TACK, 1, /* [16:16] IOM Acknowledge bit */
419 DPOF, 1, /* [17:17] Set 1 to indicate IOM, all the */
420 /* display is OFF, clear otherwise */
421 Offset(0x70), /* Physical addr is offset 0x70. */
422 IMCD, 32, /* R_SA_IOM_BIOS_MAIL_BOX_CMD */
423 IMDA, 32 /* R_SA_IOM_BIOS_MAIL_BOX_DATA */
424 }
425
426 /*
427 * TBT Group0 ON method
428 */
429 Method (TG0N, 0)
430 {
431 If (\_SB.PCI0.TDM0.VDID == 0xFFFFFFFF) {
432 Printf("TDM0 does not exist.")
433 } Else {
434 If (\_SB.PCI0.TDM0.STAT == 0) {
435 /* DMA0 is in D3Cold early. */
436 \_SB.PCI0.TDM0.D3CX() /* RTD3 Exit */
437
438 Printf("Bring TBT RPs out of D3Code.")
439 If (\_SB.PCI0.TRP0.VDID != 0xFFFFFFFF) {
440 /* RP0 D3 cold exit. */
441 \_SB.PCI0.TRP0.D3CX()
442 }
443 If (\_SB.PCI0.TRP1.VDID != 0xFFFFFFFF) {
444 /* RP1 D3 cold exit. */
445 \_SB.PCI0.TRP1.D3CX()
446 }
447 } Else {
448 Printf("Drop TG0N due to it is already exit D3 cold.")
449 }
450
451 /* TBT RTD3 exit 10ms delay. */
452 Sleep (10)
453 }
454 }
455
456 /*
457 * TBT Group0 OFF method
458 */
459 Method (TG0F, 0)
460 {
461 If (\_SB.PCI0.TDM0.VDID == 0xFFFFFFFF) {
462 Printf("TDM0 does not exist.")
463 } Else {
464 If (\_SB.PCI0.TDM0.STAT == 1) {
465 /* DMA0 is not in D3Cold now. */
466 \_SB.PCI0.TDM0.D3CE() /* Enable DMA RTD3 */
467
468 If (\_SB.PCI0.TDM0.IF30 != 1) {
469 Return
470 }
471
472 Printf("Push TBT RPs to D3Cold together")
473 If (\_SB.PCI0.TRP0.VDID != 0xFFFFFFFF) {
474 /* Put RP0 to D3 cold. */
475 \_SB.PCI0.TRP0.D3CE()
476 }
477 If (\_SB.PCI0.TRP1.VDID != 0xFFFFFFFF) {
478 /* Put RP1 to D3 cold. */
479 \_SB.PCI0.TRP1.D3CE()
480 }
481 }
482 }
483 }
484
485 /*
486 * TBT Group1 ON method
487 */
488 Method (TG1N, 0)
489 {
490 If (\_SB.PCI0.TDM1.VDID == 0xFFFFFFFF) {
491 Printf("TDM1 does not exist.")
492 } Else {
493 If (\_SB.PCI0.TDM1.STAT == 0) {
494 /* DMA1 is in D3Cold early. */
495 \_SB.PCI0.TDM1.D3CX() /* RTD3 Exit */
496
497 Printf("Bring TBT RPs out of D3Code.")
498 If (\_SB.PCI0.TRP2.VDID != 0xFFFFFFFF) {
499 /* RP2 D3 cold exit. */
500 \_SB.PCI0.TRP2.D3CX()
501 }
502 If (\_SB.PCI0.TRP3.VDID != 0xFFFFFFFF) {
503 /* RP3 D3 cold exit. */
504 \_SB.PCI0.TRP3.D3CX()
505 }
506 } Else {
507 Printf("Drop TG1N due to it is already exit D3 cold.")
508 }
509
510 /* TBT RTD3 exit 10ms delay. */
511 Sleep (10)
512 }
513 }
514
515 /*
516 * TBT Group1 OFF method
517 */
518 Method (TG1F, 0)
519 {
520 If (\_SB.PCI0.TDM1.VDID == 0xFFFFFFFF) {
521 Printf("TDM1 does not exist.")
522 } Else {
523 If (\_SB.PCI0.TDM1.STAT == 1) {
524 /* DMA1 is not in D3Cold now */
525 \_SB.PCI0.TDM1.D3CE() /* Enable DMA RTD3. */
526
527 If (\_SB.PCI0.TDM1.IF30 != 1) {
528 Return
529 }
530
531 Printf("Push TBT RPs to D3Cold together")
532 If (\_SB.PCI0.TRP2.VDID != 0xFFFFFFFF) {
533 /* Put RP2 to D3 cold. */
534 \_SB.PCI0.TRP2.D3CE()
535 }
536 If (\_SB.PCI0.TRP3.VDID != 0xFFFFFFFF) {
537 /* Put RP3 to D3 cold */
538 \_SB.PCI0.TRP3.D3CE()
539 }
540 }
541 }
542 }
543
544 PowerResource (TBT0, 5, 1)
545 {
546 Method (_STA, 0)
547 {
548 Return (\_SB.PCI0.TDM0.STAT)
549 }
550
551 Method (_ON, 0)
552 {
553 TG0N()
554 }
555
556 Method (_OFF, 0)
557 {
558 If (\_SB.PCI0.TDM0.SD3C == 0) {
559 TG0F()
560 }
561 }
562 }
563
564 PowerResource (TBT1, 5, 1)
565 {
566 Method (_STA, 0)
567 {
568 Return (\_SB.PCI0.TDM1.STAT)
569 }
570
571 Method (_ON, 0)
572 {
573 TG1N()
574 }
575
576 Method (_OFF, 0)
577 {
578 If (\_SB.PCI0.TDM1.SD3C == 0) {
579 TG1F()
580 }
581 }
582 }
583
584 #if CONFIG(D3COLD_SUPPORT)
585 Method (TCON, 0)
586 {
587 /* Reset IOM D3 cold bit if it is in D3 cold now. */
588 If (TD3C == 1) /* It was in D3 cold before. */
589 {
590 /* Reset IOM D3 cold bit. */
591 TD3C = 0 /* Request IOM for D3 cold exit sequence. */
592 Local0 = 0 /* Time check counter variable */
593 /* Wait for ack, the maximum wait time for the ack is 100 msec. */
594 While ((TACK != 0) && (Local0 < TCSS_IOM_ACK_TIMEOUT_IN_MS)) {
595 /*
596 * Wait in this loop until TACK becomes 0 with timeout
597 * TCSS_IOM_ACK_TIMEOUT_IN_MS by default.
598 */
599 Sleep (1) /* Delay of 1ms. */
600 Local0++
601 }
602
603 If (Local0 == TCSS_IOM_ACK_TIMEOUT_IN_MS) {
604 Printf("Error: Timeout occurred.")
605 }
606 Else
607 {
608 Printf("TCSS D3 exit.");
609 }
610 }
611 Else {
612 Printf("Drop TCON due to it is already exit D3 cold.")
613 }
614 }
615
616 Method (TCOF, 0)
617 {
618 If ((\_SB.PCI0.TXHC.SD3C != 0) || (\_SB.PCI0.TDM0.SD3C != 0)
619 || (\_SB.PCI0.TDM1.SD3C != 0))
620 {
621 Printf("Skip D3C entry.")
622 Return
623 }
624
625 /* Request IOM for D3 cold entry sequence. */
626 TD3C = 1
627 }
628
629 PowerResource (D3C, 5, 0)
630 {
631 /*
632 * Variable to save power state
633 * 1 - TC Cold request cleared.
634 * 0 - TC Cold request sent.
635 */
636 Name (STAT, 0x1)
637
638 Method (_STA, 0)
639 {
640 Return (STAT)
641 }
642
643 Method (_ON, 0)
644 {
645 \_SB.PCI0.TCON()
646 STAT = 1
647 }
648
649 Method (_OFF, 0)
650 {
651 \_SB.PCI0.TCOF()
652 STAT = 0
653 }
654 }
655 #endif // D3COLD_SUPPORT
656
657 /*
658 * TCSS xHCI device
659 */
660 Device (TXHC)
661 {
662 Name (_ADR, 0x000D0000)
663 Name (_DDN, "North XHCI controller")
664 Name (_STR, Unicode ("North XHCI controller"))
665 Name (DCPM, TCSS_XHCI)
666
667 Method (_STA, 0x0, NotSerialized)
668 {
669 If (THCE == 1) {
670 Return (0x0F)
671 } Else {
672 Return (0x0)
673 }
674 }
675 #include "tcss_xhci.asl"
676 }
677
678 /*
679 * TCSS DMA0 device
680 */
681 Device (TDM0)
682 {
683 Name (_ADR, 0x000D0002)
684 Name (_DDN, "TBT DMA0 controller")
685 Name (_STR, Unicode ("TBT DMA0 controller"))
686 Name (DUID, 0) /* TBT DMA number */
687 Name (DCPM, TCSS_DMA0)
688
689 Method (_STA, 0x0, NotSerialized)
690 {
691 If (DME0 == 1) {
692 Return (0x0F)
693 } Else {
694 Return (0x0)
695 }
696 }
697 #include "tcss_dma.asl"
698 }
699
700 /*
701 * TCSS DMA1 device
702 */
703 Device (TDM1)
704 {
705 Name (_ADR, 0x000D0003)
706 Name (_DDN, "TBT DMA1 controller")
707 Name (_STR, Unicode ("TBT DMA1 controller"))
708 Name (DUID, 1) /* TBT DMA number */
709 Name (DCPM, TCSS_DMA1)
710
711 Method (_STA, 0x0, NotSerialized)
712 {
713 If (DME1 == 1) {
714 Return (0x0F)
715 } Else {
716 Return (0x0)
717 }
718 }
719 #include "tcss_dma.asl"
720 }
721
722 /*
723 * TCSS PCIE Root Port #00
724 */
725 Device (TRP0)
726 {
727 Name (_ADR, 0x00070000)
728 Name (TUID, 0) /* TBT PCIE RP Number 0 for RP00 */
729 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
730 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
731 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
732 Name (DCPM, TCSS_TBT_PCIE0_RP0)
733
734 Method (_STA, 0x0, NotSerialized)
735 {
736 If (TRE0 == 1) {
737 Return (0x0F)
738 } Else {
739 Return (0x0)
740 }
741 }
742
743 Method (_INI)
744 {
745 LTEN = 0
746 LMSL = 0x88C8
747 LNSL = 0x88C8
748 }
749 #include "tcss_pcierp.asl"
750 }
751
752 /*
753 * TCSS PCIE Root Port #01
754 */
755 Device (TRP1)
756 {
757 Name (_ADR, 0x00070001)
758 Name (TUID, 1) /* TBT PCIE RP Number 1 for RP01 */
759 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
760 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
761 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
762 Name (DCPM, TCSS_TBT_PCIE0_RP1)
763
764 Method (_STA, 0x0, NotSerialized)
765 {
766 If (TRE1 == 1) {
767 Return (0x0F)
768 } Else {
769 Return (0x0)
770 }
771 }
772
773 Method (_INI)
774 {
775 LTEN = 0
776 LMSL = 0x88C8
777 LNSL = 0x88C8
778 }
779 #include "tcss_pcierp.asl"
780 }
781
782 /*
783 * TCSS PCIE Root Port #02
784 */
785 Device (TRP2)
786 {
787 Name (_ADR, 0x00070002)
788 Name (TUID, 2) /* TBT PCIE RP Number 2 for RP02 */
789 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
790 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
791 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
792 Name (DCPM, TCSS_TBT_PCIE0_RP2)
793
794 Method (_STA, 0x0, NotSerialized)
795 {
796 If (TRE2 == 1) {
797 Return (0x0F)
798 } Else {
799 Return (0x0)
800 }
801 }
802
803 Method (_INI)
804 {
805 LTEN = 0
806 LMSL = 0x88C8
807 LNSL = 0x88C8
808 }
809 #include "tcss_pcierp.asl"
810 }
811
812 /*
813 * TCSS PCIE Root Port #03
814 */
815 Device (TRP3)
816 {
817 Name (_ADR, 0x00070003)
818 Name (TUID, 3) /* TBT PCIE RP Number 3 for RP03 */
819 Name (LTEN, 0) /* Latency Tolerance Reporting Mechanism, 0:Disable, 1:Enable */
820 Name (LMSL, 0) /* PCIE LTR max snoop Latency */
821 Name (LNSL, 0) /* PCIE LTR max no snoop Latency */
822 Name (DCPM, TCSS_TBT_PCIE0_RP3)
823
824 Method (_STA, 0x0, NotSerialized)
825 {
826 If (TRE3 == 1) {
827 Return (0x0F)
828 } Else {
829 Return (0x0)
830 }
831 }
832
833 Method (_INI)
834 {
835 LTEN = 0
836 LMSL = 0x88C8
837 LNSL = 0x88C8
838 }
839 #include "tcss_pcierp.asl"
840 }
841 }