]>
Commit | Line | Data |
---|---|---|
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 | |
14 | Module Name:\r | |
15 | \r | |
16 | SmmPlatform.h\r | |
17 | \r | |
18 | Abstract:\r | |
19 | \r | |
20 | Header file for\r | |
21 | \r | |
22 | ++*/\r | |
23 | \r | |
24 | #ifndef _PLATFORM_H\r | |
25 | #define _PLATFORM_H\r | |
26 | \r | |
27 | #include <PiSmm.h>\r | |
28 | \r | |
29 | \r | |
30 | \r | |
31 | #include <Protocol/SmmBase.h>\r | |
32 | #include <Protocol/FirmwareVolume.h>\r | |
33 | #include <Protocol/SmmPowerButtonDispatch.h>\r | |
34 | #include <Protocol/SmmSxDispatch.h>\r | |
35 | #include <Protocol/SmmSwDispatch.h>\r | |
36 | #include <Protocol/SmmSwDispatch2.h>\r | |
37 | #include <Protocol/SmmIchnDispatch.h>\r | |
38 | #include <Protocol/SmmAccess.h>\r | |
39 | #include <Protocol/SmmVariable.h>\r | |
40 | #include <Protocol/PciRootBridgeIo.h>\r | |
41 | #include <Protocol/LoadedImage.h>\r | |
42 | #include "Protocol/GlobalNvsArea.h"\r | |
43 | #include <Guid/AcpiVariableCompatibility.h>\r | |
44 | #include <Guid/SetupVariable.h>\r | |
45 | #include <Guid/EfiVpdData.h>\r | |
46 | #include <Guid/PciLanInfo.h>\r | |
47 | #include <IndustryStandard/Pci22.h>\r | |
48 | \r | |
49 | #include "PchAccess.h"\r | |
50 | #include "PlatformBaseAddresses.h"\r | |
51 | \r | |
52 | #include <Library/UefiBootServicesTableLib.h>\r | |
53 | #include <Library/S3BootScriptLib.h>\r | |
54 | #include <Library/IoLib.h>\r | |
55 | #include <Library/DebugLib.h>\r | |
56 | #include <Library/HobLib.h>\r | |
57 | #include <Library/BaseLib.h>\r | |
58 | #include <Library/BaseMemoryLib.h>\r | |
59 | #include <Library/DevicePathLib.h>\r | |
60 | #include <Library/PcdLib.h>\r | |
61 | #include <Library/PchPlatformLib.h>\r | |
62 | #include <Library/StallSmmLib.h>\r | |
63 | \r | |
64 | \r | |
65 | \r | |
66 | typedef struct {\r | |
67 | UINT8 Register;\r | |
68 | UINT8 Function;\r | |
69 | UINT8 Device;\r | |
70 | UINT8 Bus;\r | |
71 | UINT32 ExtendedRegister;\r | |
72 | } SMM_PCI_IO_ADDRESS;\r | |
73 | \r | |
74 | typedef struct {\r | |
75 | CHAR8 BoardAaNumber[7];\r | |
76 | UINTN BoardFabNumber;\r | |
77 | } BOARD_AA_NUMBER_DECODE;\r | |
78 | \r | |
79 | //\r | |
80 | // BugBug -- Need to get these two values from acpi.h, but right now, they are\r | |
81 | // declared in platform-specific variants of this file, so no easy\r | |
82 | // way to pick-up the include file and work across platforms.\r | |
83 | // Need these definitions to go into a file like common\acpi.h.\r | |
84 | //\r | |
85 | #define ACPI_ENABLE 0xA0\r | |
86 | #define ACPI_DISABLE 0xA1\r | |
87 | \r | |
88 | #define APM_12_FUNCS 0x50\r | |
89 | #define SMI_SET_SMMVARIABLE_PROTOCOL 0x51 // this is used in Cpu\Pentium\Smm\Base\SmmBase.c\r | |
90 | \r | |
91 | #define SMI_CMD_GET_MSEG_STATUS 0x70\r | |
92 | #define SMI_CMD_UPDATE_MSEG_SIZE 0x71\r | |
93 | #define SMI_CMD_LOAD_STM 0x72\r | |
94 | #define SMI_CMD_UNLOAD_STM 0x73\r | |
95 | #define SMI_CMD_GET_SMRAM_RANGES 0x74\r | |
96 | \r | |
97 | \r | |
98 | #define PCAT_RTC_ADDRESS_REGISTER 0x74\r | |
99 | #define PCAT_RTC_DATA_REGISTER 0x75\r | |
100 | \r | |
101 | #define RTC_ADDRESS_SECOND 0x00\r | |
102 | #define RTC_ADDRESS_SECOND_ALARM 0x01\r | |
103 | #define RTC_ADDRESS_MINUTE 0x02\r | |
104 | #define RTC_ADDRESS_MINUTE_ALARM 0x03\r | |
105 | #define RTC_ADDRESS_HOUR 0x04\r | |
106 | #define RTC_ADDRESS_HOUR_ALARM 0x05\r | |
107 | \r | |
108 | #define RTC_ADDRESS_REGISTER_A 0x0A\r | |
109 | #define RTC_ADDRESS_REGISTER_B 0x0B\r | |
110 | #define RTC_ADDRESS_REGISTER_C 0x0C\r | |
111 | #define RTC_ADDRESS_REGISTER_D 0x0D\r | |
112 | \r | |
113 | #define B_RTC_ALARM_INT_ENABLE 0x20\r | |
114 | #define B_RTC_ALARM_INT_STATUS 0x20\r | |
115 | \r | |
116 | #define B_RTC_DATE_ALARM_MASK 0x3F\r | |
117 | \r | |
118 | #define PCAT_CMOS_2_ADDRESS_REGISTER 0x72\r | |
119 | #define PCAT_CMOS_2_DATA_REGISTER 0x73\r | |
120 | \r | |
121 | #define EC_C_PORT 0x66\r | |
122 | #define SMC_SMI_DISABLE 0xBC\r | |
123 | #define SMC_ENABLE_ACPI_MODE 0xAA // Enable ACPI mode\r | |
124 | \r | |
125 | #define IO_MISC 156\r | |
126 | \r | |
127 | \r | |
128 | #define MAXIMUM_NUMBER_OF_PSTATES 12\r | |
129 | #define ICH_SMM_DATA_PORT 0xB3\r | |
130 | \r | |
131 | #define EFI_IA32_PMG_CST_CONFIG 0x000000E2\r | |
132 | #define B_EFI_CST_CONTROL_LOCK BIT15\r | |
133 | #define B_EFI_IO_MWAIT_REDIRECTION_ENABLE BIT10\r | |
134 | #define EFI_IA32_PMG_IO_CAPTURE_ADDR 0x000000E4\r | |
135 | \r | |
136 | extern EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *mPciRootBridgeIo;\r | |
137 | \r | |
138 | //\r | |
139 | // Callback function prototypes\r | |
140 | //\r | |
141 | VOID\r | |
142 | EFIAPI\r | |
143 | PowerButtonCallback (\r | |
144 | IN EFI_HANDLE DispatchHandle,\r | |
145 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext\r | |
146 | );\r | |
147 | \r | |
148 | VOID\r | |
149 | S5SleepWakeOnLanCallBack (\r | |
150 | IN EFI_HANDLE DispatchHandle,\r | |
151 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
152 | );\r | |
153 | \r | |
154 | VOID\r | |
155 | EFIAPI\r | |
156 | S5SleepAcLossCallBack (\r | |
157 | IN EFI_HANDLE DispatchHandle,\r | |
158 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
159 | );\r | |
160 | \r | |
161 | \r | |
162 | VOID\r | |
163 | EFIAPI \r | |
164 | S4S5CallBack (\r | |
165 | IN EFI_HANDLE DispatchHandle,\r | |
166 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
167 | );\r | |
168 | \r | |
169 | VOID\r | |
170 | EFIAPI \r | |
171 | EnableAcpiCallback (\r | |
172 | IN EFI_HANDLE DispatchHandle,\r | |
173 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext\r | |
174 | );\r | |
175 | \r | |
176 | VOID\r | |
177 | EFIAPI\r | |
178 | DisableAcpiCallback (\r | |
179 | IN EFI_HANDLE DispatchHandle,\r | |
180 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext\r | |
181 | );\r | |
182 | \r | |
183 | VOID\r | |
184 | EFIAPI\r | |
185 | SmmReadyToBootCallback (\r | |
186 | IN EFI_HANDLE DispatchHandle,\r | |
187 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext\r | |
188 | );\r | |
189 | \r | |
190 | VOID\r | |
191 | DummyTco1Callback (\r | |
192 | IN EFI_HANDLE DispatchHandle,\r | |
193 | IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext\r | |
194 | );\r | |
195 | \r | |
196 | \r | |
197 | VOID\r | |
198 | PerrSerrCallback (\r | |
199 | IN EFI_HANDLE DispatchHandle,\r | |
200 | IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext\r | |
201 | );\r | |
202 | \r | |
203 | VOID\r | |
204 | RiCallback (\r | |
205 | IN EFI_HANDLE DispatchHandle,\r | |
206 | IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext\r | |
207 | );\r | |
208 | \r | |
209 | \r | |
210 | VOID\r | |
211 | SetAfterG3On (\r | |
212 | BOOLEAN Enable\r | |
213 | );\r | |
214 | \r | |
215 | VOID\r | |
216 | TurnOffVregUsb (\r | |
217 | );\r | |
218 | \r | |
219 | VOID\r | |
220 | PStateSupportCallback (\r | |
221 | IN EFI_HANDLE DispatchHandle,\r | |
222 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext\r | |
223 | );\r | |
224 | \r | |
225 | VOID\r | |
226 | PStateTransitionCallback (\r | |
227 | IN EFI_HANDLE DispatchHandle,\r | |
228 | IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext\r | |
229 | );\r | |
230 | \r | |
231 | EFI_STATUS\r | |
232 | EFIAPI \r | |
233 | SxSleepEntryCallBack (\r | |
234 | IN EFI_HANDLE DispatchHandle,\r | |
235 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
236 | );\r | |
237 | \r | |
238 | EFI_STATUS\r | |
239 | SaveRuntimeScriptTable (\r | |
240 | VOID\r | |
241 | );\r | |
242 | \r | |
243 | \r | |
244 | #endif\r | |
245 | \r |