audk/OvmfPkg/AcpiTables/Facp.aslc

96 lines
4.6 KiB
Plaintext
Raw Normal View History

/** @file
FACP Table
Copyright (c) 2013, Red Hat, Inc.
Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are
licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Platform.h"
OvmfPkg: upgrade the FADT to ACPI 2.0 without functional changes This conversion cannot be split very well into smaller patches. Comparing version 1 and version 2 (modulo the header fields): > --- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE > +++ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE > @@ -1,14 +1,14 @@ > EFI_ACPI_DESCRIPTION_HEADER Header; > UINT32 FirmwareCtrl; > UINT32 Dsdt; > - UINT8 IntModel; > - UINT8 Reserved1; > + UINT8 Reserved0; > + UINT8 PreferredPmProfile; The INT_MODEL field was present in ACPI 1.0, but eliminated in 2.0. According to the spec, "platforms should set this field to zero but field values of one are also allowed to maintain compatibility with ACPI 1.0". We're setting it to zero. About Preferred_PM_Profile (taking the place of an 1.0 reserved field), the specification says: This field is set by the OEM to convey the preferred power management profile to OSPM. OSPM can use this field to set default power management policy parameters during OS installation. >From <MdePkg/Include/IndustryStandard/Acpi20.h>: #define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED 0 #define EFI_ACPI_2_0_PM_PROFILE_DESKTOP 1 #define EFI_ACPI_2_0_PM_PROFILE_MOBILE 2 #define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION 3 #define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER 4 #define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER 5 #define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC 6 For a virtual machine, "unspecified" is the best choice. > UINT16 SciInt; > UINT32 SmiCmd; > UINT8 AcpiEnable; > UINT8 AcpiDisable; > UINT8 S4BiosReq; > - UINT8 Reserved2; > + UINT8 PstateCnt; We've been already treating this field as PSTATE_CNT. No change in value. > UINT32 Pm1aEvtBlk; > UINT32 Pm1bEvtBlk; > UINT32 Pm1aCntBlk; > @@ -20,11 +20,11 @@ > UINT8 Pm1EvtLen; > UINT8 Pm1CntLen; > UINT8 Pm2CntLen; > - UINT8 PmTmLen; > + UINT8 PmTmrLen; (Field renaming artifact.) > UINT8 Gpe0BlkLen; > UINT8 Gpe1BlkLen; > UINT8 Gpe1Base; > - UINT8 Reserved3; > + UINT8 CstCnt; We've been already treating this field as CST_CNT. No change in value. > UINT16 PLvl2Lat; > UINT16 PLvl3Lat; > UINT16 FlushSize; > @@ -34,7 +34,19 @@ > UINT8 DayAlrm; > UINT8 MonAlrm; > UINT8 Century; > - UINT8 Reserved4; > - UINT8 Reserved5; > - UINT8 Reserved6; > + UINT16 IaPcBootArch; > + UINT8 Reserved1; The first two octets are now merged into a 16-bit short; otherwise we've been treating those as boot architecture flags already (see SVN rev 13615). No change in value. > UINT32 Flags; The fixed feature flags are not modified, only the macro names (expanding to identical values) are updated to ACPI 2.0. The following fields are all new in ACPI 2.0: > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg; > + UINT8 ResetValue; We don't claim support for the reset register yet. > + UINT8 Reserved2[3]; > + UINT64 XFirmwareCtrl; > + UINT64 XDsdt; The 64-bit physical addresses for the FACS and the DSDT are automatically filled at installation time, see AddTableToList() and DeleteTable() in "MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c". > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk; We specify the extended addresses for the required and supported PM1a Event & Control, PM Timer, and GPE0 Register Blocks, and zero the rest, in accordance with the ACPI 1.0 fields. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14155 6f19259b-4bc3-4df7-8a09-765794883524
2013-03-04 18:37:47 +01:00
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
{
OvmfPkg: upgrade the FADT to ACPI 2.0 without functional changes This conversion cannot be split very well into smaller patches. Comparing version 1 and version 2 (modulo the header fields): > --- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE > +++ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE > @@ -1,14 +1,14 @@ > EFI_ACPI_DESCRIPTION_HEADER Header; > UINT32 FirmwareCtrl; > UINT32 Dsdt; > - UINT8 IntModel; > - UINT8 Reserved1; > + UINT8 Reserved0; > + UINT8 PreferredPmProfile; The INT_MODEL field was present in ACPI 1.0, but eliminated in 2.0. According to the spec, "platforms should set this field to zero but field values of one are also allowed to maintain compatibility with ACPI 1.0". We're setting it to zero. About Preferred_PM_Profile (taking the place of an 1.0 reserved field), the specification says: This field is set by the OEM to convey the preferred power management profile to OSPM. OSPM can use this field to set default power management policy parameters during OS installation. >From <MdePkg/Include/IndustryStandard/Acpi20.h>: #define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED 0 #define EFI_ACPI_2_0_PM_PROFILE_DESKTOP 1 #define EFI_ACPI_2_0_PM_PROFILE_MOBILE 2 #define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION 3 #define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER 4 #define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER 5 #define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC 6 For a virtual machine, "unspecified" is the best choice. > UINT16 SciInt; > UINT32 SmiCmd; > UINT8 AcpiEnable; > UINT8 AcpiDisable; > UINT8 S4BiosReq; > - UINT8 Reserved2; > + UINT8 PstateCnt; We've been already treating this field as PSTATE_CNT. No change in value. > UINT32 Pm1aEvtBlk; > UINT32 Pm1bEvtBlk; > UINT32 Pm1aCntBlk; > @@ -20,11 +20,11 @@ > UINT8 Pm1EvtLen; > UINT8 Pm1CntLen; > UINT8 Pm2CntLen; > - UINT8 PmTmLen; > + UINT8 PmTmrLen; (Field renaming artifact.) > UINT8 Gpe0BlkLen; > UINT8 Gpe1BlkLen; > UINT8 Gpe1Base; > - UINT8 Reserved3; > + UINT8 CstCnt; We've been already treating this field as CST_CNT. No change in value. > UINT16 PLvl2Lat; > UINT16 PLvl3Lat; > UINT16 FlushSize; > @@ -34,7 +34,19 @@ > UINT8 DayAlrm; > UINT8 MonAlrm; > UINT8 Century; > - UINT8 Reserved4; > - UINT8 Reserved5; > - UINT8 Reserved6; > + UINT16 IaPcBootArch; > + UINT8 Reserved1; The first two octets are now merged into a 16-bit short; otherwise we've been treating those as boot architecture flags already (see SVN rev 13615). No change in value. > UINT32 Flags; The fixed feature flags are not modified, only the macro names (expanding to identical values) are updated to ACPI 2.0. The following fields are all new in ACPI 2.0: > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg; > + UINT8 ResetValue; We don't claim support for the reset register yet. > + UINT8 Reserved2[3]; > + UINT64 XFirmwareCtrl; > + UINT64 XDsdt; The 64-bit physical addresses for the FACS and the DSDT are automatically filled at installation time, see AddTableToList() and DeleteTable() in "MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c". > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk; We specify the extended addresses for the required and supported PM1a Event & Control, PM Timer, and GPE0 Register Blocks, and zero the rest, in accordance with the ACPI 1.0 fields. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14155 6f19259b-4bc3-4df7-8a09-765794883524
2013-03-04 18:37:47 +01:00
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
sizeof (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE),
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
0, // to make sum of entire table == 0
{EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
EFI_ACPI_OEM_REVISION, // OEM revision number
EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
},
0, // Physical addesss of FACS
0, // Physical address of DSDT
OvmfPkg: upgrade the FADT to ACPI 2.0 without functional changes This conversion cannot be split very well into smaller patches. Comparing version 1 and version 2 (modulo the header fields): > --- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE > +++ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE > @@ -1,14 +1,14 @@ > EFI_ACPI_DESCRIPTION_HEADER Header; > UINT32 FirmwareCtrl; > UINT32 Dsdt; > - UINT8 IntModel; > - UINT8 Reserved1; > + UINT8 Reserved0; > + UINT8 PreferredPmProfile; The INT_MODEL field was present in ACPI 1.0, but eliminated in 2.0. According to the spec, "platforms should set this field to zero but field values of one are also allowed to maintain compatibility with ACPI 1.0". We're setting it to zero. About Preferred_PM_Profile (taking the place of an 1.0 reserved field), the specification says: This field is set by the OEM to convey the preferred power management profile to OSPM. OSPM can use this field to set default power management policy parameters during OS installation. >From <MdePkg/Include/IndustryStandard/Acpi20.h>: #define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED 0 #define EFI_ACPI_2_0_PM_PROFILE_DESKTOP 1 #define EFI_ACPI_2_0_PM_PROFILE_MOBILE 2 #define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION 3 #define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER 4 #define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER 5 #define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC 6 For a virtual machine, "unspecified" is the best choice. > UINT16 SciInt; > UINT32 SmiCmd; > UINT8 AcpiEnable; > UINT8 AcpiDisable; > UINT8 S4BiosReq; > - UINT8 Reserved2; > + UINT8 PstateCnt; We've been already treating this field as PSTATE_CNT. No change in value. > UINT32 Pm1aEvtBlk; > UINT32 Pm1bEvtBlk; > UINT32 Pm1aCntBlk; > @@ -20,11 +20,11 @@ > UINT8 Pm1EvtLen; > UINT8 Pm1CntLen; > UINT8 Pm2CntLen; > - UINT8 PmTmLen; > + UINT8 PmTmrLen; (Field renaming artifact.) > UINT8 Gpe0BlkLen; > UINT8 Gpe1BlkLen; > UINT8 Gpe1Base; > - UINT8 Reserved3; > + UINT8 CstCnt; We've been already treating this field as CST_CNT. No change in value. > UINT16 PLvl2Lat; > UINT16 PLvl3Lat; > UINT16 FlushSize; > @@ -34,7 +34,19 @@ > UINT8 DayAlrm; > UINT8 MonAlrm; > UINT8 Century; > - UINT8 Reserved4; > - UINT8 Reserved5; > - UINT8 Reserved6; > + UINT16 IaPcBootArch; > + UINT8 Reserved1; The first two octets are now merged into a 16-bit short; otherwise we've been treating those as boot architecture flags already (see SVN rev 13615). No change in value. > UINT32 Flags; The fixed feature flags are not modified, only the macro names (expanding to identical values) are updated to ACPI 2.0. The following fields are all new in ACPI 2.0: > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg; > + UINT8 ResetValue; We don't claim support for the reset register yet. > + UINT8 Reserved2[3]; > + UINT64 XFirmwareCtrl; > + UINT64 XDsdt; The 64-bit physical addresses for the FACS and the DSDT are automatically filled at installation time, see AddTableToList() and DeleteTable() in "MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c". > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk; We specify the extended addresses for the required and supported PM1a Event & Control, PM Timer, and GPE0 Register Blocks, and zero the rest, in accordance with the ACPI 1.0 fields. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14155 6f19259b-4bc3-4df7-8a09-765794883524
2013-03-04 18:37:47 +01:00
RESERVED, // System Interrupt Model in ACPI 1.0, eliminated in 2.0
EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED, // Preferred PM profile
SCI_INT_VECTOR, // System vector of SCI interrupt
SMI_CMD_IO_PORT, // Port address of SMI command port
ACPI_ENABLE, // value to write to port smi_cmd to enable ACPI
ACPI_DISABLE, // value to write to port smi_cmd to disable ACPI
S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS state
0, // PState control
PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk
0, // Power Mgt 1b Event Reg Blk unsupported
PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk
0, // Power Mgt 1b Ctrl Reg Blk unsupported
0, // Power Mgt 2 Ctrl Reg Blk unsupported
PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk
GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk
0, // General Purpose Event 1 Reg Blk unsupported
PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk
PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk
0, // Power Mgt 2 Ctrl Reg Blk unsupported
PM_TM_LEN, // Byte Length of ports at pm_tm_blk
GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk
0, // General Purpose Event 1 Reg Blk unsupported
0, // General Purpose Event 1 Reg Blk unsupported
0, // _CST support
P_LVL2_LAT, // worst case HW latency to enter/exit C2 state
P_LVL3_LAT, // worst case HW latency to enter/exit C3 state
FLUSH_SIZE, // Size of area read to flush caches
FLUSH_STRIDE, // Stride used in flushing caches
DUTY_OFFSET, // bit location of duty cycle field in p_cnt reg
DUTY_WIDTH, // bit width of duty cycle field in p_cnt reg
DAY_ALRM, // index to day-of-month alarm in RTC CMOS RAM
MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM
CENTURY, // index to century in RTC CMOS RAM
OvmfPkg: upgrade the FADT to ACPI 2.0 without functional changes This conversion cannot be split very well into smaller patches. Comparing version 1 and version 2 (modulo the header fields): > --- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE > +++ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE > @@ -1,14 +1,14 @@ > EFI_ACPI_DESCRIPTION_HEADER Header; > UINT32 FirmwareCtrl; > UINT32 Dsdt; > - UINT8 IntModel; > - UINT8 Reserved1; > + UINT8 Reserved0; > + UINT8 PreferredPmProfile; The INT_MODEL field was present in ACPI 1.0, but eliminated in 2.0. According to the spec, "platforms should set this field to zero but field values of one are also allowed to maintain compatibility with ACPI 1.0". We're setting it to zero. About Preferred_PM_Profile (taking the place of an 1.0 reserved field), the specification says: This field is set by the OEM to convey the preferred power management profile to OSPM. OSPM can use this field to set default power management policy parameters during OS installation. >From <MdePkg/Include/IndustryStandard/Acpi20.h>: #define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED 0 #define EFI_ACPI_2_0_PM_PROFILE_DESKTOP 1 #define EFI_ACPI_2_0_PM_PROFILE_MOBILE 2 #define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION 3 #define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER 4 #define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER 5 #define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC 6 For a virtual machine, "unspecified" is the best choice. > UINT16 SciInt; > UINT32 SmiCmd; > UINT8 AcpiEnable; > UINT8 AcpiDisable; > UINT8 S4BiosReq; > - UINT8 Reserved2; > + UINT8 PstateCnt; We've been already treating this field as PSTATE_CNT. No change in value. > UINT32 Pm1aEvtBlk; > UINT32 Pm1bEvtBlk; > UINT32 Pm1aCntBlk; > @@ -20,11 +20,11 @@ > UINT8 Pm1EvtLen; > UINT8 Pm1CntLen; > UINT8 Pm2CntLen; > - UINT8 PmTmLen; > + UINT8 PmTmrLen; (Field renaming artifact.) > UINT8 Gpe0BlkLen; > UINT8 Gpe1BlkLen; > UINT8 Gpe1Base; > - UINT8 Reserved3; > + UINT8 CstCnt; We've been already treating this field as CST_CNT. No change in value. > UINT16 PLvl2Lat; > UINT16 PLvl3Lat; > UINT16 FlushSize; > @@ -34,7 +34,19 @@ > UINT8 DayAlrm; > UINT8 MonAlrm; > UINT8 Century; > - UINT8 Reserved4; > - UINT8 Reserved5; > - UINT8 Reserved6; > + UINT16 IaPcBootArch; > + UINT8 Reserved1; The first two octets are now merged into a 16-bit short; otherwise we've been treating those as boot architecture flags already (see SVN rev 13615). No change in value. > UINT32 Flags; The fixed feature flags are not modified, only the macro names (expanding to identical values) are updated to ACPI 2.0. The following fields are all new in ACPI 2.0: > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg; > + UINT8 ResetValue; We don't claim support for the reset register yet. > + UINT8 Reserved2[3]; > + UINT64 XFirmwareCtrl; > + UINT64 XDsdt; The 64-bit physical addresses for the FACS and the DSDT are automatically filled at installation time, see AddTableToList() and DeleteTable() in "MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c". > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk; We specify the extended addresses for the required and supported PM1a Event & Control, PM Timer, and GPE0 Register Blocks, and zero the rest, in accordance with the ACPI 1.0 fields. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14155 6f19259b-4bc3-4df7-8a09-765794883524
2013-03-04 18:37:47 +01:00
0x0000, // Boot architecture flag (16-bit)
RESERVED, // reserved
OvmfPkg: upgrade the FADT to ACPI 2.0 without functional changes This conversion cannot be split very well into smaller patches. Comparing version 1 and version 2 (modulo the header fields): > --- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE > +++ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE > @@ -1,14 +1,14 @@ > EFI_ACPI_DESCRIPTION_HEADER Header; > UINT32 FirmwareCtrl; > UINT32 Dsdt; > - UINT8 IntModel; > - UINT8 Reserved1; > + UINT8 Reserved0; > + UINT8 PreferredPmProfile; The INT_MODEL field was present in ACPI 1.0, but eliminated in 2.0. According to the spec, "platforms should set this field to zero but field values of one are also allowed to maintain compatibility with ACPI 1.0". We're setting it to zero. About Preferred_PM_Profile (taking the place of an 1.0 reserved field), the specification says: This field is set by the OEM to convey the preferred power management profile to OSPM. OSPM can use this field to set default power management policy parameters during OS installation. >From <MdePkg/Include/IndustryStandard/Acpi20.h>: #define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED 0 #define EFI_ACPI_2_0_PM_PROFILE_DESKTOP 1 #define EFI_ACPI_2_0_PM_PROFILE_MOBILE 2 #define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION 3 #define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER 4 #define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER 5 #define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC 6 For a virtual machine, "unspecified" is the best choice. > UINT16 SciInt; > UINT32 SmiCmd; > UINT8 AcpiEnable; > UINT8 AcpiDisable; > UINT8 S4BiosReq; > - UINT8 Reserved2; > + UINT8 PstateCnt; We've been already treating this field as PSTATE_CNT. No change in value. > UINT32 Pm1aEvtBlk; > UINT32 Pm1bEvtBlk; > UINT32 Pm1aCntBlk; > @@ -20,11 +20,11 @@ > UINT8 Pm1EvtLen; > UINT8 Pm1CntLen; > UINT8 Pm2CntLen; > - UINT8 PmTmLen; > + UINT8 PmTmrLen; (Field renaming artifact.) > UINT8 Gpe0BlkLen; > UINT8 Gpe1BlkLen; > UINT8 Gpe1Base; > - UINT8 Reserved3; > + UINT8 CstCnt; We've been already treating this field as CST_CNT. No change in value. > UINT16 PLvl2Lat; > UINT16 PLvl3Lat; > UINT16 FlushSize; > @@ -34,7 +34,19 @@ > UINT8 DayAlrm; > UINT8 MonAlrm; > UINT8 Century; > - UINT8 Reserved4; > - UINT8 Reserved5; > - UINT8 Reserved6; > + UINT16 IaPcBootArch; > + UINT8 Reserved1; The first two octets are now merged into a 16-bit short; otherwise we've been treating those as boot architecture flags already (see SVN rev 13615). No change in value. > UINT32 Flags; The fixed feature flags are not modified, only the macro names (expanding to identical values) are updated to ACPI 2.0. The following fields are all new in ACPI 2.0: > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg; > + UINT8 ResetValue; We don't claim support for the reset register yet. > + UINT8 Reserved2[3]; > + UINT64 XFirmwareCtrl; > + UINT64 XDsdt; The 64-bit physical addresses for the FACS and the DSDT are automatically filled at installation time, see AddTableToList() and DeleteTable() in "MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c". > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk; > + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk; We specify the extended addresses for the required and supported PM1a Event & Control, PM Timer, and GPE0 Register Blocks, and zero the rest, in accordance with the ACPI 1.0 fields. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14155 6f19259b-4bc3-4df7-8a09-765794883524
2013-03-04 18:37:47 +01:00
FLAG, // Fixed feature flags
{ 0 }, // Address of the Reset Register
0, // Value for the Reset Register to reset the system
{ RESERVED }, // reserved[3]
0, // 64-bit physical addesss of FACS, set at installation
0, // 64-bit physical addesss of DSDT, set at installation
GAS2_IO(PM1a_EVT_BLK, PM1_EVT_LEN), // Ext. addr. of PM 1a Event Reg Blk
{ 0 }, // PM 1b Event Reg Blk unsupported
GAS2_IO(PM1a_CNT_BLK, PM1_CNT_LEN), // Ext. addr. of PM 1a Ctrl Reg Blk
{ 0 }, // PM 1b Ctrl Reg Blk unsupported
{ 0 }, // PM 2 Ctrl Reg Blk unsupported
GAS2_IO(PM_TMR_BLK, PM_TM_LEN), // Ext. addr. of PM Timer Ctrl Reg Blk
GAS2_IO(GPE0_BLK, GPE0_BLK_LEN), // Ext. addr. of GPE 0 Reg Blk
{ 0 } // GPE 1 Reg Blk unsupported
};
VOID*
ReferenceAcpiTable (
VOID
)
{
//
// Reference the table being generated to prevent the optimizer from removing the
// data structure from the exeutable
//
return (VOID*)&FACP;
}