29#define HPET_VALID_PAGE_PROTECTION \
30 (EFI_ACPI_NO_PAGE_PROTECTION | \
31 EFI_ACPI_4KB_PAGE_PROTECTION | \
32 EFI_ACPI_64KB_PAGE_PROTECTION)
73 ASSERT (CfgMgrProtocol !=
NULL);
76 Status = GetEX64ObjHpetInfo (
82 if (EFI_ERROR (Status)) {
85 "ERROR: HPET: Failed to get HPET information." \
94 "HPET: Device base address = 0x%x\n"
95 " : Minimum clock tick in periodic mode = 0x%x\n"
96 " : Page protection and Oem flags = 0x%x\n",
97 HpetInfo->BaseAddressLower32Bit,
98 HpetInfo->MainCounterMinimumClockTickInPeriodicMode,
99 HpetInfo->PageProtectionAndOemAttribute
106 "ERROR: HPET: unsupported page protection flags = 0x%x\n",
107 HpetInfo->PageProtectionAndOemAttribute
110 return EFI_UNSUPPORTED;
114 HpetBlockId.Uint32 =
MmioRead32 (HpetInfo->BaseAddressLower32Bit);
117 if ((HpetBlockId.Uint32 == MAX_UINT32) || (HpetBlockId.Uint32 == 0)) {
118 DEBUG ((DEBUG_ERROR,
"HPET Capabilities register read failed.\n"));
120 return EFI_NOT_FOUND;
124 if (HpetBlockId.Bits.Reserved != 0) {
125 DEBUG ((DEBUG_ERROR,
"HPET Reserved bit is set.\n"));
127 return EFI_UNSUPPORTED;
130 if (HpetBlockId.Bits.Revision == 0) {
131 DEBUG ((DEBUG_ERROR,
"HPET Revision is not set.\n"));
133 return EFI_UNSUPPORTED;
137 if (EFI_ERROR (Status)) {
143 if (EFI_ERROR (Status)) {
149 if (EFI_ERROR (Status)) {
155 if (EFI_ERROR (Status)) {
161 if (EFI_ERROR (Status)) {
168 HpetInfo->BaseAddressLower32Bit,
173 if (EFI_ERROR (Status)) {
178 if ((HpetInfo->PageProtectionAndOemAttribute & 0xF) != 0) {
181 (HpetInfo->PageProtectionAndOemAttribute & 0xF),
185 if (EFI_ERROR (Status)) {
191 if ((HpetInfo->PageProtectionAndOemAttribute >> 4) != 0) {
194 (HpetInfo->PageProtectionAndOemAttribute >> 4),
198 if (EFI_ERROR (Status)) {
242 ASSERT (This !=
NULL);
243 ASSERT (AcpiTableInfo !=
NULL);
244 ASSERT (CfgMgrProtocol !=
NULL);
245 ASSERT (Table !=
NULL);
246 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
247 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
249 if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
250 (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
254 "ERROR: HPET: Requested table revision = %d, is not supported."
255 "Supported table revision: Minimum = %d, Maximum = %d\n",
256 AcpiTableInfo->AcpiTableRevision,
257 This->MinAcpiTableRevision,
258 This->AcpiTableRevision
260 return EFI_INVALID_PARAMETER;
271 if (EFI_ERROR (Status)) {
276 if (EFI_ERROR (Status)) {
283 if (EFI_ERROR (Status)) {
292 if (EFI_ERROR (Status)) {
296 "ERROR: SSDT-HPET: Failed to Serialize SSDT Table Data."
330 ASSERT (This !=
NULL);
331 ASSERT (AcpiTableInfo !=
NULL);
332 ASSERT (CfgMgrProtocol !=
NULL);
333 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
334 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
336 if ((Table ==
NULL) || (*Table ==
NULL)) {
337 DEBUG ((DEBUG_ERROR,
"ERROR: SSDT-HPET: Invalid Table Pointer\n"));
338 ASSERT ((Table !=
NULL) && (*Table !=
NULL));
339 return EFI_INVALID_PARAMETER;
349#define HPET_GENERATOR_REVISION CREATE_REVISION (1, 0)
359 L
"ACPI.STD.SSDT.HPET.GENERATOR",
401 DEBUG ((DEBUG_INFO,
"HPET: Register Generator. Status = %r\n", Status));
425 DEBUG ((DEBUG_INFO,
"HPET: Deregister Generator. Status = %r\n", Status));
#define EFI_ACPI_6_5_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE
EFI_STATUS EFIAPI AmlGetEisaIdFromString(IN CONST CHAR8 *EisaIdStr, OUT UINT32 *EisaIdInt)
EFI_STATUS EFIAPI AcpiSsdtHpetLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC EFI_STATUS EFIAPI FreeSsdtHpetTableResources(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, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
#define HPET_VALID_PAGE_PROTECTION
#define HPET_GENERATOR_REVISION
EFI_STATUS EFIAPI AcpiSsdtHpetLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC EFI_STATUS EFIAPI SsdtHpetUpdateTableInfo(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT AML_OBJECT_NODE_HANDLE ScopeNode)
STATIC EFI_STATUS EFIAPI BuildSsdtHpetTable(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)
STATIC CONST ACPI_TABLE_GENERATOR SsdtHpetGenerator
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
@ EStdAcpiTableIdSsdtHpet
SSDT HPET Generator.
void * AML_ROOT_NODE_HANDLE
EFI_STATUS EFIAPI AmlCodeGenDevice(IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
EFI_STATUS EFIAPI AmlCodeGenNameResourceTemplate(IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode, OPTIONAL OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
EFI_STATUS EFIAPI AmlCodeGenScope(IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
EFI_STATUS EFIAPI AmlCodeGenNameInteger(IN CONST CHAR8 *NameString, IN UINT64 Integer, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
void * AML_OBJECT_NODE_HANDLE
EFI_STATUS EFIAPI AmlCodeGenRdMemory32Fixed(BOOLEAN IsReadWrite, UINT32 Address, UINT32 RangeLength, AML_OBJECT_NODE_HANDLE NameOpNode, AML_DATA_NODE_HANDLE *NewMemNode)
#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)
@ EObjNameSpaceX64
X64 Objects Namespace.
VOID EFIAPI FreePool(IN VOID *Buffer)
UINT32 EFIAPI MmioRead32(IN UINTN Address)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_STATUS EFIAPI AddSsdtAcpiHeader(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, OUT AML_ROOT_NODE_HANDLE *RootNode)
@ EX64ObjHpetInfo
11 - HPET device info
EFI_STATUS EFIAPI AmlDeleteTree(IN AML_NODE_HANDLE Node)
EFI_STATUS EFIAPI AmlSerializeDefinitionBlock(IN AML_ROOT_NODE_HANDLE RootNode, OUT EFI_ACPI_DESCRIPTION_HEADER **Table)