blob: 32aa2f28bdbec709e3deff508ee93564601f61cf [file] [log] [blame]
Elyes HAOUASf50b6622020-07-19 14:00:43 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
John Zhaoca584082020-03-16 15:33:06 -07002
3OperationRegion (XPRT, SystemMemory, BASE(_ADR), 0x100)
4Field (XPRT, ByteAcc, NoLock, Preserve)
5{
6 VDID, 32,
7 Offset(0x74), /* 0x74, XHCI CFG Power Control And Status */
8 D0D3, 2, /* 0x74 BIT[1:0] */
9 , 6,
10 PMEE, 1, /* PME Enable */
11 , 6,
12 PMES, 1, /* PME Status */
13}
14
15Method (_PS0, 0, Serialized)
16{
17 If (\_SB.PCI0.TXHC.PMEE == 1) {
18 /* Clear PME_EN of CPU xHCI */
19 \_SB.PCI0.TXHC.PMEE = 0
20 }
21}
22
23Method (_PS3, 0, Serialized)
24{
25 If (\_SB.PCI0.TXHC.PMEE == 0) {
26 /* Set PME_EN of CPU xHCI */
27 \_SB.PCI0.TXHC.PMEE = 1
28 }
29}
30
31Method (_S0W, 0x0, NotSerialized)
32{
Sean Rhodes56226662021-11-08 21:34:34 +000033 If (S0IX == 1) {
34 Return (0x4)
35 } Else {
36 Return (0x3)
37 }
John Zhaoca584082020-03-16 15:33:06 -070038}
39
40/*
41 * Variable to skip TCSS/TBT D3 cold; 1+: Skip D3CE, 0 - Enable D3CE
42 * TCSS D3 Cold and TBT RTD3 is only available when system power state is in S0.
43 */
44Name (SD3C, 0)
45
Sean Rhodes56226662021-11-08 21:34:34 +000046If (S0IX == 1) {
47 Method (_PR0)
48 {
49 Return (Package () { \_SB.PCI0.D3C })
50 }
John Zhaoca584082020-03-16 15:33:06 -070051
Sean Rhodes56226662021-11-08 21:34:34 +000052 Method (_PR3)
53 {
54 Return (Package () { \_SB.PCI0.D3C })
55 }
John Zhaoca584082020-03-16 15:33:06 -070056}
57
58/*
59 * XHCI controller _DSM method
60 */
61Method (_DSM, 4, serialized)
62{
63 Return (Buffer() { 0 })
64}
65
66/*
67 * _SXD and _SXW methods
68 */
69Method (_S3D, 0, NotSerialized)
70{
71 Return (3)
72}
73
74Method (_S4D, 0, NotSerialized)
75{
76 Return (3)
77}
78
79Method (_S3W, 0, NotSerialized)
80{
81 Return (3)
82}
83
84Method (_S4W, 0, NotSerialized)
85{
86 Return (3)
87}
88
89/*
90 * Power resource for wake
91 */
92Method (_PRW, 0)
93{
94 Return (Package() { 0x6D, 4 })
95}
96
97/*
98 * Device sleep wake
99 */
100Method (_DSW, 3)
101{
102 C2PM (Arg0, Arg1, Arg2, DCPM)
103 /* If entering Sx (Arg1 > 1), need to skip TCSS D3Cold & TBT RTD3/D3Cold. */
104 SD3C = Arg1
105}
106
107/*
108 * xHCI Root Hub Device
109 */
110Device (RHUB)
111{
112 Name (_ADR, Zero)
113
114 /* High Speed Ports */
115 Device (HS01)
116 {
117 Name (_ADR, 0x01)
118 }
119
120 /* Super Speed Ports */
121 Device (SS01)
122 {
123 Name (_ADR, 0x02)
John Zhaob8febf42020-06-11 18:05:23 -0700124 Method (_DSD, 0, NotSerialized)
125 {
126 Return( Package ()
127 {
128 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
129 Package ()
130 {
131 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM0 },
132 Package (2) { "usb4-port-number", 0 }
133 }
134 })
135 }
John Zhaoca584082020-03-16 15:33:06 -0700136 }
137
138 Device (SS02)
139 {
140 Name (_ADR, 0x03)
John Zhaob8febf42020-06-11 18:05:23 -0700141 Method (_DSD, 0, NotSerialized)
142 {
143 Return( Package ()
144 {
145 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
146 Package ()
147 {
148 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM0 },
149 Package (2) { "usb4-port-number", 1 }
150 }
151 })
152 }
John Zhaoca584082020-03-16 15:33:06 -0700153 }
154
155 Device (SS03)
156 {
157 Name (_ADR, 0x04)
John Zhaob8febf42020-06-11 18:05:23 -0700158 Method (_DSD, 0, NotSerialized)
159 {
160 Return( Package ()
161 {
162 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
163 Package ()
164 {
165 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM1 },
166 Package (2) { "usb4-port-number", 0 }
167 }
168 })
169 }
John Zhaoca584082020-03-16 15:33:06 -0700170 }
171
172 Device (SS04)
173 {
174 Name (_ADR, 0x05)
John Zhaob8febf42020-06-11 18:05:23 -0700175 Method (_DSD, 0, NotSerialized)
176 {
177 Return( Package ()
178 {
179 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
180 Package ()
181 {
182 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM1 },
183 Package (2) { "usb4-port-number", 1 }
184 }
185 })
186 }
John Zhaoca584082020-03-16 15:33:06 -0700187 }
188}