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