3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 SPDX-License-Identifier: BSD-2-Clause-Patent
18 #ifndef __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__
19 #define __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__
21 #define EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_GUID \
22 { 0xd5b06d16, 0x2ea1, 0x4def, 0x98, 0xd0, 0xa0, 0x5d, 0x40, 0x72, 0x84, 0x17 }
24 #define EFI_WATCHDOG_TIMER_NOT_SUPPORTED_PROTOCOL_GUID \
25 { 0xe9e156ac, 0x3203, 0x4572, 0xac, 0xdf, 0x84, 0x4f, 0xdc, 0xdb, 0x6, 0xbf }
28 #include <Guid/HwWatchdogTimerHob.h>
31 // General Purpose Constants
33 #define ICH_INSTAFLUSH_GPIO BIT16 // BIT 16 in GPIO Level 2 is GPIO 48.
34 #define B_INSTAFLUSH BIT4
36 // Other Watchdog timer values
38 #define WDT_COUNTDOWN_VALUE 0x14
39 #define BDS_WDT_COUNTDOWN_VALUE 0x35
43 // Prototypes for the Watchdog Timer Driver Protocol
48 (EFIAPI
*EFI_WATCHDOG_START_TIMER
) (
54 This service begins the Watchdog Timer countdown. If the countdown completes prior to
55 Stop Timer or Restart Timer the system will reset.
61 EFI_SUCCESS - Operation completed successfully
62 EFI_DEVICE_ERROR - The command was unsuccessful
70 (EFIAPI
*PEI_WATCHDOG_RESET_TIMER
) (
76 This service resets the Watchdog Timer countdown and should only be called after the
83 EFI_SUCCESS - Operation completed successfully
84 EFI_DEVICE_ERROR - The command was unsuccessful
93 (EFIAPI
*EFI_WATCHDOG_RESTART_TIMER
) (
99 This service restarts the Watchdog Timer countdown and should only be called after the
100 Start Timer function.
106 EFI_SUCCESS - Operation completed successfully
107 EFI_DEVICE_ERROR - The command was unsuccessful
116 (EFIAPI
*EFI_WATCHDOG_STOP_TIMER
) (
122 This service disables the Watchdog Timer countdown.
128 EFI_SUCCESS - Operation completed successfully
129 EFI_DEVICE_ERROR - The command was unsuccessful
137 (EFIAPI
*EFI_WATCHDOG_CHECK_TIMEOUT
) (
138 OUT HW_WATCHDOG_TIMEOUT
*WatchdogTimeout
143 This service disables the Watchdog Timer countdown.
149 EFI_SUCCESS - Operation completed successfully
150 EFI_DEVICE_ERROR - The command was unsuccessful
158 (EFIAPI
*EFI_WATCHDOG_FORCE_REBOOT
) (
159 IN BOOLEAN ForceTimeout
,
165 This service forces a reboot of the system due to a reset of the POWERGOOD_PS,
166 POWERGOOD_CLK, and the BSEL Override
172 This function should not return!
174 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur
182 (EFIAPI
*EFI_WATCHDOG_KNOWN_RESET
) (
183 IN BOOLEAN AllowReset
188 This service notifies the Watchdog Timer of the fact that a known reset is occuring.
191 AllowReset - TRUE if a Reset is currently expected
192 FALSE if a Reset is not currently expected
195 This function should not return!
197 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur
203 (EFIAPI
*EFI_GET_TIMER_COUNT_DOWN_PERIOD
)(
204 OUT UINT32
*CountdownValue
209 This service reads the current Watchdog Timer countdown reload value.
212 CountdownValue - pointer to UINT32 to return the value of the reload register.
215 EFI_SUCCESS - Operation completed successfully
216 EFI_DEVICE_ERROR - The command was unsuccessful
222 (EFIAPI
*EFI_SET_TIMER_COUNT_DOWN_PERIOD
)(
223 OUT UINT32 CountdownValue
228 This service reads the current Watchdog Timer countdown reload value.
231 CountdownValue - Value to set the reload register.
234 EFI_SUCCESS - Operation completed successfully
235 EFI_DEVICE_ERROR - The command was unsuccessful
241 (EFIAPI
*PEI_WATCHDOG_CLEAR_TIMER_STATE
) (
246 This service clears the state that indicates the Watchdog Timer fired.
251 EFI_SUCCESS - Operation completed successfully
252 EFI_DEVICE_ERROR - The command was unsuccessful
258 (EFIAPI
*EFI_STALL_WATCHDOG_COUNTDOWN
) (
264 This service disables the Watchdog Timer countdown. It also closes the recurring restart event
268 Stall - TRUE = Stop the timer countdown
269 FALSE = Start the timer countdown
272 EFI_SUCCESS - Operation completed successfully
273 EFI_DEVICE_ERROR - The command was unsuccessful
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
;
291 extern EFI_GUID gEfiWatchdogTimerDriverProtocolGuid
;
292 extern EFI_GUID gEfiWatchdogTimerNotSupportedProtocolGuid
;