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