3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
43 // Other Watchdog timer values
45 #define WDT_COUNTDOWN_VALUE 0x14
46 #define BDS_WDT_COUNTDOWN_VALUE 0x35
49 // Prototypes for the Watchdog Timer Driver Protocol
53 This service begins the Watchdog Timer countdown. If the countdown completes prior to
54 Stop Timer or Restart Timer the system will reset.
58 @retval EFI_SUCCESS Operation completed successfully
59 @retval EFI_DEVICE_ERROR The command was unsuccessful
64 (EFIAPI
*EFI_WATCHDOG_START_TIMER
) (
69 This service resets the Watchdog Timer countdown and should only be called after the
74 @retval EFI_SUCCESS Operation completed successfully
75 @retval EFI_DEVICE_ERROR The command was unsuccessful
80 (EFIAPI
*PEI_WATCHDOG_RESET_TIMER
) (
85 This service restarts the Watchdog Timer countdown and should only be called after the
90 @retval EFI_SUCCESS Operation completed successfully
91 @retval EFI_DEVICE_ERROR The command was unsuccessful
96 (EFIAPI
*EFI_WATCHDOG_RESTART_TIMER
) (
101 This service disables the Watchdog Timer countdown.
105 @retval EFI_SUCCESS Operation completed successfully
106 @retval EFI_DEVICE_ERROR The command was unsuccessful
111 (EFIAPI
*EFI_WATCHDOG_STOP_TIMER
) (
120 (EFIAPI
*EFI_WATCHDOG_CHECK_TIMEOUT
) (
121 OUT HW_WATCHDOG_TIMEOUT
*WatchdogTimeout
127 This service forces a reboot of the system due to a reset of the POWERGOOD_PS,
128 POWERGOOD_CLK, and the BSEL Override
134 This function should not return!
136 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur
141 (EFIAPI
*EFI_WATCHDOG_FORCE_REBOOT
) (
142 IN BOOLEAN ForceTimeout
,
147 This service notifies the Watchdog Timer of the fact that a known reset is occuring.
149 @param[in] AllowReset TRUE if a Reset is currently expected
150 FALSE if a Reset is not currently expected
152 This function should not return!
154 EFI_DEVICE_ERROR - The command was unsuccessful and a reboot did not occur
159 (EFIAPI
*EFI_WATCHDOG_KNOWN_RESET
) (
160 IN BOOLEAN AllowReset
164 This service reads the current Watchdog Timer countdown reload value.
166 @param[in] CountdownValue pointer to UINT32 to return the value of the reload register.
168 @retval EFI_SUCCESS Operation completed successfully
169 @retval EFI_DEVICE_ERROR The command was unsuccessful
174 (EFIAPI
*EFI_GET_TIMER_COUNT_DOWN_PERIOD
)(
175 OUT UINT32
*CountdownValue
179 This service reads the current Watchdog Timer countdown reload value.
181 @param[in] CountdownValue Value to set the reload register.
183 @retval EFI_SUCCESS Operation completed successfully
184 @retval EFI_DEVICE_ERROR The command was unsuccessful
189 (EFIAPI
*EFI_SET_TIMER_COUNT_DOWN_PERIOD
)(
190 OUT UINT32 CountdownValue
194 This service clears the state that indicates the Watchdog Timer fired.
196 @retval EFI_SUCCESS - Operation completed successfully
197 @retval EFI_DEVICE_ERROR - The command was unsuccessful
202 (EFIAPI
*PEI_WATCHDOG_CLEAR_TIMER_STATE
) (
206 This service disables the Watchdog Timer countdown. It also closes the recurring restart event
209 @param[in] Stall TRUE = Stop the timer countdown
210 FALSE = Start the timer countdown
212 @retval EFI_SUCCESS Operation completed successfully
213 @retval EFI_DEVICE_ERROR The command was unsuccessful
218 (EFIAPI
*EFI_STALL_WATCHDOG_COUNTDOWN
) (
223 typedef struct _EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL
{
224 EFI_WATCHDOG_START_TIMER StartWatchdogTimer
;
225 PEI_WATCHDOG_RESET_TIMER ResetWatchdogTimeout
;
226 EFI_WATCHDOG_RESTART_TIMER RestartWatchdogTimer
;
227 EFI_WATCHDOG_STOP_TIMER StopWatchdogTimer
;
228 EFI_WATCHDOG_CHECK_TIMEOUT CheckWatchdogTimeout
;
229 EFI_WATCHDOG_FORCE_REBOOT ForceReboot
;
230 EFI_WATCHDOG_KNOWN_RESET AllowKnownReset
;
231 EFI_GET_TIMER_COUNT_DOWN_PERIOD GetCountdownPeriod
;
232 EFI_SET_TIMER_COUNT_DOWN_PERIOD SetCountdownPeriod
;
233 PEI_WATCHDOG_CLEAR_TIMER_STATE ClearTimerState
;
234 EFI_STALL_WATCHDOG_COUNTDOWN StallWatchdogCountdown
;
235 } EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL
;
237 extern EFI_GUID gEfiWatchdogTimerDriverProtocolGuid
;
238 extern EFI_GUID gEfiWatchdogTimerNotSupportedProtocolGuid
;