HwWatchdogTimerHob.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*++
  2. Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. Module Name:
  5. HwWatchdogTimerHob.h
  6. Abstract:
  7. GUID used for Watchdog Timer status in the HOB list.
  8. --*/
  9. #ifndef _EFI_WATCHDOG_TIMER_HOB_GUID_H_
  10. #define _EFI_WATCHDOG_TIMER_HOB_GUID_H_
  11. #define EFI_WATCHDOG_TIMER_HOB_GUID \
  12. { 0x226cd3f, 0x69b5, 0x4150, 0xac, 0xbe, 0xbf, 0xbf, 0x18, 0xe3, 0x3, 0xd5 }
  13. #define EFI_WATCHDOG_TIMER_DEFINITION_HOB_GUID \
  14. { 0xd29302b0, 0x11ba, 0x4073, 0xa2, 0x27, 0x53, 0x8d, 0x25, 0x42, 0x70, 0x9f }
  15. typedef enum {
  16. HWWD_NONE,
  17. HWWD_TIMER_EXPIRED,
  18. HWWD_SPONTANEOUS_REBOOT,
  19. HWWD_FORCED_TIMEOUT
  20. } HW_WATCHDOG_TIMEOUT;
  21. typedef struct {
  22. HW_WATCHDOG_TIMEOUT TimeoutStatus;
  23. } HW_WATCHDOG_INFO;
  24. //
  25. // Watchdog timer action values.
  26. //
  27. #define WDT_ACTION_RESET 0x01 // reload/reset timer
  28. #define WDT_ACTION_QUERY_CURRENT_VALUE 0x04 // get current value // DON'T NEED FOR OVERCLOCK UTILITY
  29. #define WDT_ACTION_QUERY_COUNTDOWN_PERIOD 0x05 // get countdown period
  30. #define WDT_ACTION_SET_COUNTDOWN_PERIOD 0x06 // set countdown period
  31. #define WDT_ACTION_QUERY_RUNNING_STATE 0x08 // query if running
  32. #define WDT_ACTION_SET_RUNNING_STATE 0x09 // start timer
  33. #define WDT_ACTION_QUERY_STOPPED_STATE 0x0A // query if stopped
  34. #define WDT_ACTION_SET_STOPPED_STATE 0x0B // stop timer
  35. #define WDT_ACTION_QUERY_STATUS 0x20 // is current boot cause by wdt timeout?
  36. #define WDT_ACTION_SET_STATUS 0x21 // resets wdt status bit
  37. //
  38. // Watchdog timer instruction values.
  39. //
  40. #define WDT_INSTR_VALUE_MASK 0x03 // Mask for just the value
  41. #define WDT_INSTR_READ_CMP_VALUE 0x00 // Read / compare value
  42. #define WDT_INSTR_READ_COUNTDOWN 0x01 // read countdown value
  43. #define WDT_INSTR_WRITE_VALUE 0x02 // Write value
  44. #define WDT_INSTR_WRITE_COUNTDOWN 0x03 // write countdown value
  45. #define WDT_INSTR_PRESERVE_REG 0x80 // preserve reg; used in Write Value / Write Countdown
  46. #define WDT_INSTR_WRITE_VALUE_PRES (0x02 | WDT_INSTR_PRESERVE_REG) // Write value with preserve
  47. #define WDT_INSTR_WRITE_COUNTDOWN_PRES (0x03 | WDT_INSTR_PRESERVE_REG) // write countdown value with preserve
  48. //
  49. // The Generic Address Structure is defined in the ACPI Specification and should only be
  50. // changed to match updated revisions of that specification. The GAS_ADDRESS_SPACE and
  51. // GAS_ACCESS_SIZE enumerations are also defined by the ACPI Specification.
  52. //
  53. typedef enum {
  54. GAS_SYSTEM_MEMORY,
  55. GAS_SYSTEM_IO,
  56. GAS_PCI_CONFIG_SPACE,
  57. GAS_EMBEDDED_CONTROLLER,
  58. GAS_SMBUS
  59. } GAS_ADDRESS_SPACE;
  60. typedef enum {
  61. GAS_UNDEFINED,
  62. GAS_BYTE_ACCESS,
  63. GAS_WORD_ACCESS,
  64. GAS_DWORD_ACCESS,
  65. GAS_QWORD_ACCESS
  66. } GAS_ACCESS_SIZE;
  67. #pragma pack(1)
  68. typedef struct {
  69. UINT8 AddressSpaceId;
  70. UINT8 RegisterBitWidth;
  71. UINT8 RegisterBitOffset;
  72. UINT8 AccessSize;
  73. UINT64 Address;
  74. } GENERIC_ADDRESS_STRUCTURE;
  75. //
  76. // GAS_SYSTEM_MEMORY - When used as the AddressSpaceId, the 64-bit physical memory address
  77. // of the register. 32-bit platforms must have the high DWORD set to 0.
  78. // GAS_SYSTEM_IO - The 64-bit I/O address of the register. 32-bit platforms must have
  79. // the high DWORD set to 0.
  80. // GAS_PCI_CONFIG_SPACE - PCI Configuration space addresses must be confined to devices on PCI
  81. // Sepment Group 0, Bus 0. This restriction exists to accommodate access
  82. // to fixed hardware prior to PCI bus enumeration. The format of addresses
  83. // are defined as follows:
  84. // Highest WORD: Reserved and must be -0-
  85. // ... PCI Device number on bus 0
  86. // ... PCI Function number
  87. // Lowest WORD: Offset in the configuration space header.
  88. //
  89. typedef struct {
  90. UINT8 WdAction;
  91. UINT8 Flag;
  92. UINT16 Res;
  93. GENERIC_ADDRESS_STRUCTURE GenericAddressStructures;
  94. UINT32 Value;
  95. UINT32 Mask;
  96. } WD_INSTRUCTION;
  97. typedef struct {
  98. UINT32 TimerPeriod;
  99. UINT32 MaxTimerCount;
  100. UINT32 MinTimerCount;
  101. UINT16 InstructionCount;
  102. WD_INSTRUCTION ActionDefinitions[1];
  103. } WD_HOB_DEFINITION;
  104. #pragma pack()
  105. extern EFI_GUID gWatchdogTimerHobGuid;
  106. extern EFI_GUID gWatchdogTimerDefinitionHobGuid;
  107. #endif // _EFI_WATCHDOG_TIMER_HOB_GUID_H_