]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/WatchdogResourceTable.h
Code Scrub for MdePkg.
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / WatchdogResourceTable.h
1 /** @file
2 ACPI Watchdog Resource Table as defined at
3 Microsoft Hardware Watchdog Timer Specification.
4
5 Copyright (c) 2006 - 2007, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 **/
14
15 #ifndef _WATCHDOG_RESOURCE_TABLE_H_
16 #define _WATCHDOG_RESOURCE_TABLE_H_
17
18 #include <IndustryStandard/Acpi.h>
19
20 //
21 // Ensure proper structure formats
22 //
23 #pragma pack(1)
24 //
25 // Watchdog Resource Table definition.
26 //
27 typedef struct {
28 EFI_ACPI_DESCRIPTION_HEADER Header;
29 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ControlRegisterAddress;
30 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE CountRegisterAddress;
31 UINT16 PCIDeviceID;
32 UINT16 PCIVendorID;
33 UINT8 PCIBusNumber;
34 UINT8 PCIDeviceNumber;
35 UINT8 PCIFunctionNumber;
36 UINT8 PCISegment;
37 UINT16 MaxCount;
38 UINT8 Units;
39 } EFI_ACPI_WATCHDOG_RESOURCE_1_0_TABLE;
40
41 typedef struct {
42 EFI_ACPI_DESCRIPTION_HEADER Header;
43 UINT32 WatchdogHeaderLength;
44 UINT8 PCISegment;
45 UINT8 PCIBusNumber;
46 UINT8 PCIDeviceNumber;
47 UINT8 PCIFunctionNumber;
48 UINT32 TimerPeriod;
49 UINT32 MaxCount;
50 UINT32 MinCount;
51 UINT8 WatchdogFlags;
52 UINT8 Reserved_57[3];
53 UINT32 NumberWatchdogInstructionEntries;
54 } EFI_ACPI_WATCHDOG_RESOURCE_2_0_TABLE;
55
56 typedef struct {
57 UINT8 WatchdogAction;
58 UINT8 InstructionFlags;
59 UINT8 Reserved_2;
60 UINT8 RegisterSize;
61 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE RegisterRegion;
62 UINT32 Value;
63 UINT32 Mask;
64 } EFI_ACPI_WATCHDOG_RESOURCE_2_0_WATCHDOG_ACTION_INSTRUCTION_ENTRY;
65
66 #pragma pack()
67
68 //
69 // WDRT Revision (defined in spec)
70 //
71 #define EFI_ACPI_WATCHDOG_RESOURCE_1_0_TABLE_REVISION 0x01
72 #define EFI_ACPI_WATCHDOG_RESOURCE_2_0_TABLE_REVISION 0x02
73
74 //
75 // WDRT 1.0 Count Unit
76 //
77 #define EFI_ACPI_WDRT_1_0_COUNT_UNIT_1_SEC_PER_COUNT 1
78 #define EFI_ACPI_WDRT_1_0_COUNT_UNIT_100_MILLISEC_PER_COUNT 2
79 #define EFI_ACPI_WDRT_1_0_COUNT_UNIT_10_MILLISEC_PER_COUNT 3
80
81 //
82 // WDRT 2.0 Flags
83 //
84 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ENABLED 0x1
85 #define EFI_ACPI_WDRT_2_0_WATCHDOG_STOPPED_IN_SLEEP_STATE 0x80
86
87 //
88 // WDRT 2.0 Watchdog Actions
89 //
90 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_RESET 0x1
91 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_CURRENT_COUNTDOWN_PERIOD 0x4
92 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_COUNTDOWN_PERIOD 0x5
93 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_SET_COUNTDOWN_PERIOD 0x6
94 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_RUNNING_STATE 0x8
95 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_SET_RUNNING_STATE 0x9
96 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_STOPPED_STATE 0xA
97 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_SET_STOPPED_STATE 0xB
98 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_REBOOT 0x10
99 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_SET_REBOOT 0x11
100 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_SHUTDOWN 0x12
101 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_SET_SHUTDOWN 0x13
102 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_QUERY_WATCHDOG_STATUS 0x20
103 #define EFI_ACPI_WDRT_2_0_WATCHDOG_ACTION_SET_WATCHDOG_STATUS 0x21
104
105 //
106 // WDRT 2.0 Watchdog Action Entry Instruction Flags
107 //
108 #define EFI_ACPI_WDRT_2_0_WATCHDOG_INSTRUCTION_READ_VALUE 0x0
109 #define EFI_ACPI_WDRT_2_0_WATCHDOG_INSTRUCTION_READ_COUNTDOWN 0x1
110 #define EFI_ACPI_WDRT_2_0_WATCHDOG_INSTRUCTION_WRITE_VALUE 0x2
111 #define EFI_ACPI_WDRT_2_0_WATCHDOG_INSTRUCTION_WRITE_COUNTDOWN 0x3
112 #define EFI_ACPI_WDRT_2_0_WATCHDOG_INSTRUCTION_PRESERVE_REGISTER 0x80
113
114 #endif