Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiTables/AcpiTables.inf
r48674 r58459 34 34 Facs.aslc 35 35 Dsdt.asl 36 Ssdt.asl 36 37 37 38 [Packages] -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiTables/Dsdt.asl
r48674 r58459 1 1 /** @file 2 2 Contains root level name space objects for the platform 3 3 4 4 Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials are … … 7 7 which accompanies this distribution. The full text of the license may be found at 8 8 http://opensource.org/licenses/bsd-license.php 9 9 10 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 **/ 14 15 DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) {13 **/ 14 15 DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 4) { 16 16 // 17 17 // System Sleep States 18 18 // 19 Name (\_S0, Package () {5, 0, 0, 0}) 20 Name (\_S4, Package () {1, 0, 0, 0}) 21 Name (\_S5, Package () {0, 0, 0, 0}) 19 // We build S3 and S4 with GetSuspendStates() in 20 // "OvmfPkg/AcpiPlatformDxe/Qemu.c". 21 // 22 Name (\_S0, Package () {5, 0, 0, 0}) // Working 23 Name (\_S5, Package () {0, 0, 0, 0}) // Soft Off 22 24 23 25 // … … 37 39 // BUS, I/O, and MMIO resources 38 40 // 39 Name ( _CRS, ResourceTemplate () {41 Name (CRES, ResourceTemplate () { 40 42 WORDBusNumber ( // Bus number resource (0); the bridge produces bus numbers for its subsequent buses 41 43 ResourceProducer, // bit 0 of general flags is 1 … … 56 58 MinFixed, // Range is fixed 57 59 MaxFixed, // Range is fixed 58 PosDecode, 60 PosDecode, 59 61 EntireRange, 60 62 0x0000, // Granularity … … 69 71 MinFixed, // Range is fixed 70 72 MaxFixed, // Range is fixed 71 PosDecode, 73 PosDecode, 72 74 EntireRange, 73 75 0x0000, // Granularity … … 92 94 ) 93 95 94 DWORDMEMORY ( // Descriptor for linear frame buffer video RAM96 DWORDMEMORY ( // Descriptor for 32-bit MMIO 95 97 ResourceProducer, // bit 0 of general flags is 0 96 98 PosDecode, 97 99 MinFixed, // Range is fixed 98 100 MaxFixed, // Range is Fixed 99 Cacheable,101 NonCacheable, 100 102 ReadWrite, 101 103 0x00000000, // Granularity … … 103 105 0xFFFBFFFF, // Max 104 106 0x00000000, // Translation 105 0x07FC0000 // Range Length 107 0x07FC0000, // Range Length 108 , // ResourceSourceIndex 109 , // ResourceSource 110 PW32 // DescriptorName 106 111 ) 107 112 }) 113 114 Name (CR64, ResourceTemplate () { 115 QWordMemory ( // Descriptor for 64-bit MMIO 116 ResourceProducer, // bit 0 of general flags is 0 117 PosDecode, 118 MinFixed, // Range is fixed 119 MaxFixed, // Range is Fixed 120 Cacheable, 121 ReadWrite, 122 0x00000000, // Granularity 123 0x8000000000, // Min 124 0xFFFFFFFFFF, // Max 125 0x00000000, // Translation 126 0x8000000000, // Range Length 127 , // ResourceSourceIndex 128 , // ResourceSource 129 PW64 // DescriptorName 130 ) 131 }) 132 133 Method (_CRS, 0) { 134 // 135 // see the FIRMWARE_DATA structure in "OvmfPkg/AcpiPlatformDxe/Qemu.c" 136 // 137 External (FWDT, OpRegionObj) 138 Field(FWDT, QWordAcc, NoLock, Preserve) { 139 P0S, 64, // PciWindow32.Base 140 P0E, 64, // PciWindow32.End 141 P0L, 64, // PciWindow32.Length 142 P1S, 64, // PciWindow64.Base 143 P1E, 64, // PciWindow64.End 144 P1L, 64 // PciWindow64.Length 145 } 146 Field(FWDT, DWordAcc, NoLock, Preserve) { 147 P0SL, 32, // PciWindow32.Base, low 32 bits 148 P0SH, 32, // PciWindow32.Base, high 32 bits 149 P0EL, 32, // PciWindow32.End, low 32 bits 150 P0EH, 32, // PciWindow32.End, high 32 bits 151 P0LL, 32, // PciWindow32.Length, low 32 bits 152 P0LH, 32, // PciWindow32.Length, high 32 bits 153 P1SL, 32, // PciWindow64.Base, low 32 bits 154 P1SH, 32, // PciWindow64.Base, high 32 bits 155 P1EL, 32, // PciWindow64.End, low 32 bits 156 P1EH, 32, // PciWindow64.End, high 32 bits 157 P1LL, 32, // PciWindow64.Length, low 32 bits 158 P1LH, 32 // PciWindow64.Length, high 32 bits 159 } 160 161 // 162 // fixup 32-bit PCI IO window 163 // 164 CreateDWordField (CRES, \_SB.PCI0.PW32._MIN, PS32) 165 CreateDWordField (CRES, \_SB.PCI0.PW32._MAX, PE32) 166 CreateDWordField (CRES, \_SB.PCI0.PW32._LEN, PL32) 167 Store (P0SL, PS32) 168 Store (P0EL, PE32) 169 Store (P0LL, PL32) 170 171 If (LAnd (LEqual (P1SL, 0x00), LEqual (P1SH, 0x00))) { 172 Return (CRES) 173 } Else { 174 // 175 // fixup 64-bit PCI IO window 176 // 177 CreateQWordField (CR64, \_SB.PCI0.PW64._MIN, PS64) 178 CreateQWordField (CR64, \_SB.PCI0.PW64._MAX, PE64) 179 CreateQWordField (CR64, \_SB.PCI0.PW64._LEN, PL64) 180 Store (P1S, PS64) 181 Store (P1E, PE64) 182 Store (P1L, PL64) 183 184 // 185 // add window and return result 186 // 187 ConcatenateResTemplate (CRES, CR64, Local0) 188 Return (Local0) 189 } 190 } 108 191 109 192 // … … 114 197 Package () { 115 198 // 116 // Bus 0, Device 1 117 // 118 Package () {0x0001FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, 199 // Bus 0; Devices 0 to 15 200 // 201 Package () {0x0000FFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, 202 Package () {0x0000FFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, 203 Package () {0x0000FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, 204 Package () {0x0000FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, 205 206 // 207 // Bus 0, Device 1, Pin 0 (INTA) is special; it corresponds to the 208 // internally generated SCI (System Control Interrupt), which is 209 // always routed to GSI 9. By setting the third (= Source) field to 210 // zero, we could use the fourth (= Source Index) field to hardwire 211 // the pin to GSI 9 directly. 212 // 213 // That way however, in accordance with the ACPI spec's description 214 // of SCI, the interrupt would be treated as "active low, 215 // shareable, level", and that doesn't match qemu. 216 // 217 // In QemuInstallAcpiMadtTable() [OvmfPkg/AcpiPlatformDxe/Qemu.c] 218 // we install an Interrupt Override Structure for the identity 219 // mapped IRQ#9 / GSI 9 (the corresponding bit being set in 220 // Pcd8259LegacyModeEdgeLevel), which describes the correct 221 // polarity (active high). As a consequence, some OS'en (eg. Linux) 222 // override the default (active low) polarity originating from the 223 // _PRT; others (eg. FreeBSD) don't. Therefore we need a separate 224 // link device just to specify a polarity that matches the MADT. 225 // 226 Package () {0x0001FFFF, 0x00, \_SB.PCI0.LPC.LNKS, 0x00}, 227 119 228 Package () {0x0001FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, 120 229 Package () {0x0001FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, 121 230 Package () {0x0001FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, 122 // 123 // Bus 0, Device 3 124 // 125 Package () {0x0003FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, 126 Package () {0x0003FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, 127 Package () {0x0003FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, 128 Package () {0x0003FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, 231 232 Package () {0x0002FFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, 233 Package () {0x0002FFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, 234 Package () {0x0002FFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, 235 Package () {0x0002FFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, 236 237 Package () {0x0003FFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, 238 Package () {0x0003FFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, 239 Package () {0x0003FFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, 240 Package () {0x0003FFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00}, 241 242 Package () {0x0004FFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, 243 Package () {0x0004FFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, 244 Package () {0x0004FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, 245 Package () {0x0004FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, 246 247 Package () {0x0005FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, 248 Package () {0x0005FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, 249 Package () {0x0005FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, 250 Package () {0x0005FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, 251 252 Package () {0x0006FFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, 253 Package () {0x0006FFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, 254 Package () {0x0006FFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, 255 Package () {0x0006FFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, 256 257 Package () {0x0007FFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, 258 Package () {0x0007FFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, 259 Package () {0x0007FFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, 260 Package () {0x0007FFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00}, 261 262 Package () {0x0008FFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, 263 Package () {0x0008FFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, 264 Package () {0x0008FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, 265 Package () {0x0008FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, 266 267 Package () {0x0009FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, 268 Package () {0x0009FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, 269 Package () {0x0009FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, 270 Package () {0x0009FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, 271 272 Package () {0x000AFFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, 273 Package () {0x000AFFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, 274 Package () {0x000AFFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, 275 Package () {0x000AFFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, 276 277 Package () {0x000BFFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, 278 Package () {0x000BFFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, 279 Package () {0x000BFFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, 280 Package () {0x000BFFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00}, 281 282 Package () {0x000CFFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, 283 Package () {0x000CFFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, 284 Package () {0x000CFFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, 285 Package () {0x000CFFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, 286 287 Package () {0x000DFFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, 288 Package () {0x000DFFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, 289 Package () {0x000DFFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, 290 Package () {0x000DFFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, 291 292 Package () {0x000EFFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, 293 Package () {0x000EFFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, 294 Package () {0x000EFFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, 295 Package () {0x000EFFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, 296 297 Package () {0x000FFFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, 298 Package () {0x000FFFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, 299 Package () {0x000FFFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, 300 Package () {0x000FFFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00} 129 301 } 130 302 ) … … 133 305 // 134 306 // PCI to ISA Bridge (Bus 0, Device 1, Function 0) 307 // "Low Pin Count" 135 308 // 136 309 Device (LPC) { … … 138 311 139 312 // 140 // PCI Interrupt Routing Configuration Registers 313 // The SCI cannot be rerouted or disabled with PIRQRC[A:D]; we only 314 // need this link device in order to specify the polarity. 315 // 316 Device (LNKS) { 317 Name (_HID, EISAID("PNP0C0F")) 318 Name (_UID, 0) 319 320 Name (_STA, 0xB) // 0x1: device present 321 // 0x2: enabled and decoding resources 322 // 0x8: functioning properly 323 324 Method (_SRS, 1, NotSerialized) { /* no-op */ } 325 Method (_DIS, 0, NotSerialized) { /* no-op */ } 326 327 Name (_PRS, ResourceTemplate () { 328 Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 9 } 329 // 330 // list of IRQs occupied thus far: 9 331 // 332 }) 333 Method (_CRS, 0, NotSerialized) { Return (_PRS) } 334 } 335 336 // 337 // PCI Interrupt Routing Configuration Registers, PIRQRC[A:D] 141 338 // 142 339 OperationRegion (PRR0, PCI_Config, 0x60, 0x04) … … 150 347 // 151 348 // _STA method for LNKA, LNKB, LNKC, LNKD 349 // Arg0[in]: value of PIRA / PIRB / PIRC / PIRD 152 350 // 153 351 Method (PSTA, 1, NotSerialized) { 154 If (And (Arg0, 0x80)) { 155 Return (0x9) 352 If (And (Arg0, 0x80)) { // disable-bit set? 353 Return (0x9) // "device present" | "functioning properly" 156 354 } Else { 157 Return (0xB) 158 } 159 } 160 161 // 162 // _DIS method for LNKA, LNKB, LNKC, LNKD 163 // 164 Method (PDIS, 1, NotSerialized) { 165 Or (Arg0, 0x80, Arg0) 355 Return (0xB) // same | "enabled and decoding resources" 356 } 166 357 } 167 358 168 359 // 169 360 // _CRS method for LNKA, LNKB, LNKC, LNKD 361 // Arg0[in]: value of PIRA / PIRB / PIRC / PIRD 170 362 // 171 363 Method (PCRS, 1, NotSerialized) { 172 Name (BUF0, ResourceTemplate () {IRQ (Level, ActiveLow, Shared){0}}) 173 // 174 // Define references to buffer elements 175 // 176 CreateWordField (BUF0, 0x01, IRQW) // IRQ low 177 // 178 // Write current settings into IRQ descriptor 179 // 180 If (And (Arg0, 0x80)) { 181 Store (Zero, Local0) 182 } Else { 183 Store (One, Local0) 184 } 185 // 186 // Shift 1 by value in register 70 187 // 188 ShiftLeft (Local0, And (Arg0, 0x0F), IRQW) // Save in buffer 189 Return (BUF0) // Return Buf0 364 // 365 // create temporary buffer with an Extended Interrupt Descriptor 366 // whose single vector defaults to zero 367 // 368 Name (BUF0, ResourceTemplate () { 369 Interrupt (ResourceConsumer, Level, ActiveHigh, Shared){0} 370 } 371 ) 372 373 // 374 // define reference to first interrupt vector in buffer 375 // 376 CreateDWordField (BUF0, 0x05, IRQW) 377 378 // 379 // If the disable-bit is clear, overwrite the default zero vector 380 // with the value in Arg0 (ie. PIRQRC[A:D]). Reserved bits are read 381 // as 0. 382 // 383 If (LNot (And (Arg0, 0x80))) { 384 Store (Arg0, IRQW) 385 } 386 Return (BUF0) 190 387 } 191 388 … … 194 391 // 195 392 Name (PPRS, ResourceTemplate () { 196 IRQ (Level, ActiveLow, Shared) {3, 4, 5, 7, 9, 10, 11, 12, 14, 15} 393 Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) {5, 10, 11} 394 // 395 // list of IRQs occupied thus far: 9, 5, 10, 11 396 // 197 397 }) 198 199 //200 // _SRS method for LNKA, LNKB, LNKC, LNKD201 //202 Method (PSRS, 2, NotSerialized) {203 CreateWordField (Arg1, 0x01, IRQW) // IRQ low204 FindSetRightBit (IRQW, Local0) // Set IRQ205 If (LNotEqual (IRQW, Zero)) {206 And (Local0, 0x7F, Local0)207 Decrement (Local0)208 } Else {209 Or (Local0, 0x80, Local0)210 }211 Store (Local0, Arg0)212 }213 398 214 399 // … … 220 405 221 406 Method (_STA, 0, NotSerialized) { Return (PSTA (PIRA)) } 222 Method (_DIS, 0, NotSerialized) { PDIS (PIRA) } 407 Method (_DIS, 0, NotSerialized) { 408 Or (PIRA, 0x80, PIRA) // set disable-bit 409 } 223 410 Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRA)) } 224 411 Method (_PRS, 0, NotSerialized) { Return (PPRS) } 225 Method (_SRS, 1, NotSerialized) { PSRS (PIRA, Arg0) } 412 Method (_SRS, 1, NotSerialized) { 413 CreateDWordField (Arg0, 0x05, IRQW) 414 Store (IRQW, PIRA) 415 } 226 416 } 227 417 … … 234 424 235 425 Method (_STA, 0, NotSerialized) { Return (PSTA (PIRB)) } 236 Method (_DIS, 0, NotSerialized) { PDIS (PIRB) } 426 Method (_DIS, 0, NotSerialized) { 427 Or (PIRB, 0x80, PIRB) // set disable-bit 428 } 237 429 Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRB)) } 238 430 Method (_PRS, 0, NotSerialized) { Return (PPRS) } 239 Method (_SRS, 1, NotSerialized) { PSRS (PIRB, Arg0) } 431 Method (_SRS, 1, NotSerialized) { 432 CreateDWordField (Arg0, 0x05, IRQW) 433 Store (IRQW, PIRB) 434 } 240 435 } 241 436 … … 248 443 249 444 Method (_STA, 0, NotSerialized) { Return (PSTA (PIRC)) } 250 Method (_DIS, 0, NotSerialized) { PDIS (PIRC) } 445 Method (_DIS, 0, NotSerialized) { 446 Or (PIRC, 0x80, PIRC) // set disable-bit 447 } 251 448 Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRC)) } 252 449 Method (_PRS, 0, NotSerialized) { Return (PPRS) } 253 Method (_SRS, 1, NotSerialized) { PSRS (PIRC, Arg0) } 450 Method (_SRS, 1, NotSerialized) { 451 CreateDWordField (Arg0, 0x05, IRQW) 452 Store (IRQW, PIRC) 453 } 254 454 } 255 455 … … 259 459 Device (LNKD) { 260 460 Name (_HID, EISAID("PNP0C0F")) 261 Name (_UID, 1)461 Name (_UID, 4) 262 462 263 463 Method (_STA, 0, NotSerialized) { Return (PSTA (PIRD)) } 264 Method (_DIS, 0, NotSerialized) { PDIS (PIRD) } 464 Method (_DIS, 0, NotSerialized) { 465 Or (PIRD, 0x80, PIRD) // set disable-bit 466 } 265 467 Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRD)) } 266 468 Method (_PRS, 0, NotSerialized) { Return (PPRS) } 267 Method (_SRS, 1, NotSerialized) { PSRS (PIRD, Arg0) } 268 } 269 469 Method (_SRS, 1, NotSerialized) { 470 CreateDWordField (Arg0, 0x05, IRQW) 471 Store (IRQW, PIRD) 472 } 473 } 474 270 475 // 271 476 // Programmable Interrupt Controller (PIC) … … 278 483 IO (Decode16, 0x4D0, 0x4D0, 0x00, 0x02) 279 484 IRQNoFlags () {2} 280 }) 281 } 282 283 // 284 // ISA DMA 485 // 486 // list of IRQs occupied thus far: 9, 5, 10, 11, 2 487 // 488 }) 489 } 490 491 // 492 // ISA DMA 285 493 // 286 494 Device (DMAC) { 287 Name (_HID, EISAID ("PNP0200")) 495 Name (_HID, EISAID ("PNP0200")) 288 496 Name (_CRS, ResourceTemplate () { 289 497 IO (Decode16, 0x00, 0x00, 0, 0x10) … … 305 513 IO (Decode16, 0x40, 0x40, 0x00, 0x04) 306 514 IRQNoFlags () {0} 515 // 516 // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0 517 // 307 518 }) 308 519 } … … 316 527 IO (Decode16, 0x70, 0x70, 0x00, 0x02) 317 528 IRQNoFlags () {8} 529 // 530 // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0, 8 531 // 318 532 }) 319 533 } … … 337 551 IO (Decode16, 0xF0, 0xF0, 0x00, 0x10) 338 552 IRQNoFlags () {13} 553 // 554 // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0, 8, 13 555 // 339 556 }) 340 557 } … … 365 582 IO (Decode16, 0x370, 0x370, 0x00, 0x02) 366 583 IO (Decode16, 0x378, 0x378, 0x00, 0x08) 367 IO (Decode16, 0x40 0, 0x400, 0x00, 0x40) // PMBLK1584 IO (Decode16, 0x402, 0x402, 0x00, 0x01) // QEMU debug console, should use FixedPcdGet16 (PcdDebugIoPort) 368 585 IO (Decode16, 0x440, 0x440, 0x00, 0x10) 369 586 IO (Decode16, 0x678, 0x678, 0x00, 0x08) 370 587 IO (Decode16, 0x778, 0x778, 0x00, 0x08) 371 Memory32Fixed (ReadOnly, 0xFEC00000, 0x1000) // IO APIC 372 Memory32Fixed (ReadOnly, 0xFEE00000, 0x1000) 588 IO (Decode16, 0xafe0, 0xafe0, 0x00, 0x04) // QEMU GPE0 BLK 589 IO (Decode16, 0xb000, 0xb000, 0x00, 0x40) // PMBLK1 590 Memory32Fixed (ReadOnly, 0xFEC00000, 0x1000) // IO APIC 591 Memory32Fixed (ReadOnly, 0xFEE00000, 0x100000) // LAPIC 373 592 }) 374 593 } … … 377 596 // PS/2 Keyboard and PC/AT Enhanced Keyboard 101/102 378 597 // 379 Device (PS2K) { 598 Device (PS2K) { 380 599 Name (_HID, EISAID ("PNP0303")) 381 600 Name (_CID, EISAID ("PNP030B")) … … 384 603 IO (Decode16, 0x64, 0x64, 0x00, 0x01) 385 604 IRQNoFlags () {1} 605 // 606 // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0, 8, 13, 1 607 // 386 608 }) 387 609 } … … 395 617 Name (_CRS, ResourceTemplate() { 396 618 IRQNoFlags () {12} 619 // 620 // list of IRQs occupied thus far: 621 // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12 622 // 397 623 }) 398 624 } … … 408 634 IO (Decode16, 0x3F8, 0x3F8, 0x01, 0x08) 409 635 IRQ (Edge, ActiveHigh, Exclusive, ) {4} 636 // 637 // list of IRQs occupied thus far: 638 // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4 639 // 410 640 }) 411 641 } … … 421 651 IO (Decode16, 0x2F8, 0x2F8, 0x01, 0x08) 422 652 IRQ (Edge, ActiveHigh, Exclusive, ) {3} 653 // 654 // list of IRQs occupied thus far: 655 // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4, 3 656 // 423 657 }) 424 658 } … … 433 667 IO (Decode16, 0x3F7, 0x3F7, 0x01, 0x01) 434 668 IRQNoFlags () {6} 669 // 670 // list of IRQs occupied thus far: 671 // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4, 3, 6 672 // 435 673 DMA (Compatibility, NotBusMaster, Transfer8) {2} 674 }) 675 } 676 677 // 678 // parallel port -- no DMA for now 679 // 680 Device (PAR1) { 681 Name (_HID, EISAID ("PNP0400")) 682 Name (_DDN, "LPT1") 683 Name (_UID, 0x01) 684 Name(_CRS, ResourceTemplate() { 685 IO (Decode16, 0x0378, 0x0378, 0x00, 0x08) 686 IRQNoFlags () {7} 687 // 688 // list of IRQs occupied thus far: 689 // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4, 3, 6, 7 690 // in order: 691 // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 692 // 436 693 }) 437 694 } … … 440 697 } 441 698 } 442 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiTables/Facp.aslc
r48674 r58459 1 1 /** @file 2 2 FACP Table 3 4 Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR> 3 4 Copyright (c) 2013, Red Hat, Inc. 5 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR> 5 6 This program and the accompanying materials are 6 7 licensed and made available under the terms and conditions of the BSD License 7 8 which accompanies this distribution. The full text of the license may be found at 8 9 http://opensource.org/licenses/bsd-license.php 9 10 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 13 **/ 14 14 **/ 15 15 16 #include "Platform.h" 16 17 17 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = { 18 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, 19 sizeof (EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE), 20 EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, 21 0, // to make sum of entire table == 0 22 EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field 23 EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long) 24 EFI_ACPI_OEM_REVISION, // OEM revision number 25 EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID 26 EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number 18 EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = { 19 { 20 EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, 21 sizeof (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE), 22 EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, 23 0, // to make sum of entire table == 0 24 {EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field 25 EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long) 26 EFI_ACPI_OEM_REVISION, // OEM revision number 27 EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID 28 EFI_ACPI_CREATOR_REVISION // ASL compiler revision number 29 }, 27 30 0, // Physical addesss of FACS 28 31 0, // Physical address of DSDT 29 INT_MODEL, // System Interrupt Model30 RESERVED, // reserved32 RESERVED, // System Interrupt Model in ACPI 1.0, eliminated in 2.0 33 EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED, // Preferred PM profile 31 34 SCI_INT_VECTOR, // System vector of SCI interrupt 32 35 SMI_CMD_IO_PORT, // Port address of SMI command port … … 34 37 ACPI_DISABLE, // value to write to port smi_cmd to disable ACPI 35 38 S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS state 36 0 xE2,// PState control39 0, // PState control 37 40 PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk 38 PM1b_EVT_BLK, // Port address of Power Mgt 1b Event Reg Blk41 0, // Power Mgt 1b Event Reg Blk unsupported 39 42 PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk 40 PM1b_CNT_BLK, // Port address of Power Mgt 1b Ctrl Reg Blk41 PM2_CNT_BLK, // Port address of Power Mgt 2 Ctrl Reg Blk43 0, // Power Mgt 1b Ctrl Reg Blk unsupported 44 0, // Power Mgt 2 Ctrl Reg Blk unsupported 42 45 PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk 43 46 GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk 44 GPE1_BLK, // Port addr of General Purpose Event 1 Reg Blk47 0, // General Purpose Event 1 Reg Blk unsupported 45 48 PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk 46 49 PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk 47 PM2_CNT_LEN, // Byte Length of ports at pm2_cnt_blk50 0, // Power Mgt 2 Ctrl Reg Blk unsupported 48 51 PM_TM_LEN, // Byte Length of ports at pm_tm_blk 49 52 GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk 50 GPE1_BLK_LEN, // Byte Length of ports at gpe1_blk51 GPE1_BASE, // offset in gpe model where gpe1 events start52 0 xE3,// _CST support53 0, // General Purpose Event 1 Reg Blk unsupported 54 0, // General Purpose Event 1 Reg Blk unsupported 55 0, // _CST support 53 56 P_LVL2_LAT, // worst case HW latency to enter/exit C2 state 54 57 P_LVL3_LAT, // worst case HW latency to enter/exit C3 state … … 60 63 MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM 61 64 CENTURY, // index to century in RTC CMOS RAM 62 0x03, // Boot architecture flag 63 0x00, // Boot architecture flag 64 RESERVED, // reserved 65 FLAG 65 0x0000, // Boot architecture flag (16-bit) 66 RESERVED, // reserved 67 FLAG, // Fixed feature flags 68 GAS2_IO(RESET_REG, 1), // Extended address of the Reset Register 69 RESET_VALUE, // Value for the Reset Register to reset the system 70 { RESERVED }, // reserved[3] 71 0, // 64-bit physical addesss of FACS, set at installation 72 0, // 64-bit physical addesss of DSDT, set at installation 73 74 GAS2_IO(PM1a_EVT_BLK, PM1_EVT_LEN), // Ext. addr. of PM 1a Event Reg Blk 75 { 0 }, // PM 1b Event Reg Blk unsupported 76 GAS2_IO(PM1a_CNT_BLK, PM1_CNT_LEN), // Ext. addr. of PM 1a Ctrl Reg Blk 77 { 0 }, // PM 1b Ctrl Reg Blk unsupported 78 { 0 }, // PM 2 Ctrl Reg Blk unsupported 79 GAS2_IO(PM_TMR_BLK, PM_TM_LEN), // Ext. addr. of PM Timer Ctrl Reg Blk 80 GAS2_IO(GPE0_BLK, GPE0_BLK_LEN), // Ext. addr. of GPE 0 Reg Blk 81 { 0 } // GPE 1 Reg Blk unsupported 66 82 }; 67 83 … … 73 89 { 74 90 // 75 // Reference the table being generated to prevent the optimizer from removing the 91 // Reference the table being generated to prevent the optimizer from removing the 76 92 // data structure from the exeutable 77 93 // -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiTables/Facs.aslc
r48674 r58459 2 2 FACS Table 3 3 4 Copyright (c) 2008 - 20 09, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials are 6 6 licensed and made available under the terms and conditions of the BSD License … … 26 26 0x00, 27 27 0x00, 28 EFI_ACPI_RESERVED_BYTE, 29 EFI_ACPI_RESERVED_BYTE, 30 EFI_ACPI_RESERVED_BYTE, 31 EFI_ACPI_RESERVED_BYTE, 32 EFI_ACPI_RESERVED_BYTE, 33 EFI_ACPI_RESERVED_BYTE, 34 EFI_ACPI_RESERVED_BYTE, 35 EFI_ACPI_RESERVED_BYTE, 36 EFI_ACPI_RESERVED_BYTE, 37 EFI_ACPI_RESERVED_BYTE, 38 EFI_ACPI_RESERVED_BYTE, 39 EFI_ACPI_RESERVED_BYTE, 40 EFI_ACPI_RESERVED_BYTE, 41 EFI_ACPI_RESERVED_BYTE, 42 EFI_ACPI_RESERVED_BYTE, 43 EFI_ACPI_RESERVED_BYTE, 44 EFI_ACPI_RESERVED_BYTE, 45 EFI_ACPI_RESERVED_BYTE, 46 EFI_ACPI_RESERVED_BYTE, 47 EFI_ACPI_RESERVED_BYTE, 48 EFI_ACPI_RESERVED_BYTE, 49 EFI_ACPI_RESERVED_BYTE, 50 EFI_ACPI_RESERVED_BYTE, 51 EFI_ACPI_RESERVED_BYTE, 52 EFI_ACPI_RESERVED_BYTE, 53 EFI_ACPI_RESERVED_BYTE, 54 EFI_ACPI_RESERVED_BYTE, 55 EFI_ACPI_RESERVED_BYTE, 56 EFI_ACPI_RESERVED_BYTE, 57 EFI_ACPI_RESERVED_BYTE, 58 EFI_ACPI_RESERVED_BYTE, 59 EFI_ACPI_RESERVED_BYTE, 60 EFI_ACPI_RESERVED_BYTE, 61 EFI_ACPI_RESERVED_BYTE, 62 EFI_ACPI_RESERVED_BYTE, 63 EFI_ACPI_RESERVED_BYTE, 64 EFI_ACPI_RESERVED_BYTE, 65 EFI_ACPI_RESERVED_BYTE, 66 EFI_ACPI_RESERVED_BYTE, 67 EFI_ACPI_RESERVED_BYTE 28 { 29 EFI_ACPI_RESERVED_BYTE, 30 EFI_ACPI_RESERVED_BYTE, 31 EFI_ACPI_RESERVED_BYTE, 32 EFI_ACPI_RESERVED_BYTE, 33 EFI_ACPI_RESERVED_BYTE, 34 EFI_ACPI_RESERVED_BYTE, 35 EFI_ACPI_RESERVED_BYTE, 36 EFI_ACPI_RESERVED_BYTE, 37 EFI_ACPI_RESERVED_BYTE, 38 EFI_ACPI_RESERVED_BYTE, 39 EFI_ACPI_RESERVED_BYTE, 40 EFI_ACPI_RESERVED_BYTE, 41 EFI_ACPI_RESERVED_BYTE, 42 EFI_ACPI_RESERVED_BYTE, 43 EFI_ACPI_RESERVED_BYTE, 44 EFI_ACPI_RESERVED_BYTE, 45 EFI_ACPI_RESERVED_BYTE, 46 EFI_ACPI_RESERVED_BYTE, 47 EFI_ACPI_RESERVED_BYTE, 48 EFI_ACPI_RESERVED_BYTE, 49 EFI_ACPI_RESERVED_BYTE, 50 EFI_ACPI_RESERVED_BYTE, 51 EFI_ACPI_RESERVED_BYTE, 52 EFI_ACPI_RESERVED_BYTE, 53 EFI_ACPI_RESERVED_BYTE, 54 EFI_ACPI_RESERVED_BYTE, 55 EFI_ACPI_RESERVED_BYTE, 56 EFI_ACPI_RESERVED_BYTE, 57 EFI_ACPI_RESERVED_BYTE, 58 EFI_ACPI_RESERVED_BYTE, 59 EFI_ACPI_RESERVED_BYTE, 60 EFI_ACPI_RESERVED_BYTE, 61 EFI_ACPI_RESERVED_BYTE, 62 EFI_ACPI_RESERVED_BYTE, 63 EFI_ACPI_RESERVED_BYTE, 64 EFI_ACPI_RESERVED_BYTE, 65 EFI_ACPI_RESERVED_BYTE, 66 EFI_ACPI_RESERVED_BYTE, 67 EFI_ACPI_RESERVED_BYTE, 68 EFI_ACPI_RESERVED_BYTE 69 } 68 70 }; 69 71 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiTables/Madt.aslc
r48674 r58459 2 2 MADT Table 3 3 4 This file contains a structure definition for the ACPI 1.0 Multiple APIC 5 Description Table (MADT). 6 7 Copyright (c) 2008 - 20 09, Intel Corporation. All rights reserved.<BR>4 This file contains a structure definition for the ACPI 1.0 Multiple APIC 5 Description Table (MADT). 6 7 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR> 8 8 This program and the accompanying materials are 9 9 licensed and made available under the terms and conditions of the BSD License 10 10 which accompanies this distribution. The full text of the license may be found at 11 11 http://opensource.org/licenses/bsd-license.php 12 12 13 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 15 16 **/ 16 **/ 17 17 18 18 #include <IndustryStandard/Acpi.h> 19 20 // 21 // MADT Definitions 22 // 23 #define EFI_ACPI_OEM_MADT_REVISION 0x00000000 // TBD 19 #include <Platform.h> 24 20 25 21 // … … 72 68 // 73 69 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = { 74 EFI_ACPI_1_0_APIC_SIGNATURE, 75 sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE), 76 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, 70 { 71 { 72 EFI_ACPI_1_0_APIC_SIGNATURE, 73 sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE), 74 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, 75 0x00, // Checksum will be updated at runtime 76 {EFI_ACPI_OEM_ID}, 77 EFI_ACPI_OEM_TABLE_ID, 78 EFI_ACPI_OEM_REVISION, 79 EFI_ACPI_CREATOR_ID, 80 EFI_ACPI_CREATOR_REVISION 81 }, 77 82 78 // 79 // Checksum will be updated at runtime 80 // 81 0x00, 82 83 // 84 // It is expected that these values will be programmed at runtime 85 // 86 ' ', ' ', ' ', ' ', ' ', ' ', 87 88 0, 89 EFI_ACPI_OEM_MADT_REVISION, 90 0, 91 0, 83 // 84 // MADT specific fields 85 // 86 EFI_ACPI_LOCAL_APIC_ADDRESS, 87 EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS, 88 }, 92 89 93 //94 // MADT specific fields95 //96 EFI_ACPI_LOCAL_APIC_ADDRESS,97 EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS,98 99 90 // 100 91 // Processor Local APIC Structure 101 92 // 102 103 EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type 104 sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length 105 0x01, // Processor ID 106 0x00, // Local APIC ID 107 0x00000001, // Flags - Enabled by default 93 { 94 { 95 EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type 96 sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length 97 0x00, // Processor ID 98 0x00, // Local APIC ID 99 0x00000001 // Flags - Enabled by default 100 } 101 }, 108 102 109 103 // … … 111 105 // 112 106 113 // 114 // IRQ0=>IRQ2 Interrupt Source Override Structure 115 // 116 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type 117 sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length 118 0x00, // Bus - ISA 119 0x00, // Source - IRQ0 120 0x00000002, // Global System Interrupt - IRQ2 121 0x0000, // Flags - Conforms to specifications of the bus 107 { 108 { 109 // 110 // IRQ0=>IRQ2 Interrupt Source Override Structure 111 // 112 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type 113 sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length 114 0x00, // Bus - ISA 115 0x00, // Source - IRQ0 116 0x00000002, // Global System Interrupt - IRQ2 117 0x0000 // Flags - Conforms to specifications of the bus 118 }, 122 119 123 // 124 // ISO (SCI Active High) Interrupt Source Override Structure 125 // 126 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type 127 sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length 128 0x00, // Bus - ISA 129 0x09, // Source - IRQ0 130 0x00000009, // Global System Interrupt - IRQ2 131 0x000D, // Flags - Level-tiggered, Active High 120 { 121 // 122 // ISO (SCI Active High) Interrupt Source Override Structure 123 // 124 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type 125 sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length 126 0x00, // Bus - ISA 127 0x09, // Source - IRQ0 128 0x00000009, // Global System Interrupt - IRQ2 129 0x000D // Flags - Level-tiggered, Active High 130 } 131 }, 132 132 133 133 // 134 134 // IO APIC Structure 135 135 // 136 EFI_ACPI_1_0_IO_APIC, // Type 137 sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length 138 0x02, // IO APIC ID 139 EFI_ACPI_RESERVED_BYTE, // Reserved 140 0xFEC00000, // IO APIC Address (physical) 141 0x00000000 // Global System Interrupt Base 136 { 137 { 138 EFI_ACPI_1_0_IO_APIC, // Type 139 sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length 140 0x02, // IO APIC ID 141 EFI_ACPI_RESERVED_BYTE, // Reserved 142 0xFEC00000, // IO APIC Address (physical) 143 0x00000000 // Global System Interrupt Base 144 } 145 }, 142 146 }; 143 147 … … 149 153 { 150 154 // 151 // Reference the table being generated to prevent the optimizer from removing the 155 // Reference the table being generated to prevent the optimizer from removing the 152 156 // data structure from the exeutable 153 157 // -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/AcpiTables/Platform.h
r48674 r58459 2 2 Platform specific defines for constructing ACPI tables 3 3 4 Copyright (c) 2012, 2013, Red Hat, Inc. 4 5 Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> 5 6 This program and the accompanying materials are … … 7 8 which accompanies this distribution. The full text of the license may be found at 8 9 http://opensource.org/licenses/bsd-license.php 9 10 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 13 **/ 14 **/ 14 15 15 16 #ifndef _Platform_h_INCLUDED_ 16 17 #define _Platform_h_INCLUDED_ 17 18 18 #include <PiDxe.h> 19 #include <PiDxe.h> 19 20 #include <IndustryStandard/Acpi.h> 20 21 … … 24 25 #define EFI_ACPI_OEM_ID 'O','V','M','F',' ',' ' // OEMID 6 bytes long 25 26 #define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('O','V','M','F','E','D','K','2') // OEM table id 8 bytes long 26 #define EFI_ACPI_OEM_REVISION 0x 0200082027 #define EFI_ACPI_OEM_REVISION 0x20130221 27 28 #define EFI_ACPI_CREATOR_ID SIGNATURE_32('O','V','M','F') 28 #define EFI_ACPI_CREATOR_REVISION 0x0000009 729 #define EFI_ACPI_CREATOR_REVISION 0x00000099 29 30 30 #define INT_MODEL 0x01 31 #define SCI_INT_VECTOR 0x0009 32 #define SMI_CMD_IO_PORT 0 // If SMM was supported, then this would be 0xB2 33 #define ACPI_ENABLE 0x0E1 34 #define ACPI_DISABLE 0x01E 31 #define SCI_INT_VECTOR 0x0009 32 #define SMI_CMD_IO_PORT 0xB2 33 #define ACPI_ENABLE 0xF1 34 #define ACPI_DISABLE 0xF0 35 35 #define S4BIOS_REQ 0x00 36 #define PM1a_EVT_BLK 0x00000400 37 #define PM1b_EVT_BLK 0x00000000 38 #define PM1a_CNT_BLK 0x00000404 39 #define PM1b_CNT_BLK 0x00000000 40 #define PM2_CNT_BLK 0x00000022 41 #define PM_TMR_BLK 0x00000408 42 #define GPE0_BLK 0x0000040C 43 #define GPE1_BLK 0x00000000 36 #define PM1a_EVT_BLK 0x0000b000 37 #define PM1a_CNT_BLK 0x0000b004 38 #define PM_TMR_BLK 0x0000b008 39 #define GPE0_BLK 0x0000afe0 44 40 #define PM1_EVT_LEN 0x04 45 41 #define PM1_CNT_LEN 0x02 46 #define PM2_CNT_LEN 0x0147 42 #define PM_TM_LEN 0x04 48 43 #define GPE0_BLK_LEN 0x04 49 #define GPE1_BLK_LEN 0x0050 #define GPE1_BASE 0x0051 44 #define RESERVED 0x00 52 45 #define P_LVL2_LAT 0x0065 53 46 #define P_LVL3_LAT 0x03E9 54 #define FLUSH_SIZE 0x0 40055 #define FLUSH_STRIDE 0x00 1047 #define FLUSH_SIZE 0x0000 48 #define FLUSH_STRIDE 0x0000 56 49 #define DUTY_OFFSET 0x00 57 50 #define DUTY_WIDTH 0x00 58 #define DAY_ALRM 0x0 D51 #define DAY_ALRM 0x00 59 52 #define MON_ALRM 0x00 60 53 #define CENTURY 0x00 61 #define FLAG EFI_ACPI_1_0_WBINVD | EFI_ACPI_1_0_PROC_C1 | EFI_ACPI_1_0_SLP_BUTTON | EFI_ACPI_1_0_RTC_S4 | EFI_ACPI_1_0_TMR_VAL_EXT 54 #define FLAG (EFI_ACPI_2_0_WBINVD | \ 55 EFI_ACPI_2_0_PROC_C1 | \ 56 EFI_ACPI_2_0_SLP_BUTTON | \ 57 EFI_ACPI_2_0_RTC_S4 | \ 58 EFI_ACPI_2_0_RESET_REG_SUP) 59 #define RESET_REG 0xCF9 60 #define RESET_VALUE (BIT2 | BIT1) // PIIX3 Reset CPU + System Reset 61 62 // 63 // Byte-aligned IO port register block initializer for 64 // EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE 65 // 66 #define GAS2_IO(Base, Size) { \ 67 EFI_ACPI_2_0_SYSTEM_IO, /* AddressSpaceId */ \ 68 (Size) * 8, /* RegisterBitWidth */ \ 69 0, /* RegisterBitOffset */ \ 70 0, /* Reserved */ \ 71 (Base) /* Address */ \ 72 } 62 73 63 74 #endif 64 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c
r48674 r58459 3 3 Block I/O Protocol instances. 4 4 5 Copyright (c) 2007 - 201 0, Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR> 6 6 This program and the accompanying materials 7 7 are licensed and made available under the terms and conditions of the BSD License … … 288 288 BLOCK_MMIO_PROTOCOL *BlockMmio; 289 289 290 Private = (BLOCK_MMIO_TO_BLOCK_IO_DEVICE*) AllocateZeroPool (sizeof ( Private));290 Private = (BLOCK_MMIO_TO_BLOCK_IO_DEVICE*) AllocateZeroPool (sizeof (*Private)); 291 291 ASSERT (Private != NULL); 292 292 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c
r48674 r58459 31 31 // 32 32 #define SYSTEM_ROM_FILE_GUID \ 33 { 0x1547B4F3, 0x3E8A, 0x4FEF, 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A}33 { 0x1547B4F3, 0x3E8A, 0x4FEF, { 0x81, 0xC8, 0x32, 0x8E, 0xD6, 0x47, 0xAB, 0x1A } } 34 34 35 35 #define NULL_ROM_FILE_GUID \ 36 { 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}36 { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } 37 37 38 38 SYSTEM_ROM_TABLE mSystemRomTable[] = { … … 80 80 }, 81 81 { 82 // -- Pin 1 -- -- Pin 2 -- -- Pin 3 ---- Pin 4 --83 // Bus Dev Reg Map Reg Map Reg MapReg Map84 85 0x00,0x08,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x00,0x00,86 0x00,0x10,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x01,0x00,87 0x00,0x18,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x02,0x00,88 0x00,0x20,0x63,0xDEB8,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x03,0x00,89 0x00,0x28,0x60,0xDEB8,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x04,0x00,90 0x00,0x30,0x61,0xDEB8,0x62,0xDEB8,0x63,0xDEB8,0x60,0xDEB8,0x05,0x00,82 // -- Pin 1 -- -- Pin 2 -- -- Pin 3 -- -- Pin 4 -- 83 // Bus Dev Reg Map Reg Map Reg Map Reg Map 84 // 85 {0x00,0x08,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x00,0x00}, 86 {0x00,0x10,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x01,0x00}, 87 {0x00,0x18,{{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8}},0x02,0x00}, 88 {0x00,0x20,{{0x63,0xDEB8},{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8}},0x03,0x00}, 89 {0x00,0x28,{{0x60,0xDEB8},{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8}},0x04,0x00}, 90 {0x00,0x30,{{0x61,0xDEB8},{0x62,0xDEB8},{0x63,0xDEB8},{0x60,0xDEB8}},0x05,0x00}, 91 91 } 92 92 }; -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
r48674 r58459 3 3 by pretending that a memory buffer is storage for the NV variables. 4 4 5 Copyright (c) 2006 - 201 2, Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 6 6 This program and the accompanying materials 7 7 are licensed and made available under the terms and conditions of the BSD License … … 34 34 #include <Library/PlatformFvbLib.h> 35 35 #include "Fvb.h" 36 37 #define EFI_AUTHENTICATED_VARIABLE_GUID \ 38 { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 } } 36 39 37 40 // … … 623 626 ) 624 627 { 628 // 629 // Templates for standard (non-authenticated) variable FV header 630 // 625 631 STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndVarTemplate = { 626 632 { // EFI_FIRMWARE_VOLUME_HEADER FvHdr; … … 650 656 651 657 // UINT8 Reserved[1]; 652 0,658 {0}, 653 659 654 660 // UINT8 Revision; … … 656 662 657 663 // EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; 658 { 2, // UINT32 NumBlocks; 659 EMU_FVB_BLOCK_SIZE // UINT32 Length; 664 { 665 { 666 2, // UINT32 NumBlocks; 667 EMU_FVB_BLOCK_SIZE // UINT32 Length; 668 } 660 669 } 661 670 }, … … 685 694 } 686 695 }; 696 697 // 698 // Templates for authenticated variable FV header 699 // 700 STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndAuthenticatedVarTemplate = { 701 { // EFI_FIRMWARE_VOLUME_HEADER FvHdr; 702 // UINT8 ZeroVector[16]; 703 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 704 705 // EFI_GUID FileSystemGuid; 706 EFI_SYSTEM_NV_DATA_FV_GUID, 707 708 // UINT64 FvLength; 709 EMU_FVB_SIZE, 710 711 // UINT32 Signature; 712 EFI_FVH_SIGNATURE, 713 714 // EFI_FVB_ATTRIBUTES_2 Attributes; 715 0x4feff, 716 717 // UINT16 HeaderLength; 718 EMU_FV_HEADER_LENGTH, 719 720 // UINT16 Checksum; 721 0, 722 723 // UINT16 ExtHeaderOffset; 724 0, 725 726 // UINT8 Reserved[1]; 727 {0}, 728 729 // UINT8 Revision; 730 EFI_FVH_REVISION, 731 732 // EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; 733 { 734 { 735 2, // UINT32 NumBlocks; 736 EMU_FVB_BLOCK_SIZE // UINT32 Length; 737 } 738 } 739 }, 740 // EFI_FV_BLOCK_MAP_ENTRY EndBlockMap; 741 { 0, 0 }, // End of block map 742 { // VARIABLE_STORE_HEADER VarHdr; 743 // EFI_GUID Signature; // need authenticated variables for secure boot 744 EFI_AUTHENTICATED_VARIABLE_GUID, 745 746 // UINT32 Size; 747 ( 748 FixedPcdGet32 (PcdVariableStoreSize) - 749 OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, VarHdr) 750 ), 751 752 // UINT8 Format; 753 VARIABLE_STORE_FORMATTED, 754 755 // UINT8 State; 756 VARIABLE_STORE_HEALTHY, 757 758 // UINT16 Reserved; 759 0, 760 761 // UINT32 Reserved1; 762 0 763 } 764 }; 765 687 766 EFI_FIRMWARE_VOLUME_HEADER *Fv; 688 767 … … 690 769 // Copy the template structure into the location 691 770 // 692 CopyMem (Ptr, (VOID*)&FvAndVarTemplate, sizeof (FvAndVarTemplate)); 771 if (FeaturePcdGet (PcdSecureBootEnable) == FALSE) { 772 CopyMem (Ptr, (VOID*)&FvAndVarTemplate, sizeof (FvAndVarTemplate)); 773 } else { 774 CopyMem (Ptr, (VOID*)&FvAndAuthenticatedVarTemplate, sizeof (FvAndAuthenticatedVarTemplate)); 775 } 693 776 694 777 // … … 698 781 Fv->Checksum = CalculateCheckSum16 (Ptr, Fv->HeaderLength); 699 782 } 700 701 702 /**703 Initializes the Fault Tolerant Write data structure704 705 This data structure is used by the Fault Tolerant Write driver.706 707 @param[in] Buffer - Location for the FTW data structure708 709 **/710 VOID711 InitializeFtwState (712 IN VOID *Buffer713 )714 {715 EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *Hdr;716 UINT32 TempCrc;717 STATIC EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER DefaultFtw = {718 EFI_SYSTEM_NV_DATA_FV_GUID, // EFI_GUID Signature;719 ERASED_UINT32, // UINT32 Crc;720 ERASED_BIT, // UINT8 WorkingBlockValid : 1;721 ERASED_BIT, // UINT8 WorkingBlockInvalid : 1;722 0, // UINT8 Reserved : 6;723 { 0, 0, 0 }, // UINT8 Reserved3[3];724 FTW_WRITE_QUEUE_SIZE // UINT64 WriteQueueSize;725 };726 727 CopyMem (Buffer, (VOID*) &DefaultFtw, sizeof (DefaultFtw));728 729 Hdr = (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER*) Buffer;730 731 //732 // Calculate checksum.733 //734 // The Crc, WorkingBlockValid and WorkingBlockInvalid bits should735 // be set to the erased state before computing the checksum.736 //737 gBS->CalculateCrc32 (Buffer, sizeof (DefaultFtw), &TempCrc);738 Hdr->Crc = TempCrc;739 740 //741 // Mark as valid.742 //743 Hdr->WorkingBlockValid = NOT_ERASED_BIT;744 }745 746 783 747 784 /** … … 781 818 DEBUG ((EFI_D_ERROR, "EMU Variable invalid PCD sizes\n")); 782 819 return EFI_INVALID_PARAMETER; 820 } 821 822 if (PcdGet64 (PcdFlashNvStorageVariableBase64) != 0) { 823 DEBUG ((EFI_D_INFO, "Disabling EMU Variable FVB since " 824 "flash variables appear to be supported.\n")); 825 return EFI_ABORTED; 783 826 } 784 827 … … 826 869 // 827 870 SubPtr = (VOID*) ((UINT8*) Ptr + PcdGet32 (PcdVariableStoreSize)); 828 if (Initialize) {829 InitializeFtwState (SubPtr);830 }831 871 PcdSet32 (PcdFlashNvStorageFtwWorkingBase, (UINT32)(UINTN) SubPtr); 832 872 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
r48674 r58459 69 69 gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved 70 70 71 [FeaturePcd] 72 gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable 73 71 74 [Depex] 72 75 TRUE -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
r58172 r58459 2 2 ACPI Timer implements one instance of Timer Library. 3 3 4 Copyright (c) 2008 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR> 5 5 Copyright (c) 2011, Andrei Warkentin <[email protected]> 6 6 … … 9 9 which accompanies this distribution. The full text of the license may be found at 10 10 http://opensource.org/licenses/bsd-license.php 11 11 12 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 14 15 **/ 15 **/ 16 16 17 17 #include <Base.h> … … 21 21 #include <Library/PciLib.h> 22 22 #include <Library/DebugLib.h> 23 24 // 25 // PIIX4 Power Management Base Address 26 // 27 #ifndef VBOX 28 UINT32 mPmba = 0x400; 29 #else 23 #include <Library/PcdLib.h> 24 #include <IndustryStandard/Pci22.h> 25 #include <IndustryStandard/Acpi.h> 26 27 // 28 // PCI Location of PIIX4 Power Management PCI Configuration Registers 29 // 30 #define PIIX4_POWER_MANAGEMENT_BUS 0x00 31 #define PIIX4_POWER_MANAGEMENT_DEVICE 0x01 32 #define PIIX4_POWER_MANAGEMENT_FUNCTION 0x03 33 34 // 35 // Macro to access PIIX4 Power Management PCI Configuration Registers 36 // 37 #define PIIX4_PCI_POWER_MANAGEMENT_REGISTER(Register) \ 38 PCI_LIB_ADDRESS ( \ 39 PIIX4_POWER_MANAGEMENT_BUS, \ 40 PIIX4_POWER_MANAGEMENT_DEVICE, \ 41 PIIX4_POWER_MANAGEMENT_FUNCTION, \ 42 Register \ 43 ) 44 45 // 46 // PCI Location of Q35 Power Management PCI Configuration Registers 47 // 48 #define Q35_POWER_MANAGEMENT_BUS 0x00 49 #define Q35_POWER_MANAGEMENT_DEVICE 0x1f 50 #define Q35_POWER_MANAGEMENT_FUNCTION 0x00 51 52 // 53 // Macro to access Q35 Power Management PCI Configuration Registers 54 // 55 #define Q35_PCI_POWER_MANAGEMENT_REGISTER(Register) \ 56 PCI_LIB_ADDRESS ( \ 57 Q35_POWER_MANAGEMENT_BUS, \ 58 Q35_POWER_MANAGEMENT_DEVICE, \ 59 Q35_POWER_MANAGEMENT_FUNCTION, \ 60 Register \ 61 ) 62 63 // 64 // PCI Location of Host Bridge PCI Configuration Registers 65 // 66 #define HOST_BRIDGE_BUS 0x00 67 #define HOST_BRIDGE_DEVICE 0x00 68 #define HOST_BRIDGE_FUNCTION 0x00 69 70 // 71 // Macro to access Host Bridge Configuration Registers 72 // 73 #define HOST_BRIDGE_REGISTER(Register) \ 74 PCI_LIB_ADDRESS ( \ 75 HOST_BRIDGE_BUS, \ 76 HOST_BRIDGE_DEVICE, \ 77 HOST_BRIDGE_FUNCTION, \ 78 Register \ 79 ) 80 81 // 82 // Host Bridge Device ID (DID) Register 83 // 84 #define HOST_BRIDGE_DID HOST_BRIDGE_REGISTER (0x02) 85 86 // 87 // Host Bridge DID Register values 88 // 89 #define PCI_DEVICE_ID_INTEL_82441 0x1237 // DID value for PIIX4 90 #define PCI_DEVICE_ID_INTEL_Q35_MCH 0x29C0 // DID value for Q35 91 92 // 93 // Access Power Management PCI Config Regs based on Host Bridge type 94 // 95 #define PCI_POWER_MANAGEMENT_REGISTER(Register) \ 96 ((PciRead16 (HOST_BRIDGE_DID) == PCI_DEVICE_ID_INTEL_Q35_MCH) ? \ 97 Q35_PCI_POWER_MANAGEMENT_REGISTER (Register) : \ 98 PIIX4_PCI_POWER_MANAGEMENT_REGISTER (Register)) 99 100 // 101 // Power Management PCI Configuration Registers 102 // 103 #define PMBA PCI_POWER_MANAGEMENT_REGISTER (0x40) 104 #define PMBA_RTE BIT0 105 #define PMREGMISC PCI_POWER_MANAGEMENT_REGISTER (0x80) 106 #define PMIOSE BIT0 107 108 // 109 // The ACPI Time is a 24-bit counter 110 // 111 #define ACPI_TIMER_COUNT_SIZE BIT24 112 113 // 114 // Offset in the Power Management Base Address to the ACPI Timer 115 // 116 #define ACPI_TIMER_OFFSET 0x8 117 118 #ifdef VBOX 30 119 UINT32 mPmba = 0x4000; 120 121 #define PCI_BAR_IO 0x1 31 122 #endif 32 33 #define PCI_BAR_IO 0x134 #define ACPI_TIMER_FREQUENCY 357954535 #define ACPI_TIMER_COUNT_SIZE 0x0100000036 #define ACPI_TIMER_OFFSET 0x837 123 38 124 /** … … 52 138 ) 53 139 { 54 UINT8 Device; 55 56 Device = 1; 57 // Device = 7; 58 59 if (PciRead8 (PCI_LIB_ADDRESS (0,Device,3,0x80)) & 1) { 60 mPmba = PciRead32 (PCI_LIB_ADDRESS (0,Device,3,0x40)); 61 ASSERT (mPmba & PCI_BAR_IO); 62 mPmba &= ~PCI_BAR_IO; 63 } else { 64 PciAndThenOr32 (PCI_LIB_ADDRESS (0,Device,3,0x40), 65 (UINT32) ~0xfc0, mPmba); 66 PciOr8 (PCI_LIB_ADDRESS (0,Device,3,0x04), 0x01); 140 // 141 // Check to see if the Power Management Base Address is already enabled 142 // 143 if ((PciRead8 (PMREGMISC) & PMIOSE) == 0) { 144 // 145 // If the Power Management Base Address is not programmed, 146 // then program the Power Management Base Address from a PCD. 147 // 148 PciAndThenOr32 (PMBA, (UINT32)(~0x0000FFC0), PcdGet16 (PcdAcpiPmBaseAddress)); 149 150 // 151 // Enable PMBA I/O port decodes in PMREGMISC 152 // 153 PciOr8 (PMREGMISC, PMIOSE); 67 154 } 68 69 // 70 // ACPI Timer enable is in Bus 0, Device ?, Function 3 71 // 72 PciOr8 (PCI_LIB_ADDRESS (0,Device,3,0x80), 0x01); 155 73 156 return RETURN_SUCCESS; 74 157 } … … 118 201 119 202 **/ 120 STATIC121 203 UINT32 122 204 InternalAcpiGetTimerTick ( … … 124 206 ) 125 207 { 208 // 209 // Read PMBA to read and return the current ACPI timer value. 210 // 211 #ifndef VBOX 212 return IoRead32 ((PciRead32 (PMBA) & ~PMBA_RTE) + ACPI_TIMER_OFFSET); 213 #else 126 214 return IoRead32 (mPmba + ACPI_TIMER_OFFSET); 215 #endif 127 216 } 128 217 … … 136 225 137 226 **/ 138 STATIC139 227 VOID 140 228 InternalAcpiDelay ( -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
r48674 r58459 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 … … 34 34 [Packages] 35 35 MdePkg/MdePkg.dec 36 OvmfPkg/OvmfPkg.dec 37 38 [Pcd] 39 gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress 36 40 37 41 [LibraryClasses] … … 39 43 PciLib 40 44 IoLib 41 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/NvVarsFileLib/FsAccess.c
r48674 r58459 2 2 File System Access for NvVarsFileLib 3 3 4 Copyright (c) 2004 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 277 277 278 278 /** 279 Writes a variable to indicate that the NV variables 280 have been loaded from the file system. 281 282 **/ 283 STATIC 284 VOID 285 SetNvVarsVariable ( 286 VOID 287 ) 288 { 289 BOOLEAN VarData; 290 UINTN Size; 291 292 // 293 // Write a variable to indicate we've already loaded the 294 // variable data. If it is found, we skip the loading on 295 // subsequent attempts. 296 // 297 Size = sizeof (VarData); 298 VarData = TRUE; 299 gRT->SetVariable ( 300 L"NvVars", 301 &gEfiSimpleFileSystemProtocolGuid, 302 EFI_VARIABLE_NON_VOLATILE | 303 EFI_VARIABLE_BOOTSERVICE_ACCESS | 304 EFI_VARIABLE_RUNTIME_ACCESS, 305 Size, 306 (VOID*) &VarData 307 ); 308 } 309 310 311 /** 279 312 Loads the non-volatile variables from the NvVars file on the 280 313 given file system. … … 333 366 // subsequent attempts. 334 367 // 335 Size = sizeof (VarData); 336 VarData = TRUE; 337 gRT->SetVariable ( 338 L"NvVars", 339 &gEfiSimpleFileSystemProtocolGuid, 340 EFI_VARIABLE_NON_VOLATILE | 341 EFI_VARIABLE_BOOTSERVICE_ACCESS | 342 EFI_VARIABLE_RUNTIME_ACCESS, 343 Size, 344 (VOID*) &VarData 345 ); 368 SetNvVarsVariable(); 346 369 347 370 DEBUG (( … … 409 432 VOID *VariableData; 410 433 EFI_HANDLE SerializedVariables; 434 435 SerializedVariables = NULL; 411 436 412 437 Status = SerializeVariablesNewInstance (&SerializedVariables); … … 476 501 477 502 if (!EFI_ERROR (Status)) { 503 // 504 // Write a variable to indicate we've already loaded the 505 // variable data. If it is found, we skip the loading on 506 // subsequent attempts. 507 // 508 SetNvVarsVariable(); 509 478 510 DEBUG ((EFI_D_INFO, "Saved NV Variables to NvVars file\n")); 479 511 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
r52193 r58459 2 2 Platform BDS customizations. 3 3 4 Copyright (c) 2004 - 201 2, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 14 14 15 15 #include "BdsPlatform.h" 16 #include "QemuBootOrder.h" 16 17 #ifdef VBOX 17 18 #include "VBoxPkg.h" … … 70 71 EFI_TPL OldTpl; 71 72 OldTpl = gBS->RaiseTPL (TPL_NOTIFY); 73 74 gBS->LocateProtocol(&gEfiSimpleTextOutProtocolGuid, NULL, (VOID **)&TextOutputProtocol); 75 gBS->LocateProtocol(&gEfiUgaDrawProtocolGuid, NULL, (VOID **)&Uga); 76 gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (VOID **)&Gop); 72 77 if (Gop) 73 78 { … … 101 106 { 102 107 EFI_EVENT event; 103 104 gBS->LocateProtocol(&gEfiSimpleTextOutProtocolGuid, NULL, (VOID **)&TextOutputProtocol);105 gBS->LocateProtocol(&gEfiUgaDrawProtocolGuid, NULL, (VOID **)&Uga);106 gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (VOID **)&Gop);107 108 gBS->CreateEventEx(EVT_NOTIFY_SIGNAL, TPL_NOTIFY, VBoxConsoleSwitchMode, NULL, &gEfiEventReadyToBootGuid, &event); 108 109 return EFI_SUCCESS; … … 158 159 ); 159 160 160 #ifndef VBOX161 STATIC162 VOID163 LoadVideoRom (164 VOID165 );166 167 168 STATIC169 EFI_STATUS170 PciRomLoadEfiDriversFromRomImage (171 IN EFI_PHYSICAL_ADDRESS Rom,172 IN UINTN RomSize173 );174 #endif175 161 // 176 162 // BDS Platform Functions … … 198 184 DEBUG ((EFI_D_INFO, "PlatformBdsInit\n")); 199 185 InstallDevicePathCallback (); 200 #ifndef VBOX201 LoadVideoRom ();202 #endif203 186 } 204 187 … … 311 294 // 312 295 DevPathStr = DevicePathToStr(DevicePath); 313 DEBUG(( 314 EFI_D_INFO, 315 "BdsPlatform.c+%d: COM%d DevPath: %s\n", 316 __LINE__, 317 gPnp16550ComPortDeviceNode.UID + 1, 318 DevPathStr 319 )); 320 FreePool(DevPathStr); 296 if (DevPathStr != NULL) { 297 DEBUG(( 298 EFI_D_INFO, 299 "BdsPlatform.c+%d: COM%d DevPath: %s\n", 300 __LINE__, 301 gPnp16550ComPortDeviceNode.UID + 1, 302 DevPathStr 303 )); 304 FreePool(DevPathStr); 305 } 321 306 322 307 BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL); … … 338 323 // 339 324 DevPathStr = DevicePathToStr(DevicePath); 340 DEBUG(( 341 EFI_D_INFO, 342 "BdsPlatform.c+%d: COM%d DevPath: %s\n", 343 __LINE__, 344 gPnp16550ComPortDeviceNode.UID + 1, 345 DevPathStr 346 )); 347 FreePool(DevPathStr); 325 if (DevPathStr != NULL) { 326 DEBUG(( 327 EFI_D_INFO, 328 "BdsPlatform.c+%d: COM%d DevPath: %s\n", 329 __LINE__, 330 gPnp16550ComPortDeviceNode.UID + 1, 331 DevPathStr 332 )); 333 FreePool(DevPathStr); 334 } 348 335 349 336 BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL); … … 465 452 EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; 466 453 467 DevicePath = NULL; 454 DevicePath = NULL; 455 GopDevicePath = NULL; 468 456 Status = gBS->HandleProtocol ( 469 457 DeviceHandle, … … 826 814 // 827 815 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x3c), 0x00); 828 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x60), 0x0b); 829 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x61), 0x0 9);830 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x62), 0x0 b);831 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x63), 0x0 9);816 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x60), 0x0b); // LNKA routing target 817 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x61), 0x0b); // LNKB routing target 818 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x62), 0x0a); // LNKC routing target 819 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x63), 0x0a); // LNKD routing target 832 820 833 821 // … … 840 828 // Bus 0, Device 1, Function 3 - Power Managment Controller 841 829 // 842 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 3, 0x3c), 0x0 b);843 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 3, 0x3d), 0x01); 830 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 3, 0x3c), 0x09); 831 PciWrite8 (PCI_LIB_ADDRESS (0, 1, 3, 0x3d), 0x01); // INTA 844 832 845 833 // … … 851 839 // Bus 0, Device 3, Function 0 - Network Controller 852 840 // 853 PciWrite8 (PCI_LIB_ADDRESS (0, 3, 0, 0x3c), 0x0b); 854 PciWrite8 (PCI_LIB_ADDRESS (0, 3, 0, 0x3d), 0x01); 855 856 // 857 // Bus 0, Device 4, Function 0 - RAM Memory 858 // 859 PciWrite8 (PCI_LIB_ADDRESS (0, 4, 0, 0x3c), 0x09); 860 PciWrite8 (PCI_LIB_ADDRESS (0, 4, 0, 0x3d), 0x01); 841 PciWrite8 (PCI_LIB_ADDRESS (0, 3, 0, 0x3c), 0x0a); 842 PciWrite8 (PCI_LIB_ADDRESS (0, 3, 0, 0x3d), 0x01); // INTA (-> LNKC) 843 844 // 845 // Bus 0, Device 5, Function 0 - RAM Memory 846 // 847 PciWrite8 (PCI_LIB_ADDRESS (0, 5, 0, 0x3c), 0x0b); 848 PciWrite8 (PCI_LIB_ADDRESS (0, 5, 0, 0x3d), 0x01); // INTA (-> LNKA) 849 } 850 851 852 VOID 853 AcpiInitialization ( 854 VOID 855 ) 856 { 857 // 858 // Set ACPI SCI_EN bit in PMCNTRL 859 // 860 IoOr16 ((PciRead32 (PCI_LIB_ADDRESS (0, 1, 3, 0x40)) & ~BIT0) + 4, BIT0); 861 861 } 862 862 … … 889 889 // 890 890 DevPathStr = DevicePathToStr (DevicePath); 891 DEBUG(( 892 EFI_D_INFO, 893 "Found Mass Storage device: %s\n", 894 DevPathStr 895 )); 896 FreePool(DevPathStr); 891 if (DevPathStr != NULL) { 892 DEBUG(( 893 EFI_D_INFO, 894 "Found Mass Storage device: %s\n", 895 DevPathStr 896 )); 897 FreePool(DevPathStr); 898 } 897 899 898 900 Status = gBS->ConnectController (Handle, NULL, NULL, TRUE); … … 1041 1043 1042 1044 PciInitialization (); 1045 AcpiInitialization (); 1043 1046 1044 1047 // … … 1175 1178 ConnectRootBridge (); 1176 1179 1177 // 1178 // Try to restore variables from the hard disk early so 1179 // they can be used for the other BDS connect operations. 1180 // 1181 PlatformBdsRestoreNvVarsFromHardDisk (); 1180 if (PcdGetBool (PcdOvmfFlashVariablesEnable)) { 1181 DEBUG ((EFI_D_INFO, "PlatformBdsPolicyBehavior: not restoring NvVars " 1182 "from disk since flash variables appear to be supported.\n")); 1183 } else { 1184 // 1185 // Try to restore variables from the hard disk early so 1186 // they can be used for the other BDS connect operations. 1187 // 1188 PlatformBdsRestoreNvVarsFromHardDisk (); 1189 } 1182 1190 1183 1191 // … … 1234 1242 // 1235 1243 PlatformBdsConnectSequence (); 1244 1245 // 1246 // Process QEMU's -kernel command line option 1247 // 1248 TryRunningQemuKernel (); 1236 1249 1237 1250 // … … 1341 1354 BdsLibEnumerateAllBootOption (BootOptionList); 1342 1355 1343 1344 // 1345 // Please uncomment above ConnectAll and EnumerateAll code and remove following first boot 1346 // checking code in real production tip. 1347 // 1348 // In BOOT_WITH_FULL_CONFIGURATION boot mode, should always connect every device 1349 // and do enumerate all the default boot options. But in development system board, the boot mode 1350 // cannot be BOOT_ASSUMING_NO_CONFIGURATION_CHANGES because the machine box 1351 // is always open. So the following code only do the ConnectAll and EnumerateAll at first boot. 1352 // 1353 Status = BdsLibBuildOptionFromVar (BootOptionList, L"BootOrder"); 1354 VBoxLogFlowFuncMarkRC(Status); 1355 if (EFI_ERROR(Status)) { 1356 // 1357 // If cannot find "BootOrder" variable, it may be first boot. 1358 // Try to connect all devices and enumerate all boot options here. 1359 // 1360 BdsLibConnectAll (); 1361 BdsLibEnumerateAllBootOption (BootOptionList); 1362 } 1356 SetBootOrderFromQemu (BootOptionList); 1357 // 1358 // The BootOrder variable may have changed, reload the in-memory list with 1359 // it. 1360 // 1361 BdsLibBuildOptionFromVar (BootOptionList, L"BootOrder"); 1363 1362 1364 1363 // … … 1651 1650 1652 1651 1653 #ifndef VBOX1654 STATIC1655 VOID1656 LoadVideoRom (1657 VOID1658 )1659 {1660 PCI_DATA_STRUCTURE *Pcir;1661 UINTN RomSize;1662 1663 //1664 // The virtual machines sometimes load the video rom image1665 // directly at the legacy video BIOS location of C000:0000,1666 // and do not implement the PCI expansion ROM feature.1667 //1668 Pcir = (PCI_DATA_STRUCTURE *) (UINTN) 0xc0000;1669 RomSize = Pcir->ImageLength * 512;1670 PciRomLoadEfiDriversFromRomImage (0xc0000, RomSize);1671 }1672 1673 1674 STATIC1675 EFI_STATUS1676 PciRomLoadEfiDriversFromRomImage (1677 IN EFI_PHYSICAL_ADDRESS Rom,1678 IN UINTN RomSize1679 )1680 {1681 CHAR16 *FileName;1682 EFI_PCI_EXPANSION_ROM_HEADER *EfiRomHeader;1683 PCI_DATA_STRUCTURE *Pcir;1684 UINTN ImageIndex;1685 UINTN RomOffset;1686 UINT32 ImageSize;1687 UINT16 ImageOffset;1688 EFI_HANDLE ImageHandle;1689 EFI_STATUS Status;1690 EFI_STATUS retStatus;1691 EFI_DEVICE_PATH_PROTOCOL *FilePath;1692 BOOLEAN SkipImage;1693 UINT32 DestinationSize;1694 UINT32 ScratchSize;1695 UINT8 *Scratch;1696 VOID *ImageBuffer;1697 VOID *DecompressedImageBuffer;1698 UINT32 ImageLength;1699 EFI_DECOMPRESS_PROTOCOL *Decompress;1700 UINT32 InitializationSize;1701 1702 VBoxLogFlowFuncEnter();1703 FileName = L"PciRomInMemory";1704 1705 //FileName = L"PciRom Addr=0000000000000000";1706 //HexToString (&FileName[12], Rom, 16);1707 1708 ImageIndex = 0;1709 retStatus = EFI_NOT_FOUND;1710 RomOffset = (UINTN) Rom;1711 1712 do {1713 1714 EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *) (UINTN) RomOffset;1715 1716 if (EfiRomHeader->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) {1717 return retStatus;1718 }1719 1720 //1721 // If the pointer to the PCI Data Structure is invalid, no further images can be located.1722 // The PCI Data Structure must be DWORD aligned.1723 //1724 if (EfiRomHeader->PcirOffset == 0 ||1725 (EfiRomHeader->PcirOffset & 3) != 0 ||1726 RomOffset - (UINTN)Rom + EfiRomHeader->PcirOffset + sizeof (PCI_DATA_STRUCTURE) > RomSize) {1727 break;1728 }1729 Pcir = (PCI_DATA_STRUCTURE *) (UINTN) (RomOffset + EfiRomHeader->PcirOffset);1730 //1731 // If a valid signature is not present in the PCI Data Structure, no further images can be located.1732 //1733 if (Pcir->Signature != PCI_DATA_STRUCTURE_SIGNATURE) {1734 break;1735 }1736 ImageSize = Pcir->ImageLength * 512;1737 if (RomOffset - (UINTN)Rom + ImageSize > RomSize) {1738 break;1739 }1740 1741 if ((Pcir->CodeType == PCI_CODE_TYPE_EFI_IMAGE) &&1742 (EfiRomHeader->EfiSignature == EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE) &&1743 ((EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER) ||1744 (EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER))) {1745 1746 ImageOffset = EfiRomHeader->EfiImageHeaderOffset;1747 InitializationSize = EfiRomHeader->InitializationSize * 512;1748 1749 if (InitializationSize <= ImageSize && ImageOffset < InitializationSize) {1750 1751 ImageBuffer = (VOID *) (UINTN) (RomOffset + ImageOffset);1752 ImageLength = InitializationSize - ImageOffset;1753 DecompressedImageBuffer = NULL;1754 1755 //1756 // decompress here if needed1757 //1758 SkipImage = FALSE;1759 if (EfiRomHeader->CompressionType > EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {1760 SkipImage = TRUE;1761 }1762 1763 if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {1764 Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **) &Decompress);1765 if (EFI_ERROR (Status)) {1766 SkipImage = TRUE;1767 } else {1768 SkipImage = TRUE;1769 Status = Decompress->GetInfo (1770 Decompress,1771 ImageBuffer,1772 ImageLength,1773 &DestinationSize,1774 &ScratchSize1775 );1776 if (!EFI_ERROR (Status)) {1777 DecompressedImageBuffer = NULL;1778 DecompressedImageBuffer = AllocatePool (DestinationSize);1779 if (DecompressedImageBuffer != NULL) {1780 Scratch = AllocatePool (ScratchSize);1781 if (Scratch != NULL) {1782 Status = Decompress->Decompress (1783 Decompress,1784 ImageBuffer,1785 ImageLength,1786 DecompressedImageBuffer,1787 DestinationSize,1788 Scratch,1789 ScratchSize1790 );1791 if (!EFI_ERROR (Status)) {1792 ImageBuffer = DecompressedImageBuffer;1793 ImageLength = DestinationSize;1794 SkipImage = FALSE;1795 }1796 1797 gBS->FreePool (Scratch);1798 }1799 }1800 }1801 }1802 }1803 1804 if (!SkipImage) {1805 1806 //1807 // load image and start image1808 //1809 1810 FilePath = FileDevicePath (NULL, FileName);1811 1812 Status = gBS->LoadImage (1813 FALSE,1814 gImageHandle,1815 FilePath,1816 ImageBuffer,1817 ImageLength,1818 &ImageHandle1819 );1820 if (!EFI_ERROR (Status)) {1821 Status = gBS->StartImage (ImageHandle, NULL, NULL);1822 if (!EFI_ERROR (Status)) {1823 retStatus = Status;1824 }1825 }1826 if (FilePath != NULL) {1827 gBS->FreePool (FilePath);1828 }1829 }1830 1831 if (DecompressedImageBuffer != NULL) {1832 gBS->FreePool (DecompressedImageBuffer);1833 }1834 1835 }1836 }1837 1838 RomOffset = RomOffset + ImageSize;1839 ImageIndex++;1840 } while (((Pcir->Indicator & 0x80) == 0x00) && ((RomOffset - (UINTN) Rom) < RomSize));1841 1842 1843 VBoxLogFlowFuncLeaveRC(retStatus);1844 return retStatus;1845 }1846 #endif /* !VBOX */1847 1848 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.h
r48674 r58459 296 296 ); 297 297 298 /** 299 Loads and boots UEFI Linux via the FwCfg interface. 300 301 @retval EFI_NOT_FOUND - The Linux kernel was not found 302 303 **/ 304 EFI_STATUS 305 TryRunningQemuKernel ( 306 VOID 307 ); 308 298 309 #endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
r48674 r58459 19 19 MODULE_TYPE = DXE_DRIVER 20 20 VERSION_STRING = 1.0 21 LIBRARY_CLASS = PlatformBdsLib|DXE_DRIVER 21 LIBRARY_CLASS = PlatformBdsLib|DXE_DRIVER 22 22 23 23 # … … 30 30 BdsPlatform.c 31 31 PlatformData.c 32 QemuBootOrder.c 33 QemuKernel.c 32 34 BdsPlatform.h 35 QemuBootOrder.h 33 36 34 37 [Packages] … … 49 52 PciLib 50 53 NvVarsFileLib 54 QemuFwCfgLib 55 LoadLinuxLib 51 56 52 57 [Pcd] … … 54 59 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile 55 60 gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent 61 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable 56 62 57 63 [Pcd.IA32, Pcd.X64] -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
r48674 r58459 2 2 Reset System Library functions for OVMF 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 18 18 #include <Library/DebugLib.h> 19 19 #include <Library/IoLib.h> 20 #include <Library/PcdLib.h> 21 #include <Library/TimerLib.h> 20 22 21 23 VOID … … 26 28 ASSERT (SuspendType < 6); 27 29 28 Io AndThenOr16 (0x404, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10));29 IoOr16 ( 0x404, BIT13);30 IoBitFieldWrite16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, (UINT16) SuspendType); 31 IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13); 30 32 CpuDeadLoop (); 31 33 } … … 46 48 ) 47 49 { 48 IoWrite8 (0x64, 0xfe); 50 IoWrite8 (0xCF9, BIT2 | BIT1); // 1st choice: PIIX3 RCR, RCPU|SRST 51 MicroSecondDelay (50); 52 53 IoWrite8 (0x64, 0xfe); // 2nd choice: keyboard controller 54 CpuDeadLoop (); 49 55 } 50 56 … … 63 69 { 64 70 IoWrite8 (0x64, 0xfe); 71 CpuDeadLoop (); 65 72 } 66 73 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
r48674 r58459 2 2 # Library instance for ResetSystem library class for OVMF 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials 6 6 # are licensed and made available under the terms and conditions of the BSD License … … 32 32 [Packages] 33 33 MdePkg/MdePkg.dec 34 OvmfPkg/OvmfPkg.dec 34 35 35 36 [LibraryClasses] 36 37 DebugLib 37 38 IoLib 39 TimerLib 38 40 41 [Pcd] 42 gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
r48674 r58459 285 285 ) 286 286 { 287 return gRT->SetVariable ( 288 VariableName, 289 VendorGuid, 290 Attributes, 291 DataSize, 292 Data 293 ); 287 EFI_STATUS Status; 288 STATIC CONST UINT32 AuthMask = 289 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | 290 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS; 291 292 Status = gRT->SetVariable ( 293 VariableName, 294 VendorGuid, 295 Attributes, 296 DataSize, 297 Data 298 ); 299 300 if (Status == EFI_SECURITY_VIOLATION && (Attributes & AuthMask) != 0) { 301 DEBUG ((DEBUG_WARN, "%a: setting authenticated variable \"%s\" " 302 "failed with EFI_SECURITY_VIOLATION, ignoring\n", __FUNCTION__, 303 VariableName)); 304 Status = EFI_SUCCESS; 305 } 306 return Status; 294 307 } 295 308 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkg.dec
r48674 r58459 2 2 # EFI/Framework Open Virtual Machine Firmware (OVMF) platform 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 8 8 # which accompanies this distribution. The full text of the license may be found at 9 9 # http://opensource.org/licenses/bsd-license.php 10 # 10 # 11 11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 24 24 25 25 [LibraryClasses] 26 ## @libraryclass Loads and boots a Linux kernel image 27 # 28 LoadLinuxLib|Include/Library/LoadLinuxLib.h 29 26 30 ## @libraryclass Save and restore variables using a file 27 31 # 28 32 NvVarsFileLib|Include/Library/NvVarsFileLib.h 33 34 ## @libraryclass Access QEMU's firmware configuration interface 35 # 36 QemuFwCfgLib|Include/Library/QemuFwCfgLib.h 29 37 30 38 ## @libraryclass Serialize (and deserialize) variables … … 35 43 gUefiOvmfPkgTokenSpaceGuid = {0x93bb96af, 0xb9f2, 0x4eb8, {0x94, 0x62, 0xe0, 0xba, 0x74, 0x56, 0x42, 0x36}} 36 44 gEfiXenInfoGuid = {0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d}} 45 gOvmfPlatformConfigGuid = {0x7235c51c, 0x0c80, 0x4cab, {0x87, 0xac, 0x3b, 0x08, 0x4a, 0x63, 0x04, 0xb1}} 37 46 38 47 [Protocols] 48 gVirtioDeviceProtocolGuid = {0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}} 39 49 gBlockMmioProtocolGuid = {0x6b558ce3, 0x69e5, 0x4c67, {0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe, 0x84}} 40 50 41 51 [PcdsFixedAtBuild] 42 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase|0x0|UINT32|0 43 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize|0x0|UINT32|1 52 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0 53 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize|0x0|UINT32|1 54 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|0x0|UINT32|0x15 55 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize|0x0|UINT32|0x16 56 57 ## This flag is used to control the destination port for PlatformDebugLibIoPort 58 gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort|0x402|UINT16|4 59 60 ## This flag determines the Power Management Base Address of choice, written 61 # to PIIX4 function 3 offset 0x40-0x43 bits [15:6]. 62 gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress|0xB000|UINT16|5 63 64 ## When VirtioScsiDxe is instantiated for a HBA, the numbers of targets and 65 # LUNs are retrieved from the host during virtio-scsi setup. 66 # MdeModulePkg/Bus/Scsi/ScsiBusDxe then scans all MaxTarget * MaxLun 67 # possible devices. This can take extremely long, for example with 68 # MaxTarget=255 and MaxLun=16383. The *inclusive* constants below limit 69 # MaxTarget and MaxLun, independently, should the host report higher values, 70 # so that scanning the number of devices given by their product is still 71 # acceptably fast. 72 gUefiOvmfPkgTokenSpaceGuid.PcdVirtioScsiMaxTargetLimit|31|UINT16|6 73 gUefiOvmfPkgTokenSpaceGuid.PcdVirtioScsiMaxLunLimit|7|UINT32|7 74 75 [PcdsFixedAtBuild] 76 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase|0x0|UINT32|0x8 77 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize|0x0|UINT32|0x9 78 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize|0x0|UINT32|0xa 79 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize|0|UINT32|0xb 80 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase|0x0|UINT32|0xc 81 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase|0x0|UINT32|0xd 82 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase|0x0|UINT32|0xe 83 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress|0x0|UINT32|0xf 84 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|0x0|UINT32|0x11 85 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize|0x0|UINT32|0x12 86 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|0x0|UINT32|0x13 87 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize|0x0|UINT32|0x14 88 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|0x0|UINT32|0x17 89 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|0x0|UINT32|0x18 90 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize|0x0|UINT32|0x19 91 gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize|0x0|UINT32|0x1a 44 92 45 93 [PcdsDynamic, PcdsDynamicEx] 46 94 gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2 95 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable|FALSE|BOOLEAN|0x10 47 96 97 [PcdsFeatureFlag] 98 gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|FALSE|BOOLEAN|3 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.dsc
r58189 r58459 2 2 # EFI/Framework Open Virtual Machine Firmware (OVMF) platform 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 34 34 FLASH_DEFINITION = OvmfPkg/OvmfPkgIa32.fdf 35 35 36 # 37 # Defines for default states. These can be changed on the command line. 38 # -D FLAG=VALUE 39 # 40 DEFINE SECURE_BOOT_ENABLE = FALSE 41 36 42 [BuildOptions] 43 GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG 37 44 GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG 38 45 INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG … … 86 93 CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf 87 94 DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf 95 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 88 96 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 89 97 PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf … … 98 106 UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf 99 107 UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf 100 DevicePathLib|MdePkg/Library/UefiDevicePathLib /UefiDevicePathLib.inf108 DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf 101 109 NvVarsFileLib|OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf 102 110 FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf … … 109 117 UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf 110 118 SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf 119 QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf 120 VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf 121 LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf 122 LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf 123 CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf 111 124 112 125 !ifdef $(VBOX) … … 125 138 ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf 126 139 LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf 127 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 140 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 141 142 !if $(SECURE_BOOT_ENABLE) == TRUE 143 PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf 144 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf 145 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf 146 TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf 147 !endif 148 149 S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf 150 SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf 151 152 [LibraryClasses.common] 153 !if $(SECURE_BOOT_ENABLE) == TRUE 154 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 155 !endif 128 156 129 157 [LibraryClasses.common.SEC] 130 158 !ifndef $(VBOX) 131 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 159 QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf 160 !ifdef $(DEBUG_ON_SERIAL_PORT) 161 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 162 !else 163 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 164 !endif 132 165 !else 133 166 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 144 177 PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf 145 178 MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf 179 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf 146 180 147 181 [LibraryClasses.common.PEI_CORE] … … 155 189 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 156 190 !ifndef $(VBOX) 157 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 191 !ifdef $(DEBUG_ON_SERIAL_PORT) 192 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 193 !else 194 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 195 !endif 158 196 PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf 159 197 !else … … 192 230 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 193 231 !ifndef $(VBOX) 194 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 232 !ifdef $(DEBUG_ON_SERIAL_PORT) 233 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 234 !else 235 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 236 !endif 195 237 !else 196 238 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 198 240 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 199 241 ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf 200 !ifdef $(VBOX)201 242 !ifdef $(SOURCE_DEBUG_ENABLE) 202 243 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 203 244 !endif 204 !endif245 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 205 246 206 247 [LibraryClasses.common.DXE_RUNTIME_DRIVER] … … 210 251 ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf 211 252 !ifndef $(VBOX) 212 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 253 !ifdef $(DEBUG_ON_SERIAL_PORT) 254 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 255 !else 256 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 257 !endif 213 258 !else 214 259 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 216 261 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 217 262 UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf 218 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 263 !if $(SECURE_BOOT_ENABLE) == TRUE 264 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 265 !endif 219 266 220 267 [LibraryClasses.common.UEFI_DRIVER] … … 224 271 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 225 272 !ifndef $(VBOX) 226 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 273 !ifdef $(DEBUG_ON_SERIAL_PORT) 274 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 275 !else 276 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 277 !endif 227 278 !else 228 279 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 236 287 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 237 288 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 238 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf239 289 UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf 240 290 !ifndef $(VBOX) 241 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 291 !ifdef $(DEBUG_ON_SERIAL_PORT) 292 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 293 !else 294 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 295 !endif 242 296 !else 243 297 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 248 302 DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf 249 303 PlatformBdsLib|OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf 304 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 305 LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf 306 !ifdef $(SOURCE_DEBUG_ENABLE) 307 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 308 !endif 250 309 251 310 [LibraryClasses.common.UEFI_APPLICATION] … … 253 312 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 254 313 !ifndef $(VBOX) 255 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 314 !ifdef $(DEBUG_ON_SERIAL_PORT) 315 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 316 !else 317 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 318 !endif 256 319 !else 257 320 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 270 333 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE 271 334 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE 335 !if $(SECURE_BOOT_ENABLE) == TRUE 336 gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE 337 !endif 272 338 !ifdef $(VBOX) 273 339 gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeReplayIn|FALSE … … 281 347 gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6 282 348 gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32 283 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x 400349 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 284 350 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 285 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xc000 286 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0xc000 287 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x2000 288 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x10000 351 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000 289 352 290 353 gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 291 354 292 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x ff355 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 293 356 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F 294 357 !ifdef $(SOURCE_DEBUG_ENABLE) … … 302 365 !endif 303 366 304 !if $(BUILD_NEW_SHELL)367 !ifndef $(USE_OLD_SHELL) 305 368 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } 306 !else 307 !if $(USE_NEW_SHELL) 308 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } 309 !endif 310 !endif 369 !endif 370 371 !if $(SECURE_BOOT_ENABLE) == TRUE 372 # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot 373 gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04 374 gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04 375 gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04 376 !endif 377 378 # IRQs 5, 9, 10, 11 are level-triggered 379 gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20 311 380 312 381 ################################################################################ … … 321 390 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 322 391 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 392 gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE 393 !ifndef $(VBOX) 394 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 395 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 396 !else 397 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|1024 398 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|768 399 !endif 323 400 324 401 ################################################################################ … … 328 405 ################################################################################ 329 406 [Components] 407 OvmfPkg/ResetVector/ResetVector.inf 408 330 409 # 331 410 # SEC Phase modules … … 351 430 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf 352 431 } 432 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { 433 <LibraryClasses> 434 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf 435 } 353 436 354 437 # … … 358 441 <LibraryClasses> 359 442 NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf 443 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf 360 444 } 361 445 … … 367 451 368 452 MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf 453 454 !if $(SECURE_BOOT_ENABLE) == TRUE 455 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { 456 <LibraryClasses> 457 NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf 458 } 459 !else 369 460 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf 461 !endif 462 370 463 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf 371 464 PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf … … 374 467 PcAtChipsetPkg/8254TimerDxe/8254Timer.inf 375 468 PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf 376 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf 469 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { 470 <LibraryClasses> 471 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 472 } 377 473 PcAtChipsetPkg/KbcResetDxe/Reset.inf 378 474 MdeModulePkg/Universal/Metronome/Metronome.inf { … … 395 491 396 492 OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf 493 !ifndef $(VBOX) 494 OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf 495 OvmfPkg/VirtioBlkDxe/VirtioBlk.inf 496 OvmfPkg/VirtioScsiDxe/VirtioScsi.inf 497 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 498 !endif 397 499 OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf { 398 500 <LibraryClasses> … … 410 512 MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf 411 513 MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf 412 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf 514 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf { 515 <LibraryClasses> 516 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 517 } 413 518 MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf 414 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 519 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { 520 <LibraryClasses> 521 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf 522 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 523 } 415 524 MdeModulePkg/Universal/PrintDxe/PrintDxe.inf 416 525 MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf … … 423 532 MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 424 533 MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 534 MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 425 535 MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf 426 536 … … 465 575 # 466 576 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 577 !ifndef $(VBOX) 578 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 579 OvmfPkg/AcpiTables/AcpiTables.inf 580 OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 581 MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf 582 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf 583 !else 467 584 MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf 468 !ifndef $(VBOX)469 OvmfPkg/AcpiTables/AcpiTables.inf470 585 !endif 471 586 … … 473 588 # Network Support 474 589 # 475 !if $(NETWORK_ENABLE)590 !ifndef $(VBOX) 476 591 MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf 477 592 MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf … … 487 602 MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 488 603 MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf 604 OvmfPkg/VirtioNetDxe/VirtioNet.inf 489 605 !endif 490 606 … … 501 617 502 618 !ifdef $(CSM_ENABLE) 503 IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf 619 IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf { 620 <LibraryClasses> 621 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 622 } 504 623 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf 505 624 OvmfPkg/Csm/Csm16/Csm16.inf 506 625 !endif 507 626 508 !if $(BUILD_NEW_SHELL)627 !ifndef $(USE_OLD_SHELL) 509 628 ShellPkg/Application/Shell/Shell.inf { 510 629 <LibraryClasses> … … 525 644 # SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf 526 645 # SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf 646 BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf 527 647 528 648 <PcdsFixedAtBuild> … … 533 653 !endif 534 654 655 !if $(SECURE_BOOT_ENABLE) == TRUE 656 SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf { 657 <LibraryClasses> 658 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 659 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf 660 } 661 OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 662 !endif 663 664 OvmfPkg/PlatformDxe/Platform.inf -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.fdf
r58189 r58459 2 2 # Open Virtual Machine Firmware: FDF 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 15 15 16 16 ################################################################################ 17 18 # 19 # Default flash size for DEBUG build is 2MB. For RELEASE it is 1MB. 20 # 21 # Defining FD_SIZE_1MB or FD_SIZE_2MB on the build command line can 22 # override this. 23 # 24 [Defines] 25 !if $(TARGET) == RELEASE 26 !ifndef $(FD_SIZE_2MB) 27 DEFINE FD_SIZE_1MB= 28 !endif 29 !endif 30 31 !include OvmfPkg.fdf.inc 32 33 # 34 # Build the variable store and the firmware code as one unified flash device 35 # image. 36 # 17 37 [FD.OVMF] 18 BaseAddress = 0xFFF0000019 Size = 0x0010000038 BaseAddress = $(FW_BASE_ADDRESS) 39 Size = $(FW_SIZE) 20 40 ErasePolarity = 1 21 BlockSize = 0x1000 22 NumBlocks = 0x100 23 24 #VBox: Debug needs more space, original: 0x00000000|0x000EC000 25 0x00000000|0x000F4000 41 BlockSize = $(BLOCK_SIZE) 42 NumBlocks = $(FW_BLOCKS) 43 44 !include VarStore.fdf.inc 45 46 $(VARS_SIZE)|$(FVMAIN_SIZE) 26 47 FV = FVMAIN_COMPACT 27 48 28 #VBox: Debug needs more space, original: 0x000EC000|0x14000 29 0x000F4000|0x0000C000 49 $(SECFV_OFFSET)|$(SECFV_SIZE) 30 50 FV = SECFV 31 51 52 # 53 # Build the variable store and the firmware code as separate flash device 54 # images. 55 # 56 [FD.OVMF_VARS] 57 BaseAddress = $(FW_BASE_ADDRESS) 58 Size = $(VARS_SIZE) 59 ErasePolarity = 1 60 BlockSize = $(BLOCK_SIZE) 61 NumBlocks = $(VARS_BLOCKS) 62 63 !include VarStore.fdf.inc 64 65 [FD.OVMF_CODE] 66 BaseAddress = $(CODE_BASE_ADDRESS) 67 Size = $(CODE_SIZE) 68 ErasePolarity = 1 69 BlockSize = $(BLOCK_SIZE) 70 NumBlocks = $(CODE_BLOCKS) 71 72 0x00000000|$(FVMAIN_SIZE) 73 FV = FVMAIN_COMPACT 74 75 $(FVMAIN_SIZE)|$(SECFV_SIZE) 76 FV = SECFV 77 32 78 ################################################################################ 33 79 34 80 [FD.MEMFD] 35 BaseAddress = 0x 2000000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase36 Size = 0x 600000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize81 BaseAddress = 0x800000 82 Size = 0x900000 37 83 ErasePolarity = 1 38 84 BlockSize = 0x10000 39 NumBlocks = 0x60 40 41 0x0|0x600000 42 FV = MAINFV 85 NumBlocks = 0x90 86 87 0x000000|0x006000 88 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize 89 90 0x006000|0x001000 91 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize 92 93 0x007000|0x001000 94 gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize 95 96 0x010000|0x008000 97 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize 98 99 0x018000|0x008000 100 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize 101 102 0x020000|0x0E0000 103 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize 104 FV = PEIFV 105 106 0x100000|0x800000 107 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize 108 FV = DXEFV 43 109 44 110 ################################################################################ … … 67 133 # 68 134 # The code in this FV handles the initial firmware startup, and 69 # decompresses the MAINFV which handles the majorityof the boot sequence.135 # decompresses the PEI and DXE FVs which handles the rest of the boot sequence. 70 136 # 71 137 INF OvmfPkg/Sec/SecMain.inf 72 138 73 INF RuleOverride=RESET_VECTOR UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf74 75 ################################################################################ 76 [FV. MAINFV]139 INF RuleOverride=RESET_VECTOR OvmfPkg/ResetVector/ResetVector.inf 140 141 ################################################################################ 142 [FV.PEIFV] 77 143 BlockSize = 0x10000 78 144 FvAlignment = 16 … … 93 159 READ_LOCK_STATUS = TRUE 94 160 95 #96 # Files to be placed in MAIN FV97 #98 # This firmware volume will have files placed in it uncompressed,99 # and then then entire firmware volume will be compressed in a100 # single compression operation in order to achieve better101 # overall compression.102 #103 104 161 APRIORI PEI { 105 162 INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf … … 114 171 INF OvmfPkg/PlatformPei/PlatformPei.inf 115 172 INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf 116 117 FILE FV_IMAGE = A4EF5A93-3F1B-4232-A1C4-F0910E6D1D9C { 118 SECTION COMPRESS PI_NONE { 119 SECTION FV_IMAGE = DXEFV 120 } 121 } 173 INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf 122 174 123 175 ################################################################################ … … 143 195 144 196 APRIORI DXE { 197 INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 145 198 INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf 199 !ifndef $(VBOX) 200 INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 201 !endif 146 202 } 147 203 … … 168 224 169 225 INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf 226 !ifndef $(VBOX) 227 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf 228 INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf 229 INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf 230 INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 231 !endif 170 232 INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf 233 !ifndef $(VBOX) 171 234 INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf 172 !ifndef $(VBOX) 173 INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 235 !if $(SECURE_BOOT_ENABLE) == TRUE 236 INF SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf 237 INF OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 238 !else 239 INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 240 !endif 174 241 !else 175 242 INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf … … 196 263 INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 197 264 INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 265 INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 198 266 INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf 199 267 … … 227 295 INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf 228 296 297 !ifndef $(VBOX) 298 INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 299 INF RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf 300 INF OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 301 INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf 302 INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf 303 !else 229 304 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 230 305 INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf 231 !ifndef $(VBOX)232 INF RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf233 306 !endif 234 307 235 308 INF RuleOverride = BINARY FatBinPkg/EnhancedFatDxe/Fat.inf 236 309 237 !if $(BUILD_NEW_SHELL)310 !ifndef $(USE_OLD_SHELL) 238 311 INF ShellPkg/Application/Shell/Shell.inf 239 312 !else 240 !if $(USE_NEW_SHELL)241 INF RuleOverride = BINARY ShellBinPkg/UefiShell/UefiShell.inf242 !else243 313 INF RuleOverride = BINARY EdkShellBinPkg/FullShell/FullShell.inf 244 !endif245 314 !endif 246 315 … … 260 329 # Network modules 261 330 # 262 !if $(NETWORK_ENABLE) 331 !ifndef $(VBOX) 332 !if $(E1000_ENABLE) 263 333 FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 { 264 334 SECTION PE32 = Intel3.5/EFI32/E3507E2.EFI 265 335 } 336 !endif 266 337 INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf 267 338 INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf … … 277 348 INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 278 349 INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf 350 INF OvmfPkg/VirtioNetDxe/VirtioNet.inf 279 351 !endif 280 352 … … 295 367 INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf 296 368 !endif 369 370 !ifndef $(VBOX) 371 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf 372 !endif 373 INF OvmfPkg/PlatformDxe/Platform.inf 297 374 298 375 ################################################################################ … … 318 395 FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { 319 396 SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { 320 SECTION FV_IMAGE = MAINFV 397 # 398 # These firmware volumes will have files placed in them uncompressed, 399 # and then both firmware volumes will be compressed in a single 400 # compression operation in order to achieve better overall compression. 401 # 402 SECTION FV_IMAGE = PEIFV 403 SECTION FV_IMAGE = DXEFV 321 404 } 322 405 } … … 384 467 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) 385 468 } 386 469 387 470 [Rule.Common.UEFI_APPLICATION] 388 471 FILE APPLICATION = $(NAMED_GUID) { … … 398 481 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) 399 482 } 400 483 401 484 [Rule.Common.USER_DEFINED.ACPITABLE] 402 485 FILE FREEFORM = $(NAMED_GUID) { … … 412 495 [Rule.Common.SEC.RESET_VECTOR] 413 496 FILE RAW = $(NAMED_GUID) { 414 RAW RAW |.raw 415 } 416 417 !ifndef $(VBOX) 418 [OptionRom.OvmfVideo] 419 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf { 420 PCI_DEVICE_ID = 0x00B8 421 } 422 !endif 497 RAW BIN Align = 16 |.bin 498 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32X64.dsc
r48674 r58459 2 2 # EFI/Framework Open Virtual Machine Firmware (OVMF) platform 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 30 30 FLASH_DEFINITION = OvmfPkg/OvmfPkgIa32X64.fdf 31 31 32 # 33 # Defines for default states. These can be changed on the command line. 34 # -D FLAG=VALUE 35 # 36 DEFINE SECURE_BOOT_ENABLE = FALSE 37 32 38 [BuildOptions] 39 GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG 33 40 GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG 34 41 INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG 35 42 MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG 36 43 GCC:*_*_*_CC_FLAGS = -mno-mmx -mno-sse 37 44 !ifdef $(SOURCE_DEBUG_ENABLE) 45 MSFT:*_*_X64_GENFW_FLAGS = --keepexceptiontable 46 GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable 47 INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable 48 !endif 49 38 50 ################################################################################ 39 51 # … … 66 78 CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf 67 79 DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf 80 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 68 81 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 69 82 PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf … … 78 91 UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf 79 92 UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf 80 DevicePathLib|MdePkg/Library/UefiDevicePathLib /UefiDevicePathLib.inf93 DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf 81 94 NvVarsFileLib|OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf 82 95 FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf … … 89 102 UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf 90 103 SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf 91 LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf 104 QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf 105 VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf 106 LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf 107 LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf 108 CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf 92 109 93 110 !ifdef $(SOURCE_DEBUG_ENABLE) … … 101 118 ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf 102 119 LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf 103 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 120 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 121 122 !if $(SECURE_BOOT_ENABLE) == TRUE 123 PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf 124 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf 125 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf 126 TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf 127 !endif 128 129 S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf 130 SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf 131 132 [LibraryClasses.common] 133 !if $(SECURE_BOOT_ENABLE) == TRUE 134 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 135 !endif 104 136 105 137 [LibraryClasses.common.SEC] 106 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 138 QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf 139 !ifdef $(DEBUG_ON_SERIAL_PORT) 140 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 141 !else 142 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 143 !endif 107 144 ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf 108 145 ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf … … 114 151 PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf 115 152 MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf 153 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf 116 154 117 155 [LibraryClasses.common.PEI_CORE] … … 124 162 OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf 125 163 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 126 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 164 !ifdef $(DEBUG_ON_SERIAL_PORT) 165 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 166 !else 167 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 168 !endif 127 169 PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf 128 170 … … 136 178 OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf 137 179 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 138 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 180 !ifdef $(DEBUG_ON_SERIAL_PORT) 181 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 182 !else 183 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 184 !endif 139 185 PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf 140 186 PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf … … 149 195 MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf 150 196 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 151 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 197 !ifdef $(DEBUG_ON_SERIAL_PORT) 198 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 199 !else 200 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 201 !endif 152 202 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 153 203 ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf … … 155 205 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 156 206 !endif 207 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 157 208 158 209 [LibraryClasses.common.DXE_RUNTIME_DRIVER] … … 161 212 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 162 213 ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf 163 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 214 !ifdef $(DEBUG_ON_SERIAL_PORT) 215 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 216 !else 217 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 218 !endif 164 219 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 165 220 UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf 166 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 221 !if $(SECURE_BOOT_ENABLE) == TRUE 222 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 223 !endif 167 224 168 225 [LibraryClasses.common.UEFI_DRIVER] … … 171 228 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 172 229 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 173 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 230 !ifdef $(DEBUG_ON_SERIAL_PORT) 231 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 232 !else 233 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 234 !endif 174 235 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 175 236 UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf … … 180 241 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 181 242 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 182 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf183 243 UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf 184 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 244 !ifdef $(DEBUG_ON_SERIAL_PORT) 245 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 246 !else 247 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 248 !endif 185 249 NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf 186 250 IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf … … 188 252 DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf 189 253 PlatformBdsLib|OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf 254 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 255 LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf 256 !ifdef $(SOURCE_DEBUG_ENABLE) 257 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 258 !endif 190 259 191 260 [LibraryClasses.common.UEFI_APPLICATION] 192 261 HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf 193 262 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 194 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 263 !ifdef $(DEBUG_ON_SERIAL_PORT) 264 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 265 !else 266 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 267 !endif 195 268 196 269 ################################################################################ … … 206 279 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE 207 280 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE 281 !if $(SECURE_BOOT_ENABLE) == TRUE 282 gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE 283 !endif 208 284 209 285 [PcdsFixedAtBuild] … … 213 289 gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6 214 290 gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32 215 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x 400291 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 216 292 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 217 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xc000 218 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0xc000 219 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x2000 220 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x10000 293 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000 221 294 222 295 gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 … … 234 307 !endif 235 308 236 !if $(BUILD_NEW_SHELL)309 !ifndef $(USE_OLD_SHELL) 237 310 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } 238 !else 239 !if $(USE_NEW_SHELL) 240 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } 241 !endif 242 !endif 311 !endif 312 313 [PcdsFixedAtBuild.X64] 314 !if $(SECURE_BOOT_ENABLE) == TRUE 315 # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot 316 gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04 317 gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04 318 gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04 319 !endif 320 321 # IRQs 5, 9, 10, 11 are level-triggered 322 gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20 243 323 244 324 ################################################################################ … … 253 333 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 254 334 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 335 gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE 336 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 337 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 255 338 256 339 … … 261 344 ################################################################################ 262 345 [Components.IA32] 346 OvmfPkg/ResetVector/ResetVector.inf 347 263 348 # 264 349 # SEC Phase modules … … 284 369 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf 285 370 } 371 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { 372 <LibraryClasses> 373 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf 374 } 286 375 287 376 [Components.X64] … … 292 381 <LibraryClasses> 293 382 NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf 383 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf 294 384 } 295 385 … … 301 391 302 392 MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf 393 394 !if $(SECURE_BOOT_ENABLE) == TRUE 395 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { 396 <LibraryClasses> 397 NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf 398 } 399 !else 303 400 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf 401 !endif 402 304 403 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf 305 404 PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf … … 308 407 PcAtChipsetPkg/8254TimerDxe/8254Timer.inf 309 408 PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf 310 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf 409 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { 410 <LibraryClasses> 411 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 412 } 311 413 PcAtChipsetPkg/KbcResetDxe/Reset.inf 312 414 MdeModulePkg/Universal/Metronome/Metronome.inf { … … 329 431 330 432 OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf 433 OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf 434 OvmfPkg/VirtioBlkDxe/VirtioBlk.inf 435 OvmfPkg/VirtioScsiDxe/VirtioScsi.inf 436 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 331 437 OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf { 332 438 <LibraryClasses> … … 340 446 MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf 341 447 MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf 342 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf 448 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf { 449 <LibraryClasses> 450 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 451 } 343 452 MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf 344 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 453 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { 454 <LibraryClasses> 455 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf 456 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 457 } 345 458 MdeModulePkg/Universal/PrintDxe/PrintDxe.inf 346 459 MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf … … 353 466 MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 354 467 MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 468 MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 355 469 MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf 356 470 … … 379 493 # 380 494 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 381 MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf495 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 382 496 OvmfPkg/AcpiTables/AcpiTables.inf 497 OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 498 MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf 499 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf 383 500 384 501 # 385 502 # Network Support 386 503 # 387 !if $(NETWORK_ENABLE)388 504 MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf 389 505 MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf … … 399 515 MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 400 516 MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf 401 !endif517 OvmfPkg/VirtioNetDxe/VirtioNet.inf 402 518 403 519 # … … 411 527 412 528 !ifdef $(CSM_ENABLE) 413 IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf 529 IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf { 530 <LibraryClasses> 531 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 532 } 414 533 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf 415 534 OvmfPkg/Csm/Csm16/Csm16.inf 416 535 !endif 417 536 418 !if $(BUILD_NEW_SHELL)537 !ifndef $(USE_OLD_SHELL) 419 538 ShellPkg/Application/Shell/Shell.inf { 420 539 <LibraryClasses> … … 435 554 # SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf 436 555 # SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf 556 BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf 437 557 438 558 <PcdsFixedAtBuild> … … 443 563 !endif 444 564 565 !if $(SECURE_BOOT_ENABLE) == TRUE 566 SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf { 567 <LibraryClasses> 568 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 569 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf 570 } 571 OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 572 !endif 573 574 OvmfPkg/PlatformDxe/Platform.inf -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32X64.fdf
r48674 r58459 2 2 # Open Virtual Machine Firmware: FDF 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 15 15 16 16 ################################################################################ 17 18 # 19 # Default flash size for DEBUG build is 2MB. For RELEASE it is 1MB. 20 # 21 # Defining FD_SIZE_1MB or FD_SIZE_2MB on the build command line can 22 # override this. 23 # 24 [Defines] 25 !if $(TARGET) == RELEASE 26 !ifndef $(FD_SIZE_2MB) 27 DEFINE FD_SIZE_1MB= 28 !endif 29 !endif 30 31 !include OvmfPkg.fdf.inc 32 33 # 34 # Build the variable store and the firmware code as one unified flash device 35 # image. 36 # 17 37 [FD.OVMF] 18 BaseAddress = 0xFFF0000019 Size = 0x0010000038 BaseAddress = $(FW_BASE_ADDRESS) 39 Size = $(FW_SIZE) 20 40 ErasePolarity = 1 21 BlockSize = 0x1000 22 NumBlocks = 0x100 23 24 0x00000000|0x000EC000 41 BlockSize = $(BLOCK_SIZE) 42 NumBlocks = $(FW_BLOCKS) 43 44 !include VarStore.fdf.inc 45 46 $(VARS_SIZE)|$(FVMAIN_SIZE) 25 47 FV = FVMAIN_COMPACT 26 48 27 0x000EC000|0x14000 49 $(SECFV_OFFSET)|$(SECFV_SIZE) 28 50 FV = SECFV 29 51 52 # 53 # Build the variable store and the firmware code as separate flash device 54 # images. 55 # 56 [FD.OVMF_VARS] 57 BaseAddress = $(FW_BASE_ADDRESS) 58 Size = $(VARS_SIZE) 59 ErasePolarity = 1 60 BlockSize = $(BLOCK_SIZE) 61 NumBlocks = $(VARS_BLOCKS) 62 63 !include VarStore.fdf.inc 64 65 [FD.OVMF_CODE] 66 BaseAddress = $(CODE_BASE_ADDRESS) 67 Size = $(CODE_SIZE) 68 ErasePolarity = 1 69 BlockSize = $(BLOCK_SIZE) 70 NumBlocks = $(CODE_BLOCKS) 71 72 0x00000000|$(FVMAIN_SIZE) 73 FV = FVMAIN_COMPACT 74 75 $(FVMAIN_SIZE)|$(SECFV_SIZE) 76 FV = SECFV 77 30 78 ################################################################################ 31 79 32 80 [FD.MEMFD] 33 BaseAddress = 0x800000 |gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase34 Size = 0x 500000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize81 BaseAddress = 0x800000 82 Size = 0x900000 35 83 ErasePolarity = 1 36 84 BlockSize = 0x10000 37 NumBlocks = 0x50 38 39 0x0|0x500000 40 FV = MAINFV 85 NumBlocks = 0x90 86 87 0x000000|0x006000 88 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize 89 90 0x006000|0x001000 91 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize 92 93 0x007000|0x001000 94 gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize 95 96 0x010000|0x008000 97 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize 98 99 0x018000|0x008000 100 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize 101 102 0x020000|0x0E0000 103 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize 104 FV = PEIFV 105 106 0x100000|0x800000 107 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize 108 FV = DXEFV 41 109 42 110 ################################################################################ … … 65 133 # 66 134 # The code in this FV handles the initial firmware startup, and 67 # decompresses the MAINFV which handles the majorityof the boot sequence.135 # decompresses the PEI and DXE FVs which handles the rest of the boot sequence. 68 136 # 69 137 INF OvmfPkg/Sec/SecMain.inf 70 138 71 INF RuleOverride=RESET_VECTOR USE = IA32 UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf72 73 ################################################################################ 74 [FV. MAINFV]139 INF RuleOverride=RESET_VECTOR OvmfPkg/ResetVector/ResetVector.inf 140 141 ################################################################################ 142 [FV.PEIFV] 75 143 BlockSize = 0x10000 76 144 FvAlignment = 16 … … 91 159 READ_LOCK_STATUS = TRUE 92 160 93 #94 # Files to be placed in MAIN FV95 #96 # This firmware volume will have files placed in it uncompressed,97 # and then then entire firmware volume will be compressed in a98 # single compression operation in order to achieve better99 # overall compression.100 #101 102 161 APRIORI PEI { 103 162 INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf … … 112 171 INF OvmfPkg/PlatformPei/PlatformPei.inf 113 172 INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf 114 115 FILE FV_IMAGE = A4EF5A93-3F1B-4232-A1C4-F0910E6D1D9C { 116 SECTION COMPRESS PI_NONE { 117 SECTION FV_IMAGE = DXEFV 118 } 119 } 173 INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf 120 174 121 175 ################################################################################ … … 141 195 142 196 APRIORI DXE { 197 INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 143 198 INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf 199 INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 144 200 } 145 201 … … 166 222 167 223 INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf 224 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf 225 INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf 226 INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf 227 INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 168 228 INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf 169 229 INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf 170 INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 230 231 !if $(SECURE_BOOT_ENABLE) == TRUE 232 INF SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf 233 INF OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 234 !else 235 INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 236 !endif 237 171 238 INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf 172 239 INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf … … 188 255 INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 189 256 INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 257 INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 190 258 INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf 191 259 … … 204 272 205 273 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 206 INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf274 INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 207 275 INF RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf 276 INF OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 277 INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf 278 INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf 208 279 209 280 INF RuleOverride = BINARY USE = X64 FatBinPkg/EnhancedFatDxe/Fat.inf 210 281 211 !if $(BUILD_NEW_SHELL)282 !ifndef $(USE_OLD_SHELL) 212 283 INF ShellPkg/Application/Shell/Shell.inf 213 284 !else 214 !if $(USE_NEW_SHELL)215 INF RuleOverride = BINARY USE = X64 ShellBinPkg/UefiShell/UefiShell.inf216 !else217 285 INF RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf 218 !endif219 286 !endif 220 287 … … 226 293 # Network modules 227 294 # 228 !if $( NETWORK_ENABLE)295 !if $(E1000_ENABLE) 229 296 FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 { 230 297 SECTION PE32 = Intel3.5/EFIX64/E3507X2.EFI 231 298 } 299 !endif 232 300 INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf 233 301 INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf … … 243 311 INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 244 312 INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf 245 !endif313 INF OvmfPkg/VirtioNetDxe/VirtioNet.inf 246 314 247 315 # … … 259 327 INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf 260 328 !endif 329 330 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf 331 INF OvmfPkg/PlatformDxe/Platform.inf 261 332 262 333 ################################################################################ … … 282 353 FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { 283 354 SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { 284 SECTION FV_IMAGE = MAINFV 355 # 356 # These firmware volumes will have files placed in them uncompressed, 357 # and then both firmware volumes will be compressed in a single 358 # compression operation in order to achieve better overall compression. 359 # 360 SECTION FV_IMAGE = PEIFV 361 SECTION FV_IMAGE = DXEFV 285 362 } 286 363 } … … 348 425 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) 349 426 } 350 427 351 428 [Rule.Common.UEFI_APPLICATION] 352 429 FILE APPLICATION = $(NAMED_GUID) { … … 362 439 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) 363 440 } 364 441 365 442 [Rule.Common.USER_DEFINED.ACPITABLE] 366 443 FILE FREEFORM = $(NAMED_GUID) { … … 376 453 [Rule.Common.SEC.RESET_VECTOR] 377 454 FILE RAW = $(NAMED_GUID) { 378 RAW RAW |.raw 379 } 380 381 [OptionRom.OvmfVideo] 382 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf { 383 PCI_DEVICE_ID = 0x00B8 384 } 455 RAW BIN Align = 16 |.bin 456 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.dsc
r58189 r58459 2 2 # EFI/Framework Open Virtual Machine Firmware (OVMF) platform 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 34 34 FLASH_DEFINITION = OvmfPkg/OvmfPkgX64.fdf 35 35 36 # 37 # Defines for default states. These can be changed on the command line. 38 # -D FLAG=VALUE 39 # 40 DEFINE SECURE_BOOT_ENABLE = FALSE 41 36 42 [BuildOptions] 43 GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG 37 44 GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG 38 45 INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG 39 46 MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG 40 47 GCC:*_*_*_CC_FLAGS = -mno-mmx -mno-sse 48 !ifdef $(SOURCE_DEBUG_ENABLE) 49 MSFT:*_*_X64_GENFW_FLAGS = --keepexceptiontable 50 GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable 51 INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable 52 !endif 41 53 42 54 !ifdef $(VBOX) … … 85 97 CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf 86 98 DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf 99 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 87 100 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 88 101 PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf … … 97 110 UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf 98 111 UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf 99 DevicePathLib|MdePkg/Library/UefiDevicePathLib /UefiDevicePathLib.inf112 DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf 100 113 NvVarsFileLib|OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf 101 114 FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf … … 108 121 UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf 109 122 SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf 110 LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf 123 QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf 124 VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf 125 LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf 126 LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf 127 CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf 111 128 112 129 !ifdef $(VBOX) … … 125 142 ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf 126 143 LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf 127 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 144 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 145 146 !if $(SECURE_BOOT_ENABLE) == TRUE 147 PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf 148 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf 149 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf 150 TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf 151 !endif 152 153 S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf 154 SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf 155 156 [LibraryClasses.common] 157 !if $(SECURE_BOOT_ENABLE) == TRUE 158 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 159 !endif 128 160 129 161 [LibraryClasses.common.SEC] 130 162 !ifndef $(VBOX) 131 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 163 QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf 164 !ifdef $(DEBUG_ON_SERIAL_PORT) 165 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 166 !else 167 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 168 !endif 132 169 !else 133 170 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 144 181 PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf 145 182 MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf 183 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf 146 184 147 185 [LibraryClasses.common.PEI_CORE] … … 172 210 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf 173 211 !ifndef $(VBOX) 174 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 212 !ifdef $(DEBUG_ON_SERIAL_PORT) 213 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 214 !else 215 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 216 !endif 175 217 PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf 176 218 !else … … 192 234 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 193 235 !ifndef $(VBOX) 194 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 236 !ifdef $(DEBUG_ON_SERIAL_PORT) 237 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 238 !else 239 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 240 !endif 195 241 !else 196 242 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 198 244 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 199 245 ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf 200 !ifdef $(VBOX)201 246 !ifdef $(SOURCE_DEBUG_ENABLE) 202 247 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 203 248 !endif 204 !endif249 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 205 250 206 251 [LibraryClasses.common.DXE_RUNTIME_DRIVER] … … 210 255 ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf 211 256 !ifndef $(VBOX) 212 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 257 !ifdef $(DEBUG_ON_SERIAL_PORT) 258 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 259 !else 260 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 261 !endif 213 262 !else 214 263 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 216 265 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 217 266 UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf 218 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf 267 !if $(SECURE_BOOT_ENABLE) == TRUE 268 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 269 !endif 219 270 220 271 [LibraryClasses.common.UEFI_DRIVER] … … 224 275 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 225 276 !ifndef $(VBOX) 226 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 277 !ifdef $(DEBUG_ON_SERIAL_PORT) 278 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 279 !else 280 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 281 !endif 227 282 !else 228 283 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 236 291 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 237 292 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 238 DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf239 293 UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf 240 294 !ifndef $(VBOX) 241 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 295 !ifdef $(DEBUG_ON_SERIAL_PORT) 296 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 297 !else 298 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 299 !endif 242 300 !else 243 301 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 248 306 DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf 249 307 PlatformBdsLib|OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf 308 CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 309 LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf 310 !ifdef $(SOURCE_DEBUG_ENABLE) 311 DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf 312 !endif 250 313 251 314 [LibraryClasses.common.UEFI_APPLICATION] … … 253 316 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 254 317 !ifndef $(VBOX) 255 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 318 !ifdef $(DEBUG_ON_SERIAL_PORT) 319 DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 320 !else 321 DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf 322 !endif 256 323 !else 257 324 DebugLib|VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf … … 270 337 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE 271 338 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE 339 !if $(SECURE_BOOT_ENABLE) == TRUE 340 gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE 341 !endif 272 342 !ifdef $(VBOX) 273 343 gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeReplayIn|FALSE … … 281 351 gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6 282 352 gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32 283 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x 400353 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 284 354 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 285 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xc000 286 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0xc000 287 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x2000 288 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x10000 355 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000 289 356 290 357 gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 291 358 292 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x ff359 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 293 360 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F 294 361 !ifdef $(SOURCE_DEBUG_ENABLE) … … 302 369 !endif 303 370 304 !if $(BUILD_NEW_SHELL)371 !ifndef $(USE_OLD_SHELL) 305 372 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } 306 !else 307 !if $(USE_NEW_SHELL) 308 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } 309 !endif 310 !endif 373 !endif 374 375 !if $(SECURE_BOOT_ENABLE) == TRUE 376 # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot 377 gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04 378 gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04 379 gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04 380 !endif 381 382 # IRQs 5, 9, 10, 11 are level-triggered 383 gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20 311 384 312 385 ################################################################################ … … 321 394 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 322 395 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 396 gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE 397 !ifndef $(VBOX) 398 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 399 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 400 !else 401 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|1024 402 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|768 403 !endif 323 404 324 405 ################################################################################ … … 328 409 ################################################################################ 329 410 [Components] 411 OvmfPkg/ResetVector/ResetVector.inf 412 330 413 # 331 414 # SEC Phase modules … … 351 434 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf 352 435 } 436 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { 437 <LibraryClasses> 438 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf 439 } 353 440 354 441 # … … 358 445 <LibraryClasses> 359 446 NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf 447 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf 360 448 } 361 449 … … 367 455 368 456 MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf 457 458 !if $(SECURE_BOOT_ENABLE) == TRUE 459 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { 460 <LibraryClasses> 461 NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf 462 } 463 !else 369 464 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf 465 !endif 466 370 467 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf 371 468 PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf … … 374 471 PcAtChipsetPkg/8254TimerDxe/8254Timer.inf 375 472 PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf 376 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf 473 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { 474 <LibraryClasses> 475 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 476 } 377 477 PcAtChipsetPkg/KbcResetDxe/Reset.inf 378 478 MdeModulePkg/Universal/Metronome/Metronome.inf { … … 395 495 396 496 OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf 497 !ifndef $(VBOX) 498 OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf 499 OvmfPkg/VirtioBlkDxe/VirtioBlk.inf 500 OvmfPkg/VirtioScsiDxe/VirtioScsi.inf 501 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 502 !endif 397 503 OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf { 398 504 <LibraryClasses> … … 410 516 MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf 411 517 MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf 412 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf 518 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf { 519 <LibraryClasses> 520 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 521 } 413 522 MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf 414 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 523 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { 524 <LibraryClasses> 525 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf 526 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 527 } 415 528 MdeModulePkg/Universal/PrintDxe/PrintDxe.inf 416 529 MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf … … 423 536 MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 424 537 MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 538 MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 425 539 MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf 426 540 … … 465 579 # 466 580 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 581 !ifndef $(VBOX) 582 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 583 OvmfPkg/AcpiTables/AcpiTables.inf 584 OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 585 MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf 586 MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf 587 !else 467 588 MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf 468 !ifndef $(VBOX)469 OvmfPkg/AcpiTables/AcpiTables.inf470 589 !endif 471 590 … … 473 592 # Network Support 474 593 # 475 !if $(NETWORK_ENABLE)594 !ifndef $(VBOX) 476 595 MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf 477 596 MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf … … 487 606 MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 488 607 MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf 608 OvmfPkg/VirtioNetDxe/VirtioNet.inf 489 609 !endif 490 610 … … 501 621 502 622 !ifdef $(CSM_ENABLE) 503 IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf 623 IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf { 624 <LibraryClasses> 625 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 626 } 504 627 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf 505 628 OvmfPkg/Csm/Csm16/Csm16.inf 506 629 !endif 507 630 508 !if $(BUILD_NEW_SHELL)631 !ifndef $(USE_OLD_SHELL) 509 632 ShellPkg/Application/Shell/Shell.inf { 510 633 <LibraryClasses> … … 525 648 # SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf 526 649 # SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf 650 BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf 527 651 528 652 <PcdsFixedAtBuild> … … 533 657 !endif 534 658 659 !if $(SECURE_BOOT_ENABLE) == TRUE 660 SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf { 661 <LibraryClasses> 662 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 663 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf 664 } 665 OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 666 !endif 667 668 OvmfPkg/PlatformDxe/Platform.inf -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.fdf
r58189 r58459 2 2 # Open Virtual Machine Firmware: FDF 3 3 # 4 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 15 15 16 16 ################################################################################ 17 18 # 19 # Default flash size for DEBUG build is 2MB. For RELEASE it is 1MB. 20 # 21 # Defining FD_SIZE_1MB or FD_SIZE_2MB on the build command line can 22 # override this. 23 # 24 [Defines] 25 !if $(TARGET) == RELEASE 26 !ifndef $(FD_SIZE_2MB) 27 DEFINE FD_SIZE_1MB= 28 !endif 29 !endif 30 31 !include OvmfPkg.fdf.inc 32 33 # 34 # Build the variable store and the firmware code as one unified flash device 35 # image. 36 # 17 37 [FD.OVMF] 18 BaseAddress = 0xFFF0000019 Size = 0x0010000038 BaseAddress = $(FW_BASE_ADDRESS) 39 Size = $(FW_SIZE) 20 40 ErasePolarity = 1 21 BlockSize = 0x1000 22 NumBlocks = 0x100 23 24 0x00000000|0x000EC000 41 BlockSize = $(BLOCK_SIZE) 42 NumBlocks = $(FW_BLOCKS) 43 44 !include VarStore.fdf.inc 45 46 $(VARS_SIZE)|$(FVMAIN_SIZE) 25 47 FV = FVMAIN_COMPACT 26 48 27 0x000EC000|0x14000 49 $(SECFV_OFFSET)|$(SECFV_SIZE) 28 50 FV = SECFV 29 51 52 # 53 # Build the variable store and the firmware code as separate flash device 54 # images. 55 # 56 [FD.OVMF_VARS] 57 BaseAddress = $(FW_BASE_ADDRESS) 58 Size = $(VARS_SIZE) 59 ErasePolarity = 1 60 BlockSize = $(BLOCK_SIZE) 61 NumBlocks = $(VARS_BLOCKS) 62 63 !include VarStore.fdf.inc 64 65 [FD.OVMF_CODE] 66 BaseAddress = $(CODE_BASE_ADDRESS) 67 Size = $(CODE_SIZE) 68 ErasePolarity = 1 69 BlockSize = $(BLOCK_SIZE) 70 NumBlocks = $(CODE_BLOCKS) 71 72 0x00000000|$(FVMAIN_SIZE) 73 FV = FVMAIN_COMPACT 74 75 $(FVMAIN_SIZE)|$(SECFV_SIZE) 76 FV = SECFV 77 30 78 ################################################################################ 31 79 32 80 [FD.MEMFD] 33 BaseAddress = 0x 2000000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase34 Size = 0x 600000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize81 BaseAddress = 0x800000 82 Size = 0x900000 35 83 ErasePolarity = 1 36 84 BlockSize = 0x10000 37 NumBlocks = 0x60 38 39 0x0|0x600000 40 FV = MAINFV 85 NumBlocks = 0x90 86 87 0x000000|0x006000 88 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize 89 90 0x006000|0x001000 91 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize 92 93 0x007000|0x001000 94 gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize 95 96 0x010000|0x008000 97 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize 98 99 0x018000|0x008000 100 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase|gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize 101 102 0x020000|0x0E0000 103 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize 104 FV = PEIFV 105 106 0x100000|0x800000 107 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize 108 FV = DXEFV 41 109 42 110 ################################################################################ … … 65 133 # 66 134 # The code in this FV handles the initial firmware startup, and 67 # decompresses the MAINFV which handles the majorityof the boot sequence.135 # decompresses the PEI and DXE FVs which handles the rest of the boot sequence. 68 136 # 69 137 INF OvmfPkg/Sec/SecMain.inf 70 138 71 INF RuleOverride=RESET_VECTOR UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf72 73 ################################################################################ 74 [FV. MAINFV]139 INF RuleOverride=RESET_VECTOR OvmfPkg/ResetVector/ResetVector.inf 140 141 ################################################################################ 142 [FV.PEIFV] 75 143 BlockSize = 0x10000 76 144 FvAlignment = 16 … … 91 159 READ_LOCK_STATUS = TRUE 92 160 93 #94 # Files to be placed in MAIN FV95 #96 # This firmware volume will have files placed in it uncompressed,97 # and then then entire firmware volume will be compressed in a98 # single compression operation in order to achieve better99 # overall compression.100 #101 102 161 APRIORI PEI { 103 162 INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf … … 112 171 INF OvmfPkg/PlatformPei/PlatformPei.inf 113 172 INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf 114 115 FILE FV_IMAGE = A4EF5A93-3F1B-4232-A1C4-F0910E6D1D9C { 116 SECTION COMPRESS PI_NONE { 117 SECTION FV_IMAGE = DXEFV 118 } 119 } 173 INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf 120 174 121 175 ################################################################################ … … 141 195 142 196 APRIORI DXE { 197 INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 143 198 INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf 199 INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 144 200 } 145 201 … … 166 222 167 223 INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf 224 !ifndef $(VBOX) 225 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf 226 INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf 227 INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf 228 INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf 229 !endif 168 230 INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf 231 !ifndef $(VBOX) 169 232 INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf 170 !ifndef $(VBOX) 171 INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 233 !if $(SECURE_BOOT_ENABLE) == TRUE 234 INF SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf 235 INF OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 236 !else 237 INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 238 !endif 172 239 !else 173 240 INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf … … 194 261 INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 195 262 INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 263 INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 196 264 INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf 197 265 … … 225 293 INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf 226 294 295 !ifndef $(VBOX) 296 INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 297 INF RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf 298 INF OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 299 INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf 300 INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf 301 !else 227 302 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 228 303 INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf 229 !ifndef $(VBOX)230 INF RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf231 304 !endif 232 305 233 306 INF RuleOverride = BINARY FatBinPkg/EnhancedFatDxe/Fat.inf 234 307 235 !if $(BUILD_NEW_SHELL)308 !ifndef $(USE_OLD_SHELL) 236 309 INF ShellPkg/Application/Shell/Shell.inf 237 310 !else 238 !if $(USE_NEW_SHELL)239 INF RuleOverride = BINARY ShellBinPkg/UefiShell/UefiShell.inf240 !else241 311 INF RuleOverride = BINARY EdkShellBinPkg/FullShell/FullShell.inf 242 !endif243 312 !endif 244 313 … … 258 327 # Network modules 259 328 # 260 !if $(NETWORK_ENABLE) 329 !ifndef $(VBOX) 330 !if $(E1000_ENABLE) 261 331 FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 { 262 332 SECTION PE32 = Intel3.5/EFIX64/E3507X2.EFI 263 333 } 334 !endif 264 335 INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf 265 336 INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf … … 275 346 INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf 276 347 INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf 348 INF OvmfPkg/VirtioNetDxe/VirtioNet.inf 277 349 !endif 278 350 … … 293 365 INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf 294 366 !endif 367 368 !ifndef $(VBOX) 369 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf 370 !endif 371 INF OvmfPkg/PlatformDxe/Platform.inf 295 372 296 373 ################################################################################ … … 316 393 FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { 317 394 SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { 318 SECTION FV_IMAGE = MAINFV 395 # 396 # These firmware volumes will have files placed in them uncompressed, 397 # and then both firmware volumes will be compressed in a single 398 # compression operation in order to achieve better overall compression. 399 # 400 SECTION FV_IMAGE = PEIFV 401 SECTION FV_IMAGE = DXEFV 319 402 } 320 403 } … … 382 465 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) 383 466 } 384 467 385 468 [Rule.Common.UEFI_APPLICATION] 386 469 FILE APPLICATION = $(NAMED_GUID) { … … 396 479 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) 397 480 } 398 481 399 482 [Rule.Common.USER_DEFINED.ACPITABLE] 400 483 FILE FREEFORM = $(NAMED_GUID) { … … 410 493 [Rule.Common.SEC.RESET_VECTOR] 411 494 FILE RAW = $(NAMED_GUID) { 412 RAW RAW |.raw 413 } 414 415 !ifndef $(VBOX) 416 [OptionRom.OvmfVideo] 417 INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf { 418 PCI_DEVICE_ID = 0x00B8 419 } 420 !endif 495 RAW BIN Align = 16 |.bin 496 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Fv.c
r48674 r58459 2 2 Build FV related hobs for platform. 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 14 14 15 15 #include "PiPei.h" 16 #include "Platform.h" 16 17 #include <Library/DebugLib.h> 17 18 #include <Library/HobLib.h> … … 21 22 22 23 /** 23 Perform a call-back into the SEC simulator to get address of the Firmware Hub 24 25 @param FfsHeader Ffs Header availible to every PEIM 26 @param PeiServices General purpose services available to every PEIM. 24 Publish PEI & DXE (Decompressed) Memory based FVs to let PEI 25 and DXE know about them. 27 26 28 27 @retval EFI_SUCCESS Platform PEI FVs were initialized successfully. … … 34 33 ) 35 34 { 36 DEBUG ((EFI_D_ ERROR, "Platform PEI Firmware Volume Initialization\n"));35 DEBUG ((EFI_D_INFO, "Platform PEI Firmware Volume Initialization\n")); 37 36 38 DEBUG ( 39 (EFI_D_ERROR, "Firmware Volume HOB: 0x%x 0x%x\n", 40 PcdGet32 (PcdOvmfMemFvBase), 41 PcdGet32 (PcdOvmfMemFvSize) 42 ) 37 // 38 // Create a memory allocation HOB for the PEI FV. 39 // 40 // Allocate as ACPI NVS is S3 is supported 41 // 42 BuildMemoryAllocationHob ( 43 PcdGet32 (PcdOvmfPeiMemFvBase), 44 PcdGet32 (PcdOvmfPeiMemFvSize), 45 mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData 43 46 ); 44 47 45 BuildFvHob (PcdGet32 (PcdOvmfMemFvBase), PcdGet32 (PcdOvmfMemFvSize)); 48 // 49 // Let DXE know about the DXE FV 50 // 51 BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize)); 46 52 47 53 // 48 // Create a memory allocation HOB .54 // Create a memory allocation HOB for the DXE FV. 49 55 // 50 56 BuildMemoryAllocationHob ( 51 PcdGet32 (PcdOvmf MemFvBase),52 PcdGet32 (PcdOvmf MemFvSize),57 PcdGet32 (PcdOvmfDxeMemFvBase), 58 PcdGet32 (PcdOvmfDxeMemFvSize), 53 59 EfiBootServicesData 60 ); 61 62 // 63 // Let PEI know about the DXE FV so it can find the DXE Core 64 // 65 PeiServicesInstallFvInfoPpi ( 66 NULL, 67 (VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase), 68 PcdGet32 (PcdOvmfDxeMemFvSize), 69 NULL, 70 NULL 54 71 ); 55 72 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/MemDetect.c
r58173 r58459 2 2 Memory Detection for Virtual Machines. 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 25 25 // The Library classes this module consumes 26 26 // 27 #include <Library/BaseMemoryLib.h> 27 28 #include <Library/DebugLib.h> 28 29 #include <Library/HobLib.h> … … 36 37 #include "Cmos.h" 37 38 38 STATIC 39 UINTN 39 UINT32 40 40 GetSystemMemorySizeBelow4gb ( 41 VOID 41 42 ) 42 43 { … … 84 85 } 85 86 86 87 87 /** 88 P eform Memory Detection88 Publish PEI core memory 89 89 90 90 @return EFI_SUCCESS The PEIM initialized successfully. 91 91 92 92 **/ 93 EFI_PHYSICAL_ADDRESS 94 MemDetect ( 93 EFI_STATUS 94 PublishPeiMemory ( 95 VOID 95 96 ) 96 97 { … … 99 100 UINT64 MemorySize; 100 101 UINT64 LowerMemorySize; 101 UINT64 UpperMemorySize; 102 103 DEBUG ((EFI_D_ERROR, "MemDetect called\n")); 104 105 // 106 // Determine total memory size available 107 // 108 LowerMemorySize = GetSystemMemorySizeBelow4gb (); 109 UpperMemorySize = GetSystemMemorySizeAbove4gb (); 110 111 // 112 // Determine the range of memory to use during PEI 113 // 114 MemoryBase = PcdGet32 (PcdOvmfMemFvBase) + PcdGet32 (PcdOvmfMemFvSize); 115 MemorySize = LowerMemorySize - MemoryBase; 116 if (MemorySize > SIZE_64MB) { 117 MemoryBase = LowerMemorySize - SIZE_64MB; 118 MemorySize = SIZE_64MB; 102 103 if (mBootMode == BOOT_ON_S3_RESUME) { 104 MemoryBase = PcdGet32 (PcdS3AcpiReservedMemoryBase); 105 MemorySize = PcdGet32 (PcdS3AcpiReservedMemorySize); 106 } else { 107 LowerMemorySize = GetSystemMemorySizeBelow4gb (); 108 109 // 110 // Determine the range of memory to use during PEI 111 // 112 MemoryBase = PcdGet32 (PcdOvmfDxeMemFvBase) + PcdGet32 (PcdOvmfDxeMemFvSize); 113 MemorySize = LowerMemorySize - MemoryBase; 114 if (MemorySize > SIZE_64MB) { 115 MemoryBase = LowerMemorySize - SIZE_64MB; 116 MemorySize = SIZE_64MB; 117 } 119 118 } 120 119 #ifdef VBOX … … 128 127 ASSERT_EFI_ERROR (Status); 129 128 129 return Status; 130 } 131 132 133 #ifndef VBOX 134 /** 135 Peform Memory Detection for QEMU / KVM 136 137 **/ 138 STATIC 139 VOID 140 QemuInitializeRam ( 141 VOID 142 ) 143 { 144 UINT64 LowerMemorySize; 145 UINT64 UpperMemorySize; 146 147 DEBUG ((EFI_D_INFO, "%a called\n", __FUNCTION__)); 148 149 // 150 // Determine total memory size available 151 // 152 LowerMemorySize = GetSystemMemorySizeBelow4gb (); 153 UpperMemorySize = GetSystemMemorySizeAbove4gb (); 154 155 if (mBootMode != BOOT_ON_S3_RESUME) { 156 // 157 // Create memory HOBs 158 // 159 AddMemoryRangeHob (BASE_1MB, LowerMemorySize); 160 AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); 161 } 162 163 MtrrSetMemoryAttribute (BASE_1MB, LowerMemorySize - BASE_1MB, CacheWriteBack); 164 165 MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack); 166 167 if (UpperMemorySize != 0) { 168 if (mBootMode != BOOT_ON_S3_RESUME) { 169 AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); 170 } 171 172 MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack); 173 } 174 } 175 #else 176 VOID 177 VBoxInitializeRam ( 178 VOID 179 ) 180 { 181 UINT64 LowerMemorySize; 182 UINT64 UpperMemorySize; 183 EFI_PHYSICAL_ADDRESS MemoryBase; 184 UINT64 MemorySize; 185 186 DEBUG ((EFI_D_INFO, "%a called\n", __FUNCTION__)); 187 188 // 189 // Determine total memory size available 190 // 191 LowerMemorySize = GetSystemMemorySizeBelow4gb (); 192 UpperMemorySize = GetSystemMemorySizeAbove4gb (); 193 194 if (mBootMode == BOOT_ON_S3_RESUME) { 195 MemoryBase = PcdGet32 (PcdS3AcpiReservedMemoryBase); 196 MemorySize = PcdGet32 (PcdS3AcpiReservedMemorySize); 197 } else { 198 LowerMemorySize = GetSystemMemorySizeBelow4gb (); 199 200 // 201 // Determine the range of memory to use during PEI 202 // 203 MemoryBase = PcdGet32 (PcdOvmfDxeMemFvBase) + PcdGet32 (PcdOvmfDxeMemFvSize); 204 MemorySize = LowerMemorySize - MemoryBase; 205 if (MemorySize > SIZE_64MB) { 206 MemoryBase = LowerMemorySize - SIZE_64MB; 207 MemorySize = SIZE_64MB; 208 } 209 } 210 MemorySize -= BASE_64KB; /* Reserves 64KB for ACPI tables. */ 211 130 212 // 131 213 // Create memory HOBs … … 133 215 AddMemoryBaseSizeHob (MemoryBase, MemorySize); 134 216 AddMemoryRangeHob (BASE_1MB, MemoryBase); 217 MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, CacheWriteBack); 218 AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); 219 MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack); 220 221 if (UpperMemorySize != 0) { 222 AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); 223 224 MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack); 225 } 226 } 227 #endif 228 229 /** 230 Publish system RAM and reserve memory regions 231 232 **/ 233 VOID 234 InitializeRamRegions ( 235 VOID 236 ) 237 { 135 238 #ifndef VBOX 136 AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); 239 if (!mXen) { 240 QemuInitializeRam (); 241 } else { 242 XenPublishRamRegions (); 243 } 244 #else 245 VBoxInitializeRam(); 137 246 #endif 138 247 139 MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, CacheWriteBack); 140 141 #ifdef VBOX 142 AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); 248 if (mS3Supported && mBootMode != BOOT_ON_S3_RESUME) { 249 // 250 // This is the memory range that will be used for PEI on S3 resume 251 // 252 BuildMemoryAllocationHob ( 253 (EFI_PHYSICAL_ADDRESS)(UINTN) PcdGet32 (PcdS3AcpiReservedMemoryBase), 254 (UINT64)(UINTN) PcdGet32 (PcdS3AcpiReservedMemorySize), 255 EfiACPIMemoryNVS 256 ); 257 258 // 259 // Cover the initial RAM area used as stack and temporary PEI heap. 260 // 261 // This is reserved as ACPI NVS so it can be used on S3 resume. 262 // 263 BuildMemoryAllocationHob ( 264 PcdGet32 (PcdOvmfSecPeiTempRamBase), 265 PcdGet32 (PcdOvmfSecPeiTempRamSize), 266 EfiACPIMemoryNVS 267 ); 268 269 // 270 // SEC stores its table of GUIDed section handlers here. 271 // 272 BuildMemoryAllocationHob ( 273 PcdGet64 (PcdGuidedExtractHandlerTableAddress), 274 PcdGet32 (PcdGuidedExtractHandlerTableSize), 275 EfiACPIMemoryNVS 276 ); 277 278 #ifdef MDE_CPU_X64 279 // 280 // Reserve the initial page tables built by the reset vector code. 281 // 282 // Since this memory range will be used by the Reset Vector on S3 283 // resume, it must be reserved as ACPI NVS. 284 // 285 BuildMemoryAllocationHob ( 286 (EFI_PHYSICAL_ADDRESS)(UINTN) PcdGet32 (PcdOvmfSecPageTablesBase), 287 (UINT64)(UINTN) PcdGet32 (PcdOvmfSecPageTablesSize), 288 EfiACPIMemoryNVS 289 ); 143 290 #endif 144 MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack); 145 146 if (UpperMemorySize != 0) { 147 AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); 148 149 MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack); 150 } 151 152 return MemoryBase + MemorySize; 153 } 154 291 } 292 293 if (mBootMode != BOOT_ON_S3_RESUME) { 294 // 295 // Reserve the lock box storage area 296 // 297 // Since this memory range will be used on S3 resume, it must be 298 // reserved as ACPI NVS. 299 // 300 // If S3 is unsupported, then various drivers might still write to the 301 // LockBox area. We ought to prevent DXE from serving allocation requests 302 // such that they would overlap the LockBox storage. 303 // 304 ZeroMem ( 305 (VOID*)(UINTN) PcdGet32 (PcdOvmfLockBoxStorageBase), 306 (UINTN) PcdGet32 (PcdOvmfLockBoxStorageSize) 307 ); 308 BuildMemoryAllocationHob ( 309 (EFI_PHYSICAL_ADDRESS)(UINTN) PcdGet32 (PcdOvmfLockBoxStorageBase), 310 (UINT64)(UINTN) PcdGet32 (PcdOvmfLockBoxStorageSize), 311 mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData 312 ); 313 } 314 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.c
r58174 r58459 2 2 Platform PEI driver 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 Copyright (c) 2011, Andrei Warkentin <[email protected]> 6 6 … … 31 31 #include <Library/PeimEntryPoint.h> 32 32 #include <Library/PeiServicesLib.h> 33 #include <Library/QemuFwCfgLib.h> 33 34 #include <Library/ResourcePublicationLib.h> 34 35 #include <Guid/MemoryTypeInformation.h> 35 36 #include <Ppi/MasterBootMode.h> 37 #include <IndustryStandard/Pci22.h> 36 38 37 39 #include "Platform.h" … … 59 61 60 62 63 EFI_BOOT_MODE mBootMode = BOOT_WITH_FULL_CONFIGURATION; 64 65 BOOLEAN mS3Supported = FALSE; 66 67 61 68 VOID 62 69 AddIoMemoryBaseSizeHob ( … … 210 217 } 211 218 212 213 219 VOID 214 220 MemMapInitialization ( 215 EFI_PHYSICAL_ADDRESS TopOfMemory221 VOID 216 222 ) 217 223 { … … 241 247 242 248 // 243 // Add PCI MMIO space available to PCI resource allocations244 //245 if (TopOfMemory < BASE_2GB) {246 AddIoMemoryBaseSizeHob (BASE_2GB, 0xFC000000 - BASE_2GB);247 } else {248 AddIoMemoryBaseSizeHob (TopOfMemory, 0xFC000000 - TopOfMemory);249 }250 251 //252 // Local APIC range253 //254 AddIoMemoryBaseSizeHob (0xFEC80000, SIZE_512KB);255 256 //257 // I/O APIC range258 //259 AddIoMemoryBaseSizeHob (0xFEC00000, SIZE_512KB);260 261 //262 249 // Video memory + Legacy BIOS region 263 250 #ifdef VBOX … … 267 254 AddIoMemoryRangeHob (0x0A0000, BASE_1MB); 268 255 256 if (!mXen) { 257 UINT32 TopOfLowRam; 258 TopOfLowRam = GetSystemMemorySizeBelow4gb (); 259 260 // 261 // address purpose size 262 // ------------ -------- ------------------------- 263 // max(top, 2g) PCI MMIO 0xFC000000 - max(top, 2g) 264 // 0xFC000000 gap 44 MB 265 // 0xFEC00000 IO-APIC 4 KB 266 // 0xFEC01000 gap 1020 KB 267 // 0xFED00000 HPET 1 KB 268 // 0xFED00400 gap 1023 KB 269 // 0xFEE00000 LAPIC 1 MB 270 // 271 AddIoMemoryRangeHob (TopOfLowRam < BASE_2GB ? 272 BASE_2GB : TopOfLowRam, 0xFC000000); 273 AddIoMemoryBaseSizeHob (0xFEC00000, SIZE_4KB); 274 AddIoMemoryBaseSizeHob (0xFED00000, SIZE_1KB); 275 AddIoMemoryBaseSizeHob (PcdGet32(PcdCpuLocalApicBaseAddress), SIZE_1MB); 276 } 277 269 278 #ifdef VBOX 270 279 // … … 284 293 VOID 285 294 MiscInitialization ( 286 BOOLEAN Xen295 VOID 287 296 ) 288 297 { … … 297 306 BuildCpuHob (36, 16); 298 307 299 if (!Xen) { 300 // 301 // Set the PM I/O base address to 0x400 302 // 303 PciAndThenOr32 (PCI_LIB_ADDRESS (0, 1, 3, 0x40), (UINT32) ~0xfc0, 0x400); 308 // 309 // If PMREGMISC/PMIOSE is set, assume the ACPI PMBA has been configured (for 310 // example by Xen) and skip the setup here. This matches the logic in 311 // AcpiTimerLibConstructor (). 312 // 313 if ((PciRead8 (PCI_LIB_ADDRESS (0, 1, 3, 0x80)) & 0x01) == 0) { 314 // 315 // The PEI phase should be exited with fully accessibe PIIX4 IO space: 316 // 1. set PMBA 317 // 318 PciAndThenOr32 ( 319 PCI_LIB_ADDRESS (0, 1, 3, 0x40), 320 (UINT32) ~0xFFC0, 321 PcdGet16 (PcdAcpiPmBaseAddress) 322 ); 323 324 // 325 // 2. set PCICMD/IOSE 326 // 327 PciOr8 ( 328 PCI_LIB_ADDRESS (0, 1, 3, PCI_COMMAND_OFFSET), 329 EFI_PCI_COMMAND_IO_SPACE 330 ); 331 332 // 333 // 3. set PMREGMISC/PMIOSE 334 // 335 PciOr8 (PCI_LIB_ADDRESS (0, 1, 3, 0x80), 0x01); 304 336 } 305 337 } … … 308 340 VOID 309 341 BootModeInitialization ( 310 ) 311 { 312 EFI_STATUS Status; 313 314 Status = PeiServicesSetBootMode (BOOT_WITH_FULL_CONFIGURATION); 342 VOID 343 ) 344 { 345 EFI_STATUS Status; 346 347 if (CmosRead8 (0xF) == 0xFE) { 348 mBootMode = BOOT_ON_S3_RESUME; 349 } 350 351 Status = PeiServicesSetBootMode (mBootMode); 315 352 ASSERT_EFI_ERROR (Status); 316 353 … … 334 371 VariableStore = 335 372 (EFI_PHYSICAL_ADDRESS)(UINTN) 336 AllocateRuntimePool ( 337 2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize) 373 AllocateAlignedRuntimePages ( 374 EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)), 375 PcdGet32 (PcdFlashNvStorageFtwSpareSize) 338 376 ); 339 377 DEBUG ((EFI_D_INFO, … … 383 421 ) 384 422 { 385 #ifndef VBOX386 EFI_STATUS Status;387 #endif388 EFI_PHYSICAL_ADDRESS TopOfMemory;389 BOOLEAN Xen;390 391 423 DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n")); 392 424 393 425 DebugDumpCmos (); 394 426 395 TopOfMemory = MemDetect (); 396 397 #ifndef VBOX 398 Status = InitializeXen (); 399 Xen = EFI_ERROR (Status) ? FALSE : TRUE; 400 #else 401 Xen = FALSE; 402 #endif 403 404 ReserveEmuVariableNvStore (); 405 406 PeiFvInitialization (); 407 408 MemMapInitialization (TopOfMemory); 409 410 MiscInitialization (Xen); 427 XenDetect (); 428 429 if (QemuFwCfgS3Enabled ()) { 430 DEBUG ((EFI_D_INFO, "S3 support was detected on QEMU\n")); 431 mS3Supported = TRUE; 432 } 411 433 412 434 BootModeInitialization (); 413 435 436 PublishPeiMemory (); 437 438 InitializeRamRegions (); 439 440 if (mXen) { 441 DEBUG ((EFI_D_INFO, "Xen was detected\n")); 442 InitializeXen (); 443 } 444 445 if (mBootMode != BOOT_ON_S3_RESUME) { 446 ReserveEmuVariableNvStore (); 447 448 PeiFvInitialization (); 449 450 MemMapInitialization (); 451 } 452 453 MiscInitialization (); 454 414 455 return EFI_SUCCESS; 415 456 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.h
r48674 r58459 2 2 Platform PEI module include file. 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 15 15 #ifndef _PLATFORM_PEI_H_INCLUDED_ 16 16 #define _PLATFORM_PEI_H_INCLUDED_ 17 18 #include <IndustryStandard/E820.h> 17 19 18 20 VOID … … 58 60 ); 59 61 60 EFI_PHYSICAL_ADDRESS 61 MemDetect ( 62 EFI_STATUS 63 PublishPeiMemory ( 64 VOID 65 ); 66 67 UINT32 68 GetSystemMemorySizeBelow4gb ( 69 VOID 70 ); 71 72 VOID 73 InitializeRamRegions ( 62 74 VOID 63 75 ); … … 73 85 ); 74 86 87 BOOLEAN 88 XenDetect ( 89 VOID 90 ); 91 92 extern BOOLEAN mXen; 93 94 VOID 95 XenPublishRamRegions ( 96 VOID 97 ); 98 99 extern EFI_BOOT_MODE mBootMode; 100 101 extern BOOLEAN mS3Supported; 102 75 103 #endif // _PLATFORM_PEI_H_INCLUDED_ -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/PlatformPei.inf
r48674 r58459 3 3 # 4 4 # This module provides platform specific function to detect boot mode. 5 # Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>5 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 6 6 # 7 7 # This program and the accompanying materials … … 37 37 38 38 [Packages] 39 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec 39 40 MdePkg/MdePkg.dec 40 41 MdeModulePkg/MdeModulePkg.dec … … 55 56 PeiServicesTablePointerLib 56 57 PeimEntryPoint 58 QemuFwCfgLib 57 59 MtrrLib 60 PcdLib 58 61 59 62 [Pcd] 60 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase 61 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize 63 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase 64 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize 65 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase 66 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize 67 gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress 68 gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase 69 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase 70 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize 71 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase 72 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize 73 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase 74 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize 75 gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize 76 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize 77 gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress 62 78 gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize 63 79 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize 64 80 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize 65 81 gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved 82 gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration 83 gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress 66 84 67 85 [Ppis] -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Xen.c
r48674 r58459 2 2 Xen Platform PEI support 3 3 4 Copyright (c) 2006 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 Copyright (c) 2011, Andrei Warkentin <[email protected]> 6 6 … … 28 28 #include <Library/PcdLib.h> 29 29 #include <Guid/XenInfo.h> 30 #include <IndustryStandard/E820.h> 31 #include <Library/ResourcePublicationLib.h> 32 #include <Library/MtrrLib.h> 30 33 31 34 #include "Platform.h" 35 #include "Xen.h" 36 37 BOOLEAN mXen = FALSE; 38 39 STATIC UINT32 mXenLeaf = 0; 32 40 33 41 EFI_XEN_INFO mXenInfo; 34 42 43 /** 44 Returns E820 map provided by Xen 45 46 @param Entries Pointer to E820 map 47 @param Count Number of entries 48 49 @return EFI_STATUS 50 **/ 51 EFI_STATUS 52 XenGetE820Map ( 53 EFI_E820_ENTRY64 **Entries, 54 UINT32 *Count 55 ) 56 { 57 EFI_XEN_OVMF_INFO *Info = 58 (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS; 59 60 if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) { 61 return EFI_NOT_FOUND; 62 } 63 64 ASSERT (Info->E820 < MAX_ADDRESS); 65 *Entries = (EFI_E820_ENTRY64 *)(UINTN) Info->E820; 66 *Count = Info->E820EntriesCount; 67 68 return EFI_SUCCESS; 69 } 35 70 36 71 /** … … 85 120 Figures out if we are running inside Xen HVM. 86 121 87 @return UINT32 CPUID index used to connect to HV. 88 89 **/ 90 UINT32 122 @retval TRUE Xen was detected 123 @retval FALSE Xen was not detected 124 125 **/ 126 BOOLEAN 91 127 XenDetect ( 92 128 VOID 93 129 ) 94 130 { 95 96 UINT32 XenLeaf;97 131 UINT8 Signature[13]; 98 132 99 for (XenLeaf = 0x40000000; XenLeaf < 0x40010000; XenLeaf += 0x100) { 100 AsmCpuid (XenLeaf, NULL, (UINT32 *) &Signature[0], 133 if (mXenLeaf != 0) { 134 return TRUE; 135 } 136 137 Signature[12] = '\0'; 138 for (mXenLeaf = 0x40000000; mXenLeaf < 0x40010000; mXenLeaf += 0x100) { 139 AsmCpuid (mXenLeaf, 140 NULL, 141 (UINT32 *) &Signature[0], 101 142 (UINT32 *) &Signature[4], 102 143 (UINT32 *) &Signature[8]); 103 Signature[12] = '\0';104 144 105 145 if (!AsciiStrCmp ((CHAR8 *) Signature, "XenVMMXenVMM")) { 106 return XenLeaf; 146 mXen = TRUE; 147 return TRUE; 107 148 } 108 149 } 109 150 110 return 0; 111 } 151 mXenLeaf = 0; 152 return FALSE; 153 } 154 155 156 VOID 157 XenPublishRamRegions ( 158 VOID 159 ) 160 { 161 EFI_E820_ENTRY64 *E820Map; 162 UINT32 E820EntriesCount; 163 EFI_STATUS Status; 164 165 if (!mXen) { 166 return; 167 } 168 169 DEBUG ((EFI_D_INFO, "Using memory map provided by Xen\n")); 170 171 // 172 // Parse RAM in E820 map 173 // 174 Status = XenGetE820Map (&E820Map, &E820EntriesCount); 175 176 ASSERT_EFI_ERROR (Status); 177 178 if (E820EntriesCount > 0) { 179 EFI_E820_ENTRY64 *Entry; 180 UINT32 Loop; 181 182 for (Loop = 0; Loop < E820EntriesCount; Loop++) { 183 Entry = E820Map + Loop; 184 185 // 186 // Only care about RAM 187 // 188 if (Entry->Type != EfiAcpiAddressRangeMemory) { 189 continue; 190 } 191 192 if (Entry->BaseAddr >= BASE_4GB) { 193 AddUntestedMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length); 194 } else { 195 AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length); 196 } 197 198 MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBack); 199 } 200 } 201 } 202 112 203 113 204 /** … … 123 214 ) 124 215 { 125 UINT32 XenLeaf; 126 127 XenLeaf = XenDetect (); 128 129 if (XenLeaf == 0) { 216 if (mXenLeaf == 0) { 130 217 return EFI_NOT_FOUND; 131 218 } 132 219 133 DEBUG ((EFI_D_INFO, "Xen was detected\n")); 134 135 XenConnect (XenLeaf); 220 XenConnect (mXenLeaf); 136 221 137 222 // … … 141 226 AddReservedMemoryBaseSizeHob (0xFC000000, 0x1000000); 142 227 228 PcdSetBool (PcdPciDisableBusEnumeration, TRUE); 229 143 230 return EFI_SUCCESS; 144 231 } -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuVideoDxe/Driver.c
r48674 r58459 16 16 17 17 #include "Qemu.h" 18 #include <IndustryStandard/Acpi.h> 18 19 19 20 EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = { … … 26 27 }; 27 28 29 QEMU_VIDEO_CARD gQemuVideoCardList[] = { 30 { 31 CIRRUS_LOGIC_VENDOR_ID, 32 CIRRUS_LOGIC_5430_DEVICE_ID, 33 QEMU_VIDEO_CIRRUS_5430, 34 L"Cirrus 5430" 35 },{ 36 CIRRUS_LOGIC_VENDOR_ID, 37 CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID, 38 QEMU_VIDEO_CIRRUS_5430, 39 L"Cirrus 5430" 40 },{ 41 CIRRUS_LOGIC_VENDOR_ID, 42 CIRRUS_LOGIC_5446_DEVICE_ID, 43 QEMU_VIDEO_CIRRUS_5446, 44 L"Cirrus 5446" 45 },{ 46 0x1234, 47 0x1111, 48 QEMU_VIDEO_BOCHS_MMIO, 49 L"QEMU Standard VGA" 50 },{ 51 0x1b36, 52 0x0100, 53 QEMU_VIDEO_BOCHS, 54 L"QEMU QXL VGA" 55 },{ 56 0 /* end of list */ 57 } 58 }; 59 60 static QEMU_VIDEO_CARD* 61 QemuVideoDetect( 62 IN UINT16 VendorId, 63 IN UINT16 DeviceId 64 ) 65 { 66 UINTN Index = 0; 67 68 while (gQemuVideoCardList[Index].VendorId != 0) { 69 if (gQemuVideoCardList[Index].VendorId == VendorId && 70 gQemuVideoCardList[Index].DeviceId == DeviceId) { 71 return gQemuVideoCardList + Index; 72 } 73 Index++; 74 } 75 return NULL; 76 } 77 28 78 /** 29 79 Check if this device is supported. … … 48 98 EFI_PCI_IO_PROTOCOL *PciIo; 49 99 PCI_TYPE00 Pci; 50 EFI_DEV_PATH *Node;100 QEMU_VIDEO_CARD *Card; 51 101 52 102 // … … 80 130 81 131 Status = EFI_UNSUPPORTED; 82 // 83 // See if the I/O enable is on. Most systems only allow one VGA device to be turned on 84 // at a time, so see if this is one that is turned on. 85 // 86 // if (((Pci.Hdr.Command & 0x01) == 0x01)) { 87 // 88 // See if this is a Cirrus Logic PCI controller 89 // 90 if (Pci.Hdr.VendorId == CIRRUS_LOGIC_VENDOR_ID) { 91 // 92 // See if this is a 5430 or a 5446 PCI controller 93 // 94 if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID || 95 Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID || 96 Pci.Hdr.DeviceId == CIRRUS_LOGIC_5446_DEVICE_ID) { 97 98 Status = EFI_SUCCESS; 99 // 100 // If this is an Intel 945 graphics controller, 101 // go further check RemainingDevicePath validation 102 // 103 if (RemainingDevicePath != NULL) { 104 Node = (EFI_DEV_PATH *) RemainingDevicePath; 105 // 106 // Check if RemainingDevicePath is the End of Device Path Node, 107 // if yes, return EFI_SUCCESS 108 // 109 if (!IsDevicePathEnd (Node)) { 110 // 111 // If RemainingDevicePath isn't the End of Device Path Node, 112 // check its validation 113 // 114 if (Node->DevPath.Type != ACPI_DEVICE_PATH || 115 Node->DevPath.SubType != ACPI_ADR_DP || 116 DevicePathNodeLength(&Node->DevPath) != sizeof(ACPI_ADR_DEVICE_PATH)) { 117 Status = EFI_UNSUPPORTED; 118 } 119 } 120 } 121 } 132 Card = QemuVideoDetect(Pci.Hdr.VendorId, Pci.Hdr.DeviceId); 133 if (Card != NULL) { 134 DEBUG ((EFI_D_INFO, "QemuVideo: %s detected\n", Card->Name)); 135 Status = EFI_SUCCESS; 122 136 } 123 137 … … 157 171 ) 158 172 { 159 EFI_STATUS Status; 160 QEMU_VIDEO_PRIVATE_DATA *Private; 161 BOOLEAN PciAttributesSaved; 162 EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; 163 ACPI_ADR_DEVICE_PATH AcpiDeviceNode; 164 165 PciAttributesSaved = FALSE; 173 EFI_TPL OldTpl; 174 EFI_STATUS Status; 175 QEMU_VIDEO_PRIVATE_DATA *Private; 176 BOOLEAN IsQxl; 177 EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; 178 ACPI_ADR_DEVICE_PATH AcpiDeviceNode; 179 PCI_TYPE00 Pci; 180 QEMU_VIDEO_CARD *Card; 181 EFI_PCI_IO_PROTOCOL *ChildPciIo; 182 183 OldTpl = gBS->RaiseTPL (TPL_CALLBACK); 184 166 185 // 167 186 // Allocate Private context data for GOP inteface. … … 170 189 if (Private == NULL) { 171 190 Status = EFI_OUT_OF_RESOURCES; 172 goto Error;191 goto RestoreTpl; 173 192 } 174 193 … … 177 196 // 178 197 Private->Signature = QEMU_VIDEO_PRIVATE_DATA_SIGNATURE; 179 Private->Handle = NULL;180 198 181 199 // … … 191 209 ); 192 210 if (EFI_ERROR (Status)) { 193 goto Error; 194 } 211 goto FreePrivate; 212 } 213 214 // 215 // Read the PCI Configuration Header from the PCI Device 216 // 217 Status = Private->PciIo->Pci.Read ( 218 Private->PciIo, 219 EfiPciIoWidthUint32, 220 0, 221 sizeof (Pci) / sizeof (UINT32), 222 &Pci 223 ); 224 if (EFI_ERROR (Status)) { 225 goto ClosePciIo; 226 } 227 228 // 229 // Determine card variant. 230 // 231 Card = QemuVideoDetect(Pci.Hdr.VendorId, Pci.Hdr.DeviceId); 232 if (Card == NULL) { 233 Status = EFI_DEVICE_ERROR; 234 goto ClosePciIo; 235 } 236 Private->Variant = Card->Variant; 237 238 // 239 // IsQxl is based on the detected Card->Variant, which at a later point might 240 // not match Private->Variant. 241 // 242 IsQxl = (BOOLEAN)(Card->Variant == QEMU_VIDEO_BOCHS); 195 243 196 244 // … … 205 253 206 254 if (EFI_ERROR (Status)) { 207 goto Error; 208 } 209 PciAttributesSaved = TRUE; 210 255 goto ClosePciIo; 256 } 257 258 // 259 // Set new PCI attributes 260 // 211 261 Status = Private->PciIo->Attributes ( 212 262 Private->PciIo, … … 216 266 ); 217 267 if (EFI_ERROR (Status)) { 218 goto Error; 268 goto ClosePciIo; 269 } 270 271 // 272 // Check whenever the qemu stdvga mmio bar is present (qemu 1.3+). 273 // 274 if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO) { 275 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *MmioDesc; 276 277 Status = Private->PciIo->GetBarAttributes ( 278 Private->PciIo, 279 PCI_BAR_IDX2, 280 NULL, 281 (VOID**) &MmioDesc 282 ); 283 if (EFI_ERROR (Status) || 284 MmioDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_MEM) { 285 DEBUG ((EFI_D_INFO, "QemuVideo: No mmio bar, fallback to port io\n")); 286 Private->Variant = QEMU_VIDEO_BOCHS; 287 } else { 288 DEBUG ((EFI_D_INFO, "QemuVideo: Using mmio bar @ 0x%lx\n", 289 MmioDesc->AddrRangeMin)); 290 } 291 292 if (!EFI_ERROR (Status)) { 293 FreePool (MmioDesc); 294 } 295 } 296 297 // 298 // Check if accessing the bochs interface works. 299 // 300 if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO || 301 Private->Variant == QEMU_VIDEO_BOCHS) { 302 UINT16 BochsId; 303 BochsId = BochsRead(Private, VBE_DISPI_INDEX_ID); 304 if ((BochsId & 0xFFF0) != VBE_DISPI_ID0) { 305 DEBUG ((EFI_D_INFO, "QemuVideo: BochsID mismatch (got 0x%x)\n", BochsId)); 306 Status = EFI_DEVICE_ERROR; 307 goto RestoreAttributes; 308 } 219 309 } 220 310 … … 228 318 ); 229 319 if (EFI_ERROR (Status)) { 230 goto Error;320 goto RestoreAttributes; 231 321 } 232 322 … … 234 324 // Set Gop Device Path 235 325 // 236 if (RemainingDevicePath == NULL) { 237 ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH)); 238 AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH; 239 AcpiDeviceNode.Header.SubType = ACPI_ADR_DP; 240 AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0); 241 SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DEVICE_PATH)); 242 243 Private->GopDevicePath = AppendDevicePathNode ( 244 ParentDevicePath, 245 (EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode 246 ); 247 } else if (!IsDevicePathEnd (RemainingDevicePath)) { 248 // 249 // If RemainingDevicePath isn't the End of Device Path Node, 250 // only scan the specified device by RemainingDevicePath 251 // 252 Private->GopDevicePath = AppendDevicePathNode (ParentDevicePath, RemainingDevicePath); 253 } else { 254 // 255 // If RemainingDevicePath is the End of Device Path Node, 256 // don't create child device and return EFI_SUCCESS 257 // 258 Private->GopDevicePath = NULL; 259 } 260 261 if (Private->GopDevicePath != NULL) { 262 // 263 // Creat child handle and device path protocol firstly 264 // 265 Private->Handle = NULL; 266 Status = gBS->InstallMultipleProtocolInterfaces ( 267 &Private->Handle, 268 &gEfiDevicePathProtocolGuid, 269 Private->GopDevicePath, 270 NULL 271 ); 326 ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH)); 327 AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH; 328 AcpiDeviceNode.Header.SubType = ACPI_ADR_DP; 329 AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0); 330 SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DEVICE_PATH)); 331 332 Private->GopDevicePath = AppendDevicePathNode ( 333 ParentDevicePath, 334 (EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode 335 ); 336 if (Private->GopDevicePath == NULL) { 337 Status = EFI_OUT_OF_RESOURCES; 338 goto RestoreAttributes; 339 } 340 341 // 342 // Create new child handle and install the device path protocol on it. 343 // 344 Status = gBS->InstallMultipleProtocolInterfaces ( 345 &Private->Handle, 346 &gEfiDevicePathProtocolGuid, 347 Private->GopDevicePath, 348 NULL 349 ); 350 if (EFI_ERROR (Status)) { 351 goto FreeGopDevicePath; 272 352 } 273 353 … … 275 355 // Construct video mode buffer 276 356 // 277 Status = QemuVideoVideoModeSetup (Private); 278 if (EFI_ERROR (Status)) { 279 goto Error; 280 } 281 282 if (Private->GopDevicePath == NULL) { 283 // 284 // If RemainingDevicePath is the End of Device Path Node, 285 // don't create child device and return EFI_SUCCESS 286 // 287 Status = EFI_SUCCESS; 288 } else { 289 290 // 291 // Start the GOP software stack. 292 // 293 Status = QemuVideoGraphicsOutputConstructor (Private); 294 ASSERT_EFI_ERROR (Status); 295 296 Status = gBS->InstallMultipleProtocolInterfaces ( 297 &Private->Handle, 298 &gEfiGraphicsOutputProtocolGuid, 299 &Private->GraphicsOutput, 300 NULL 301 ); 302 } 303 304 Error: 305 if (EFI_ERROR (Status)) { 306 if (Private) { 307 if (Private->PciIo) { 308 if (PciAttributesSaved == TRUE) { 309 // 310 // Restore original PCI attributes 311 // 312 Private->PciIo->Attributes ( 313 Private->PciIo, 314 EfiPciIoAttributeOperationSet, 315 Private->OriginalPciAttributes, 316 NULL 317 ); 318 } 319 // 320 // Close the PCI I/O Protocol 321 // 322 gBS->CloseProtocol ( 323 Private->Handle, 324 &gEfiPciIoProtocolGuid, 325 This->DriverBindingHandle, 326 Private->Handle 327 ); 328 } 329 330 gBS->FreePool (Private); 331 } 332 } 357 switch (Private->Variant) { 358 case QEMU_VIDEO_CIRRUS_5430: 359 case QEMU_VIDEO_CIRRUS_5446: 360 Status = QemuVideoCirrusModeSetup (Private); 361 break; 362 case QEMU_VIDEO_BOCHS_MMIO: 363 case QEMU_VIDEO_BOCHS: 364 Status = QemuVideoBochsModeSetup (Private, IsQxl); 365 break; 366 default: 367 ASSERT (FALSE); 368 Status = EFI_DEVICE_ERROR; 369 break; 370 } 371 if (EFI_ERROR (Status)) { 372 goto UninstallGopDevicePath; 373 } 374 375 // 376 // Start the GOP software stack. 377 // 378 Status = QemuVideoGraphicsOutputConstructor (Private); 379 if (EFI_ERROR (Status)) { 380 goto FreeModeData; 381 } 382 383 Status = gBS->InstallMultipleProtocolInterfaces ( 384 &Private->Handle, 385 &gEfiGraphicsOutputProtocolGuid, 386 &Private->GraphicsOutput, 387 NULL 388 ); 389 if (EFI_ERROR (Status)) { 390 goto DestructQemuVideoGraphics; 391 } 392 393 // 394 // Reference parent handle from child handle. 395 // 396 Status = gBS->OpenProtocol ( 397 Controller, 398 &gEfiPciIoProtocolGuid, 399 (VOID **) &ChildPciIo, 400 This->DriverBindingHandle, 401 Private->Handle, 402 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 403 ); 404 if (EFI_ERROR (Status)) { 405 goto UninstallGop; 406 } 407 408 if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO || 409 Private->Variant == QEMU_VIDEO_BOCHS) { 410 InstallVbeShim (Card->Name, Private->GraphicsOutput.Mode->FrameBufferBase); 411 } 412 413 gBS->RestoreTPL (OldTpl); 414 return EFI_SUCCESS; 415 416 UninstallGop: 417 gBS->UninstallProtocolInterface (Private->Handle, 418 &gEfiGraphicsOutputProtocolGuid, &Private->GraphicsOutput); 419 420 DestructQemuVideoGraphics: 421 QemuVideoGraphicsOutputDestructor (Private); 422 423 FreeModeData: 424 FreePool (Private->ModeData); 425 426 UninstallGopDevicePath: 427 gBS->UninstallProtocolInterface (Private->Handle, 428 &gEfiDevicePathProtocolGuid, Private->GopDevicePath); 429 430 FreeGopDevicePath: 431 FreePool (Private->GopDevicePath); 432 433 RestoreAttributes: 434 Private->PciIo->Attributes (Private->PciIo, EfiPciIoAttributeOperationSet, 435 Private->OriginalPciAttributes, NULL); 436 437 ClosePciIo: 438 gBS->CloseProtocol (Controller, &gEfiPciIoProtocolGuid, 439 This->DriverBindingHandle, Controller); 440 441 FreePrivate: 442 FreePool (Private); 443 444 RestoreTpl: 445 gBS->RestoreTPL (OldTpl); 333 446 334 447 return Status; … … 362 475 QEMU_VIDEO_PRIVATE_DATA *Private; 363 476 477 if (NumberOfChildren == 0) { 478 // 479 // Close the PCI I/O Protocol 480 // 481 gBS->CloseProtocol ( 482 Controller, 483 &gEfiPciIoProtocolGuid, 484 This->DriverBindingHandle, 485 Controller 486 ); 487 return EFI_SUCCESS; 488 } 489 490 // 491 // free all resources for whose access we need the child handle, because the 492 // child handle is going away 493 // 494 ASSERT (NumberOfChildren == 1); 364 495 Status = gBS->OpenProtocol ( 365 C ontroller,496 ChildHandleBuffer[0], 366 497 &gEfiGraphicsOutputProtocolGuid, 367 498 (VOID **) &GraphicsOutput, … … 378 509 // 379 510 Private = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (GraphicsOutput); 511 ASSERT (Private->Handle == ChildHandleBuffer[0]); 380 512 381 513 QemuVideoGraphicsOutputDestructor (Private); … … 404 536 ); 405 537 406 //407 // Close the PCI I/O Protocol408 //409 538 gBS->CloseProtocol ( 410 539 Controller, 411 540 &gEfiPciIoProtocolGuid, 412 541 This->DriverBindingHandle, 413 Controller542 Private->Handle 414 543 ); 544 545 FreePool (Private->ModeData); 546 gBS->UninstallProtocolInterface (Private->Handle, 547 &gEfiDevicePathProtocolGuid, Private->GopDevicePath); 548 FreePool (Private->GopDevicePath); 415 549 416 550 // … … 553 687 ) 554 688 { 555 outb (Private, PALETTE_INDEX_REGISTER, (UINT8) Index);556 outb (Private, PALETTE_DATA_REGISTER, (UINT8) (Red >> 2));557 outb (Private, PALETTE_DATA_REGISTER, (UINT8) (Green >> 2));558 outb (Private, PALETTE_DATA_REGISTER, (UINT8) (Blue >> 2));689 VgaOutb (Private, PALETTE_INDEX_REGISTER, (UINT8) Index); 690 VgaOutb (Private, PALETTE_DATA_REGISTER, (UINT8) (Red >> 2)); 691 VgaOutb (Private, PALETTE_DATA_REGISTER, (UINT8) (Green >> 2)); 692 VgaOutb (Private, PALETTE_DATA_REGISTER, (UINT8) (Blue >> 2)); 559 693 } 560 694 … … 641 775 **/ 642 776 VOID 643 Initialize GraphicsMode (644 QEMU_VIDEO_PRIVATE_DATA *Private, 645 QEMU_VIDEO_ VIDEO_MODES*ModeData777 InitializeCirrusGraphicsMode ( 778 QEMU_VIDEO_PRIVATE_DATA *Private, 779 QEMU_VIDEO_CIRRUS_MODES *ModeData 646 780 ) 647 781 { 648 782 UINT8 Byte; 649 783 UINTN Index; 650 UINT16 DeviceId;651 EFI_STATUS Status;652 653 Status = Private->PciIo->Pci.Read (654 Private->PciIo,655 EfiPciIoWidthUint16,656 PCI_DEVICE_ID_OFFSET,657 1,658 &DeviceId659 );660 //661 // Read the PCI Configuration Header from the PCI Device662 //663 ASSERT_EFI_ERROR (Status);664 784 665 785 outw (Private, SEQ_ADDRESS_REGISTER, 0x1206); … … 670 790 } 671 791 672 if ( DeviceId != CIRRUS_LOGIC_5446_DEVICE_ID) {792 if (Private->Variant == QEMU_VIDEO_CIRRUS_5430) { 673 793 outb (Private, SEQ_ADDRESS_REGISTER, 0x0f); 674 794 Byte = (UINT8) ((inb (Private, SEQ_DATA_REGISTER) & 0xc7) ^ 0x30); … … 702 822 outw (Private, GRAPH_ADDRESS_REGISTER, 0x000b); 703 823 outb (Private, DAC_PIXEL_MASK_REGISTER, 0xff); 824 825 SetDefaultPalette (Private); 826 ClearScreen (Private); 827 } 828 829 VOID 830 BochsWrite ( 831 QEMU_VIDEO_PRIVATE_DATA *Private, 832 UINT16 Reg, 833 UINT16 Data 834 ) 835 { 836 EFI_STATUS Status; 837 838 if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO) { 839 Status = Private->PciIo->Mem.Write ( 840 Private->PciIo, 841 EfiPciIoWidthUint16, 842 PCI_BAR_IDX2, 843 0x500 + (Reg << 1), 844 1, 845 &Data 846 ); 847 ASSERT_EFI_ERROR (Status); 848 } else { 849 outw (Private, VBE_DISPI_IOPORT_INDEX, Reg); 850 outw (Private, VBE_DISPI_IOPORT_DATA, Data); 851 } 852 } 853 854 UINT16 855 BochsRead ( 856 QEMU_VIDEO_PRIVATE_DATA *Private, 857 UINT16 Reg 858 ) 859 { 860 EFI_STATUS Status; 861 UINT16 Data; 862 863 if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO) { 864 Status = Private->PciIo->Mem.Read ( 865 Private->PciIo, 866 EfiPciIoWidthUint16, 867 PCI_BAR_IDX2, 868 0x500 + (Reg << 1), 869 1, 870 &Data 871 ); 872 ASSERT_EFI_ERROR (Status); 873 } else { 874 outw (Private, VBE_DISPI_IOPORT_INDEX, Reg); 875 Data = inw (Private, VBE_DISPI_IOPORT_DATA); 876 } 877 return Data; 878 } 879 880 VOID 881 VgaOutb ( 882 QEMU_VIDEO_PRIVATE_DATA *Private, 883 UINTN Reg, 884 UINT8 Data 885 ) 886 { 887 EFI_STATUS Status; 888 889 if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO) { 890 Status = Private->PciIo->Mem.Write ( 891 Private->PciIo, 892 EfiPciIoWidthUint8, 893 PCI_BAR_IDX2, 894 0x400 - 0x3c0 + Reg, 895 1, 896 &Data 897 ); 898 ASSERT_EFI_ERROR (Status); 899 } else { 900 outb (Private, Reg, Data); 901 } 902 } 903 904 VOID 905 InitializeBochsGraphicsMode ( 906 QEMU_VIDEO_PRIVATE_DATA *Private, 907 QEMU_VIDEO_BOCHS_MODES *ModeData 908 ) 909 { 910 DEBUG ((EFI_D_INFO, "InitializeBochsGraphicsMode: %dx%d @ %d\n", 911 ModeData->Width, ModeData->Height, ModeData->ColorDepth)); 912 913 /* unblank */ 914 VgaOutb (Private, ATT_ADDRESS_REGISTER, 0x20); 915 916 BochsWrite (Private, VBE_DISPI_INDEX_ENABLE, 0); 917 BochsWrite (Private, VBE_DISPI_INDEX_BANK, 0); 918 BochsWrite (Private, VBE_DISPI_INDEX_X_OFFSET, 0); 919 BochsWrite (Private, VBE_DISPI_INDEX_Y_OFFSET, 0); 920 921 BochsWrite (Private, VBE_DISPI_INDEX_BPP, (UINT16) ModeData->ColorDepth); 922 BochsWrite (Private, VBE_DISPI_INDEX_XRES, (UINT16) ModeData->Width); 923 BochsWrite (Private, VBE_DISPI_INDEX_VIRT_WIDTH, (UINT16) ModeData->Width); 924 BochsWrite (Private, VBE_DISPI_INDEX_YRES, (UINT16) ModeData->Height); 925 BochsWrite (Private, VBE_DISPI_INDEX_VIRT_HEIGHT, (UINT16) ModeData->Height); 926 927 BochsWrite (Private, VBE_DISPI_INDEX_ENABLE, 928 VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED); 704 929 705 930 SetDefaultPalette (Private); -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuVideoDxe/Gop.c
r48674 r58459 73 73 DEBUG ((EFI_D_INFO, "FrameBufferBase: 0x%x, FrameBufferSize: 0x%x\n", Mode->FrameBufferBase, Mode->FrameBufferSize)); 74 74 75 FreePool (FrameBufDesc); 75 76 return EFI_SUCCESS; 76 77 } … … 114 115 Private = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This); 115 116 116 if (Private->HardwareNeedsStarting) {117 return EFI_NOT_STARTED;118 }119 120 117 if (Info == NULL || SizeOfInfo == NULL || ModeNumber >= This->Mode->MaxMode) { 121 118 return EFI_INVALID_PARAMETER; … … 176 173 } 177 174 178 Private->LineBuffer = NULL;179 175 Private->LineBuffer = AllocatePool (4 * ModeData->HorizontalResolution); 180 176 if (Private->LineBuffer == NULL) { … … 182 178 } 183 179 184 InitializeGraphicsMode (Private, &QemuVideoVideoModes[ModeData->ModeNumber]); 180 switch (Private->Variant) { 181 case QEMU_VIDEO_CIRRUS_5430: 182 case QEMU_VIDEO_CIRRUS_5446: 183 InitializeCirrusGraphicsMode (Private, &QemuVideoCirrusModes[ModeData->InternalModeIndex]); 184 break; 185 case QEMU_VIDEO_BOCHS_MMIO: 186 case QEMU_VIDEO_BOCHS: 187 InitializeBochsGraphicsMode (Private, &QemuVideoBochsModes[ModeData->InternalModeIndex]); 188 break; 189 default: 190 ASSERT (FALSE); 191 gBS->FreePool (Private->LineBuffer); 192 Private->LineBuffer = NULL; 193 return EFI_DEVICE_ERROR; 194 } 185 195 186 196 This->Mode->Mode = ModeNumber; … … 195 205 This->Mode->Info 196 206 ); 197 198 Private->HardwareNeedsStarting = FALSE;199 207 200 208 return EFI_SUCCESS; … … 307 315 return Status; 308 316 } 317 309 318 Status = gBS->AllocatePool ( 310 319 EfiBootServicesData, … … 313 322 ); 314 323 if (EFI_ERROR (Status)) { 315 return Status;324 goto FreeMode; 316 325 } 317 326 Private->GraphicsOutput.Mode->MaxMode = (UINT32) Private->MaxMode; 318 327 Private->GraphicsOutput.Mode->Mode = GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER; 319 Private->HardwareNeedsStarting = TRUE;320 328 Private->LineBuffer = NULL; 321 329 … … 323 331 // Initialize the hardware 324 332 // 325 GraphicsOutput->SetMode (GraphicsOutput, 0); 333 Status = GraphicsOutput->SetMode (GraphicsOutput, 0); 334 if (EFI_ERROR (Status)) { 335 goto FreeInfo; 336 } 337 326 338 DrawLogo ( 327 339 Private, … … 331 343 332 344 return EFI_SUCCESS; 345 346 FreeInfo: 347 FreePool (Private->GraphicsOutput.Mode->Info); 348 349 FreeMode: 350 FreePool (Private->GraphicsOutput.Mode); 351 Private->GraphicsOutput.Mode = NULL; 352 353 return Status; 333 354 } 334 355 … … 349 370 --*/ 350 371 { 372 if (Private->LineBuffer != NULL) { 373 FreePool (Private->LineBuffer); 374 } 375 351 376 if (Private->GraphicsOutput.Mode != NULL) { 352 377 if (Private->GraphicsOutput.Mode->Info != NULL) { -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuVideoDxe/Initialize.c
r48674 r58459 144 144 /// Table of supported video modes 145 145 /// 146 QEMU_VIDEO_ VIDEO_MODES QemuVideoVideoModes[] = {146 QEMU_VIDEO_CIRRUS_MODES QemuVideoCirrusModes[] = { 147 147 // { 640, 480, 8, 60, Crtc_640_480_256_60, Seq_640_480_256_60, 0xe3 }, 148 148 // { 800, 600, 8, 60, Crtc_800_600_256_60, Seq_800_600_256_60, 0xef }, … … 155 155 }; 156 156 157 #define QEMU_VIDEO_ MODE_COUNT \158 (sizeof (QemuVideo VideoModes) / sizeof (QemuVideoVideoModes[0]))157 #define QEMU_VIDEO_CIRRUS_MODE_COUNT \ 158 (sizeof (QemuVideoCirrusModes) / sizeof (QemuVideoCirrusModes[0])) 159 159 160 160 /** … … 163 163 **/ 164 164 EFI_STATUS 165 QemuVideo VideoModeSetup (165 QemuVideoCirrusModeSetup ( 166 166 QEMU_VIDEO_PRIVATE_DATA *Private 167 167 ) … … 169 169 UINT32 Index; 170 170 QEMU_VIDEO_MODE_DATA *ModeData; 171 QEMU_VIDEO_ VIDEO_MODES*VideoMode;171 QEMU_VIDEO_CIRRUS_MODES *VideoMode; 172 172 173 173 // … … 175 175 // 176 176 Private->ModeData = AllocatePool ( 177 sizeof (Private->ModeData[0]) * QEMU_VIDEO_ MODE_COUNT177 sizeof (Private->ModeData[0]) * QEMU_VIDEO_CIRRUS_MODE_COUNT 178 178 ); 179 if (Private->ModeData == NULL) { 180 return EFI_OUT_OF_RESOURCES; 181 } 179 182 ModeData = Private->ModeData; 180 VideoMode = &QemuVideo VideoModes[0];181 for (Index = 0; Index < QEMU_VIDEO_ MODE_COUNT; Index ++) {182 ModeData-> ModeNumber= Index;183 VideoMode = &QemuVideoCirrusModes[0]; 184 for (Index = 0; Index < QEMU_VIDEO_CIRRUS_MODE_COUNT; Index ++) { 185 ModeData->InternalModeIndex = Index; 183 186 ModeData->HorizontalResolution = VideoMode->Width; 184 187 ModeData->VerticalResolution = VideoMode->Height; … … 186 189 ModeData->RefreshRate = VideoMode->RefreshRate; 187 190 DEBUG ((EFI_D_INFO, 188 "Adding Video Mode %d: %dx%d, %d-bit, %d Hz\n", 189 ModeData->ModeNumber, 191 "Adding Mode %d as Cirrus Internal Mode %d: %dx%d, %d-bit, %d Hz\n", 192 (INT32) (ModeData - Private->ModeData), 193 ModeData->InternalModeIndex, 190 194 ModeData->HorizontalResolution, 191 195 ModeData->VerticalResolution, … … 197 201 VideoMode ++; 198 202 } 199 Private->MaxMode = QEMU_VIDEO_MODE_COUNT;203 Private->MaxMode = ModeData - Private->ModeData; 200 204 201 205 return EFI_SUCCESS; 202 206 } 203 207 208 /// 209 /// Table of supported video modes 210 /// 211 QEMU_VIDEO_BOCHS_MODES QemuVideoBochsModes[] = { 212 { 640, 480, 32 }, 213 { 800, 480, 32 }, 214 { 800, 600, 32 }, 215 { 832, 624, 32 }, 216 { 960, 640, 32 }, 217 { 1024, 600, 32 }, 218 { 1024, 768, 32 }, 219 { 1152, 864, 32 }, 220 { 1152, 870, 32 }, 221 { 1280, 720, 32 }, 222 { 1280, 760, 32 }, 223 { 1280, 768, 32 }, 224 { 1280, 800, 32 }, 225 { 1280, 960, 32 }, 226 { 1280, 1024, 32 }, 227 { 1360, 768, 32 }, 228 { 1366, 768, 32 }, 229 { 1400, 1050, 32 }, 230 { 1440, 900, 32 }, 231 { 1600, 900, 32 }, 232 { 1600, 1200, 32 }, 233 { 1680, 1050, 32 }, 234 { 1920, 1080, 32 }, 235 { 1920, 1200, 32 }, 236 { 1920, 1440, 32 }, 237 { 2000, 2000, 32 }, 238 { 2048, 1536, 32 }, 239 { 2048, 2048, 32 }, 240 { 2560, 1440, 32 }, 241 { 2560, 1600, 32 }, 242 { 2560, 2048, 32 }, 243 { 2800, 2100, 32 }, 244 { 3200, 2400, 32 }, 245 { 3840, 2160, 32 }, 246 { 4096, 2160, 32 }, 247 { 7680, 4320, 32 }, 248 { 8192, 4320, 32 } 249 }; 250 251 #define QEMU_VIDEO_BOCHS_MODE_COUNT \ 252 (sizeof (QemuVideoBochsModes) / sizeof (QemuVideoBochsModes[0])) 253 254 EFI_STATUS 255 QemuVideoBochsModeSetup ( 256 QEMU_VIDEO_PRIVATE_DATA *Private, 257 BOOLEAN IsQxl 258 ) 259 { 260 UINT32 AvailableFbSize; 261 UINT32 Index; 262 QEMU_VIDEO_MODE_DATA *ModeData; 263 QEMU_VIDEO_BOCHS_MODES *VideoMode; 264 265 // 266 // Fetch the available framebuffer size. 267 // 268 // VBE_DISPI_INDEX_VIDEO_MEMORY_64K is expected to return the size of the 269 // drawable framebuffer. Up to and including qemu-2.1 however it used to 270 // return the size of PCI BAR 0 (ie. the full video RAM size). 271 // 272 // On stdvga the two concepts coincide with each other; the full memory size 273 // is usable for drawing. 274 // 275 // On QXL however, only a leading segment, "surface 0", can be used for 276 // drawing; the rest of the video memory is used for the QXL guest-host 277 // protocol. VBE_DISPI_INDEX_VIDEO_MEMORY_64K should report the size of 278 // "surface 0", but since it doesn't (up to and including qemu-2.1), we 279 // retrieve the size of the drawable portion from a field in the QXL ROM BAR, 280 // where it is also available. 281 // 282 if (IsQxl) { 283 UINT32 Signature; 284 UINT32 DrawStart; 285 286 Signature = 0; 287 DrawStart = 0xFFFFFFFF; 288 AvailableFbSize = 0; 289 if (EFI_ERROR ( 290 Private->PciIo->Mem.Read (Private->PciIo, EfiPciIoWidthUint32, 291 PCI_BAR_IDX2, 0, 1, &Signature)) || 292 Signature != SIGNATURE_32 ('Q', 'X', 'R', 'O') || 293 EFI_ERROR ( 294 Private->PciIo->Mem.Read (Private->PciIo, EfiPciIoWidthUint32, 295 PCI_BAR_IDX2, 36, 1, &DrawStart)) || 296 DrawStart != 0 || 297 EFI_ERROR ( 298 Private->PciIo->Mem.Read (Private->PciIo, EfiPciIoWidthUint32, 299 PCI_BAR_IDX2, 40, 1, &AvailableFbSize))) { 300 DEBUG ((EFI_D_ERROR, "%a: can't read size of drawable buffer from QXL " 301 "ROM\n", __FUNCTION__)); 302 return EFI_NOT_FOUND; 303 } 304 } else { 305 AvailableFbSize = BochsRead (Private, VBE_DISPI_INDEX_VIDEO_MEMORY_64K); 306 AvailableFbSize *= SIZE_64KB; 307 } 308 DEBUG ((EFI_D_VERBOSE, "%a: AvailableFbSize=0x%x\n", __FUNCTION__, 309 AvailableFbSize)); 310 311 // 312 // Setup Video Modes 313 // 314 Private->ModeData = AllocatePool ( 315 sizeof (Private->ModeData[0]) * QEMU_VIDEO_BOCHS_MODE_COUNT 316 ); 317 if (Private->ModeData == NULL) { 318 return EFI_OUT_OF_RESOURCES; 319 } 320 ModeData = Private->ModeData; 321 VideoMode = &QemuVideoBochsModes[0]; 322 for (Index = 0; Index < QEMU_VIDEO_BOCHS_MODE_COUNT; Index ++) { 323 UINTN RequiredFbSize; 324 325 ASSERT (VideoMode->ColorDepth % 8 == 0); 326 RequiredFbSize = (UINTN) VideoMode->Width * VideoMode->Height * 327 (VideoMode->ColorDepth / 8); 328 if (RequiredFbSize <= AvailableFbSize) { 329 ModeData->InternalModeIndex = Index; 330 ModeData->HorizontalResolution = VideoMode->Width; 331 ModeData->VerticalResolution = VideoMode->Height; 332 ModeData->ColorDepth = VideoMode->ColorDepth; 333 ModeData->RefreshRate = 60; 334 DEBUG ((EFI_D_INFO, 335 "Adding Mode %d as Bochs Internal Mode %d: %dx%d, %d-bit, %d Hz\n", 336 (INT32) (ModeData - Private->ModeData), 337 ModeData->InternalModeIndex, 338 ModeData->HorizontalResolution, 339 ModeData->VerticalResolution, 340 ModeData->ColorDepth, 341 ModeData->RefreshRate 342 )); 343 344 ModeData ++ ; 345 } 346 VideoMode ++; 347 } 348 Private->MaxMode = ModeData - Private->ModeData; 349 350 return EFI_SUCCESS; 351 } 352 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuVideoDxe/Qemu.h
r48674 r58459 51 51 // 52 52 typedef struct { 53 UINT32 ModeNumber;53 UINT32 InternalModeIndex; // points into card-specific mode table 54 54 UINT32 HorizontalResolution; 55 55 UINT32 VerticalResolution; … … 86 86 // 87 87 #define QEMU_VIDEO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('Q', 'V', 'I', 'D') 88 89 typedef enum { 90 QEMU_VIDEO_CIRRUS_5430 = 1, 91 QEMU_VIDEO_CIRRUS_5446, 92 QEMU_VIDEO_BOCHS, 93 QEMU_VIDEO_BOCHS_MMIO, 94 } QEMU_VIDEO_VARIANT; 95 96 typedef struct { 97 UINT16 VendorId; 98 UINT16 DeviceId; 99 QEMU_VIDEO_VARIANT Variant; 100 CHAR16 *Name; 101 } QEMU_VIDEO_CARD; 88 102 89 103 typedef struct { … … 94 108 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput; 95 109 EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; 110 111 // 112 // The next three fields match the client-visible 113 // EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE.Mode and 114 // EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE.MaxMode fields. 115 // 96 116 UINTN CurrentMode; 97 117 UINTN MaxMode; 98 118 QEMU_VIDEO_MODE_DATA *ModeData; 119 99 120 UINT8 *LineBuffer; 100 BOOLEAN HardwareNeedsStarting;121 QEMU_VIDEO_VARIANT Variant; 101 122 } QEMU_VIDEO_PRIVATE_DATA; 102 123 103 124 /// 104 /// Video Mode structure125 /// Card-specific Video Mode structures 105 126 /// 106 127 typedef struct { … … 112 133 UINT16 *SeqSettings; 113 134 UINT8 MiscSetting; 114 } QEMU_VIDEO_VIDEO_MODES; 135 } QEMU_VIDEO_CIRRUS_MODES; 136 137 typedef struct { 138 UINT32 Width; 139 UINT32 Height; 140 UINT32 ColorDepth; 141 } QEMU_VIDEO_BOCHS_MODES; 115 142 116 143 #define QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS(a) \ … … 129 156 extern UINT8 Crtc_1024_768_256_60[]; 130 157 extern UINT16 Seq_1024_768_256_60[]; 131 extern QEMU_VIDEO_VIDEO_MODES QemuVideoVideoModes[]; 158 extern QEMU_VIDEO_CIRRUS_MODES QemuVideoCirrusModes[]; 159 extern QEMU_VIDEO_BOCHS_MODES QemuVideoBochsModes[]; 132 160 extern EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding; 133 161 extern EFI_COMPONENT_NAME_PROTOCOL gQemuVideoComponentName; … … 151 179 #define PALETTE_DATA_REGISTER 0x3c9 152 180 181 #define VBE_DISPI_IOPORT_INDEX 0x01CE 182 #define VBE_DISPI_IOPORT_DATA 0x01D0 183 184 #define VBE_DISPI_INDEX_ID 0x0 185 #define VBE_DISPI_INDEX_XRES 0x1 186 #define VBE_DISPI_INDEX_YRES 0x2 187 #define VBE_DISPI_INDEX_BPP 0x3 188 #define VBE_DISPI_INDEX_ENABLE 0x4 189 #define VBE_DISPI_INDEX_BANK 0x5 190 #define VBE_DISPI_INDEX_VIRT_WIDTH 0x6 191 #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7 192 #define VBE_DISPI_INDEX_X_OFFSET 0x8 193 #define VBE_DISPI_INDEX_Y_OFFSET 0x9 194 #define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa 195 196 #define VBE_DISPI_ID0 0xB0C0 197 #define VBE_DISPI_ID1 0xB0C1 198 #define VBE_DISPI_ID2 0xB0C2 199 #define VBE_DISPI_ID3 0xB0C3 200 #define VBE_DISPI_ID4 0xB0C4 201 #define VBE_DISPI_ID5 0xB0C5 202 203 #define VBE_DISPI_DISABLED 0x00 204 #define VBE_DISPI_ENABLED 0x01 205 #define VBE_DISPI_GETCAPS 0x02 206 #define VBE_DISPI_8BIT_DAC 0x20 207 #define VBE_DISPI_LFB_ENABLED 0x40 208 #define VBE_DISPI_NOCLEARMEM 0x80 153 209 154 210 // … … 359 415 // 360 416 VOID 361 InitializeGraphicsMode ( 362 QEMU_VIDEO_PRIVATE_DATA *Private, 363 QEMU_VIDEO_VIDEO_MODES *ModeData 417 InitializeCirrusGraphicsMode ( 418 QEMU_VIDEO_PRIVATE_DATA *Private, 419 QEMU_VIDEO_CIRRUS_MODES *ModeData 420 ); 421 422 VOID 423 InitializeBochsGraphicsMode ( 424 QEMU_VIDEO_PRIVATE_DATA *Private, 425 QEMU_VIDEO_BOCHS_MODES *ModeData 364 426 ); 365 427 … … 411 473 ); 412 474 413 EFI_STATUS 414 QemuVideoVideoModeSetup ( 475 VOID 476 BochsWrite ( 477 QEMU_VIDEO_PRIVATE_DATA *Private, 478 UINT16 Reg, 479 UINT16 Data 480 ); 481 482 UINT16 483 BochsRead ( 484 QEMU_VIDEO_PRIVATE_DATA *Private, 485 UINT16 Reg 486 ); 487 488 VOID 489 VgaOutb ( 490 QEMU_VIDEO_PRIVATE_DATA *Private, 491 UINTN Reg, 492 UINT8 Data 493 ); 494 495 EFI_STATUS 496 QemuVideoCirrusModeSetup ( 415 497 QEMU_VIDEO_PRIVATE_DATA *Private 416 498 ); 417 499 500 EFI_STATUS 501 QemuVideoBochsModeSetup ( 502 QEMU_VIDEO_PRIVATE_DATA *Private, 503 BOOLEAN IsQxl 504 ); 505 506 VOID 507 InstallVbeShim ( 508 IN CONST CHAR16 *CardName, 509 IN EFI_PHYSICAL_ADDRESS FrameBufferBase 510 ); 418 511 #endif -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
r48674 r58459 24 24 ENTRY_POINT = InitializeQemuVideo 25 25 26 PCI_VENDOR_ID = 0x101327 PCI_DEVICE_ID = 0x00A828 PCI_CLASS_CODE = 0x03000029 PCI_REVISION = 0x0030 PCI_COMPRESS = TRUE31 32 26 # 33 27 # The following information is for reference only and not required by the build tools. … … 45 39 Gop.c 46 40 Initialize.c 41 VbeShim.c 47 42 48 43 [Packages] 49 44 MdePkg/MdePkg.dec 50 45 OptionRomPkg/OptionRomPkg.dec 46 OvmfPkg/OvmfPkg.dec 51 47 52 48 [LibraryClasses] … … 56 52 DevicePathLib 57 53 MemoryAllocationLib 54 PciLib 55 PrintLib 58 56 TimerLib 59 57 UefiBootServicesTableLib -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/README
r48674 r58459 10 10 === STATUS === 11 11 12 Current status: Alpha13 14 12 Current capabilities: 15 13 * IA32 and X64 architectures 16 * QEMU (0. 9.1or later)14 * QEMU (0.10.0 or later) 17 15 - Video, keyboard, IDE, CD-ROM, serial 18 16 - Runs UEFI shell 19 17 - Optional NIC support. Requires QEMU (0.12.2 or later) 20 * UEFI Linux has booted (but is not stable) 18 * UEFI Linux boots 19 * UEFI Windows 8 boots 20 * UEFI Windows 7 & Windows 2008 Server boot (see important notes below!) 21 21 22 22 === FUTURE PLANS === 23 23 24 * Stabilize UEFI Linux boot25 24 * Test/Stabilize UEFI Self-Certification Tests (SCT) results 26 25 … … 32 31 - Intel ASL compiler: Available from http://www.acpica.org 33 32 - Microsoft ASL compiler: Available from http://www.acpi.info 33 * NASM: http://www.nasm.us/ 34 34 35 35 Update Conf/target.txt ACTIVE_PLATFORM for OVMF: … … 51 51 * OVMF.FD 52 52 - Please note! This filename has changed. Older releases used OVMF.Fv. 53 * CirrusLogic5446.rom 53 * OvmfVideo.rom 54 - This file is not built separately any longer, starting with svn r13520. 54 55 55 56 More information on building OVMF can be found at: … … 59 60 === RUNNING OVMF on QEMU === 60 61 61 * QEMU 0.9.1 or later is required. 62 * Either copy, rename or symlink OVMF.FD => bios.bin 63 * Either copy, rename or symlink CirrusLogic5446.rom => vgabios-cirrus.bin 62 * QEMU 0.12.2 or later is required. 64 63 * Be sure to use qemu-system-x86_64, if you are using and X64 firmware. 65 64 (qemu-system-x86_64 works for the IA32 firmware as well, of course.) 66 * Use the QEMU -L parameter to specify the directory where the bios.bin 67 and vgabios-cirrus.bin files are located. 68 * Optionally you can use the QEMU -serial command to capture the 69 OVMF debug messages. For example: -serial file:serial.log 65 * Use OVMF for QEMU firmware (3 options available) 66 - Option 1: QEMU 1.6 or newer; Use QEMU -pflash parameter 67 * QEMU/OVMF will use emulated flash, and fully support UEFI variables 68 * Run qemu with: -pflash path/to/OVMF.fd 69 - Option 2: Use QEMU -bios parameter 70 * Note that UEFI variables will be partially emulated, and non-volatile 71 variables may lose their contents after a reboot 72 * Run qemu with: -bios path/to/OVMF.fd 73 - Option 3: Use QEMU -L parameter 74 * Note that UEFI variables will be partially emulated, and non-volatile 75 variables may lose their contents after a reboot 76 * Either copy, rename or symlink OVMF.fd => bios.bin 77 * Use the QEMU -L parameter to specify the directory where the bios.bin 78 file is located. 70 79 * The EFI shell is built into OVMF builds at this time, so it should 71 80 run automatically if a UEFI boot application is not found on the … … 73 82 * On Linux, newer version of QEMU may enable KVM feature, and this might 74 83 cause OVMF to fail to boot. The QEMU '-no-kvm' may allow OVMF to boot. 84 * Capturing OVMF debug messages on qemu: 85 - The default OVMF build writes debug messages to IO port 0x402. The 86 following qemu command line options save them in the file called 87 debug.log: '-debugcon file:debug.log -global isa-debugcon.iobase=0x402'. 88 - It is possible to revert to the original behavior, when debug messages were 89 written to the emulated serial port (potentially intermixing OVMF debug 90 output with UEFI serial console output). For this the 91 '-D DEBUG_ON_SERIAL_PORT' option has to be passed to the build command (see 92 the next section), and in order to capture the serial output qemu needs to 93 be started with eg. '-serial file:serial.log'. 94 - Debug messages fall into several categories. Logged vs. suppressed 95 categories are controlled at OVMF build time by the 96 'gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel' bitmask (an UINT32 97 value) in the selected .dsc file. Individual bits of this bitmask are 98 defined in <MdePkg/Include/Library/DebugLib.h>. One non-default bit (with 99 some performance impact) that is frequently set for debugging is 0x00400000 100 (DEBUG_VERBOSE). 101 - The RELEASE build target ('-b RELEASE' build option, see below) disables 102 all debug messages. The default build target is DEBUG. 75 103 76 104 === Build Scripts === … … 86 114 $ OvmfPkg/build.sh -a X64 qemu -cdrom /path/to/disk-image.iso 87 115 88 To build a 32-bit OVMF without debug serialmessages using GCC 4.5:116 To build a 32-bit OVMF without debug messages using GCC 4.5: 89 117 $ OvmfPkg/build.sh -a IA32 -b RELEASE -t GCC45 90 118 91 119 === Network Support === 92 120 93 To add network drivers to OVMF: 94 95 * Download UEFI drivers for the e1000 NIC 96 - http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=17515&lang=eng 97 - Install the drivers into a directory called Intel3.5 in your WORKSPACE 98 99 * Include the drivers in OVMF during the build: 100 - Add '-D NETWORK_ENABLE' to your build command 101 - For example: build -D NETWORK_ENABLE 102 103 * Use the QEMU -net parameter to enable NIC support. 104 - QEMU does not support UEFI DHCP or UEFI PXE Boot, so long timeouts will 105 occur when NICs are enabled. The long timeouts can be avoided by 106 interrupts the boot sequence by pressing a key when the logo appears. 107 - Example: Enable e1000 NIC with a DHCP server and restrict packet 108 forwarding: 109 -net nic,model=e1000 -net user,restrict=yes -net user,dhcpstart=10.0.2.10 110 - Example: Enable e1000 NIC with a DHCP server, restrict packet forwarding, 111 and generate PCAP file: 112 -net nic,model=e1000 -net user,restrict=yes -net user,dhcpstart=10.0.2.10 113 -net dump,file=a.pcap 114 - Example: Enable 2 e1000 NICs with a DHCP server and restrict 115 packet forwarding: 116 -net nic,model=e1000,addr=3 -net nic,model=e1000,addr=4 117 -net user,restrict=yes -net user,dhcpstart=10.0.2.10 118 121 OVMF provides a UEFI network stack by default. Its lowest level driver is the 122 NIC driver, higher levels are generic. In order to make DHCP, PXE Boot, and eg. 123 socket test utilities from the StdLib edk2 package work, (1) qemu has to be 124 configured to emulate a NIC, (2) a matching UEFI NIC driver must be available 125 when OVMF boots. 126 127 (If a NIC is configured for the virtual machine, and -- dependent on boot order 128 -- PXE booting is attempted, but no DHCP server responds to OVMF's DHCP 129 DISCOVER message at startup, the boot process may take approx. 3 seconds 130 longer.) 131 132 * For each NIC emulated by qemu, a GPLv2 licensed UEFI driver is available from 133 the iPXE project. The qemu source distribution, starting with version 1.5, 134 contains prebuilt binaries of these drivers (and of course allows one to 135 rebuild them from source as well). This is the recommended set of drivers. 136 137 * Use the qemu -netdev and -device options, or the legacy -net option, to 138 enable NIC support: <http://wiki.qemu.org/Documentation/Networking>. 139 140 * For a qemu >= 1.5 binary running *without* any "-M machine" option where 141 "machine" would identify a < qemu-1.5 configuration (for example: "-M 142 pc-i440fx-1.4" or "-M pc-0.13"), the iPXE drivers are automatically available 143 to and configured for OVMF in the default qemu installation. 144 145 * For a qemu binary in [0.13, 1.5), or a qemu >= 1.5 binary with an "-M 146 machine" option where "machine" selects a < qemu-1.5 configuration: 147 148 - download a >= 1.5.0-rc1 source tarball from <http://wiki.qemu.org/Download>, 149 150 - extract the following iPXE driver files from the tarball and install them 151 in a location that is accessible to qemu processes (this may depend on your 152 SELinux configuration, for example): 153 154 qemu-VERSION/pc-bios/efi-e1000.rom 155 qemu-VERSION/pc-bios/efi-ne2k_pci.rom 156 qemu-VERSION/pc-bios/efi-pcnet.rom 157 qemu-VERSION/pc-bios/efi-rtl8139.rom 158 qemu-VERSION/pc-bios/efi-virtio.rom 159 160 - extend the NIC's -device option on the qemu command line with a matching 161 "romfile=" optarg: 162 163 -device e1000,...,romfile=/full/path/to/efi-e1000.rom 164 -device ne2k_pci,...,romfile=/full/path/to/efi-ne2k_pci.rom 165 -device pcnet,...,romfile=/full/path/to/efi-pcnet.rom 166 -device rtl8139,...,romfile=/full/path/to/efi-rtl8139.rom 167 -device virtio-net-pci,...,romfile=/full/path/to/efi-virtio.rom 168 169 * Independently of the iPXE NIC drivers, the default OVMF build provides a 170 basic virtio-net driver, located in OvmfPkg/VirtioNetDxe. 171 172 * Also independently of the iPXE NIC drivers, Intel's proprietary E1000 NIC 173 driver (PROEFI) can be embedded in the OVMF image at build time: 174 175 - Download UEFI drivers for the e1000 NIC 176 - http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=17515&lang=eng 177 - Install the drivers into a directory called Intel3.5 in your WORKSPACE. 178 179 - Include the driver in OVMF during the build: 180 - Add "-D E1000_ENABLE -D FD_SIZE_2MB" to your build command, 181 - For example: "build -D E1000_ENABLE -D FD_SIZE_2MB". 182 183 * When a matching iPXE driver is configured for a NIC as described above, it 184 takes priority over other drivers that could possibly drive the card too: 185 186 | e1000 ne2k_pci pcnet rtl8139 virtio-net-pci 187 -------------+------------------------------------------------ 188 iPXE | x x x x x 189 VirtioNetDxe | x 190 Intel PROEFI | x 191 192 === OVMF Flash Layout === 193 194 Like all current IA32/X64 system designs, OVMF's firmware 195 device (rom/flash) appears in QEMU's physical address space 196 just below 4GB (0x100000000). 197 198 The layout of the firmware device in memory looks like: 199 200 +--------------------------------------- 4GB (0x100000000) 201 | VTF0 (16-bit reset code) and OVMF SEC 202 | (SECFV) 203 +--------------------------------------- varies based on flash size 204 | 205 | Compressed main firmware image 206 | (FVMAIN_COMPACT) 207 | 208 +--------------------------------------- base + 0x20000 209 | Fault-tolerant write (FTW) 210 | Spare blocks (64KB/0x10000) 211 +--------------------------------------- base + 0x10000 212 | FTW Work block (4KB/0x1000) 213 +--------------------------------------- base + 0x0f000 214 | Event log area (4KB/0x1000) 215 +--------------------------------------- base + 0x0e000 216 | Non-volatile variable storage 217 | area (56KB/0xe000) 218 +--------------------------------------- base address 219 220 OVMF supports building a 1MB or a 2MB flash image. The base address for 221 a 1MB image in QEMU physical memory is 0xfff00000. The base address for 222 a 2MB image is 0xffe00000. 223 224 The code in SECFV locates FVMAIN_COMPACT, and decompresses the 225 main firmware (MAINFV) into RAM memory at address 0x800000. The 226 remaining OVMF firmware then uses this decompressed firmware 227 volume image. 228 229 === UNIXGCC Debug === 230 231 If you build with the UNIXGCC toolchain, then debugging will be disabled 232 due to larger image sizes being produced by the UNIXGCC toolchain. The 233 first choice recommendation is to use GCC44 or newer instead. 234 235 If you must use UNIXGCC, then you can override the build options for 236 particular libraries and modules in the .dsc to re-enable debugging 237 selectively. For example: 238 [Components] 239 OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf { 240 <BuildOptions> 241 GCC:*_*_*_CC_FLAGS = -UMDEPKG_NDEBUG 242 } 243 IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf { 244 <BuildOptions> 245 GCC:*_*_*_CC_FLAGS = -UMDEPKG_NDEBUG 246 } 247 248 === UEFI Windows 7 & Windows 2008 Server === 249 250 * One of the '-vga std' and '-vga qxl' QEMU options should be used. 251 * Only one video mode, 1024x768x32, is supported at OS runtime. 252 * The '-vga qxl' QEMU option is recommended. After booting the installed 253 guest OS, select the video card in Device Manager, and upgrade its driver 254 to the QXL XDDM one. Download location: 255 <http://www.spice-space.org/download.html>, Guest | Windows binaries. 256 This enables further resolutions at OS runtime, and provides S3 257 (suspend/resume) capability. -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Sec/Ia32/SecEntry.S
r48674 r58459 2 2 #------------------------------------------------------------------------------ 3 3 #* 4 #* Copyright (c) 2006 - 20 09, Intel Corporation. All rights reserved.<BR>4 #* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 #* This program and the accompanying materials 6 6 #* are licensed and made available under the terms and conditions of the BSD License … … 37 37 38 38 # 39 # Load temporary stack top at very low memory. The C code 40 # can reload to a better address. 39 # Load temporary RAM stack based on PCDs 41 40 # 42 movl $BASE_512KB, %eax 41 .set SEC_TOP_OF_STACK, FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \ 42 FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) 43 movl $SEC_TOP_OF_STACK, %eax 43 44 movl %eax, %esp 44 45 nop 45 46 46 47 # 47 # Call into C code 48 # Setup parameters and call SecCoreStartupWithStack 49 # [esp] return address for call 50 # [esp+4] BootFirmwareVolumePtr 51 # [esp+8] TopOfCurrentStack 48 52 # 49 53 pushl %eax -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Sec/Ia32/SecEntry.asm
r48674 r58459 2 2 ;------------------------------------------------------------------------------ 3 3 ;* 4 ;* Copyright (c) 2006 - 20 09, Intel Corporation. All rights reserved.<BR>4 ;* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 ;* This program and the accompanying materials 6 6 ;* are licensed and made available under the terms and conditions of the BSD License … … 39 39 40 40 ; 41 ; Load temporary stack top at very low memory. The C code 42 ; can reload to a better address. 41 ; Load temporary RAM stack based on PCDs 43 42 ; 44 mov eax, BASE_512KB 43 SEC_TOP_OF_STACK EQU (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \ 44 FixedPcdGet32 (PcdOvmfSecPeiTempRamSize)) 45 mov eax, SEC_TOP_OF_STACK 45 46 mov esp, eax 46 47 nop 47 48 48 49 ; 49 ; Call into C code 50 ; Setup parameters and call SecCoreStartupWithStack 51 ; [esp] return address for call 52 ; [esp+4] BootFirmwareVolumePtr 53 ; [esp+8] TopOfCurrentStack 50 54 ; 51 55 push eax -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Sec/SecMain.c
r48674 r58459 2 2 Main SEC phase code. Transitions to PEI. 3 3 4 Copyright (c) 2008 - 201 1, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 129 129 with the specified section type. 130 130 131 The Instance parameter indicates which instance of the section 132 type to return. (0 is first instance, 1 is second...) 133 134 @param[in] Sections The sections to search 135 @param[in] SizeOfSections Total size of all sections 136 @param[in] SectionType The section type to locate 137 @param[in] Instance The section instance number 138 @param[out] FoundSection The FFS section if found 139 140 @retval EFI_SUCCESS The file and section was found 141 @retval EFI_NOT_FOUND The file and section was not found 142 @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted 143 144 **/ 145 EFI_STATUS 146 FindFfsSectionInstance ( 147 IN VOID *Sections, 148 IN UINTN SizeOfSections, 149 IN EFI_SECTION_TYPE SectionType, 150 IN UINTN Instance, 151 OUT EFI_COMMON_SECTION_HEADER **FoundSection 152 ) 153 { 154 EFI_PHYSICAL_ADDRESS CurrentAddress; 155 UINT32 Size; 156 EFI_PHYSICAL_ADDRESS EndOfSections; 157 EFI_COMMON_SECTION_HEADER *Section; 158 EFI_PHYSICAL_ADDRESS EndOfSection; 159 160 // 161 // Loop through the FFS file sections within the PEI Core FFS file 162 // 163 EndOfSection = (EFI_PHYSICAL_ADDRESS)(UINTN) Sections; 164 EndOfSections = EndOfSection + SizeOfSections; 165 for (;;) { 166 if (EndOfSection == EndOfSections) { 167 break; 168 } 169 CurrentAddress = (EndOfSection + 3) & ~(3ULL); 170 if (CurrentAddress >= EndOfSections) { 171 return EFI_VOLUME_CORRUPTED; 172 } 173 174 Section = (EFI_COMMON_SECTION_HEADER*)(UINTN) CurrentAddress; 175 176 Size = SECTION_SIZE (Section); 177 if (Size < sizeof (*Section)) { 178 return EFI_VOLUME_CORRUPTED; 179 } 180 181 EndOfSection = CurrentAddress + Size; 182 if (EndOfSection > EndOfSections) { 183 return EFI_VOLUME_CORRUPTED; 184 } 185 186 // 187 // Look for the requested section type 188 // 189 if (Section->Type == SectionType) { 190 if (Instance == 0) { 191 *FoundSection = Section; 192 return EFI_SUCCESS; 193 } else { 194 Instance--; 195 } 196 } 197 } 198 199 return EFI_NOT_FOUND; 200 } 201 202 /** 203 Locates a section within a series of sections 204 with the specified section type. 205 131 206 @param[in] Sections The sections to search 132 207 @param[in] SizeOfSections Total size of all sections … … 147 222 ) 148 223 { 149 EFI_PHYSICAL_ADDRESS CurrentAddress; 150 UINT32 Size; 151 EFI_PHYSICAL_ADDRESS EndOfSections; 152 EFI_COMMON_SECTION_HEADER *Section; 153 EFI_PHYSICAL_ADDRESS EndOfSection; 154 155 // 156 // Loop through the FFS file sections within the PEI Core FFS file 157 // 158 EndOfSection = (EFI_PHYSICAL_ADDRESS)(UINTN) Sections; 159 EndOfSections = EndOfSection + SizeOfSections; 160 for (;;) { 161 if (EndOfSection == EndOfSections) { 162 break; 163 } 164 CurrentAddress = (EndOfSection + 3) & ~(3ULL); 165 if (CurrentAddress >= EndOfSections) { 166 return EFI_VOLUME_CORRUPTED; 167 } 168 169 Section = (EFI_COMMON_SECTION_HEADER*)(UINTN) CurrentAddress; 170 DEBUG ((EFI_D_INFO, "Section->Type: 0x%x\n", Section->Type)); 171 172 Size = SECTION_SIZE (Section); 173 if (Size < sizeof (*Section)) { 174 return EFI_VOLUME_CORRUPTED; 175 } 176 177 EndOfSection = CurrentAddress + Size; 178 if (EndOfSection > EndOfSections) { 179 return EFI_VOLUME_CORRUPTED; 180 } 181 182 // 183 // Look for the requested section type 184 // 185 if (Section->Type == SectionType) { 186 *FoundSection = Section; 187 return EFI_SUCCESS; 188 } 189 DEBUG ((EFI_D_INFO, "Section->Type (0x%x) != SectionType (0x%x)\n", Section->Type, SectionType)); 190 } 191 192 return EFI_NOT_FOUND; 224 return FindFfsSectionInstance ( 225 Sections, 226 SizeOfSections, 227 SectionType, 228 0, 229 FoundSection 230 ); 193 231 } 194 232 … … 208 246 **/ 209 247 EFI_STATUS 210 EFIAPI211 248 FindFfsFileAndSection ( 212 249 IN EFI_FIRMWARE_VOLUME_HEADER *Fv, … … 224 261 225 262 if (Fv->Signature != EFI_FVH_SIGNATURE) { 226 DEBUG ((EFI_D_ INFO, "FV at %p does not have FV header signature\n", Fv));263 DEBUG ((EFI_D_ERROR, "FV at %p does not have FV header signature\n", Fv)); 227 264 return EFI_VOLUME_CORRUPTED; 228 265 } … … 246 283 return EFI_VOLUME_CORRUPTED; 247 284 } 248 DEBUG ((EFI_D_INFO, "File->Type: 0x%x\n", File->Type));249 285 250 286 EndOfFile = CurrentAddress + Size; … … 257 293 // 258 294 if (File->Type != FileType) { 259 DEBUG ((EFI_D_INFO, "File->Type (0x%x) != FileType (0x%x)\n", File->Type, FileType));260 295 continue; 261 296 } … … 277 312 278 313 @param[in,out] Fv On input, the firmware volume to search 279 On output, the decompressed mainFV314 On output, the decompressed BOOT/PEI FV 280 315 281 316 @retval EFI_SUCCESS The file and section was found … … 285 320 **/ 286 321 EFI_STATUS 287 EFIAPI 288 DecompressGuidedFv ( 322 DecompressMemFvs ( 289 323 IN OUT EFI_FIRMWARE_VOLUME_HEADER **Fv 290 324 ) … … 298 332 VOID *OutputBuffer; 299 333 VOID *ScratchBuffer; 300 EFI_FIRMWARE_VOLUME_IMAGE_SECTION *NewFvSection; 301 EFI_FIRMWARE_VOLUME_HEADER *NewFv; 302 303 NewFvSection = (EFI_FIRMWARE_VOLUME_IMAGE_SECTION*) NULL; 334 EFI_FIRMWARE_VOLUME_IMAGE_SECTION *FvSection; 335 EFI_FIRMWARE_VOLUME_HEADER *PeiMemFv; 336 EFI_FIRMWARE_VOLUME_HEADER *DxeMemFv; 337 338 FvSection = (EFI_FIRMWARE_VOLUME_IMAGE_SECTION*) NULL; 304 339 305 340 Status = FindFfsFileAndSection ( … … 325 360 } 326 361 327 //PcdGet32 (PcdOvmfMemFvBase), PcdGet32 (PcdOvmfMemFvSize) 328 OutputBuffer = (VOID*) ((UINT8*)(UINTN) PcdGet32 (PcdOvmfMemFvBase) + SIZE_1MB); 362 OutputBuffer = (VOID*) ((UINT8*)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase) + SIZE_1MB); 329 363 ScratchBuffer = ALIGN_POINTER ((UINT8*) OutputBuffer + OutputBufferSize, SIZE_1MB); 330 364 Status = ExtractGuidedSectionDecode ( … … 339 373 } 340 374 341 Status = FindFfsSectionIn Sections(375 Status = FindFfsSectionInstance ( 342 376 OutputBuffer, 343 377 OutputBufferSize, 344 378 EFI_SECTION_FIRMWARE_VOLUME_IMAGE, 345 (EFI_COMMON_SECTION_HEADER**) &NewFvSection 379 0, 380 (EFI_COMMON_SECTION_HEADER**) &FvSection 346 381 ); 347 382 if (EFI_ERROR (Status)) { 348 DEBUG ((EFI_D_ERROR, "Unable to find FV image in extracted data\n"));383 DEBUG ((EFI_D_ERROR, "Unable to find PEI FV section\n")); 349 384 return Status; 350 385 } 351 386 352 NewFv = (EFI_FIRMWARE_VOLUME_HEADER*)(UINTN) PcdGet32 (PcdOvmfMemFvBase); 353 CopyMem (NewFv, (VOID*) (NewFvSection + 1), PcdGet32 (PcdOvmfMemFvSize)); 354 355 if (NewFv->Signature != EFI_FVH_SIGNATURE) { 356 DEBUG ((EFI_D_ERROR, "Extracted FV at %p does not have FV header signature\n", NewFv)); 387 ASSERT (SECTION_SIZE (FvSection) == 388 (PcdGet32 (PcdOvmfPeiMemFvSize) + sizeof (*FvSection))); 389 ASSERT (FvSection->Type == EFI_SECTION_FIRMWARE_VOLUME_IMAGE); 390 391 PeiMemFv = (EFI_FIRMWARE_VOLUME_HEADER*)(UINTN) PcdGet32 (PcdOvmfPeiMemFvBase); 392 CopyMem (PeiMemFv, (VOID*) (FvSection + 1), PcdGet32 (PcdOvmfPeiMemFvSize)); 393 394 if (PeiMemFv->Signature != EFI_FVH_SIGNATURE) { 395 DEBUG ((EFI_D_ERROR, "Extracted FV at %p does not have FV header signature\n", PeiMemFv)); 357 396 CpuDeadLoop (); 358 397 return EFI_VOLUME_CORRUPTED; 359 398 } 360 399 361 *Fv = NewFv; 400 Status = FindFfsSectionInstance ( 401 OutputBuffer, 402 OutputBufferSize, 403 EFI_SECTION_FIRMWARE_VOLUME_IMAGE, 404 1, 405 (EFI_COMMON_SECTION_HEADER**) &FvSection 406 ); 407 if (EFI_ERROR (Status)) { 408 DEBUG ((EFI_D_ERROR, "Unable to find DXE FV section\n")); 409 return Status; 410 } 411 412 ASSERT (FvSection->Type == EFI_SECTION_FIRMWARE_VOLUME_IMAGE); 413 ASSERT (SECTION_SIZE (FvSection) == 414 (PcdGet32 (PcdOvmfDxeMemFvSize) + sizeof (*FvSection))); 415 416 DxeMemFv = (EFI_FIRMWARE_VOLUME_HEADER*)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase); 417 CopyMem (DxeMemFv, (VOID*) (FvSection + 1), PcdGet32 (PcdOvmfDxeMemFvSize)); 418 419 if (DxeMemFv->Signature != EFI_FVH_SIGNATURE) { 420 DEBUG ((EFI_D_ERROR, "Extracted FV at %p does not have FV header signature\n", DxeMemFv)); 421 CpuDeadLoop (); 422 return EFI_VOLUME_CORRUPTED; 423 } 424 425 *Fv = PeiMemFv; 362 426 return EFI_SUCCESS; 363 427 } … … 375 439 **/ 376 440 EFI_STATUS 377 EFIAPI378 441 FindPeiCoreImageBaseInFv ( 379 442 IN EFI_FIRMWARE_VOLUME_HEADER *Fv, … … 407 470 } 408 471 472 473 /** 474 Reads 8-bits of CMOS data. 475 476 Reads the 8-bits of CMOS data at the location specified by Index. 477 The 8-bit read value is returned. 478 479 @param Index The CMOS location to read. 480 481 @return The value read. 482 483 **/ 484 STATIC 485 UINT8 486 CmosRead8 ( 487 IN UINTN Index 488 ) 489 { 490 IoWrite8 (0x70, (UINT8) Index); 491 return IoRead8 (0x71); 492 } 493 494 495 STATIC 496 BOOLEAN 497 IsS3Resume ( 498 VOID 499 ) 500 { 501 return (CmosRead8 (0xF) == 0xFE); 502 } 503 504 505 STATIC 506 EFI_STATUS 507 GetS3ResumePeiFv ( 508 IN OUT EFI_FIRMWARE_VOLUME_HEADER **PeiFv 509 ) 510 { 511 *PeiFv = (EFI_FIRMWARE_VOLUME_HEADER*)(UINTN) PcdGet32 (PcdOvmfPeiMemFvBase); 512 return EFI_SUCCESS; 513 } 514 515 409 516 /** 410 517 Locates the PEI Core entry point address … … 419 526 **/ 420 527 VOID 421 EFIAPI422 528 FindPeiCoreImageBase ( 423 529 IN OUT EFI_FIRMWARE_VOLUME_HEADER **BootFv, … … 427 533 *PeiCoreImageBase = 0; 428 534 429 FindMainFv (BootFv); 430 431 DecompressGuidedFv (BootFv); 535 if (IsS3Resume ()) { 536 DEBUG ((EFI_D_VERBOSE, "SEC: S3 resume\n")); 537 GetS3ResumePeiFv (BootFv); 538 } else { 539 DEBUG ((EFI_D_VERBOSE, "SEC: Normal boot\n")); 540 FindMainFv (BootFv); 541 542 DecompressMemFvs (BootFv); 543 } 432 544 433 545 FindPeiCoreImageBaseInFv (*BootFv, PeiCoreImageBase); … … 439 551 **/ 440 552 EFI_STATUS 441 EFIAPI442 553 FindImageBase ( 443 554 IN EFI_FIRMWARE_VOLUME_HEADER *BootFirmwareVolumePtr, … … 532 643 **/ 533 644 VOID 534 EFIAPI535 645 FindAndReportEntryPoints ( 536 646 IN EFI_FIRMWARE_VOLUME_HEADER **BootFirmwareVolumePtr, … … 591 701 ProcessLibraryConstructorList (NULL, NULL); 592 702 593 DEBUG ((EFI_D_ ERROR,703 DEBUG ((EFI_D_INFO, 594 704 "SecCoreStartupWithStack(0x%x, 0x%x)\n", 595 705 (UINT32)(UINTN)BootFv, … … 616 726 AsmWriteIdtr (&IdtDescriptor); 617 727 728 #if defined (MDE_CPU_X64) 729 // 730 // ASSERT that the Page Tables were set by the reset vector code to 731 // the address we expect. 732 // 733 ASSERT (AsmReadCr3 () == (UINTN) PcdGet32 (PcdOvmfSecPageTablesBase)); 734 #endif 735 618 736 // 619 737 // |-------------| <-- TopOfCurrentStack … … 624 742 // 625 743 744 ASSERT ((UINTN) (PcdGet32 (PcdOvmfSecPeiTempRamBase) + 745 PcdGet32 (PcdOvmfSecPeiTempRamSize)) == 746 (UINTN) TopOfCurrentStack); 747 626 748 // 627 749 // Initialize SEC hand-off state … … 629 751 SecCoreData.DataSize = sizeof(EFI_SEC_PEI_HAND_OFF); 630 752 631 SecCoreData.TemporaryRamSize = SIZE_64KB;753 SecCoreData.TemporaryRamSize = (UINTN) PcdGet32 (PcdOvmfSecPeiTempRamSize); 632 754 SecCoreData.TemporaryRamBase = (VOID*)((UINT8 *)TopOfCurrentStack - SecCoreData.TemporaryRamSize); 633 755 … … 714 836 BASE_LIBRARY_JUMP_BUFFER JumpBuffer; 715 837 716 DEBUG ((EFI_D_ERROR, "TemporaryRamMigration(0x%x, 0x%x, 0x%x)\n", (UINTN)TemporaryMemoryBase, (UINTN)PermanentMemoryBase, CopySize)); 838 DEBUG ((EFI_D_INFO, 839 "TemporaryRamMigration(0x%x, 0x%x, 0x%x)\n", 840 (UINTN) TemporaryMemoryBase, 841 (UINTN) PermanentMemoryBase, 842 CopySize 843 )); 717 844 718 845 OldHeap = (VOID*)(UINTN)TemporaryMemoryBase; -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Sec/SecMain.inf
r48674 r58459 2 2 # SEC Driver 3 3 # 4 # Copyright (c) 2008 - 201 0, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 65 65 66 66 [Pcd] 67 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase 68 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize 67 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase 68 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize 69 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase 70 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize 71 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase 72 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase 73 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Sec/X64/SecEntry.S
r48674 r58459 2 2 #------------------------------------------------------------------------------ 3 3 #* 4 #* Copyright (c) 2006 - 20 09, Intel Corporation. All rights reserved.<BR>4 #* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 #* This program and the accompanying materials 6 6 #* are licensed and made available under the terms and conditions of the BSD License … … 40 40 # can reload to a better address. 41 41 # 42 movq $BASE_512KB, %rsp 42 .set SEC_TOP_OF_STACK, FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \ 43 FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) 44 movq $SEC_TOP_OF_STACK, %rsp 43 45 nop 44 46 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Sec/X64/SecEntry.asm
r48674 r58459 2 2 ;------------------------------------------------------------------------------ 3 3 ;* 4 ;* Copyright (c) 2006 - 20 09, Intel Corporation. All rights reserved.<BR>4 ;* Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 ;* This program and the accompanying materials 6 6 ;* are licensed and made available under the terms and conditions of the BSD License … … 37 37 38 38 ; 39 ; Load temporary stack top at very low memory. The C code 40 ; can reload to a better address. 39 ; Load temporary RAM stack based on PCDs 41 40 ; 42 mov rsp, BASE_512KB 41 SEC_TOP_OF_STACK EQU (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \ 42 FixedPcdGet32 (PcdOvmfSecPeiTempRamSize)) 43 mov rsp, SEC_TOP_OF_STACK 43 44 nop 44 45 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
r48674 r58459 85 85 86 86 @param Smbios SMBIOS protocol 87 @param EntryPointStructure SMBIOS entry point structures block87 @param TableAddress SMBIOS tables starting address 88 88 89 89 **/ … … 91 91 InstallAllStructures ( 92 92 IN EFI_SMBIOS_PROTOCOL *Smbios, 93 IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure93 IN UINT8 *TableAddress 94 94 ) 95 95 { … … 98 98 EFI_SMBIOS_HANDLE SmbiosHandle; 99 99 100 SmbiosTable.Raw = (UINT8*)(UINTN) EntryPointStructure->TableAddress;100 SmbiosTable.Raw = TableAddress; 101 101 if (SmbiosTable.Raw == NULL) { 102 102 return EFI_INVALID_PARAMETER; … … 107 107 // Log the SMBIOS data for this structure 108 108 // 109 SmbiosHandle = S MBIOS_HANDLE_PI_RESERVED;109 SmbiosHandle = SmbiosTable.Hdr->Handle; 110 110 Status = Smbios->Add ( 111 111 Smbios, … … 146 146 EFI_SMBIOS_PROTOCOL *Smbios; 147 147 SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure; 148 UINT8 *SmbiosTables; 148 149 149 150 // … … 160 161 161 162 // 162 // Add Xen SMBIOS data if found163 // Add Xen or QEMU SMBIOS data if found 163 164 // 164 165 EntryPointStructure = GetXenSmbiosTables (); 165 166 if (EntryPointStructure != NULL) { 166 Status = InstallAllStructures (Smbios, EntryPointStructure); 167 SmbiosTables = (UINT8*)(UINTN)EntryPointStructure->TableAddress; 168 } else { 169 SmbiosTables = GetQemuSmbiosTables (); 170 } 171 172 if (SmbiosTables != NULL) { 173 Status = InstallAllStructures (Smbios, SmbiosTables); 174 175 // 176 // Free SmbiosTables if allocated by Qemu (i.e., NOT by Xen): 177 // 178 if (EntryPointStructure == NULL) { 179 FreePool (SmbiosTables); 180 } 167 181 } 168 182 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
r48674 r58459 26 26 #include <Library/BaseMemoryLib.h> 27 27 #include <Library/UefiBootServicesTableLib.h> 28 #include <Library/MemoryAllocationLib.h> 28 29 29 30 … … 36 37 SMBIOS_TABLE_ENTRY_POINT * 37 38 GetXenSmbiosTables ( 39 VOID 40 ); 41 42 43 /** 44 Locates and extracts the QEMU SMBIOS table data if present in fw_cfg 45 46 @return Address of extracted QEMU SMBIOS data 47 48 **/ 49 UINT8 * 50 GetQemuSmbiosTables ( 38 51 VOID 39 52 ); -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
r48674 r58459 33 33 SmbiosPlatformDxe.c 34 34 Xen.c 35 Qemu.c 35 36 36 37 [Packages] … … 46 47 DebugLib 47 48 HobLib 49 QemuFwCfgLib 50 MemoryAllocationLib 48 51 49 52 [Protocols] -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/build.sh
r48674 r58459 1 #!/ bin/bash1 #!/usr/bin/env bash 2 2 # 3 3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> 4 # Copyright (c) 2010 - 201 1, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # 6 6 # This program and the accompanying materials … … 42 42 # 43 43 44 PROCESSOR=X64 44 ARCH_IA32=no 45 ARCH_X64=no 45 46 BUILDTARGET=DEBUG 46 47 BUILD_OPTIONS= 47 48 PLATFORMFILE= 49 THREADNUMBER=1 48 50 LAST_ARG= 49 51 RUN_QEMU=no 52 ENABLE_FLASH=no 50 53 51 54 # … … 58 61 ;; 59 62 Darwin*) 60 Major=$(uname -r | cut -f 1 -d '.') 61 if [[ $Major == 9 ]] 62 then 63 Major=$(uname -r | cut -f 1 -d '.') 64 case $Major in 65 10) 66 TARGET_TOOLS=XCODE32 67 ;; 68 1[12]) 69 TARGET_TOOLS=XCLANG 70 ;; 71 *) 63 72 echo OvmfPkg requires Snow Leopard or later OS 64 73 exit 1 65 else 66 TARGET_TOOLS=XCODE32 67 fi 68 ;; 74 ;; 75 esac 76 ;; 69 77 Linux*) 70 78 gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}') … … 76 84 TARGET_TOOLS=GCC46 77 85 ;; 86 4.7.*) 87 TARGET_TOOLS=GCC47 88 ;; 89 4.8.*) 90 TARGET_TOOLS=GCC48 91 ;; 92 4.9.*|4.1[0-9].*) 93 TARGET_TOOLS=GCC49 94 ;; 78 95 *) 79 96 TARGET_TOOLS=GCC44 … … 90 107 if [ -z "$LAST_ARG" ]; then 91 108 case $arg in 92 -a|-b|-t|-p )109 -a|-b|-t|-p|-n) 93 110 LAST_ARG=$arg 94 111 ;; … … 98 115 break 99 116 ;; 117 --enable-flash) 118 ENABLE_FLASH=yes 119 ;; 100 120 *) 101 121 BUILD_OPTIONS="$BUILD_OPTIONS $arg" … … 105 125 case $LAST_ARG in 106 126 -a) 107 PROCESSOR=$arg 127 if [[ x"$arg" != x"IA32" && x"$arg" != x"X64" ]]; then 128 echo Unsupported processor architecture: $arg 129 echo Only IA32 or X64 is supported 130 exit 1 131 fi 132 eval ARCH_$arg=yes 108 133 ;; 109 134 -b) … … 116 141 TARGET_TOOLS=$arg 117 142 ;; 143 -n) 144 THREADNUMBER=$arg 145 ;; 118 146 *) 119 147 BUILD_OPTIONS="$BUILD_OPTIONS $arg" … … 125 153 done 126 154 155 if [[ "$ARCH_IA32" == "yes" && "$ARCH_X64" == "yes" ]]; then 156 PROCESSOR=IA32X64 157 Processor=Ia32X64 158 BUILD_OPTIONS="$BUILD_OPTIONS -a IA32 -a X64" 159 PLATFORM_BUILD_DIR=Ovmf3264 160 BUILD_ROOT_ARCH=X64 161 elif [[ "$ARCH_IA32" == "yes" && "$ARCH_X64" == "no" ]]; then 162 PROCESSOR=IA32 163 Processor=Ia32 164 BUILD_OPTIONS="$BUILD_OPTIONS -a IA32" 165 PLATFORM_BUILD_DIR=Ovmf$Processor 166 BUILD_ROOT_ARCH=$PROCESSOR 167 else 168 PROCESSOR=X64 169 Processor=X64 170 BUILD_OPTIONS="$BUILD_OPTIONS -a X64" 171 PLATFORM_BUILD_DIR=Ovmf$Processor 172 BUILD_ROOT_ARCH=X64 173 fi 174 127 175 case $PROCESSOR in 128 176 IA32) 129 Processor=Ia32 130 QEMU_COMMAND=qemu 131 ;; 132 X64) 133 Processor=X64 134 QEMU_COMMAND=qemu-system-x86_64 177 if [ -n "$QEMU_COMMAND" ]; then 178 # 179 # The user set the QEMU_COMMAND variable. We'll use it to run QEMU. 180 # 181 : 182 elif [ -x `which qemu-system-i386` ]; then 183 QEMU_COMMAND=qemu-system-i386 184 elif [ -x `which qemu-system-x86_64` ]; then 185 QEMU_COMMAND=qemu-system-x86_64 186 elif [ -x `which qemu` ]; then 187 QEMU_COMMAND=qemu 188 else 189 echo Unable to find QEMU for IA32 architecture! 190 exit 1 191 fi 192 ;; 193 X64|IA32X64) 194 if [ -z "$QEMU_COMMAND" ]; then 195 # 196 # The user didn't set the QEMU_COMMAND variable. 197 # 198 QEMU_COMMAND=qemu-system-x86_64 199 fi 135 200 ;; 136 201 *) … … 145 210 fi 146 211 147 ADD_QEMU_HDA=yes 148 for arg in "$@" 149 do 150 case $arg in 151 -hd[a-d]|-fd[ab]|-cdrom) 152 ADD_QEMU_HDA=no 153 break 212 if [[ "$RUN_QEMU" == "yes" ]]; then 213 qemu_version=$($QEMU_COMMAND -version 2>&1 | tail -1 | awk '{print $4}') 214 case $qemu_version in 215 1.[6-9].*|1.[1-9][0-9].*|2.*.*) 216 ENABLE_FLASH=yes 154 217 ;; 155 218 esac 156 done 219 220 ADD_QEMU_HDA=yes 221 for arg in "$@" 222 do 223 case $arg in 224 -hd[a-d]|-fd[ab]|-cdrom) 225 ADD_QEMU_HDA=no 226 break 227 ;; 228 esac 229 done 230 fi 157 231 158 232 # … … 167 241 #exit 1 168 242 169 BUILD_ROOT=$WORKSPACE/Build/ Ovmf$Processor/"$BUILDTARGET"_"$TARGET_TOOLS"243 BUILD_ROOT=$WORKSPACE/Build/$PLATFORM_BUILD_DIR/"$BUILDTARGET"_"$TARGET_TOOLS" 170 244 FV_DIR=$BUILD_ROOT/FV 171 BUILD_ROOT_ARCH=$BUILD_ROOT/$ PROCESSOR245 BUILD_ROOT_ARCH=$BUILD_ROOT/$BUILD_ROOT_ARCH 172 246 QEMU_FIRMWARE_DIR=$BUILD_ROOT/QEMU 173 247 … … 192 266 fi 193 267 ln -sf $FV_DIR/OVMF.fd $QEMU_FIRMWARE_DIR/bios.bin 194 ln -sf $FV_DIR/OvmfVideo.rom $QEMU_FIRMWARE_DIR/vgabios-cirrus.bin 268 if [[ "$ENABLE_FLASH" == "yes" ]]; then 269 QEMU_COMMAND="$QEMU_COMMAND -pflash $QEMU_FIRMWARE_DIR/bios.bin" 270 else 271 QEMU_COMMAND="$QEMU_COMMAND -L $QEMU_FIRMWARE_DIR" 272 fi 195 273 if [[ "$ADD_QEMU_HDA" == "yes" ]]; then 196 AUTO_QEMU_HDA="-hda fat:$BUILD_ROOT_ARCH" 197 else 198 AUTO_QEMU_HDA= 199 fi 200 QEMU_COMMAND="$QEMU_COMMAND -L $QEMU_FIRMWARE_DIR $AUTO_QEMU_HDA $*" 274 QEMU_COMMAND="$QEMU_COMMAND -hda fat:$BUILD_ROOT_ARCH" 275 fi 276 QEMU_COMMAND="$QEMU_COMMAND $*" 201 277 echo Running: $QEMU_COMMAND 202 278 $QEMU_COMMAND … … 208 284 # 209 285 echo Running edk2 build for OvmfPkg$Processor 210 build -p $PLATFORMFILE $BUILD_OPTIONS - a $PROCESSOR -b $BUILDTARGET -t $TARGET_TOOLS286 build -p $PLATFORMFILE $BUILD_OPTIONS -b $BUILDTARGET -t $TARGET_TOOLS -n $THREADNUMBER 211 287 exit $? 212 288 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/create-release.py
r48674 r58459 1 1 #!/usr/bin/python 2 2 # 3 # Copyright (c) 2010 - 201 1, Intel Corporation. All rights reserved.<BR>3 # Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR> 4 4 # 5 5 # This program and the accompanying materials … … 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 # 13 14 release_type = 'alpha'15 13 16 14 import os … … 33 31 print "OvmfPkg/OvmfPkgX64.dsc doesn't exist" 34 32 sys.exit(-1) 35 36 if 'TOOLCHAIN' in os.environ:37 TOOLCHAIN = os.environ['TOOLCHAIN']38 else:39 TOOLCHAIN = 'GCC44'40 33 41 34 def run_and_capture_output(args, checkExitCode = True): … … 47 40 return stdout 48 41 49 def git_svn_info(): 42 gcc_version = run_and_capture_output(args=('gcc', '--version')) 43 gcc_re = re.compile(r'\s*\S+\s+\([^\)]+?\)\s+(\d+(?:\.\d+)*)(?:\s+.*)?') 44 mo = gcc_re.match(gcc_version) 45 if not mo: 46 print "Unable to find GCC version" 47 sys.exit(-1) 48 gcc_version = map(lambda n: int(n), mo.group(1).split('.')) 49 50 if 'TOOLCHAIN' in os.environ: 51 TOOLCHAIN = os.environ['TOOLCHAIN'] 52 else: 53 assert(gcc_version[0] == 4) 54 minor = max(4, min(7, gcc_version[1])) 55 TOOLCHAIN = 'GCC4' + str(minor) 56 57 def git_based_version(): 50 58 dir = os.getcwd() 51 os.chdir('OvmfPkg') 52 stdout = run_and_capture_output(args=('git', 'svn', 'info')) 59 if not os.path.exists('.git'): 60 os.chdir('OvmfPkg') 61 stdout = run_and_capture_output(args=('git', 'log', 62 '-n', '1', 63 '--abbrev-commit')) 64 regex = re.compile(r'^\s*git-svn-id:\s+\S+@(\d+)\s+[0-9a-f\-]+$', 65 re.MULTILINE) 66 mo = regex.search(stdout) 67 if mo: 68 version = 'r' + mo.group(1) 69 else: 70 version = stdout.split(None, 3)[1] 53 71 os.chdir(dir) 54 return stdout72 return version 55 73 56 74 def svn_info(): … … 61 79 return stdout 62 80 63 def get_svn_info_output(): 81 def svn_based_version(): 82 buf = svn_info() 83 revision_re = re.compile('^Revision\:\s*([\da-f]+)$', re.MULTILINE) 84 mo = revision_re.search(buf) 85 assert(mo is not None) 86 return 'r' + mo.group(1) 87 88 def get_revision(): 64 89 if os.path.exists(os.path.join('OvmfPkg', '.svn')): 65 return svn_ info()90 return svn_based_version() 66 91 else: 67 return git_svn_info() 68 69 def get_revision(): 70 buf = get_svn_info_output() 71 revision_re = re.compile('^Revision\:\s*(\d+)$', re.MULTILINE) 72 mo = revision_re.search(buf) 73 if mo is not None: 74 return int(mo.group(1)) 92 return git_based_version() 75 93 76 94 revision = get_revision() … … 85 103 machine = run_and_capture_output(args=('uname', '-m')).strip() 86 104 87 gcc_version = run_and_capture_output(args=('gcc', '--version')) 88 gcc_version = gcc_version.split('\n')[0].split()[-1] 105 gcc_version_str = '.'.join(map(lambda v: str(v), gcc_version)) 89 106 90 107 ld_version = run_and_capture_output(args=('ld', '--version')) … … 96 113 97 114 sb = StringIO.StringIO() 98 print >> sb, 'edk2: ', 'r%d' %revision99 print >> sb, 'compiler: GCC', gcc_version 115 print >> sb, 'edk2: ', revision 116 print >> sb, 'compiler: GCC', gcc_version_str, '(' + TOOLCHAIN + ')' 100 117 print >> sb, 'binutils:', ld_version 101 118 print >> sb, 'iasl: ', iasl_version 102 119 print >> sb, 'system: ', distro, machine.replace('_', '-') 103 120 return to_dos_text(sb.getvalue()) 121 122 def read_file(filename): 123 f = open(filename) 124 d = f.read() 125 f.close() 126 return d 104 127 105 128 LICENSE = to_dos_text( … … 117 140 === BSD license: START === 118 141 119 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. 120 121 Redistribution and use in source and binary forms, with or without 122 modification, are permitted provided that the following conditions 123 are met: 124 125 * Redistributions of source code must retain the above copyright 126 notice, this list of conditions and the following disclaimer. 127 * Redistributions in binary form must reproduce the above copyright 128 notice, this list of conditions and the following disclaimer in 129 the documentation and/or other materials provided with the 130 distribution. 131 * Neither the name of the Intel Corporation nor the names of its 132 contributors may be used to endorse or promote products derived 133 from this software without specific prior written permission. 134 135 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 136 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 137 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 138 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 139 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 140 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 141 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 142 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 143 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 144 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 145 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 146 POSSIBILITY OF SUCH DAMAGE. 147 142 ''') 143 144 LICENSE += read_file(os.path.join('MdePkg', 'License.txt')) 145 146 LICENSE += to_dos_text( 147 ''' 148 148 === BSD license: END === 149 149 150 150 === FAT filesystem driver license: START === 151 151 152 Copyright (c) 2004, Intel Corporation. All rights reserved. 153 154 Redistribution and use in source and binary forms, with or without 155 modification, are permitted provided that the following conditions 156 are met: 157 158 * Redistributions of source code must retain the above copyright 159 notice, this list of conditions and the following disclaimer. 160 * Redistributions in binary form must reproduce the above copyright 161 notice, this list of conditions and the following disclaimer in 162 the documentation and/or other materials provided with the 163 distribution. 164 * Neither the name of Intel nor the names of its 165 contributors may be used to endorse or promote products derived 166 from this software without specific prior written permission. 167 168 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 169 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 170 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 171 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 172 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 173 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 174 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 175 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 176 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 177 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 178 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 179 POSSIBILITY OF SUCH DAMAGE. 180 181 Additional terms: 182 In addition to the forgoing, redistribution and use of the code is 183 conditioned upon the FAT 32 File System Driver and all derivative 184 works thereof being used for and designed only to read and/or write 185 to a file system that is directly managed by an Extensible Firmware 186 Interface (EFI) implementation or by an emulator of an EFI 187 implementation. 188 152 ''') 153 154 LICENSE += read_file(os.path.join('FatBinPkg', 'License.txt')) 155 156 LICENSE += to_dos_text( 157 ''' 189 158 === FAT filesystem driver license: END === 190 159 ''') … … 211 180 def create_zip(arch): 212 181 global build_info 213 filename = 'OVMF-%s- r%d-%s.zip' % (arch, revision, release_type)182 filename = 'OVMF-%s-%s.zip' % (arch, revision) 214 183 print 'Creating', filename, '...', 215 184 sys.stdout.flush() … … 228 197 ) 229 198 zipf.write(os.path.join(FV_DIR, 'OVMF.fd'), 'OVMF.fd') 230 zipf.write(os.path.join(FV_DIR, 'CirrusLogic5446.rom'), 'CirrusLogic5446.rom')231 199 zipf.close() 232 200 print '[done]'
Note:
See TracChangeset
for help on using the changeset viewer.