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