]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/Q35MchIch9.h
OvmfPkg/SmmControl2Dxe: correct PCI_CONFIG_READ_WRITE in S3 boot script
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Q35MchIch9.h
1 /** @file
2 Various register numbers and value bits based on the following publications:
3 - Intel(R) datasheet 316966-002
4 - Intel(R) datasheet 316972-004
5
6 Copyright (C) 2015, Red Hat, Inc.
7 Copyright (c) 2014, Gabriel L. Somlo <somlo@cmu.edu>
8
9 This program and the accompanying materials are licensed and made available
10 under the terms and conditions of the BSD License which accompanies this
11 distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
15 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 **/
17
18 #ifndef __Q35_MCH_ICH9_H__
19 #define __Q35_MCH_ICH9_H__
20
21 #include <Library/PciLib.h>
22 #include <Uefi/UefiBaseType.h>
23 #include <Uefi/UefiSpec.h>
24 #include <Protocol/PciRootBridgeIo.h>
25
26 //
27 // Host Bridge Device ID (DID) value for Q35/MCH
28 //
29 #define INTEL_Q35_MCH_DEVICE_ID 0x29C0
30
31 //
32 // B/D/F/Type: 0/0/0/PCI
33 //
34 #define DRAMC_REGISTER_Q35(Offset) PCI_LIB_ADDRESS (0, 0, 0, (Offset))
35
36 #define MCH_GGC 0x52
37 #define MCH_GGC_IVD BIT1
38
39 #define MCH_PCIEXBAR_LOW 0x60
40 #define MCH_PCIEXBAR_LOWMASK 0x0FFFFFFF
41 #define MCH_PCIEXBAR_BUS_FF 0
42 #define MCH_PCIEXBAR_EN BIT0
43
44 #define MCH_PCIEXBAR_HIGH 0x64
45 #define MCH_PCIEXBAR_HIGHMASK 0xFFFFFFF0
46
47 #define MCH_SMRAM 0x9D
48 #define MCH_SMRAM_D_LCK BIT4
49 #define MCH_SMRAM_G_SMRAME BIT3
50
51 #define MCH_ESMRAMC 0x9E
52 #define MCH_ESMRAMC_H_SMRAME BIT7
53 #define MCH_ESMRAMC_E_SMERR BIT6
54 #define MCH_ESMRAMC_SM_CACHE BIT5
55 #define MCH_ESMRAMC_SM_L1 BIT4
56 #define MCH_ESMRAMC_SM_L2 BIT3
57 #define MCH_ESMRAMC_TSEG_8MB BIT2
58 #define MCH_ESMRAMC_TSEG_2MB BIT1
59 #define MCH_ESMRAMC_TSEG_1MB 0
60 #define MCH_ESMRAMC_TSEG_MASK (BIT2 | BIT1)
61 #define MCH_ESMRAMC_T_EN BIT0
62
63 #define MCH_GBSM 0xA4
64 #define MCH_GBSM_MB_SHIFT 20
65
66 #define MCH_BGSM 0xA8
67 #define MCH_BGSM_MB_SHIFT 20
68
69 #define MCH_TSEGMB 0xAC
70 #define MCH_TSEGMB_MB_SHIFT 20
71
72 #define MCH_TOLUD 0xB0
73 #define MCH_TOLUD_MB_SHIFT 4
74
75 //
76 // B/D/F/Type: 0/0x1f/0/PCI
77 //
78 #define POWER_MGMT_REGISTER_Q35(Offset) \
79 PCI_LIB_ADDRESS (0, 0x1f, 0, (Offset))
80
81 #define POWER_MGMT_REGISTER_Q35_EFI_PCI_ADDRESS(Offset) \
82 EFI_PCI_ADDRESS (0, 0x1f, 0, (Offset))
83
84 #define ICH9_PMBASE 0x40
85 #define ICH9_PMBASE_MASK (BIT15 | BIT14 | BIT13 | BIT12 | BIT11 | \
86 BIT10 | BIT9 | BIT8 | BIT7)
87
88 #define ICH9_ACPI_CNTL 0x44
89 #define ICH9_ACPI_CNTL_ACPI_EN BIT7
90
91 #define ICH9_GEN_PMCON_1 0xA0
92 #define ICH9_GEN_PMCON_1_SMI_LOCK BIT4
93
94 #define ICH9_RCBA 0xF0
95 #define ICH9_RCBA_EN BIT0
96
97 //
98 // IO ports
99 //
100 #define ICH9_APM_CNT 0xB2
101 #define ICH9_APM_STS 0xB3
102
103 //
104 // IO ports relative to PMBASE
105 //
106 #define ICH9_PMBASE_OFS_SMI_EN 0x30
107 #define ICH9_SMI_EN_APMC_EN BIT5
108 #define ICH9_SMI_EN_GBL_SMI_EN BIT0
109
110 #define ICH9_ROOT_COMPLEX_BASE 0xFED1C000
111
112 #endif