3 Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24 #ifndef __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__
25 #define __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__
27 #define EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_GUID \
28 { 0xd5b06d16, 0x2ea1, 0x4def, 0x98, 0xd0, 0xa0, 0x5d, 0x40, 0x72, 0x84, 0x17 }
30 #define EFI_WATCHDOG_TIMER_NOT_SUPPORTED_PROTOCOL_GUID \
31 { 0xe9e156ac, 0x3203, 0x4572, 0xac, 0xdf, 0x84, 0x4f, 0xdc, 0xdb, 0x6, 0xbf }
34 #include <Guid/HwWatchdogTimerHob.h>
37 // General Purpose Constants
39 #define ICH_INSTAFLUSH_GPIO BIT16 // BIT 16 in GPIO Level 2 is GPIO 48.
40 #define B_INSTAFLUSH BIT4
42 // Other Watchdog timer values
44 #define WDT_COUNTDOWN_VALUE 0x14
45 #define BDS_WDT_COUNTDOWN_VALUE 0x35
49 // Prototypes for the Watchdog Timer Driver Protocol
54 (EFIAPI
*EFI_WATCHDOG_START_TIMER
) (
60 This service begins the Watchdog Timer countdown. If the countdown completes prior to
61 Stop Timer or Restart Timer the system will reset.
67 EFI_SUCCESS - Operation completed successfully
68 EFI_DEVICE_ERROR - The command was unsuccessful
76 (EFIAPI
*PEI_WATCHDOG_RESET_TIMER
) (
82 This service resets the Watchdog Timer countdown and should only be called after the
89 EFI_SUCCESS - Operation completed successfully
90 EFI_DEVICE_ERROR - The command was unsuccessful
99 (EFIAPI
*EFI_WATCHDOG_RESTART_TIMER
) (
105 This service restarts the Watchdog Timer countdown and should only be called after the
106 Start Timer function.
112 EFI_SUCCESS - Operation completed successfully
113 EFI_DEVICE_ERROR - The command was unsuccessful
122 (EFIAPI
*EFI_WATCHDOG_STOP_TIMER
) (
128 This service disables the Watchdog Timer countdown.
134 EFI_SUCCESS - Operation completed successfully
135 EFI_DEVICE_ERROR - The command was unsuccessful
143 (EFIAPI
*EFI_WATCHDOG_CHECK_TIMEOUT
) (
144 OUT HW_WATCHDOG_TIMEOUT
*WatchdogTimeout
149 This service disables the Watchdog Timer countdown.
155 EFI_SUCCESS - Operation completed successfully
156 EFI_DEVICE_ERROR - The command was unsuccessful
164 (EFIAPI
*EFI_WATCHDOG_FORCE_REBOOT
) (
165 IN BOOLEAN ForceTimeout
,
171 This service forces a reboot of the system due to a reset of the POWERGOOD_PS,
172 POWERGOOD_CLK, and the BSEL Override
178 This function should not return!
180 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur
188 (EFIAPI
*EFI_WATCHDOG_KNOWN_RESET
) (
189 IN BOOLEAN AllowReset
194 This service notifies the Watchdog Timer of the fact that a known reset is occuring.
197 AllowReset - TRUE if a Reset is currently expected
198 FALSE if a Reset is not currently expected
201 This function should not return!
203 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur
209 (EFIAPI
*EFI_GET_TIMER_COUNT_DOWN_PERIOD
)(
210 OUT UINT32
*CountdownValue
215 This service reads the current Watchdog Timer countdown reload value.
218 CountdownValue - pointer to UINT32 to return the value of the reload register.
221 EFI_SUCCESS - Operation completed successfully
222 EFI_DEVICE_ERROR - The command was unsuccessful
228 (EFIAPI
*EFI_SET_TIMER_COUNT_DOWN_PERIOD
)(
229 OUT UINT32 CountdownValue
234 This service reads the current Watchdog Timer countdown reload value.
237 CountdownValue - Value to set the reload register.
240 EFI_SUCCESS - Operation completed successfully
241 EFI_DEVICE_ERROR - The command was unsuccessful
247 (EFIAPI
*PEI_WATCHDOG_CLEAR_TIMER_STATE
) (
252 This service clears the state that indicates the Watchdog Timer fired.
257 EFI_SUCCESS - Operation completed successfully
258 EFI_DEVICE_ERROR - The command was unsuccessful
264 (EFIAPI
*EFI_STALL_WATCHDOG_COUNTDOWN
) (
270 This service disables the Watchdog Timer countdown. It also closes the recurring restart event
274 Stall - TRUE = Stop the timer countdown
275 FALSE = Start the timer countdown
278 EFI_SUCCESS - Operation completed successfully
279 EFI_DEVICE_ERROR - The command was unsuccessful
283 typedef struct _EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL
{
284 EFI_WATCHDOG_START_TIMER StartWatchdogTimer
;
285 PEI_WATCHDOG_RESET_TIMER ResetWatchdogTimeout
;
286 EFI_WATCHDOG_RESTART_TIMER RestartWatchdogTimer
;
287 EFI_WATCHDOG_STOP_TIMER StopWatchdogTimer
;
288 EFI_WATCHDOG_CHECK_TIMEOUT CheckWatchdogTimeout
;
289 EFI_WATCHDOG_FORCE_REBOOT ForceReboot
;
290 EFI_WATCHDOG_KNOWN_RESET AllowKnownReset
;
291 EFI_GET_TIMER_COUNT_DOWN_PERIOD GetCountdownPeriod
;
292 EFI_SET_TIMER_COUNT_DOWN_PERIOD SetCountdownPeriod
;
293 PEI_WATCHDOG_CLEAR_TIMER_STATE ClearTimerState
;
294 EFI_STALL_WATCHDOG_COUNTDOWN StallWatchdogCountdown
;
295 } EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL
;
297 extern EFI_GUID gEfiWatchdogTimerDriverProtocolGuid
;
298 extern EFI_GUID gEfiWatchdogTimerNotSupportedProtocolGuid
;