3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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.
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.
21 This is an implementation of the ACPI platform driver. Requirements for
22 this driver are defined in the Tiano ACPI External Product Specification,
28 #ifndef _ACPI_PLATFORM_H_
29 #define _ACPI_PLATFORM_H_
32 // Statements that include other header files.
34 #include <FrameworkDxe.h>
37 #include <Library/UefiLib.h>
38 #include <Library/BaseLib.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/UefiRuntimeServicesTableLib.h>
41 #include <Library/DebugLib.h>
42 #include <Protocol/FirmwareVolume.h>
43 #include <Library/PcdLib.h>
44 #include <IndustryStandard/HighPrecisionEventTimerTable.h>
45 #include <IndustryStandard/Acpi.h>
46 #include <Protocol/AcpiSystemDescriptionTable.h>
47 #include <Protocol/MpService.h>
48 #include <Protocol/CpuIo.h>
49 #include <IndustryStandard/Acpi30.h>
50 #include <IndustryStandard/Acpi20.h>
51 #include <Library/HobLib.h>
52 #include <AlertStandardFormatTable.h>
53 #include <Guid/SetupVariable.h>
54 #include <Protocol/GlobalNvsArea.h>
55 #include <Library/BaseMemoryLib.h>
56 #include <Library/MemoryAllocationLib.h>
58 #include <Library/PchPlatformLib.h>
62 extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea
;
65 // ACPI table information used to initialize tables.
66 #define EFI_ACPI_OEM_REVISION 0x00000003
67 #define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('V', 'L', 'V', '2')
68 #define EFI_ACPI_CREATOR_REVISION 0x0100000D
70 #define WPCN381U_CONFIG_INDEX 0x2E
71 #define WPCN381U_CONFIG_DATA 0x2F
72 #define WPCN381U_CHIP_ID 0xF4
73 #define WDCP376_CHIP_ID 0xF1
75 #define MOBILE_PLATFORM 1
76 #define DESKTOP_PLATFORM 2
79 // Define macros to build data structure signatures from characters.
81 #ifndef EFI_SIGNATURE_16
82 #define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
84 #ifndef EFI_SIGNATURE_32
85 #define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
87 #ifndef EFI_SIGNATURE_64
88 #define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
89 (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
93 #define GV3_SSDT_OEM_TABLE_IDBASE 0x4000
96 // Private Driver Data.
99 // Define Union of IO APIC & Local APIC structure.
102 EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE AcpiLocalApic
;
103 EFI_ACPI_2_0_IO_APIC_STRUCTURE AcpiIoApic
;
108 } ACPI_APIC_STRUCTURE_PTR
;
111 // Protocol private structure definition.
115 Entry point of the ACPI platform driver.
117 @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
118 @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
120 @retval EFI_SUCCESS Driver initialized successfully.
121 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
122 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
126 InstallAcpiPlatform (
127 IN EFI_HANDLE ImageHandle
,
128 IN EFI_SYSTEM_TABLE
*SystemTable
132 Get Acpi Table Version.
134 @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
135 @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
137 @retval EFI_SUCCESS: Driver initialized successfully.
138 @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded.
139 @retval EFI_OUT_OF_RESOURCES: Could not allocate needed resources.
142 EFI_ACPI_TABLE_VERSION
143 GetAcpiTableVersion (
148 The funtion returns Oem specific information of Acpi Platform.
150 @param[in] OemId OemId returned.
151 @param[in] OemTableId OemTableId returned.
152 @param[in] OemRevision OemRevision returned.
154 @retval EFI_STATUS Status of function execution.
158 AcpiPlatformGetOemFields (
160 OUT UINT64
*OemTableId
,
161 OUT UINT32
*OemRevision
165 The function returns Acpi table version.
169 @retval EFI_ACPI_TABLE_VERSION Acpi table version encoded as a UINT32.
172 EFI_ACPI_TABLE_VERSION
173 AcpiPlatformGetAcpiSetting (
178 Entry point for Acpi platform driver.
180 @param[in] ImageHandle A handle for the image that is initializing this driver.
181 @param[in] SystemTable A pointer to the EFI system table.
183 @retval EFI_SUCCESS Driver initialized successfully.
184 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
185 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
190 AcpiPlatformEntryPoint (
191 IN EFI_HANDLE ImageHandle
,
192 IN EFI_SYSTEM_TABLE
*SystemTable
212 SettingI2CTouchAddress (
220 IN EFI_HANDLE ImageHandle
,
221 IN EFI_SYSTEM_TABLE
*SystemTable