/** @file\r
Helper Library for ACPI\r
\r
- Copyright (c) 2014, ARM Ltd. All rights reserved.\r
+ Copyright (c) 2014-2016, ARM Ltd. All rights reserved.\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
#include <Uefi.h>\r
\r
+#include <IndustryStandard/Acpi10.h>\r
+\r
//\r
// Macros for the Generic Address Space\r
//\r
GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \\r
}\r
\r
+#define EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector, GicVersion) \\r
+ { \\r
+ EFI_ACPI_6_0_GICD, sizeof (EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r
+ GicDistHwId, GicDistBase, GicDistVector, GicVersion, \\r
+ {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE} \\r
+ }\r
+\r
// Note the parking protocol is configured by UEFI if required\r
#define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase) \\r
{ \\r
GicId, AcpiCpuId, Flags, 0, PmuIrq, 0, GicBase \\r
}\r
\r
+// Note the parking protocol is configured by UEFI if required\r
+#define EFI_ACPI_5_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \\r
+ GicBase, GicVBase, GicHBase, GsivId, GicRBase) \\r
+ { \\r
+ EFI_ACPI_5_1_GIC, sizeof (EFI_ACPI_5_1_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r
+ GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \\r
+ GsivId, GicRBase, Mpidr \\r
+ }\r
+\r
+#define EFI_ACPI_6_0_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \\r
+ GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency) \\r
+ { \\r
+ EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r
+ GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \\r
+ GsivId, GicRBase, Mpidr, Efficiency, \\r
+ {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE} \\r
+ }\r
+\r
+#define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase) \\r
+ { \\r
+ EFI_ACPI_6_0_GIC_MSI_FRAME, sizeof (EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r
+ GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase \\r
+ }\r
+\r
+//\r
+// SBSA Generic Watchdog\r
+//\r
+#define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(RefreshFramePhysicalAddress, \\r
+ ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags) \\r
+ { \\r
+ EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG, sizeof(EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \\r
+ EFI_ACPI_RESERVED_BYTE, RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \\r
+ WatchdogTimerGSIV, WatchdogTimerFlags \\r
+ }\r
+\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_LOCATE_ACPI_CHECK) (\r
+ IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader\r
+ );\r
+\r
+/**\r
+ Locate and Install the ACPI tables from the Firmware Volume if it verifies\r
+ the function condition.\r
+\r
+ @param AcpiFile Guid of the ACPI file into the Firmware Volume\r
+ @param CheckAcpiTableFunction Function that checks if the ACPI table should be installed\r
+\r
+ @return EFI_SUCCESS The function completed successfully.\r
+ @return EFI_NOT_FOUND The protocol could not be located.\r
+ @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.\r
+\r
+**/\r
+EFI_STATUS\r
+LocateAndInstallAcpiFromFvConditional (\r
+ IN CONST EFI_GUID* AcpiFile,\r
+ IN EFI_LOCATE_ACPI_CHECK CheckAcpiTableFunction\r
+ );\r
\r
/**\r
Locate and Install the ACPI tables from the Firmware Volume\r