]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2TbltDevicePkg / AcpiPlatform / AcpiPlatformHooks.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13
14 Module Name:
15
16 AcpiPlatformHooks.h
17
18 Abstract:
19
20 This is an implementation of the ACPI platform driver. Requirements for
21 this driver are defined in the Tiano ACPI External Product Specification,
22 revision 0.3.6.
23
24 --*/
25
26 #ifndef _ACPI_PLATFORM_HOOKS_H_
27 #define _ACPI_PLATFORM_HOOKS_H_
28
29 //
30 // Statements that include other header files
31 //
32
33 #include <IndustryStandard/Acpi.h>
34 #include "Platform.h"
35 #include <Protocol/EnhancedSpeedstep.h>
36
37 #define AML_NAME_OP 0x08
38 #define AML_METHOD_OP 0x14
39 #define AML_OPREGION_OP 0x80
40 #define AML_PACKAGE_OP 0x12 // Package operator.
41 #define AML_NAME_PREFIX_SIZE 0x06
42 #define AML_NAME_DWORD_SIZE 0x0C
43
44 #pragma pack(1)
45
46 typedef struct {
47 UINT8 AcpiProcessorId;
48 UINT8 ApicId;
49 UINT16 Flags;
50 } EFI_CPU_ID_MAP;
51
52 typedef struct {
53 UINT8 StartByte;
54 UINT32 NameStr;
55 UINT8 Size;
56 UINT32 Value;
57 } EFI_ACPI_NAMEPACK_DWORD;
58
59 typedef struct {
60 UINT8 StartByte;
61 UINT32 NameStr;
62 UINT8 OpCode;
63 UINT16 Size; // Hardcode to 16bit width because the table we use is fixed size
64 UINT8 NumEntries;
65 } EFI_ACPI_NAME_COMMAND;
66
67 typedef struct {
68 UINT8 PackageOp;
69 UINT8 PkgLeadByte;
70 UINT8 NumEntries;
71 UINT8 DwordPrefix0;
72 UINT32 CoreFreq;
73 UINT8 DwordPrefix1;
74 UINT32 Power;
75 UINT8 DwordPrefix2;
76 UINT32 TransLatency;
77 UINT8 DwordPrefix3;
78 UINT32 BMLatency;
79 UINT8 DwordPrefix4;
80 UINT32 Control;
81 UINT8 DwordPrefix5;
82 UINT32 Status;
83 } EFI_PSS_PACKAGE;
84
85 typedef struct {
86 UINT8 PackageOp;
87 UINT8 PkgLeadByte;
88 UINT8 NumEntries;
89 UINT8 BytePrefix0;
90 UINT8 Entries;
91 UINT8 BytePrefix1;
92 UINT8 Revision;
93 UINT8 BytePrefix2;
94 UINT8 Domain;
95 UINT8 BytePrefix3;
96 UINT8 Coordinate;
97 UINT8 BytePrefix4;
98 UINT8 ProcNumber;
99 } EFI_PSD_PACKAGE;
100
101 #pragma pack()
102
103 #define ACPI_NAME_COMMAND_FROM_NAME_STR(a) BASE_CR (a, EFI_ACPI_NAME_COMMAND, NameStr)
104 #define ACPI_NAME_COMMAND_FROM_NAMEPACK_STR(a) BASE_CR (a, EFI_ACPI_NAMEPACK_DWORD, NameStr)
105
106 EFI_STATUS
107 PlatformHookInit (
108 VOID
109 );
110
111
112 EFI_STATUS
113 PatchDsdtTable (
114 IN OUT EFI_ACPI_DESCRIPTION_HEADER *TableHeader
115 );
116
117 EFI_STATUS
118 PatchGv3SsdtTable (
119 IN OUT EFI_ACPI_DESCRIPTION_HEADER *Table
120 );
121
122 EFI_STATUS
123 PatchErstTable (
124 IN OUT EFI_ACPI_DESCRIPTION_HEADER *Table
125 );
126
127 EFI_STATUS
128 AppendCpuMapTableEntry (
129 IN EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE *AcpiLocalApic
130 );
131
132 #endif