1 /* SPDX-License-Identifier: GPL-2.0-only */
3 // XHCI Controller 0:14.0
7 Name (_ADR, 0x00140000)
9 Name (PLSD, 5) // Port Link State - RxDetect
10 Name (PLSP, 7) // Port Link State - Polling
12 OperationRegion (XPRT, PCI_Config, 0, 0x100)
13 Field (XPRT, AnyAcc, NoLock, Preserve)
45 Method (LPCL, 0, Serialized)
47 OperationRegion (XREG, SystemMemory, ^XMEM << 16, 0x600)
48 Field (XREG, DWordAcc, Lock, Preserve)
50 Offset (0x510), // PORTSCNUSB3[0]
52 Offset (0x520), // PORTSCNUSB3[1]
54 Offset (0x530), // PORTSCNUSB3[2]
56 Offset (0x540), // PORTSCNUSB3[3]
60 // Port Enabled/Disabled (Bit 1)
63 // Change Status (Bits 23:17)
64 Name (CHST, 0x7f << 17)
83 Method (LPS0, 0, Serialized)
85 OperationRegion (XREG, SystemMemory, ^XMEM << 16, 0x600)
86 Field (XREG, DWordAcc, Lock, Preserve)
88 Offset (0x510), // PORTSCNUSB3
90 PLS1, 4, // [8:5] Port Link State
91 PPR1, 1, // [9] Port Power
93 CSC1, 1, // [17] Connect Status Change
95 WRC1, 1, // [19] Warm Port Reset Change
97 WPR1, 1, // [31] Warm Port Reset
98 Offset (0x520), // PORTSCNUSB3
100 PLS2, 4, // [8:5] Port Link State
101 PPR2, 1, // [9] Port Power
103 CSC2, 1, // [17] Connect Status Change
105 WRC2, 1, // [19] Warm Port Reset Change
107 WPR2, 1, // [31] Warm Port Reset
108 Offset (0x530), // PORTSCNUSB3
110 PLS3, 4, // [8:5] Port Link State
111 PPR3, 1, // [9] Port Power
113 CSC3, 1, // [17] Connect Status Change
115 WRC3, 1, // [19] Warm Port Reset Change
117 WPR3, 1, // [31] Warm Port Reset
118 Offset (0x540), // PORTSCNUSB3
120 PLS4, 4, // [8:5] Port Link State
121 PPR4, 1, // [9] Port Power
123 CSC4, 1, // [17] Connect Status Change
125 WRC4, 1, // [19] Warm Port Reset Change
127 WPR4, 1, // [31] Warm Port Reset
130 // Wait for all powered ports to finish polling
132 While ((PPR1 == 1 && PLS1 == PLSP || PPR2 == 1 && PLS2 == PLSP) ||
133 (PPR3 == 1 && PLS3 == PLSP || PPR4 == 1 && PLS4 == PLSP))
142 // For each USB3 Port:
143 // If port is disconnected (PLS=5 PP=1 CSC=0)
144 // 1) Issue warm reset (WPR=1)
145 // 2) Poll for warm reset complete (WRC=0)
146 // 3) Write 1 to port status to clear
148 // Local# indicate if port is reset
154 If (PLS1 == PLSD && (CSC1 == 0 && PPR1 == 1)) {
155 WPR1 = 1 // Issue warm reset
158 If (PLS2 == PLSD && (CSC2 == 0 && PPR2 == 1)) {
159 WPR2 = 1 // Issue warm reset
162 If (PLS3 == PLSD && (CSC3 == 0 && PPR3 == 1)) {
163 WPR3 = 1 // Issue warm reset
166 If (PLS4 == PLSD && (CSC4 == 0 && PPR4 == 1)) {
167 WPR4 = 1 // Issue warm reset
171 // Poll for warm reset complete on all ports that were reset
173 While ((Local1 == 1 && WRC1 == 0 || Local2 == 1 && WRC2 == 0) ||
174 (Local3 == 1 && WRC3 == 0 || Local4 == 1 && WRC4 == 0))
183 // Clear status bits in all ports
187 Method (_PSC, 0, NotSerialized)
192 Method (_PS0, 0, Serialized)
194 If (^DVID == 0xFFFF) {
197 If (^XMEM == 0xFFFF || ^XMEM == 0) {
201 OperationRegion (XREG, SystemMemory, (^XMEM << 16) + 0x8000, 0x200)
202 Field (XREG, DWordAcc, Lock, Preserve)
204 Offset (0x0e0), // AUX Reset Control 1
207 Offset (0x154), // AUX Domain PM Control Register 2
210 Offset (0x16c), // AUX Clock Control
214 CLK1, 1, // USB3 Port Aux/Core Clock Gating Enable
217 // If device is in D3, set back to D0
223 #if CONFIG(INTEL_LYNXPOINT_LP)
224 // Clear PCI 0xB0[14:13]
228 // Clear MMIO 0x816C[14,2]
232 // Set MMIO 0x8154[31]
235 // Handle per-port reset if needed
238 // Set MMIO 0x80e0[15]
241 // Set MMIO 0x8154[31]
245 // Clear PCI CFG offset 0x40[11]
248 // Clear PCI CFG offset 0x44[13:12]
254 Method (_PS3, 0, Serialized)
256 If (^DVID == 0xFFFF) {
259 If (^XMEM == 0xFFFF || ^XMEM == 0) {
263 OperationRegion (XREG, SystemMemory, (^XMEM << 16) + 0x8000, 0x200)
264 Field (XREG, DWordAcc, Lock, Preserve)
266 Offset (0x0e0), // AUX Reset Control 1
269 Offset (0x154), // AUX Domain PM Control Register 2
272 Offset (0x16c), // AUX Clock Control
276 CLK1, 1, // USB3 Port Aux/Core Clock Gating Enable
279 ^PMES = 1 // Clear PME Status
280 ^PMEE = 1 // Enable PME
282 // If device is in D3, set back to D0
288 #if CONFIG(INTEL_LYNXPOINT_LP)
289 // Set PCI 0xB0[14:13]
293 // Set MMIO 0x816C[14,2]
297 // Clear MMIO 0x8154[31]
300 // Clear MMIO 0x80e0[15]
303 // Clear MMIO 0x8154[31]
307 // Set PCI CFG offset 0x40[11]
310 // Set PCI CFG offset 0x44[13:12]
319 Name (_PRW, Package () { DEFAULT_PRW_VALUE, 3 })
321 // Leave USB ports on for to allow Wake from USB
323 Method (_S3D, 0) // Highest D State in S3 State
328 Method (_S4D, 0) // Highest D State in S4 State
337 // GPLD: Generate Port Location Data (PLD)
338 Method (GPLD, 1, Serialized) {
339 Name (PCKG, Package () {
343 // REV: Revision 2 for ACPI 5.0
344 CreateField (DerefOf (PCKG [0]), 0, 7, REV)
347 // VISI: Port visibility to user per port
348 CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI)
353 Device (PRT1) { Name (_ADR, 1) } // USB Port 0
354 Device (PRT2) { Name (_ADR, 2) } // USB Port 1
355 Device (PRT3) { Name (_ADR, 3) } // USB Port 2
356 Device (PRT4) { Name (_ADR, 4) } // USB Port 3
357 Device (PRT5) { Name (_ADR, 5) } // USB Port 4
358 Device (PRT6) { Name (_ADR, 6) } // USB Port 5
359 Device (PRT7) { Name (_ADR, 7) } // USB Port 6
360 Device (PRT8) { Name (_ADR, 8) } // USB Port 7
361 Device (SSP1) { Name (_ADR, 10) } // USB Port 10
362 Device (SSP2) { Name (_ADR, 11) } // USB Port 11
363 Device (SSP3) { Name (_ADR, 12) } // USB Port 12
364 Device (SSP4) { Name (_ADR, 13) } // USB Port 13
365 Device (SSP5) { Name (_ADR, 14) } // USB Port 14
366 Device (SSP6) { Name (_ADR, 15) } // USB Port 15