Patrick Georgi | 2efc880 | 2012-11-06 11:03:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 19 | * MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | Device (GFX0) |
| 23 | { |
| 24 | Name (_ADR, 0x00020000) |
| 25 | |
Vladimir Serbinenko | f3155d2 | 2014-08-10 23:53:42 +0200 | [diff] [blame^] | 26 | OperationRegion (GFXC, PCI_Config, 0x00, 0x0100) |
| 27 | Field (GFXC, DWordAcc, NoLock, Preserve) |
| 28 | { |
| 29 | Offset (0x10), |
| 30 | BAR0, 64 |
| 31 | } |
| 32 | |
| 33 | OperationRegion (GFRG, SystemMemory, And (BAR0, 0xfffffffffffffff0), 0x400000) |
| 34 | Field (GFRG, DWordAcc, NoLock, Preserve) |
| 35 | { |
| 36 | Offset (0x61250), |
| 37 | CR1, 32, |
| 38 | BCLV, 16, |
| 39 | BCLM, 16, |
| 40 | } |
| 41 | |
Patrick Georgi | 2efc880 | 2012-11-06 11:03:53 +0100 | [diff] [blame] | 42 | /* Display Output Switching */ |
| 43 | Method (_DOS, 1) |
| 44 | { |
| 45 | /* Windows 2000 and Windows XP call _DOS to enable/disable |
| 46 | * Display Output Switching during init and while a switch |
| 47 | * is already active |
| 48 | */ |
| 49 | Store (And(Arg0, 7), DSEN) |
| 50 | } |
| 51 | |
| 52 | /* We try to support as many GM45 systems as possible, |
| 53 | * so keep the number of DIDs flexible. |
| 54 | */ |
| 55 | Method (_DOD, 0) |
| 56 | { |
| 57 | If (LEqual(NDID, 1)) { |
| 58 | Name(DOD1, Package() { |
| 59 | 0xffffffff |
| 60 | }) |
| 61 | Store (Or(0x00010000, DID1), Index(DOD1, 0)) |
| 62 | Return(DOD1) |
| 63 | } |
| 64 | |
| 65 | If (LEqual(NDID, 2)) { |
| 66 | Name(DOD2, Package() { |
| 67 | 0xffffffff, |
| 68 | 0xffffffff |
| 69 | }) |
| 70 | Store (Or(0x00010000, DID1), Index(DOD2, 0)) |
| 71 | Store (Or(0x00010000, DID2), Index(DOD2, 1)) |
| 72 | Return(DOD2) |
| 73 | } |
| 74 | |
| 75 | If (LEqual(NDID, 3)) { |
| 76 | Name(DOD3, Package() { |
| 77 | 0xffffffff, |
| 78 | 0xffffffff, |
| 79 | 0xffffffff |
| 80 | }) |
| 81 | Store (Or(0x00010000, DID1), Index(DOD3, 0)) |
| 82 | Store (Or(0x00010000, DID2), Index(DOD3, 1)) |
| 83 | Store (Or(0x00010000, DID3), Index(DOD3, 2)) |
| 84 | Return(DOD3) |
| 85 | } |
| 86 | |
| 87 | If (LEqual(NDID, 4)) { |
| 88 | Name(DOD4, Package() { |
| 89 | 0xffffffff, |
| 90 | 0xffffffff, |
| 91 | 0xffffffff, |
| 92 | 0xffffffff |
| 93 | }) |
| 94 | Store (Or(0x00010000, DID1), Index(DOD4, 0)) |
| 95 | Store (Or(0x00010000, DID2), Index(DOD4, 1)) |
| 96 | Store (Or(0x00010000, DID3), Index(DOD4, 2)) |
| 97 | Store (Or(0x00010000, DID4), Index(DOD4, 3)) |
| 98 | Return(DOD4) |
| 99 | } |
| 100 | |
| 101 | If (LGreater(NDID, 4)) { |
| 102 | Name(DOD5, Package() { |
| 103 | 0xffffffff, |
| 104 | 0xffffffff, |
| 105 | 0xffffffff, |
| 106 | 0xffffffff, |
| 107 | 0xffffffff |
| 108 | }) |
| 109 | Store (Or(0x00010000, DID1), Index(DOD5, 0)) |
| 110 | Store (Or(0x00010000, DID2), Index(DOD5, 1)) |
| 111 | Store (Or(0x00010000, DID3), Index(DOD5, 2)) |
| 112 | Store (Or(0x00010000, DID4), Index(DOD5, 3)) |
| 113 | Store (Or(0x00010000, DID5), Index(DOD5, 4)) |
| 114 | Return(DOD5) |
| 115 | } |
| 116 | |
| 117 | /* Some error happened, but we have to return something */ |
| 118 | Return (Package() {0x00000400}) |
| 119 | } |
| 120 | |
| 121 | Device(DD01) |
| 122 | { |
| 123 | /* Device Unique ID */ |
| 124 | Method(_ADR, 0, Serialized) |
| 125 | { |
| 126 | If(LEqual(DID1, 0)) { |
| 127 | Return (1) |
| 128 | } Else { |
| 129 | Return (And(0xffff, DID1)) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | /* Device Current Status */ |
| 134 | Method(_DCS, 0) |
| 135 | { |
| 136 | TRAP(1) |
| 137 | If (And(CSTE, 1)) { |
| 138 | Return (0x1f) |
| 139 | } |
| 140 | Return(0x1d) |
| 141 | } |
| 142 | |
| 143 | /* Query Device Graphics State */ |
| 144 | Method(_DGS, 0) |
| 145 | { |
| 146 | If (And(NSTE, 1)) { |
| 147 | Return(1) |
| 148 | } |
| 149 | Return(0) |
| 150 | } |
| 151 | |
| 152 | /* Device Set State */ |
| 153 | Method(_DSS, 1) |
| 154 | { |
| 155 | /* If Parameter Arg0 is (1 << 31) | (1 << 30), the |
| 156 | * display switch was completed |
| 157 | */ |
| 158 | If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { |
| 159 | Store (NSTE, CSTE) |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | Device(DD02) |
| 165 | { |
| 166 | /* Device Unique ID */ |
| 167 | Method(_ADR, 0, Serialized) |
| 168 | { |
| 169 | If(LEqual(DID2, 0)) { |
| 170 | Return (2) |
| 171 | } Else { |
| 172 | Return (And(0xffff, DID2)) |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /* Device Current Status */ |
| 177 | Method(_DCS, 0) |
| 178 | { |
| 179 | TRAP(1) |
| 180 | If (And(CSTE, 2)) { |
| 181 | Return (0x1f) |
| 182 | } |
| 183 | Return(0x1d) |
| 184 | } |
| 185 | |
| 186 | /* Query Device Graphics State */ |
| 187 | Method(_DGS, 0) |
| 188 | { |
| 189 | If (And(NSTE, 2)) { |
| 190 | Return(1) |
| 191 | } |
| 192 | Return(0) |
| 193 | } |
| 194 | |
| 195 | /* Device Set State */ |
| 196 | Method(_DSS, 1) |
| 197 | { |
| 198 | /* If Parameter Arg0 is (1 << 31) | (1 << 30), the |
| 199 | * display switch was completed |
| 200 | */ |
| 201 | If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { |
| 202 | Store (NSTE, CSTE) |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | |
| 208 | Device(DD03) |
| 209 | { |
| 210 | /* Device Unique ID */ |
| 211 | Method(_ADR, 0, Serialized) |
| 212 | { |
| 213 | If(LEqual(DID3, 0)) { |
| 214 | Return (3) |
| 215 | } Else { |
| 216 | Return (And(0xffff, DID3)) |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | /* Device Current Status */ |
| 221 | Method(_DCS, 0) |
| 222 | { |
| 223 | TRAP(1) |
| 224 | If (And(CSTE, 4)) { |
| 225 | Return (0x1f) |
| 226 | } |
| 227 | Return(0x1d) |
| 228 | } |
| 229 | |
| 230 | /* Query Device Graphics State */ |
| 231 | Method(_DGS, 0) |
| 232 | { |
| 233 | If (And(NSTE, 4)) { |
| 234 | Return(1) |
| 235 | } |
| 236 | Return(0) |
| 237 | } |
| 238 | |
| 239 | /* Device Set State */ |
| 240 | Method(_DSS, 1) |
| 241 | { |
| 242 | /* If Parameter Arg0 is (1 << 31) | (1 << 30), the |
| 243 | * display switch was completed |
| 244 | */ |
| 245 | If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { |
| 246 | Store (NSTE, CSTE) |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | |
| 252 | Device(DD04) |
| 253 | { |
| 254 | /* Device Unique ID */ |
| 255 | Method(_ADR, 0, Serialized) |
| 256 | { |
| 257 | If(LEqual(DID4, 0)) { |
| 258 | Return (4) |
| 259 | } Else { |
| 260 | Return (And(0xffff, DID4)) |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /* Device Current Status */ |
| 265 | Method(_DCS, 0) |
| 266 | { |
| 267 | TRAP(1) |
| 268 | If (And(CSTE, 8)) { |
| 269 | Return (0x1f) |
| 270 | } |
| 271 | Return(0x1d) |
| 272 | } |
| 273 | |
| 274 | /* Query Device Graphics State */ |
| 275 | Method(_DGS, 0) |
| 276 | { |
| 277 | If (And(NSTE, 4)) { |
| 278 | Return(1) |
| 279 | } |
| 280 | Return(0) |
| 281 | } |
| 282 | |
| 283 | /* Device Set State */ |
| 284 | Method(_DSS, 1) |
| 285 | { |
| 286 | /* If Parameter Arg0 is (1 << 31) | (1 << 30), the |
| 287 | * display switch was completed |
| 288 | */ |
| 289 | If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { |
| 290 | Store (NSTE, CSTE) |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | |
| 296 | Device(DD05) |
| 297 | { |
| 298 | /* Device Unique ID */ |
| 299 | Method(_ADR, 0, Serialized) |
| 300 | { |
| 301 | If(LEqual(DID5, 0)) { |
| 302 | Return (5) |
| 303 | } Else { |
| 304 | Return (And(0xffff, DID5)) |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | /* Device Current Status */ |
| 309 | Method(_DCS, 0) |
| 310 | { |
| 311 | TRAP(1) |
| 312 | If (And(CSTE, 16)) { |
| 313 | Return (0x1f) |
| 314 | } |
| 315 | Return(0x1d) |
| 316 | } |
| 317 | |
| 318 | /* Query Device Graphics State */ |
| 319 | Method(_DGS, 0) |
| 320 | { |
| 321 | If (And(NSTE, 4)) { |
| 322 | Return(1) |
| 323 | } |
| 324 | Return(0) |
| 325 | } |
| 326 | |
| 327 | /* Device Set State */ |
| 328 | Method(_DSS, 1) |
| 329 | { |
| 330 | /* If Parameter Arg0 is (1 << 31) | (1 << 30), the |
| 331 | * display switch was completed |
| 332 | */ |
| 333 | If (LEqual(And(Arg0, 0xc0000000), 0xc0000000)) { |
| 334 | Store (NSTE, CSTE) |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | } |