]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/OvmfPlatforms.h
OvmfPkg: Factor out platform detection (q35 vs. piix4)
[mirror_edk2.git] / OvmfPkg / Include / OvmfPlatforms.h
1 /** @file
2 OVMF Platform definitions
3
4 Copyright (c) 2014, Gabriel L. Somlo <somlo@cmu.edu>
5
6 This program and the accompanying materials are licensed and made
7 available under the terms and conditions of the BSD License which
8 accompanies this distribution. The full text of the license may
9 be found at http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 **/
14
15 #ifndef __OVMF_PLATFORMS_H__
16 #define __OVMF_PLATFORMS_H__
17
18 #include <Library/PciLib.h>
19 #include <IndustryStandard/Pci22.h>
20
21 //
22 // Host Bridge Device ID (DID) values for PIIX4 and Q35/MCH
23 //
24 #define INTEL_82441_DEVICE_ID 0x1237 // PIIX4
25 #define INTEL_Q35_MCH_DEVICE_ID 0x29C0 // Q35
26
27 //
28 // OVMF Host Bridge DID Address
29 //
30 #define OVMF_HOSTBRIDGE_DID \
31 PCI_LIB_ADDRESS (0, 0, 0, PCI_DEVICE_ID_OFFSET)
32
33 //
34 // Power Management Device and Function numbers for PIIX4 and Q35/MCH
35 //
36 #define OVMF_PM_DEVICE_PIIX4 0x01
37 #define OVMF_PM_FUNC_PIIX4 0x03
38 #define OVMF_PM_DEVICE_Q35 0x1f
39 #define OVMF_PM_FUNC_Q35 0x00
40
41 //
42 // Power Management Register access for PIIX4 and Q35/MCH
43 //
44 #define POWER_MGMT_REGISTER_PIIX4(Offset) \
45 PCI_LIB_ADDRESS (0, OVMF_PM_DEVICE_PIIX4, OVMF_PM_FUNC_PIIX4, (Offset))
46 #define POWER_MGMT_REGISTER_Q35(Offset) \
47 PCI_LIB_ADDRESS (0, OVMF_PM_DEVICE_Q35, OVMF_PM_FUNC_Q35, (Offset))
48
49 #endif