]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Helper Library for ACPI\r | |
3 | \r | |
4 | Copyright (c) 2014, ARM Ltd. All rights reserved.\r | |
5 | \r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __ACPI_LIB_H__\r | |
17 | #define __ACPI_LIB_H__\r | |
18 | \r | |
19 | #include <Uefi.h>\r | |
20 | \r | |
21 | //\r | |
22 | // Macros for the Generic Address Space\r | |
23 | //\r | |
24 | #define NULL_GAS { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_UNDEFINED, 0L }\r | |
25 | #define ARM_GAS8(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_BYTE, Address }\r | |
26 | #define ARM_GAS16(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 16, 0, EFI_ACPI_5_0_WORD, Address }\r | |
27 | #define ARM_GAS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_DWORD, Address }\r | |
28 | #define ARM_GASN(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_DWORD, Address }\r | |
29 | \r | |
30 | //\r | |
31 | // Macros for the Multiple APIC Description Table (MADT)\r | |
32 | //\r | |
33 | #define EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector) \\r | |
34 | { \\r | |
35 | EFI_ACPI_5_0_GICD, sizeof (EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r | |
36 | GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \\r | |
37 | }\r | |
38 | \r | |
39 | // Note the parking protocol is configured by UEFI if required\r | |
40 | #define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase) \\r | |
41 | { \\r | |
42 | EFI_ACPI_5_0_GIC, sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r | |
43 | GicId, AcpiCpuId, Flags, 0, PmuIrq, 0, GicBase \\r | |
44 | }\r | |
45 | \r | |
46 | // Note the parking protocol is configured by UEFI if required\r | |
47 | #define EFI_ACPI_5_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \\r | |
48 | GicBase, GicVBase, GicHBase, GsivId, GicRBase) \\r | |
49 | { \\r | |
50 | EFI_ACPI_5_1_GIC, sizeof (EFI_ACPI_5_1_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r | |
51 | GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \\r | |
52 | GsivId, GicRBase, Mpidr \\r | |
53 | }\r | |
54 | \r | |
55 | #define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase) \\r | |
56 | { \\r | |
57 | EFI_ACPI_6_0_GIC_MSI_FRAME, sizeof (EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE), EFI_ACPI_RESERVED_WORD, \\r | |
58 | GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase \\r | |
59 | }\r | |
60 | \r | |
61 | //\r | |
62 | // SBSA Generic Watchdog\r | |
63 | //\r | |
64 | #define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(RefreshFramePhysicalAddress, \\r | |
65 | ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags) \\r | |
66 | { \\r | |
67 | EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG, sizeof(EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \\r | |
68 | EFI_ACPI_RESERVED_WORD, RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \\r | |
69 | WatchdogTimerGSIV, WatchdogTimerFlags \\r | |
70 | }\r | |
71 | \r | |
72 | /**\r | |
73 | Locate and Install the ACPI tables from the Firmware Volume\r | |
74 | \r | |
75 | @param AcpiFile Guid of the ACPI file into the Firmware Volume\r | |
76 | \r | |
77 | @return EFI_SUCCESS The function completed successfully.\r | |
78 | @return EFI_NOT_FOUND The protocol could not be located.\r | |
79 | @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.\r | |
80 | \r | |
81 | **/\r | |
82 | EFI_STATUS\r | |
83 | LocateAndInstallAcpiFromFv (\r | |
84 | IN CONST EFI_GUID* AcpiFile\r | |
85 | );\r | |
86 | \r | |
87 | #endif // __ACPI_LIB_H__\r |