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