| 1 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 |
|
| 3 |
OperationRegion (DPME, SystemMemory, BASE(_ADR), 0x100) |
| 4 |
Field (DPME, AnyAcc, NoLock, Preserve) |
| 5 |
{ |
| 6 |
VDID, 32, |
| 7 |
Offset(0x84), /* 0x84, DMA CFG PM CAP */ |
| 8 |
PMST, 2, /* 1:0, PM_STATE */ |
| 9 |
, 6, |
| 10 |
PMEE, 1, /* 8, PME_EN */ |
| 11 |
, 6, |
| 12 |
PMES, 1, /* 15, PME_STATUS */ |
| 13 |
Offset(0xC8), /* 0xC8, TBT NVM FW Revision */ |
| 14 |
, 30, |
| 15 |
IF30, 1, /* ITBT FW Version Bit30 */ |
| 16 |
INFR, 1, /* TBT NVM FW Ready */ |
| 17 |
Offset(0xEC), /* 0xEC, TBT TO PCIE Register */ |
| 18 |
TB2P, 32, /* TBT to PCIe */ |
| 19 |
P2TB, 32, /* PCIe to TBT */ |
| 20 |
Offset(0xFC), /* 0xFC, DMA RTD3 Force Power */ |
| 21 |
DD3E, 1, /* 0:0 DMA RTD3 Enable */ |
| 22 |
DFPE, 1, /* 1:1 DMA Force Power */ |
| 23 |
, 22, |
| 24 |
DMAD, 8 /* 31:24 DMA Active Delay */ |
| 25 |
} |
| 26 |
|
| 27 |
Name (STAT, 0x1) /* Variable to save power state 1 - D0, 0 - D3C */ |
| 28 |
|
| 29 |
Method (_S0W, 0x0) |
| 30 |
{ |
| 31 |
#if CONFIG(D3COLD_SUPPORT) |
| 32 |
Return (0x04) |
| 33 |
#else |
| 34 |
Return (0x03) |
| 35 |
#endif // D3COLD_SUPPORT |
| 36 |
} |
| 37 |
|
| 38 |
/* |
| 39 |
* Get power resources that are dependent on this device for Operating System Power Management |
| 40 |
* to put the device in the D0 device state |
| 41 |
*/ |
| 42 |
Method (_PR0) |
| 43 |
{ |
| 44 |
#if CONFIG(D3COLD_SUPPORT) |
| 45 |
If (DUID == 0) { |
| 46 |
Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT0 }) |
| 47 |
} Else { |
| 48 |
Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT1 }) |
| 49 |
} |
| 50 |
#else |
| 51 |
If (DUID == 0) { |
| 52 |
Return (Package() { \_SB.PCI0.TBT0 }) |
| 53 |
} Else { |
| 54 |
Return (Package() { \_SB.PCI0.TBT1 }) |
| 55 |
} |
| 56 |
#endif // D3COLD_SUPPORT |
| 57 |
} |
| 58 |
|
| 59 |
Method (_PR3) |
| 60 |
{ |
| 61 |
#if CONFIG(D3COLD_SUPPORT) |
| 62 |
If (DUID == 0) { |
| 63 |
Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT0 }) |
| 64 |
} Else { |
| 65 |
Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT1 }) |
| 66 |
} |
| 67 |
#else |
| 68 |
If (DUID == 0) { |
| 69 |
Return (Package() { \_SB.PCI0.TBT0 }) |
| 70 |
} Else { |
| 71 |
Return (Package() { \_SB.PCI0.TBT1 }) |
| 72 |
} |
| 73 |
#endif // D3COLD_SUPPORT |
| 74 |
} |
| 75 |
|
| 76 |
/* |
| 77 |
* RTD3 Exit Method to bring TBT controller out of RTD3 mode. |
| 78 |
*/ |
| 79 |
Method (D3CX, 0, Serialized) |
| 80 |
{ |
| 81 |
DD3E = 0x00 /* Disable DMA RTD3 */ |
| 82 |
STAT = 0x01 |
| 83 |
} |
| 84 |
|
| 85 |
/* |
| 86 |
* RTD3 Entry method to enable TBT controller RTD3 mode. |
| 87 |
*/ |
| 88 |
Method (D3CE, 0, Serialized) |
| 89 |
{ |
| 90 |
DD3E = 0x01 /* Enable DMA RTD3 */ |
| 91 |
STAT = 0x00 |
| 92 |
} |
| 93 |
|
| 94 |
/* |
| 95 |
* Variable to skip TCSS/TBT D3 cold; 1+: Skip D3CE, 0 - Enable D3CE |
| 96 |
* TCSS D3 Cold and TBT RTD3 is only available when system power state is in S0. |
| 97 |
*/ |
| 98 |
Name (SD3C, 0) |
| 99 |
|
| 100 |
Method (_DSW, 3) |
| 101 |
{ |
| 102 |
/* If entering Sx (Arg1 > 1), need to skip TCSS D3Cold & TBT RTD3/D3Cold. */ |
| 103 |
SD3C = Arg1 |
| 104 |
} |
| 105 |
|
| 106 |
Method (_PRW, 0) |
| 107 |
{ |
| 108 |
Return (Package() { 0x6D, 4 }) |
| 109 |
} |