2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 * USB Port Wake Enable (UPWE) on usb attach/detach
18 * Arg1 - Port 1 Status and control offset
19 * Arg2 - xHCI Memory-mapped address
21 Method (UPWE, 3, Serialized)
23 /* Local0 = Arg1 + ((Arg0 - 1) * 0x10) */
24 Add (Arg1, Multiply (Subtract (Arg0, 1), 0x10), Local0)
26 /* Map ((XMEM << 16) + Local0 in PSCR */
27 OperationRegion (PSCR, SystemMemory,
28 Add (ShiftLeft (Arg2, 16), Local0), 0x10)
29 Field (PSCR, DWordAcc, NoLock, Preserve)
35 * And port status/control reg with RO and RWS bits
36 * RO bits: 0, 2:3, 10:13, 24, 28:30
37 * RWS bits: 5:9, 14:16, 25:27
39 And (Local0, ~0x80FE0012, Local0)
40 /* Set WCE and WDE bits */
41 Or (Local0, 0x6000000, Local0)
46 * USB Wake Enable Setup (UWES)
47 * Arg0 - Port enable bitmap
48 * Arg1 - Port 1 Status and control offset
49 * Arg2 - xHCI Memory-mapped address
51 Method (UWES, 3, Serialized)
56 FindSetRightBit (Local0, Local1)
57 If (LEqual (Local1, Zero)) {
60 UPWE (Local1, Arg1, Arg2)
62 * Clear the lowest set bit in Local0 since it was
64 * Local0 = Local0 & (Local0 - 1)
66 And (Local0, Subtract (Local0, 1), Local0)
70 /* XHCI Controller 0:14.0 */
74 Name (_ADR, 0x00140000)
76 Name (_PRW, Package () { GPE0_PME_B0, 3 })
81 UWES (And (\U2WE, 0x3FF), 0x480, XMEM)
82 UWES (And (\U3WE, 0x3F), 0x540, XMEM)
85 Name (_S3D, 3) /* D3 supported in S3 */
86 Name (_S4D, 3) /* D3 supported in S4 */
87 Name (_S0W, 3) /* D3 can wake device in S0 */
88 Name (_S3W, 3) /* D3 can wake system from S3 */
89 Name (_S4W, 3) /* D3 can wake system from S4 */
91 OperationRegion (XPRT, PCI_Config, 0x00, 0x100)
92 Field (XPRT, AnyAcc, NoLock, Preserve)
95 DVID, 16, /* VENDORID */
98 XMEM, 16, /* MEM_BASE */
99 Offset (0x50), /* XHCLKGTEN */
101 STGE, 1, /* SS Link Trunk clock gating enable */
103 D0D3, 2, /* POWERSTATE */
105 PMEE, 1, /* PME_EN */
107 PMES, 1, /* PME_STS */
110 D3HE, 1, /* D3_hot_en */
113 OperationRegion (XREG, SystemMemory,
114 Add (ShiftLeft (XMEM, 16), 0x8000), 0x200)
115 Field (XREG, DWordAcc, Lock, Preserve)
117 Offset (0x1c4), /* USB2PMCTRL */
119 UPSW, 2, /* U2PSUSPGP */
122 Method (_PSC, 0, Serialized)
127 Method (_PS0, 0, Serialized)
129 If (!LEqual (^DVID, 0xFFFF)) {
130 If (!LOr (LEqual (^XMEM, 0xFFFF), LEqual (^XMEM, 0x0000))) {
132 /* Disable d3hot and SS link trunk clock gating */
136 /* If device is in D3, set back to D0 */
137 If (LEqual (^D0D3, 3)) {
139 Store (Local0, ^D0D3)
140 Store (^D0D3, Local0)
143 /* Disable USB2 PHY SUS Well Power Gating */
147 * Apply USB2 PHPY Power Gating workaround if needed.
150 /* Write to MTPMC to have PMC disable power gating */
151 Store (1, ^^PMC.MPMC)
153 /* Wait for PCH_PM_STS.MSG_FULL_STS to be 0 */
167 Method (_PS3, 0, Serialized)
169 If (!LEqual (^DVID, 0xFFFF)) {
170 If (!LOr (LEqual (^XMEM, 0xFFFF), LEqual (^XMEM, 0x0000))) {
172 /* Clear PME Status */
178 /* If device is in D3, set back to D0 */
179 If (LEqual (^D0D3, 3)) {
181 Store (Local0, ^D0D3)
182 Store (^D0D3, Local0)
185 /* Enable USB2 PHY SUS Well Power Gating in D0/D0i2/D0i3/D3 */
188 /* Enable d3hot and SS link trunk clock gating */
192 /* Now put device in D3 */
194 Store (Local0, ^D0D3)
195 Store (^D0D3, Local0)
198 * Apply USB2 PHPY Power Gating workaround if needed.
199 * This code assumes XDCI is disabled, if it is enabled
200 * then this must also check if it is in D3 state too.
203 /* Write to MTPMC to have PMC enable power gating */
204 Store (3, ^^PMC.MPMC)
206 /* Wait for PCH_PM_STS.MSG_FULL_STS to be 0 */
220 /* Root Hub for Skylake-LP PCH */
225 // GPLD: Generate Port Location Data (PLD)
226 Method (GPLD, 1, Serialized)
229 Name (PCKG, Package (0x01)
234 // REV: Revision 0x02 for ACPI 5.0
235 CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
238 // VISI: Port visibility to user per port
239 CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
246 Device (HS01) { Name (_ADR, 1) }
247 Device (HS02) { Name (_ADR, 2) }
248 Device (HS03) { Name (_ADR, 3) }
249 Device (HS04) { Name (_ADR, 4) }
250 Device (HS05) { Name (_ADR, 5) }
251 Device (HS06) { Name (_ADR, 6) }
252 Device (HS07) { Name (_ADR, 7) }
253 Device (HS08) { Name (_ADR, 8) }
254 Device (HS09) { Name (_ADR, 9) }
255 Device (HS10) { Name (_ADR, 10) }
258 Device (USR1) { Name (_ADR, 11) }
259 Device (USR2) { Name (_ADR, 12) }
262 Device (SS01) { Name (_ADR, 13) }
263 Device (SS02) { Name (_ADR, 14) }
264 Device (SS03) { Name (_ADR, 15) }
265 Device (SS04) { Name (_ADR, 16) }
266 Device (SS05) { Name (_ADR, 17) }
267 Device (SS06) { Name (_ADR, 18) }