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