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