Home | History | Annotate | Download | only in Protocol
      1 /*++
      2 
      3 Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
      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 // Other Watchdog timer values
     43 //
     44 #define WDT_COUNTDOWN_VALUE                 0x14
     45 #define BDS_WDT_COUNTDOWN_VALUE             0x35
     46 
     47 
     48 //
     49 // Prototypes for the Watchdog Timer Driver Protocol
     50 //
     51 
     52 typedef
     53 EFI_STATUS
     54 (EFIAPI *EFI_WATCHDOG_START_TIMER) (
     55   VOID
     56   );
     57 /*++
     58 
     59   Routine Description:
     60     This service begins the Watchdog Timer countdown.  If the countdown completes prior to
     61     Stop Timer or Restart Timer the system will reset.
     62 
     63   Arguments:
     64     None
     65 
     66   Returns:
     67     EFI_SUCCESS       - Operation completed successfully
     68     EFI_DEVICE_ERROR  - The command was unsuccessful
     69 
     70 --*/
     71 
     72 
     73 
     74 typedef
     75 EFI_STATUS
     76 (EFIAPI *PEI_WATCHDOG_RESET_TIMER) (
     77   VOID
     78   );
     79 /*++
     80 
     81   Routine Description:
     82     This service resets the Watchdog Timer countdown and should only be called after the
     83     Start Timer function.
     84 
     85   Arguments:
     86     None
     87 
     88   Returns:
     89     EFI_SUCCESS       - Operation completed successfully
     90     EFI_DEVICE_ERROR  - The command was unsuccessful
     91 
     92 --*/
     93 
     94 
     95 
     96 
     97 typedef
     98 EFI_STATUS
     99 (EFIAPI *EFI_WATCHDOG_RESTART_TIMER) (
    100   VOID
    101   );
    102 /*++
    103 
    104   Routine Description:
    105     This service restarts the Watchdog Timer countdown and should only be called after the
    106     Start Timer function.
    107 
    108   Arguments:
    109     None
    110 
    111   Returns:
    112     EFI_SUCCESS       - Operation completed successfully
    113     EFI_DEVICE_ERROR  - The command was unsuccessful
    114 
    115 --*/
    116 
    117 
    118 
    119 
    120 typedef
    121 EFI_STATUS
    122 (EFIAPI *EFI_WATCHDOG_STOP_TIMER) (
    123   VOID
    124   );
    125 /*++
    126 
    127   Routine Description:
    128     This service disables the Watchdog Timer countdown.
    129 
    130   Arguments:
    131     None
    132 
    133   Returns:
    134     EFI_SUCCESS       - Operation completed successfully
    135     EFI_DEVICE_ERROR  - The command was unsuccessful
    136 
    137 --*/
    138 
    139 
    140 
    141 typedef
    142 EFI_STATUS
    143 (EFIAPI *EFI_WATCHDOG_CHECK_TIMEOUT) (
    144   OUT HW_WATCHDOG_TIMEOUT       *WatchdogTimeout
    145   );
    146 /*++
    147 
    148   Routine Description:
    149     This service disables the Watchdog Timer countdown.
    150 
    151   Arguments:
    152     None
    153 
    154   Returns:
    155     EFI_SUCCESS       - Operation completed successfully
    156     EFI_DEVICE_ERROR  - The command was unsuccessful
    157 
    158 --*/
    159 
    160 
    161 
    162 typedef
    163 EFI_STATUS
    164 (EFIAPI *EFI_WATCHDOG_FORCE_REBOOT) (
    165   IN BOOLEAN                    ForceTimeout,
    166   IN UINT8                      ResetType
    167   );
    168 /*++
    169 
    170   Routine Description:
    171     This service forces a reboot of the system due to a reset of the POWERGOOD_PS,
    172     POWERGOOD_CLK, and the BSEL Override
    173 
    174   Arguments:
    175     None
    176 
    177   Returns:
    178     This function should not return!
    179 
    180     EFI_DEVICE_ERROR  - The command was unsuccessful and a reboot did not occur
    181 
    182 --*/
    183 
    184 
    185 
    186 typedef
    187 EFI_STATUS
    188 (EFIAPI *EFI_WATCHDOG_KNOWN_RESET) (
    189   IN BOOLEAN                    AllowReset
    190   );
    191 /*++
    192 
    193   Routine Description:
    194     This service notifies the Watchdog Timer of the fact that a known reset is occuring.
    195 
    196   Arguments:
    197     AllowReset -  TRUE if a Reset is currently expected
    198                   FALSE if a Reset is not currently expected
    199 
    200   Returns:
    201     This function should not return!
    202 
    203     EFI_DEVICE_ERROR  - The command was unsuccessful and a reboot did not occur
    204 
    205 --*/
    206 
    207 typedef
    208 EFI_STATUS
    209 (EFIAPI *EFI_GET_TIMER_COUNT_DOWN_PERIOD)(
    210   OUT UINT32      *CountdownValue
    211   );
    212 /*++
    213 
    214   Routine Description:
    215     This service reads the current Watchdog Timer countdown reload value.
    216 
    217   Arguments:
    218     CountdownValue - pointer to UINT32 to return the value of the reload register.
    219 
    220   Returns:
    221     EFI_SUCCESS       - Operation completed successfully
    222     EFI_DEVICE_ERROR  - The command was unsuccessful
    223 
    224 --*/
    225 
    226 typedef
    227 EFI_STATUS
    228 (EFIAPI *EFI_SET_TIMER_COUNT_DOWN_PERIOD)(
    229   OUT UINT32      CountdownValue
    230   );
    231 /*++
    232 
    233   Routine Description:
    234     This service reads the current Watchdog Timer countdown reload value.
    235 
    236   Arguments:
    237     CountdownValue - Value to set the reload register.
    238 
    239   Returns:
    240     EFI_SUCCESS       - Operation completed successfully
    241     EFI_DEVICE_ERROR  - The command was unsuccessful
    242 
    243 --*/
    244 
    245 typedef
    246 EFI_STATUS
    247 (EFIAPI *PEI_WATCHDOG_CLEAR_TIMER_STATE) (
    248   );
    249 /*++
    250 
    251   Routine Description:
    252     This service clears the state that indicates the Watchdog Timer fired.
    253 
    254   Arguments:
    255 
    256   Returns:
    257     EFI_SUCCESS       - Operation completed successfully
    258     EFI_DEVICE_ERROR  - The command was unsuccessful
    259 
    260 --*/
    261 
    262 typedef
    263 EFI_STATUS
    264 (EFIAPI *EFI_STALL_WATCHDOG_COUNTDOWN) (
    265   IN BOOLEAN Stall
    266   );
    267 /*++
    268 
    269   Routine Description:
    270     This service disables the Watchdog Timer countdown.  It also closes the recurring restart event
    271     if the event exists.
    272 
    273   Arguments:
    274     Stall - TRUE = Stop the timer countdown
    275             FALSE = Start the timer countdown
    276 
    277   Returns:
    278     EFI_SUCCESS       - Operation completed successfully
    279     EFI_DEVICE_ERROR  - The command was unsuccessful
    280 
    281 --*/
    282 
    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;
    296 
    297 extern EFI_GUID gEfiWatchdogTimerDriverProtocolGuid;
    298 extern EFI_GUID gEfiWatchdogTimerNotSupportedProtocolGuid;
    299 
    300 #endif
    301