diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /ReferenceCode/AcpiTables/SampleCode/Lpit | |
download | zprj-master.tar.xz |
Diffstat (limited to 'ReferenceCode/AcpiTables/SampleCode/Lpit')
-rw-r--r-- | ReferenceCode/AcpiTables/SampleCode/Lpit/LowPowerIdleTable.h | 68 | ||||
-rw-r--r-- | ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.act | 110 | ||||
-rw-r--r-- | ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.cif | 12 | ||||
-rw-r--r-- | ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.h | 114 | ||||
-rw-r--r-- | ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.mak | 75 | ||||
-rw-r--r-- | ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.sdl | 38 |
6 files changed, 417 insertions, 0 deletions
diff --git a/ReferenceCode/AcpiTables/SampleCode/Lpit/LowPowerIdleTable.h b/ReferenceCode/AcpiTables/SampleCode/Lpit/LowPowerIdleTable.h new file mode 100644 index 0000000..9ef102b --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/Lpit/LowPowerIdleTable.h @@ -0,0 +1,68 @@ +/** @file + +This file defines the Low Power Idle Table definition, defined by +Intel IA-PC LPIT (Low Power Idle Table) Specification draft. + +@copyright +Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. +This file contains an 'Intel Peripheral Driver' and is +licensed for Intel CPUs and chipsets under the terms of your +license agreement with Intel or your vendor. This file may +be modified by the user, subject to additional terms of the +license agreement + +**/ + +#ifndef _LOW_POWER_IDLE_TABLE_H_ +#define _LOW_POWER_IDLE_TABLE_H_ + +// +// Include files +// +#include "Acpi2_0.h" + +// +// LPIT Definitions +// + +#define EFI_ACPI_LOW_POWER_IDLE_TABLE_REVISION 0x1 + +// +// Ensure proper structure formats +// +#pragma pack(1) + +typedef union _EFI_ACPI_LPI_STATE_FLAGS { + struct { + UINT32 Disabled :1; + UINT32 CounterUnavailable :1; + UINT32 Reserved :30; + }; + UINT32 AsUlong; +} EFI_ACPI_LPI_STATE_FLAGS, *PEFI_ACPI_LPI_STATE_FLAGS; + +// Only Mwait LPI here: + +typedef struct _EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR { + UINT32 Type; // offset: 0 + UINT32 Length; // offset: 4 + UINT16 UniqueId; // offset: 8 + UINT8 Reserved[2]; // offset: 10 + EFI_ACPI_LPI_STATE_FLAGS Flags; // offset: 12 + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EntryTrigger; // offset: 16 + UINT32 Residency; // offset: 28 + UINT32 Latency; // offset: 32 + EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResidencyCounter; // offset: 36 + UINT64 ResidencyCounterFrequency; //offset: 48 +} EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR; + +#pragma pack() + +#endif //_LOW_POWER_IDLE_TABLE_H_ diff --git a/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.act b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.act new file mode 100644 index 0000000..82849de --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.act @@ -0,0 +1,110 @@ +/*++ + This file contains an 'Intel Peripheral Driver' and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement + --*/ +/*++ + +Copyright (c) 2013 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + +Lpit.act + +Abstract: + +This file contains a structure definition for the ACPI Low Power Idle Table +(LPIT). The contents of this file should only be modified +for bug fixes, no porting is required. The table layout is defined in +LowPowerIdleTable.h and the table contents are defined in Lpit.h. + +--*/ + + // + // Statements that include other files + // + +#include "Lpit.h" + + // + // Low Power Idle Table + // Please modify all values in Lpit.h only. + // + +EFI_ACPI_LOW_POWER_IDLE_TABLE Lpit = { + + // + // Header + // + + + EFI_ACPI_LOW_POWER_IDLE_TABLE_SIGNATURE, + sizeof (EFI_ACPI_LOW_POWER_IDLE_TABLE), + EFI_ACPI_LOW_POWER_IDLE_TABLE_REVISION , + + // + // Checksum will be updated at runtime + // + 0x00, + + // + // It is expected that these values will be updated at runtime + // + 'A', 'L', 'A', 'S', 'K', 'A', + + 0, + EFI_ACPI_OEM_LPIT_REVISION, + EFI_ACPI_CREATER_ID, + EFI_ACPI_CREATER_REVISION, + + + + // + // Descriptor + // + { + { + EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE, + sizeof(EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR), + EFI_ACPI_HSW_LPI_AUDIO_ID, + {0,0}, + {EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG}, // Flags + EFI_ACPI_HSW_LPI_TRIGGER, //EntryTrigger + EFI_ACPI_HSW_LPI_MIN_RES, //Residency + EFI_ACPI_HSW_LPI_LATENCY, //Latency + EFI_ACPI_HSW_LPI_RES_COUNTER, //ResidencyCounter + EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_TSC //Residency counter frequency + }, + { + EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE, + sizeof(EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR), + EFI_ACPI_HSW_LPI_CS_ID, + {0,0}, + {EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG}, // Flags + EFI_ACPI_HSW_LPI_TRIGGER, //EntryTrigger + EFI_ACPI_HSW_LPI_MIN_RES, //Residency + EFI_ACPI_HSW_LPI_LATENCY, //Latency + EFI_ACPI_HSW_LPI_RES_COUNTER, //ResidencyCounter + EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_TSC //Residency counter frequency + } + } + +}; + +VOID +main ( + VOID + ) + +{ +}
\ No newline at end of file diff --git a/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.cif b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.cif new file mode 100644 index 0000000..b9f6d91 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.cif @@ -0,0 +1,12 @@ +<component> + name = "lpit" + category = ModulePart + LocalRoot = "ReferenceCode\AcpiTables\SampleCode\Lpit\" + RefName = "lpit" +[files] +"LowPowerIdleTable.h" +"lpit.act" +"lpit.h" +"lpit.mak" +"lpit.sdl" +<endComponent> diff --git a/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.h b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.h new file mode 100644 index 0000000..17e6eed --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.h @@ -0,0 +1,114 @@ +/*++ + This file contains an 'Intel Peripheral Driver' and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement + --*/ +/*++ + +Copyright (c) 2013 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + +Lpit.h + +Abstract: + +This file describes the contents of the ACPI Low Power Idle Table (LPIT). +All changes to the LPIT contents should be done in this file. + + + +--*/ + +#ifndef _LPIT_H_ +#define _LPIT_H_ + +// +// Statements that include other files +// + +#include "LowPowerIdleTable.h" + +// +// Defines for LPIT table, some are HSW ULT specific +// + + +// signature "LPIT" +#define EFI_ACPI_LOW_POWER_IDLE_TABLE_SIGNATURE 0x5449504c + +#define EFI_ACPI_OEM_LPIT_REVISION 0x00000000 +#define EFI_ACPI_CREATER_ID 0x2e494d41 //"AMI." +#define EFI_ACPI_CREATER_REVISION 0x5 +#define EFI_ACPI_LOW_POWER_IDLE_MWAIT_TYPE 0x0 +#define EFI_ACPI_LOW_POWER_IDLE_DEFAULT_FLAG 0x0 +#define EFI_ACPI_LOW_POWER_IDLE_NO_RES_COUNTER_FLAG 0x2 +#define EFI_ACPI_LOW_POWER_IDLE_RES_FREQ_TSC 0x0 + +// +// LPI state count (only 1 on HSW ULT) +// + +#define EFI_ACPI_HSW_LPI_STATE_COUNT 2 + +// +// LPI TRIGGER (HW C10 on HSW ULT) +// +#define EFI_ACPI_HSW_LPI_TRIGGER {0x7F,0x1,0x2,0x0,0x60} + +// +// LPI residency counter (HW C10 on HSW ULT) +// +#define EFI_ACPI_HSW_LPI_RES_COUNTER {0x7F,64,0x0,0x0,0x632} + +// +// LPI DUMMY COUNTER +// +#define EFI_ACPI_HSW_DUMMY_RES_COUNTER {0x0,0,0x0,0x0,0x0} + + +// +// LPI break-even residency in us (HW C10 on HSW ULT) +// +#define EFI_ACPI_HSW_LPI_MIN_RES 30000 + +// +// LPI latency in us (HW C10 on HSW ULT) +// +#define EFI_ACPI_HSW_LPI_LATENCY 3000 + +// +// LPI ID (HW C10 on HSW ULT) +// +#define EFI_ACPI_HSW_LPI_AUDIO_ID 0 + +// +// LPI ID (HW C10 on HSW ULT) +// +#define EFI_ACPI_HSW_LPI_CS_ID 1 + +// +// LPI ACPI table header +// + +#pragma pack(1) + +typedef struct _EFI_ACPI_LOW_POWER_IDLE_TABLE { + EFI_ACPI_DESCRIPTION_HEADER Header; + EFI_ACPI_MWAIT_LPI_STATE_DESCRIPTOR LpiStates[EFI_ACPI_HSW_LPI_STATE_COUNT]; +} EFI_ACPI_LOW_POWER_IDLE_TABLE; + +#pragma pack() + + +#endif //_LPIT_H_ diff --git a/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.mak b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.mak new file mode 100644 index 0000000..5c78da2 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.mak @@ -0,0 +1,75 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2013, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +#<AMI_FHDR_START> +# +# Name: lpit.mak +# +# Description: MAke file to build Aptio ACPI ASL components +# +# +#<AMI_FHDR_END> +#************************************************************************* +all : Lpit + +Lpit : $(BUILD_DIR)\Lpit.ffS + +Lpit_Includes = \ + $(EDK_INCLUDES)\ + +Lpit_Defines = \ + /D"TIANO_RELEASE_VERSION=0x00080006"\ + +Lpit_ACPIS = \ + $(BUILD_DIR)\Lpit.acpi\ + +$(BUILD_DIR)\Lpit.asl: $(BUILD_DIR)\token.mak $(LPIT_DIR)\lpit.mak + copy << $@ +<< + +$(BUILD_DIR)\Lpit.exe : $(LPIT_DIR)\lpit.act $(LPIT_DIR)\lpit.h + @CL $(CFLAGS) $(Lpit_Defines) /Fo$(BUILD_DIR)\ $(Lpit_Includes) /TC $(LPIT_DIR)\lpit.act + @Link /OUT:$(BUILD_DIR)\Lpit.exe /NODEFAULTLIB /ENTRY:main $(BUILD_DIR)\Lpit.obj + +$(BUILD_DIR)\Lpit.acpi : $(BUILD_DIR)\Lpit.exe + $(GENACPI) $(BUILD_DIR)\Lpit.exe $(BUILD_DIR)\Lpit.acpi + +$(BUILD_DIR)\Lpit.sec : $(Lpit_ACPIS) + $(GENSECTION) -I $** -O $@ -S EFI_SECTION_RAW + +$(BUILD_DIR)\Lpit.ffs: $(BUILD_DIR)\Lpit.sec $(LPIT_DIR)\lpit.mak + $(MAKE) /f Core\FFS.mak \ + BUILD_DIR=$(BUILD_DIR) \ + GUID=9DD795EB-41E8-4591-8E63-5EF4AA33B908\ + TYPE=EFI_FV_FILETYPE_FREEFORM \ + FFS_CHECKSUM=1\ + RAWFILE=$(BUILD_DIR)\Lpit.sec FFSFILE=$(BUILD_DIR)\Lpit.ffs COMPRESS=0 NAME=Lpit + + + + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.sdl b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.sdl new file mode 100644 index 0000000..188ddd8 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/Lpit/lpit.sdl @@ -0,0 +1,38 @@ +TOKEN + Name = "LPIT_SUPPORT" + Value = "1" + Help = "Main switch to enable LPIT support in Project" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes + Master = Yes +End + +PATH + Name = "LPIT_DIR" +End + +MODULE + Help = "Includes LPIT.mak to Project" + File = "lpit.mak" +End + +ELINK + Name = "$(BUILD_DIR)\Lpit.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + +ELINK + Name = "$(BUILD_DIR)\Lpit.asl" + Parent = "GENERIC_ASL" + InvokeOrder = AfterParent +End + +TOKEN + Name = "LPIT_GUID" + Value = "{0x9dd795eb, 0x41e8, 0x4591, 0x8e, 0x63, 0x5e, 0xf4, 0xaa, 0x33, 0xb9, 0x8}" + Help = "lpit Acpi Package" + TokenType = Expression + TargetH = Yes +End
\ No newline at end of file |