blob: acbeb30c13000a58aa33b8a2d4461048e0a29bba [file] [log] [blame]
Ravi Sarawadie02fd832022-05-08 00:27:31 -07001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
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{
33 Return (0x4)
34}
35
36/*
37 * Variable to skip TCSS/TBT D3 cold; 1+: Skip D3CE, 0 - Enable D3CE
38 * TCSS D3 Cold and TBT RTD3 is only available when system power state is in S0.
39 */
40Name (SD3C, 0)
41
42Method (_PR0)
43{
44 Return (Package () { \_SB.PCI0.D3C })
45}
46
47Method (_PR3)
48{
49 Return (Package () { \_SB.PCI0.D3C })
50}
51
52/*
53 * XHCI controller _DSM method
54 */
55Method (_DSM, 4, serialized)
56{
57 Return (Buffer() { 0 })
58}
59
60/*
61 * _SXD and _SXW methods
62 */
63Method (_S3D, 0, NotSerialized)
64{
65 Return (3)
66}
67
68Method (_S4D, 0, NotSerialized)
69{
70 Return (3)
71}
72
73Method (_S3W, 0, NotSerialized)
74{
75 Return (3)
76}
77
78Method (_S4W, 0, NotSerialized)
79{
80 Return (3)
81}
82
83/*
84 * Power resource for wake
85 */
86Method (_PRW, 0)
87{
88 Return (Package() { 0x6D, 4 })
89}
90
91/*
92 * Device sleep wake
93 */
94Method (_DSW, 3)
95{
96 C2PM (Arg0, Arg1, Arg2, DCPM)
97 /* If entering Sx (Arg1 > 1), need to skip TCSS D3Cold & TBT RTD3/D3Cold. */
98 SD3C = Arg1
99}
100
101/*
102 * xHCI Root Hub Device
103 */
104Device (RHUB)
105{
106 Name (_ADR, Zero)
107
108 /* High Speed Ports */
109 Device (HS01)
110 {
111 Name (_ADR, 0x01)
112 }
113
114 /* Super Speed Ports */
115 Device (SS01)
116 {
117 Name (_ADR, 0x02)
118 Method (_DSD, 0, NotSerialized)
119 {
120 Return( Package ()
121 {
122 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
123 Package ()
124 {
125 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM0 },
126 Package (2) { "usb4-port-number", 0 }
127 }
128 })
129 }
130 }
131
132 Device (SS02)
133 {
134 Name (_ADR, 0x03)
135 Method (_DSD, 0, NotSerialized)
136 {
137 Return( Package ()
138 {
139 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
140 Package ()
141 {
142 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM0 },
143 Package (2) { "usb4-port-number", 1 }
144 }
145 })
146 }
147 }
148
149 Device (SS03)
150 {
151 Name (_ADR, 0x04)
152 Method (_DSD, 0, NotSerialized)
153 {
154 Return( Package ()
155 {
156 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
157 Package ()
158 {
159 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM1 },
160 Package (2) { "usb4-port-number", 0 }
161 }
162 })
163 }
164 }
165
166 Device (SS04)
167 {
168 Name (_ADR, 0x05)
169 Method (_DSD, 0, NotSerialized)
170 {
171 Return( Package ()
172 {
173 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
174 Package ()
175 {
176 Package (2) { "usb4-host-interface", \_SB.PCI0.TDM1 },
177 Package (2) { "usb4-port-number", 1 }
178 }
179 })
180 }
181 }
182}