1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* Intel Cougar Point USB support */
5 // EHCI Controller 0:1d.0
11 Name (_PRW, Package(){ 13, 4 }) // Power Resources for Wake
13 // Leave USB ports on for to allow Wake from USB
15 Method(_S3D,0) // Highest D State in S3 State
20 Method(_S4D,0) // Highest D State in S4 State
27 Name (_ADR, 0x00000000)
30 // GPLD: Generate Port Location Data (PLD)
31 Method (GPLD, 1, Serialized)
34 Name (PCKG, Package (0x01)
39 // REV: Revision 0x02 for ACPI 5.0
40 CreateField (DerefOf (PCKG [0]), 0, 0x07, REV)
43 // VISI: Port visibility to user per port
44 CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI)
50 // How many are there?
51 Device (PRT1) { Name (_ADR, 1) } // USB Port 0
52 Device (PRT2) { Name (_ADR, 2) } // USB Port 1
53 Device (PRT3) { Name (_ADR, 3) } // USB Port 2
54 Device (PRT4) { Name (_ADR, 4) } // USB Port 3
55 Device (PRT5) { Name (_ADR, 5) } // USB Port 4
56 Device (PRT6) { Name (_ADR, 6) } // USB Port 5
60 // EHCI #2 Controller 0:1a.0
64 Name(_ADR, 0x001a0000)
66 Name (_PRW, Package(){ 13, 4 }) // Power Resources for Wake
68 // Leave USB ports on for to allow Wake from USB
70 Method(_S3D,0) // Highest D State in S3 State
75 Method(_S4D,0) // Highest D State in S4 State
82 Name (_ADR, 0x00000000)
84 // GPLD: Generate Port Location Data (PLD)
85 Method (GPLD, 1, Serialized)
87 Name (PCKG, Package (0x01)
92 // REV: Revision 0x02 for ACPI 5.0
93 CreateField (DerefOf (PCKG [0]), 0, 0x07, REV)
96 // VISI: Port visibility to user per port
97 CreateField (DerefOf (PCKG [0]), 0x40, 1, VISI)
103 // How many are there?
104 Device (PRT1) { Name (_ADR, 1) } // USB Port 0
105 Device (PRT2) { Name (_ADR, 2) } // USB Port 1
106 Device (PRT3) { Name (_ADR, 3) } // USB Port 2
107 Device (PRT4) { Name (_ADR, 4) } // USB Port 3
108 Device (PRT5) { Name (_ADR, 5) } // USB Port 4
109 Device (PRT6) { Name (_ADR, 6) } // USB Port 5
115 Name(_ADR, 0x00140000)
116 OperationRegion(XDEV, PCI_Config, 0, 256)
117 Field(XDEV, DWordAcc, NoLock, Preserve)
121 PRM2, 32, // XUSB2PRM
122 SSEN, 32, // USB3_PSSEN
124 XPRT, 32, // XHCI Ports
127 Name (_PRW, Package(){ 13, 4 }) // Power Resources for Wake
129 Method(POSC,2,Serialized)
132 * Arg0 - An Integer containing a count of entries in Arg3
133 * Arg1 - A Buffer containing a list of DWORD capabilities
136 // Create DWord field from the Capabilities Buffer
137 CreateDWordField(Arg1,0,CDW1)
141 // Set unknown revision bit
145 // Set failure if xHCI is disabled by coreboot
150 // Query flag clear and xHCI in auto mode
151 If(!(CDW1 & 0x1) && (XHCI == 2 || XHCI == 3)) {
152 Printf ("XHCI Switch")
155 If(Local0 == 0 || Local0 == 1) {
158 ElseIf(Local0 == 2) {
161 ElseIf(Local0 == 3) {
164 Local0 = RPM3 & 0xfffffff0
165 RPM3 = Local0 | Local1
166 Local0 = PRM2 & 0xfffffff0
167 PRM2 = Local0 | Local1
168 Local0 = SSEN & 0xfffffff0
169 SSEN = Local0 | Local1
170 Local0 = X2PR & 0xfffffff0
171 X2PR = Local0 | Local1
176 // Leave USB ports on for to allow Wake from USB
177 Method(_S3D,0) // Highest D State in S3 State
182 Method(_S4D,0) // Highest D State in S4 State