Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2009 coresystems GmbH |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 5 | * Copyright (C) 2015 Google Inc. |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 6 | * Copyright (C) 2015 Intel Corporation. |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 19 | * Foundation, Inc. |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 22 | /* XHCI Controller 0:14.0 */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 23 | |
| 24 | Device (XHCI) |
| 25 | { |
| 26 | Name (_ADR, 0x00140000) |
| 27 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 28 | Name (_PRW, Package () { GPE0_PME_B0, 3 }) |
| 29 | |
| 30 | Method (_DSW, 3) |
| 31 | { |
| 32 | Store (Arg0, PMEE) |
| 33 | } |
| 34 | |
| 35 | Name (_S3D, 3) /* D3 supported in S3 */ |
| 36 | Name (_S4D, 3) /* D3 supported in S4 */ |
| 37 | Name (_S0W, 3) /* D3 can wake device in S0 */ |
| 38 | Name (_S3W, 3) /* D3 can wake system from S3 */ |
| 39 | Name (_S4W, 3) /* D3 can wake system from S4 */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 40 | |
| 41 | OperationRegion (XPRT, PCI_Config, 0x00, 0x100) |
| 42 | Field (XPRT, AnyAcc, NoLock, Preserve) |
| 43 | { |
| 44 | Offset (0x0), |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 45 | DVID, 16, /* VENDORID */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 46 | Offset (0x10), |
| 47 | , 16, |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 48 | XMEM, 16, /* MEM_BASE */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 49 | Offset (0x74), |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 50 | D0D3, 2, /* POWERSTATE */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 51 | , 6, |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 52 | PMEE, 1, /* PME_EN */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 53 | , 6, |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 54 | PMES, 1, /* PME_STS */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 57 | OperationRegion (XREG, SystemMemory, |
| 58 | Add (ShiftLeft (XMEM, 16), 0x8000), 0x200) |
| 59 | Field (XREG, DWordAcc, Lock, Preserve) |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 60 | { |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 61 | Offset (0x1c4), /* USB2PMCTRL */ |
| 62 | , 2, |
| 63 | UPSW, 2, /* U2PSUSPGP */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 66 | Method (_PSC, 0, Serialized) |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 67 | { |
| 68 | Return (^D0D3) |
| 69 | } |
| 70 | |
| 71 | Method (_PS0, 0, Serialized) |
| 72 | { |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 73 | If (LEqual (^DVID, 0xFFFF)) { |
| 74 | Return |
| 75 | } |
| 76 | If (LOr (LEqual (^XMEM, 0xFFFF), LEqual (^XMEM, 0x0000))) { |
| 77 | Return |
| 78 | } |
| 79 | |
| 80 | /* If device is in D3, set back to D0 */ |
| 81 | If (LEqual (^D0D3, 3)) { |
| 82 | Store (Zero, ^D0D3) |
| 83 | Store (^D0D3, Local0) |
| 84 | } |
| 85 | |
| 86 | /* Disable USB2 PHY SUS Well Power Gating */ |
| 87 | Store (Zero, ^UPSW) |
| 88 | |
| 89 | /* |
| 90 | * Apply USB2 PHPY Power Gating workaround if needed. |
| 91 | */ |
| 92 | If (^^PMC.UWAB) { |
| 93 | /* Write to MTPMC to have PMC disable power gating */ |
| 94 | Store (1, ^^PMC.MPMC) |
| 95 | |
| 96 | /* Wait for PCH_PM_STS.MSG_FULL_STS to be 0 */ |
| 97 | Store (10, Local0) |
| 98 | While (^^PMC.PMFS) { |
| 99 | If (LNot (Local0)) { |
| 100 | Break |
| 101 | } |
| 102 | Decrement (Local0) |
| 103 | Sleep (10) |
| 104 | } |
| 105 | } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 106 | } |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 107 | |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 108 | Method (_PS3, 0, Serialized) |
| 109 | { |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 110 | If (LEqual (^DVID, 0xFFFF)) { |
| 111 | Return |
| 112 | } |
| 113 | If (LOr (LEqual (^XMEM, 0xFFFF), LEqual (^XMEM, 0x0000))) { |
| 114 | Return |
| 115 | } |
| 116 | |
| 117 | /* Clear PME Status */ |
| 118 | Store (1, ^PMES) |
| 119 | |
| 120 | /* Enable PME */ |
| 121 | Store (1, ^PMEE) |
| 122 | |
| 123 | /* If device is in D3, set back to D0 */ |
| 124 | If (LEqual (^D0D3, 3)) { |
| 125 | Store (Zero, ^D0D3) |
| 126 | Store (^D0D3, Local0) |
| 127 | } |
| 128 | |
| 129 | /* Enable USB2 PHY SUS Well Power Gating in D0/D0i2/D0i3/D3 */ |
| 130 | Store (3, ^UPSW) |
| 131 | |
| 132 | /* Now put device in D3 */ |
| 133 | Store (3, ^D0D3) |
| 134 | Store (^D0D3, Local0) |
| 135 | |
| 136 | /* |
| 137 | * Apply USB2 PHPY Power Gating workaround if needed. |
| 138 | * This code assumes XDCI is disabled, if it is enabled |
| 139 | * then this must also check if it is in D3 state too. |
| 140 | */ |
| 141 | If (^^PMC.UWAB) { |
| 142 | /* Write to MTPMC to have PMC enable power gating */ |
| 143 | Store (3, ^^PMC.MPMC) |
| 144 | |
| 145 | /* Wait for PCH_PM_STS.MSG_FULL_STS to be 0 */ |
| 146 | Store (10, Local0) |
| 147 | While (^^PMC.PMFS) { |
| 148 | If (LNot (Local0)) { |
| 149 | Break |
| 150 | } |
| 151 | Decrement (Local0) |
| 152 | Sleep (10) |
| 153 | } |
| 154 | } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 155 | } |
| 156 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 157 | /* Root Hub for Skylake-LP PCH */ |
| 158 | Device (RHUB) |
| 159 | { |
| 160 | Name (_ADR, Zero) |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 161 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 162 | /* USB2 */ |
| 163 | Device (HS01) { Name (_ADR, 1) } |
| 164 | Device (HS02) { Name (_ADR, 2) } |
| 165 | Device (HS03) { Name (_ADR, 3) } |
| 166 | Device (HS04) { Name (_ADR, 4) } |
| 167 | Device (HS05) { Name (_ADR, 5) } |
| 168 | Device (HS06) { Name (_ADR, 6) } |
| 169 | Device (HS07) { Name (_ADR, 7) } |
| 170 | Device (HS08) { Name (_ADR, 8) } |
| 171 | Device (HS09) { Name (_ADR, 9) } |
| 172 | Device (HS10) { Name (_ADR, 10) } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 173 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 174 | /* USBr */ |
| 175 | Device (USR1) { Name (_ADR, 11) } |
| 176 | Device (USR2) { Name (_ADR, 12) } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 177 | |
Duncan Laurie | e32da95 | 2015-08-27 17:09:02 -0700 | [diff] [blame^] | 178 | /* USB3 */ |
| 179 | Device (SS01) { Name (_ADR, 13) } |
| 180 | Device (SS02) { Name (_ADR, 14) } |
| 181 | Device (SS03) { Name (_ADR, 15) } |
| 182 | Device (SS04) { Name (_ADR, 16) } |
| 183 | Device (SS05) { Name (_ADR, 17) } |
| 184 | Device (SS06) { Name (_ADR, 18) } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 185 | } |
| 186 | } |