]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/Protocol/HwWatchdogTimer.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / ValleyView2Soc / SouthCluster / Include / Protocol / HwWatchdogTimer.h
diff --git a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/Protocol/HwWatchdogTimer.h b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/Protocol/HwWatchdogTimer.h
new file mode 100644 (file)
index 0000000..61cde2f
--- /dev/null
@@ -0,0 +1,300 @@
+/*++\r
+\r
+Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved\r
+\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+\r
+\r
+Module Name:\r
+\r
+  HwWatchdogTimer.h\r
+\r
+Abstract:\r
+\r
+\r
+--*/\r
+\r
+#ifndef __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__\r
+#define __EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_H__\r
+\r
+#define EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL_GUID \\r
+  { 0xd5b06d16, 0x2ea1, 0x4def, 0x98, 0xd0, 0xa0, 0x5d, 0x40, 0x72, 0x84, 0x17 }\r
+\r
+#define EFI_WATCHDOG_TIMER_NOT_SUPPORTED_PROTOCOL_GUID \\r
+  { 0xe9e156ac, 0x3203, 0x4572, 0xac, 0xdf, 0x84, 0x4f, 0xdc, 0xdb, 0x6, 0xbf }\r
+\r
+\r
+#include <Guid/HwWatchdogTimerHob.h>\r
+\r
+//\r
+// General Purpose Constants\r
+//\r
+#define ICH_INSTAFLUSH_GPIO      BIT16 // BIT 16 in GPIO Level 2 is GPIO 48.\r
+#define B_INSTAFLUSH             BIT4\r
+//\r
+// Other Watchdog timer values\r
+//\r
+#define WDT_COUNTDOWN_VALUE                 0x14\r
+#define BDS_WDT_COUNTDOWN_VALUE             0x35\r
+\r
+\r
+//\r
+// Prototypes for the Watchdog Timer Driver Protocol\r
+//\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_START_TIMER) (\r
+  VOID\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service begins the Watchdog Timer countdown.  If the countdown completes prior to\r
+    Stop Timer or Restart Timer the system will reset.\r
+\r
+  Arguments:\r
+    None\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEI_WATCHDOG_RESET_TIMER) (\r
+  VOID\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service resets the Watchdog Timer countdown and should only be called after the\r
+    Start Timer function.\r
+\r
+  Arguments:\r
+    None\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+\r
+\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_RESTART_TIMER) (\r
+  VOID\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service restarts the Watchdog Timer countdown and should only be called after the\r
+    Start Timer function.\r
+\r
+  Arguments:\r
+    None\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+\r
+\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_STOP_TIMER) (\r
+  VOID\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service disables the Watchdog Timer countdown.\r
+\r
+  Arguments:\r
+    None\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_CHECK_TIMEOUT) (\r
+  OUT HW_WATCHDOG_TIMEOUT       *WatchdogTimeout\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service disables the Watchdog Timer countdown.\r
+\r
+  Arguments:\r
+    None\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_FORCE_REBOOT) (\r
+  IN BOOLEAN                    ForceTimeout,\r
+  IN UINT8                      ResetType\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service forces a reboot of the system due to a reset of the POWERGOOD_PS,\r
+    POWERGOOD_CLK, and the BSEL Override\r
+\r
+  Arguments:\r
+    None\r
+\r
+  Returns:\r
+    This function should not return!\r
+\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful and a reboot did not occur\r
+\r
+--*/\r
+\r
+\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_KNOWN_RESET) (\r
+  IN BOOLEAN                    AllowReset\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service notifies the Watchdog Timer of the fact that a known reset is occuring.\r
+\r
+  Arguments:\r
+    AllowReset -  TRUE if a Reset is currently expected\r
+                  FALSE if a Reset is not currently expected\r
+\r
+  Returns:\r
+    This function should not return!\r
+\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful and a reboot did not occur\r
+\r
+--*/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_TIMER_COUNT_DOWN_PERIOD)(\r
+  OUT UINT32      *CountdownValue\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service reads the current Watchdog Timer countdown reload value.\r
+\r
+  Arguments:\r
+    CountdownValue - pointer to UINT32 to return the value of the reload register.\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_TIMER_COUNT_DOWN_PERIOD)(\r
+  OUT UINT32      CountdownValue\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service reads the current Watchdog Timer countdown reload value.\r
+\r
+  Arguments:\r
+    CountdownValue - Value to set the reload register.\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEI_WATCHDOG_CLEAR_TIMER_STATE) (\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service clears the state that indicates the Watchdog Timer fired.\r
+\r
+  Arguments:\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_STALL_WATCHDOG_COUNTDOWN) (\r
+  IN BOOLEAN Stall\r
+  );\r
+/*++\r
+\r
+  Routine Description:\r
+    This service disables the Watchdog Timer countdown.  It also closes the recurring restart event\r
+    if the event exists.\r
+\r
+  Arguments:\r
+    Stall - TRUE = Stop the timer countdown\r
+            FALSE = Start the timer countdown\r
+\r
+  Returns:\r
+    EFI_SUCCESS       - Operation completed successfully\r
+    EFI_DEVICE_ERROR  - The command was unsuccessful\r
+\r
+--*/\r
+\r
+typedef struct _EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL {\r
+  EFI_WATCHDOG_START_TIMER                      StartWatchdogTimer;\r
+  PEI_WATCHDOG_RESET_TIMER                      ResetWatchdogTimeout;\r
+  EFI_WATCHDOG_RESTART_TIMER                    RestartWatchdogTimer;\r
+  EFI_WATCHDOG_STOP_TIMER                       StopWatchdogTimer;\r
+  EFI_WATCHDOG_CHECK_TIMEOUT                    CheckWatchdogTimeout;\r
+  EFI_WATCHDOG_FORCE_REBOOT                     ForceReboot;\r
+  EFI_WATCHDOG_KNOWN_RESET                      AllowKnownReset;\r
+  EFI_GET_TIMER_COUNT_DOWN_PERIOD               GetCountdownPeriod;\r
+  EFI_SET_TIMER_COUNT_DOWN_PERIOD               SetCountdownPeriod;\r
+  PEI_WATCHDOG_CLEAR_TIMER_STATE                ClearTimerState;\r
+  EFI_STALL_WATCHDOG_COUNTDOWN                  StallWatchdogCountdown;\r
+} EFI_WATCHDOG_TIMER_DRIVER_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiWatchdogTimerDriverProtocolGuid;\r
+extern EFI_GUID gEfiWatchdogTimerNotSupportedProtocolGuid;\r
+\r
+#endif\r