24#define HPET_VALID_PAGE_PROTECTION \
25 (EFI_ACPI_NO_PAGE_PROTECTION | \
26 EFI_ACPI_4KB_PAGE_PROTECTION | \
27 EFI_ACPI_64KB_PAGE_PROTECTION)
50 { EFI_ACPI_6_5_SYSTEM_MEMORY, 64,0, EFI_ACPI_RESERVED_BYTE, 0 },
56 EFI_ACPI_NO_PAGE_PROTECTION
84 ASSERT (CfgMgrProtocol !=
NULL);
87 Status = GetEX64ObjHpetInfo (
93 if (EFI_ERROR (Status)) {
96 "ERROR: HPET: Failed to get HPET information." \
105 "HPET: Device base address = 0x%x\n"
106 " : Minimum clock tick in periodic mode = 0x%x\n"
107 " : Page protection and Oem flags = 0x%x\n",
108 HpetInfo->BaseAddressLower32Bit,
109 HpetInfo->MainCounterMinimumClockTickInPeriodicMode,
110 HpetInfo->PageProtectionAndOemAttribute
117 "ERROR: HPET: unsupported page protection flags = 0x%x\n",
118 HpetInfo->PageProtectionAndOemAttribute
121 return EFI_UNSUPPORTED;
125 HpetBlockId.Uint32 =
MmioRead32 (HpetInfo->BaseAddressLower32Bit);
128 if ((HpetBlockId.Uint32 == MAX_UINT32) || (HpetBlockId.Uint32 == 0)) {
129 DEBUG ((DEBUG_ERROR,
"HPET Capabilities register read failed.\n"));
131 return EFI_NOT_FOUND;
135 if (HpetBlockId.Bits.Reserved != 0) {
136 DEBUG ((DEBUG_ERROR,
"HPET Reserved bit is set.\n"));
138 return EFI_UNSUPPORTED;
141 if (HpetBlockId.Bits.Revision == 0) {
142 DEBUG ((DEBUG_ERROR,
"HPET Revision is not set.\n"));
144 return EFI_UNSUPPORTED;
148 AcpiHpet.EventTimerBlockId = HpetBlockId.Uint32;
151 AcpiHpet.BaseAddressLower32Bit.Address = HpetInfo->BaseAddressLower32Bit;
154 AcpiHpet.MainCounterMinimumClockTickInPeriodicMode = HpetInfo->MainCounterMinimumClockTickInPeriodicMode;
157 AcpiHpet.PageProtectionAndOemAttribute = HpetInfo->PageProtectionAndOemAttribute;
195 ASSERT (This !=
NULL);
196 ASSERT (AcpiTableInfo !=
NULL);
197 ASSERT (CfgMgrProtocol !=
NULL);
198 ASSERT (Table !=
NULL);
199 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
200 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
202 if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
203 (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
207 "ERROR: HPET: Requested table revision = %d, is not supported."
208 "Supported table revision: Minimum = %d, Maximum = %d\n",
209 AcpiTableInfo->AcpiTableRevision,
210 This->MinAcpiTableRevision,
211 This->AcpiTableRevision
213 return EFI_INVALID_PARAMETER;
225 if (EFI_ERROR (Status)) {
228 "ERROR: HPET: Failed to add ACPI header. Status = %r\n",
236 if (EFI_ERROR (Status)) {
247#define HPET_GENERATOR_REVISION CREATE_REVISION (1, 0)
257 L
"ACPI.STD.HPET.GENERATOR",
300 DEBUG ((DEBUG_INFO,
"HPET: Register Generator. Status = %r\n", Status));
324 DEBUG ((DEBUG_INFO,
"HPET: Deregister Generator. Status = %r\n", Status));
#define EFI_ACPI_6_5_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE
STATIC EFI_STATUS EFIAPI HpetUpdateTableInfo(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol)
#define HPET_VALID_PAGE_PROTECTION
#define HPET_GENERATOR_REVISION
STATIC EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER AcpiHpet
STATIC EFI_STATUS EFIAPI BuildHpetTable(IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
EFI_STATUS EFIAPI AcpiHpetLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC CONST ACPI_TABLE_GENERATOR HpetGenerator
EFI_STATUS EFIAPI AcpiHpetLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI RegisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
EFI_STATUS EFIAPI DeregisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdHpet
HPET Generator.
#define ACPI_HEADER(Signature, Type, Revision)
#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)
@ EObjNameSpaceX64
X64 Objects Namespace.
#define EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_REVISION
UINT32 EFIAPI MmioRead32(IN UINTN Address)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_STATUS EFIAPI AddAcpiHeader(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN OUT EFI_ACPI_DESCRIPTION_HEADER *CONST AcpiHeader, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST UINT32 Length)
@ EX64ObjHpetInfo
11 - HPET device info