]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/IndustryStandard/Acpi.h
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / C / Include / IndustryStandard / Acpi.h
1 /** @file
2 This file contains some basic ACPI definitions that are consumed by drivers
3 that do not care about ACPI versions.
4
5 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef _ACPI_H_
12 #define _ACPI_H_
13
14 //
15 // Common table header, this prefaces all ACPI tables, including FACS, but
16 // excluding the RSD PTR structure
17 //
18 typedef struct {
19 UINT32 Signature;
20 UINT32 Length;
21 } EFI_ACPI_COMMON_HEADER;
22
23 //
24 // Common ACPI description table header. This structure prefaces most ACPI tables.
25 //
26 #pragma pack(1)
27
28 typedef struct {
29 UINT32 Signature;
30 UINT32 Length;
31 UINT8 Revision;
32 UINT8 Checksum;
33 UINT8 OemId[6];
34 UINT64 OemTableId;
35 UINT32 OemRevision;
36 UINT32 CreatorId;
37 UINT32 CreatorRevision;
38 } EFI_ACPI_DESCRIPTION_HEADER;
39
40 #pragma pack()
41 //
42 // Define for Pci Host Bridge Resource Allocation
43 //
44 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
45 #define ACPI_END_TAG_DESCRIPTOR 0x79
46
47 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
48 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
49 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
50
51 //
52 // Power Management Timer frequency is fixed at 3.579545MHz
53 //
54 #define ACPI_TIMER_FREQUENCY 3579545
55
56 //
57 // Make sure structures match spec
58 //
59 #pragma pack(1)
60
61 typedef struct {
62 UINT8 Desc;
63 UINT16 Len;
64 UINT8 ResType;
65 UINT8 GenFlag;
66 UINT8 SpecificFlag;
67 UINT64 AddrSpaceGranularity;
68 UINT64 AddrRangeMin;
69 UINT64 AddrRangeMax;
70 UINT64 AddrTranslationOffset;
71 UINT64 AddrLen;
72 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
73
74 typedef struct {
75 UINT8 Desc;
76 UINT8 Checksum;
77 } EFI_ACPI_END_TAG_DESCRIPTOR;
78
79 //
80 // General use definitions
81 //
82 #define EFI_ACPI_RESERVED_BYTE 0x00
83 #define EFI_ACPI_RESERVED_WORD 0x0000
84 #define EFI_ACPI_RESERVED_DWORD 0x00000000
85 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
86
87 //
88 // Resource Type Specific Flags
89 // Ref ACPI specification 6.4.3.5.5
90 //
91 // Bit [0] : Write Status, _RW
92 //
93 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
94 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
95 //
96 // Bit [2:1] : Memory Attributes, _MEM
97 //
98 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
99 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
100 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
101 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
102 //
103 // Bit [4:3] : Memory Attributes, _MTP
104 //
105 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
106 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
107 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
108 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
109 //
110 // Bit [5] : Memory to I/O Translation, _TTP
111 //
112 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
113 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
114
115 #pragma pack()
116
117 #endif