]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/Protocol/HwWatchdogTimer.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / ValleyView2Soc / SouthCluster / Include / Protocol / HwWatchdogTimer.h
CommitLineData
3cbfba02
DW
1/*++\r
2\r
3Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved\r
4\r
5 This program and the accompanying materials are licensed and made available under\r
6 the terms and conditions of the BSD License that accompanies this distribution.\r
7 The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13\r
14\r
15Module Name:\r
16\r
17 HwWatchdogTimer.h\r
18\r
19Abstract:\r
20\r
21\r
22--*/\r
23\r
24#ifndef __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__\r
25#define __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__\r
26\r
27#define EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_GUID \\r
28 { 0xd5b06d16, 0x2ea1, 0x4def, 0x98, 0xd0, 0xa0, 0x5d, 0x40, 0x72, 0x84, 0x17 }\r
29\r
30#define EFI_WATCHDOG_TIMER_NOT_SUPPORTED_PROTOCOL_GUID \\r
31 { 0xe9e156ac, 0x3203, 0x4572, 0xac, 0xdf, 0x84, 0x4f, 0xdc, 0xdb, 0x6, 0xbf }\r
32\r
33\r
34#include <Guid/HwWatchdogTimerHob.h>\r
35\r
36//\r
37// General Purpose Constants\r
38//\r
39#define ICH_INSTAFLUSH_GPIO BIT16 // BIT 16 in GPIO Level 2 is GPIO 48.\r
40#define B_INSTAFLUSH BIT4\r
41//\r
42// Other Watchdog timer values\r
43//\r
44#define WDT_COUNTDOWN_VALUE 0x14\r
45#define BDS_WDT_COUNTDOWN_VALUE 0x35\r
46\r
47\r
48//\r
49// Prototypes for the Watchdog Timer Driver Protocol\r
50//\r
51\r
52typedef\r
53EFI_STATUS\r
54(EFIAPI *EFI_WATCHDOG_START_TIMER) (\r
55 VOID\r
56 );\r
57/*++\r
58\r
59 Routine Description:\r
60 This service begins the Watchdog Timer countdown. If the countdown completes prior to\r
61 Stop Timer or Restart Timer the system will reset.\r
62\r
63 Arguments:\r
64 None\r
65\r
66 Returns:\r
67 EFI_SUCCESS - Operation completed successfully\r
68 EFI_DEVICE_ERROR - The command was unsuccessful\r
69\r
70--*/\r
71\r
72\r
73\r
74typedef\r
75EFI_STATUS\r
76(EFIAPI *PEI_WATCHDOG_RESET_TIMER) (\r
77 VOID\r
78 );\r
79/*++\r
80\r
81 Routine Description:\r
82 This service resets the Watchdog Timer countdown and should only be called after the\r
83 Start Timer function.\r
84\r
85 Arguments:\r
86 None\r
87\r
88 Returns:\r
89 EFI_SUCCESS - Operation completed successfully\r
90 EFI_DEVICE_ERROR - The command was unsuccessful\r
91\r
92--*/\r
93\r
94\r
95\r
96\r
97typedef\r
98EFI_STATUS\r
99(EFIAPI *EFI_WATCHDOG_RESTART_TIMER) (\r
100 VOID\r
101 );\r
102/*++\r
103\r
104 Routine Description:\r
105 This service restarts the Watchdog Timer countdown and should only be called after the\r
106 Start Timer function.\r
107\r
108 Arguments:\r
109 None\r
110\r
111 Returns:\r
112 EFI_SUCCESS - Operation completed successfully\r
113 EFI_DEVICE_ERROR - The command was unsuccessful\r
114\r
115--*/\r
116\r
117\r
118\r
119\r
120typedef\r
121EFI_STATUS\r
122(EFIAPI *EFI_WATCHDOG_STOP_TIMER) (\r
123 VOID\r
124 );\r
125/*++\r
126\r
127 Routine Description:\r
128 This service disables the Watchdog Timer countdown.\r
129\r
130 Arguments:\r
131 None\r
132\r
133 Returns:\r
134 EFI_SUCCESS - Operation completed successfully\r
135 EFI_DEVICE_ERROR - The command was unsuccessful\r
136\r
137--*/\r
138\r
139\r
140\r
141typedef\r
142EFI_STATUS\r
143(EFIAPI *EFI_WATCHDOG_CHECK_TIMEOUT) (\r
144 OUT HW_WATCHDOG_TIMEOUT *WatchdogTimeout\r
145 );\r
146/*++\r
147\r
148 Routine Description:\r
149 This service disables the Watchdog Timer countdown.\r
150\r
151 Arguments:\r
152 None\r
153\r
154 Returns:\r
155 EFI_SUCCESS - Operation completed successfully\r
156 EFI_DEVICE_ERROR - The command was unsuccessful\r
157\r
158--*/\r
159\r
160\r
161\r
162typedef\r
163EFI_STATUS\r
164(EFIAPI *EFI_WATCHDOG_FORCE_REBOOT) (\r
165 IN BOOLEAN ForceTimeout,\r
166 IN UINT8 ResetType\r
167 );\r
168/*++\r
169\r
170 Routine Description:\r
171 This service forces a reboot of the system due to a reset of the POWERGOOD_PS,\r
172 POWERGOOD_CLK, and the BSEL Override\r
173\r
174 Arguments:\r
175 None\r
176\r
177 Returns:\r
178 This function should not return!\r
179\r
180 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur\r
181\r
182--*/\r
183\r
184\r
185\r
186typedef\r
187EFI_STATUS\r
188(EFIAPI *EFI_WATCHDOG_KNOWN_RESET) (\r
189 IN BOOLEAN AllowReset\r
190 );\r
191/*++\r
192\r
193 Routine Description:\r
194 This service notifies the Watchdog Timer of the fact that a known reset is occuring.\r
195\r
196 Arguments:\r
197 AllowReset - TRUE if a Reset is currently expected\r
198 FALSE if a Reset is not currently expected\r
199\r
200 Returns:\r
201 This function should not return!\r
202\r
203 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur\r
204\r
205--*/\r
206\r
207typedef\r
208EFI_STATUS\r
209(EFIAPI *EFI_GET_TIMER_COUNT_DOWN_PERIOD)(\r
210 OUT UINT32 *CountdownValue\r
211 );\r
212/*++\r
213\r
214 Routine Description:\r
215 This service reads the current Watchdog Timer countdown reload value.\r
216\r
217 Arguments:\r
218 CountdownValue - pointer to UINT32 to return the value of the reload register.\r
219\r
220 Returns:\r
221 EFI_SUCCESS - Operation completed successfully\r
222 EFI_DEVICE_ERROR - The command was unsuccessful\r
223\r
224--*/\r
225\r
226typedef\r
227EFI_STATUS\r
228(EFIAPI *EFI_SET_TIMER_COUNT_DOWN_PERIOD)(\r
229 OUT UINT32 CountdownValue\r
230 );\r
231/*++\r
232\r
233 Routine Description:\r
234 This service reads the current Watchdog Timer countdown reload value.\r
235\r
236 Arguments:\r
237 CountdownValue - Value to set the reload register.\r
238\r
239 Returns:\r
240 EFI_SUCCESS - Operation completed successfully\r
241 EFI_DEVICE_ERROR - The command was unsuccessful\r
242\r
243--*/\r
244\r
245typedef\r
246EFI_STATUS\r
247(EFIAPI *PEI_WATCHDOG_CLEAR_TIMER_STATE) (\r
248 );\r
249/*++\r
250\r
251 Routine Description:\r
252 This service clears the state that indicates the Watchdog Timer fired.\r
253\r
254 Arguments:\r
255\r
256 Returns:\r
257 EFI_SUCCESS - Operation completed successfully\r
258 EFI_DEVICE_ERROR - The command was unsuccessful\r
259\r
260--*/\r
261\r
262typedef\r
263EFI_STATUS\r
264(EFIAPI *EFI_STALL_WATCHDOG_COUNTDOWN) (\r
265 IN BOOLEAN Stall\r
266 );\r
267/*++\r
268\r
269 Routine Description:\r
270 This service disables the Watchdog Timer countdown. It also closes the recurring restart event\r
271 if the event exists.\r
272\r
273 Arguments:\r
274 Stall - TRUE = Stop the timer countdown\r
275 FALSE = Start the timer countdown\r
276\r
277 Returns:\r
278 EFI_SUCCESS - Operation completed successfully\r
279 EFI_DEVICE_ERROR - The command was unsuccessful\r
280\r
281--*/\r
282\r
283typedef struct _EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL {\r
284 EFI_WATCHDOG_START_TIMER StartWatchdogTimer;\r
285 PEI_WATCHDOG_RESET_TIMER ResetWatchdogTimeout;\r
286 EFI_WATCHDOG_RESTART_TIMER RestartWatchdogTimer;\r
287 EFI_WATCHDOG_STOP_TIMER StopWatchdogTimer;\r
288 EFI_WATCHDOG_CHECK_TIMEOUT CheckWatchdogTimeout;\r
289 EFI_WATCHDOG_FORCE_REBOOT ForceReboot;\r
290 EFI_WATCHDOG_KNOWN_RESET AllowKnownReset;\r
291 EFI_GET_TIMER_COUNT_DOWN_PERIOD GetCountdownPeriod;\r
292 EFI_SET_TIMER_COUNT_DOWN_PERIOD SetCountdownPeriod;\r
293 PEI_WATCHDOG_CLEAR_TIMER_STATE ClearTimerState;\r
294 EFI_STALL_WATCHDOG_COUNTDOWN StallWatchdogCountdown;\r
295} EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL;\r
296\r
297extern EFI_GUID gEfiWatchdogTimerDriverProtocolGuid;\r
298extern EFI_GUID gEfiWatchdogTimerNotSupportedProtocolGuid;\r
299\r
300#endif\r