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