1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
/*++
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SensorInfoVariable.h
Abstract:
GUID used for Sensor Info variable.
--*/
//
// Module: SensorInfoVariable.h
//
// Description: Provides structure and literal definitions for the
// Sensor Information Variable. The BIOS will provide
// this variable to runtime applications via the EFI
// GetVariable function.
//
// Notes: 1. When defining and initializing the variable within the
// BIOS, the module will define the structure using the
// typedef macros in a block. For an ATX board using a
// single Heceta 6P, which has 4 temperature sensors, 6
// voltage sensors, 4 fan speed sensors and 3 fan speed
// controllers, this block would be declared as follows:
//
// TYPEDEF_TEMP_SENSOR_SECTION(4);
// TYPEDEF_VOLT_SENSOR_SECTION(6);
// TYPEDEF_FAN_SENSOR_SECTION(4);
// TYPEDEF_FAN_CONTROLLER_SENSOR(3);
// TYPEDEF_SENSOR_INFO_VAR;
//
// 2. When crafting code to access the variable, the module
// will also need to invoke the typedef macros in a
// block but, since it cannot declare a structure for the
// overall variable (because array lengths will vary), it
// cannot use TYPEDEF_SENSOR_INFO_VAR. The block will
// typically be used as follows:
//
// TYPEDEF_TEMP_SENSOR_SECTION(1);
// TYPEDEF_VOLT_SENSOR_SECTION(1);
// TYPEDEF_FAN_SENSOR_SECTION(1);
// TYPEDEF_FAN_CONTROLLER_SENSOR(1);
//
// The structure buffer should instead be declared as a
// BYTE array. Pointers to the various sections can then
// be built using the XXXX_SECTION_LEN macros...
//
#ifndef _SENSOR_INFO_VAR_GUID_H_
#define _SENSOR_INFO_VAR_GUID_H_
#define SENSOR_INFO_VAR_GUID \
{ \
0xE59E7B4D, 0x06DC, 0x44AB, 0xB3, 0x6D, 0x5E, 0xD7, 0x78, 0x9C, 0x53, 0x0A \
}
extern EFI_GUID gEfiSensorInfoVarGuid;
extern CHAR16 gEfiSensorInfoVarName[];
extern CHAR16 gEfiSensorInfoVarNameWithPassword[];
#define SENSOR_INFO_VAR_NAME L"SensorInfoVar"
#define SENSOR_INFO_VAR_NAME_WITH_PASSWORD SENSOR_INFO_VAR_NAME L"S4k?A^7!"
//
// Sensor/Controller usage definitions
//
#define UNKNOWN_OTHER 0
//
// Temperature Sensors
//
#define CPU_CORE_TEMPERATURE 1
#define CPU_DIE_TEMPERATURE 2
#define ICH_TEMPERATURE 3
#define MCH_TEMPERATURE 4
#define VR_TEMPERATURE 5
#define MEMORY_TEMPERATURE 6
#define MOTHERBOARD_AMBIENT_TEMPERATURE 7
#define SYSTEM_AMBIENT_AIR_TEMPERATURE 8
#define CPU_INLET_AIR_TEMPERATURE 9
#define SYSTEM_INLET_AIR_TEMPERATURE 10
#define SYSTEM_OUTLET_AIR_TEMPERATURE 11
#define PSU_HOTSPOT_TEMPERATURE 12
#define PSU_INLET_AIR_TEMPERATURE 13
#define PSU_OUTLET_AIR_TEMPERATURE 14
#define DRIVE_TEMPERATURE 15
#define GPU_TEMPERATURE 16
#define IOH_TEMPERATURE 17
#define LAST_TEMPERATURE 17
//
// Voltage Sensors
//
#define PLUS_12_VOLTS 1
#define NEG_12_VOLTS 2
#define PLUS_5_VOLTS 3
#define PLUS_5_VOLT_BACKUP 4
#define NEG_5_VOLTS 5
#define PLUS_3P3_VOLTS 6
#define PLUS_2P5_VOLTS 7
#define PLUS_1P5_VOLTS 8
#define CPU_1_VCCP_VOLTAGE 9
#define CPU_2_VCCP_VOLTAGE 10
#define CPU_3_VCCP_VOLTAGE 11
#define CPU_4_VCCP_VOLTAGE 12
#define PSU_INPUT_VOLTAGE 13
#define MCH_VCC_VOLTAGE 14
#define PLUS_3P3_VOLT_STANDBY 15
#define CPU_VTT_VOLTAGE 16
#define PLUS_1P8_VOLTS 17
#define LAST_VOLTAGE 17
//
// Fan Speed Sensors and Controllers.
//
#define CPU_COOLING_FAN 1
#define SYSTEM_COOLING_FAN 2
#define MCH_COOLING_FAN 3
#define VR_COOLING_FAN 4
#define CHASSIS_COOLING_FAN 5
#define CHASSIS_INLET_FAN 6
#define CHASSIS_OUTLET_FAN 7
#define PSU_COOLING_FAN 8
#define PSU_INLET_FAN 9
#define PSU_OUTLET_FAN 10
#define DRIVE_COOLING_FAN 11
#define GPU_COOLING_FAN 12
#define AUX_COOLING_FAN 13
#define IOH_COOLING_FAN 14
#define LAST_FAN 14
//
// Fan Type Definitions
//
#define FAN_TYPE_UNKNOWN 0
#define FAN_3WIRE_PULSE 1
#define FAN_3WIRE_VOLTAGE 2
#define FAN_4WIRE 3
#pragma pack(1)
//
// TEMP_SENSOR_INFO - Structure providing info for a temperature sensor.
//
typedef struct _TEMP_SENSOR_INFO
{
UINT8 byDevice; // Device index
UINT8 byIndex; // Physical sensor index
UINT8 byUsage; // Usage indicator
UINT8 bRelative; // Relative vs. Absolute readings
} TEMP_SENSOR_INFO, *P_TEMP_SENSOR_INFO;
//
// TYPEDEF_TEMP_SENSOR_SECTION - Macro that can be used to typedef the
// TEMP_SENSOR_SECTION structure, which provides information about all
// temperature sensors.
//
#define TYPEDEF_TEMP_SENSOR_SECTION(count) \
typedef struct _TEMP_SENSOR_SECTION \
{ \
UINT8 byCount; \
TEMP_SENSOR_INFO stSensor[count]; \
\
} TEMP_SENSOR_SECTION, *P_TEMP_SENSOR_SECTION
//
// VOLT_SENSOR_INFO - Structure providing info for a voltage sensor.
//
typedef struct _VOLT_SENSOR_INFO
{
UINT8 byDevice; // Device index
UINT8 byIndex; // Physical sensor index
UINT8 byUsage; // Usage indicator
} VOLT_SENSOR_INFO, *P_VOLT_SENSOR_INFO;
//
// TYPEDEF_VOLT_SENSOR_SECTION - Macro that can be used to typedef the
// VOLT_SENSOR_SECTION structure, which provides information about all
// voltage sensors.
//
#define TYPEDEF_VOLT_SENSOR_SECTION(count) \
typedef struct _VOLT_SENSOR_SECTION \
{ \
UINT8 byCount; \
VOLT_SENSOR_INFO stSensor[count]; \
\
} VOLT_SENSOR_SECTION, *P_VOLT_SENSOR_SECTION
//
// FAN_SENSOR_INFO - Structure providing info for a fan speed sensor.
//
typedef struct _FAN_SENSOR_INFO
{
UINT8 byDevice; // Device index
UINT8 byIndex; // Physical sensor index
UINT8 byUsage; // Usage indicator
UINT8 byType; // Fan type
UINT8 byController; // Associated Fan Controller
} FAN_SENSOR_INFO, *P_FAN_SENSOR_INFO;
//
// TYPEDEF_FAN_SENSOR_SECTION - Macro that can be used to typedef the
// FAN_SENSOR_SECTION structure, which provides information about all fan
// speed sensors.
//
#define TYPEDEF_FAN_SENSOR_SECTION(count) \
typedef struct _FAN_SENSOR_SECTION \
{ \
UINT8 byCount; \
FAN_SENSOR_INFO stSensor[count]; \
\
} FAN_SENSOR_SECTION, *P_FAN_SENSOR_SECTION
//
// FAN_CONTROLLER_INFO - Structure providing info for a fan speed controller.
//
#define MAX_ASSOC_FANS 4
#define ASSOC_UNUSED 0xFF
typedef struct _FAN_CONTROLLER_INFO
{
UINT8 byDevice; // Device index
UINT8 byIndex; // Physical Controller Index
UINT8 byUsage; // Usage Indicator
UINT8 byFan[MAX_ASSOC_FANS]; // Associated Fan Sensors
} FAN_CONTROLLER_INFO, *P_FAN_CONTROLLER_INFO;
//
// TYPEDEF_FAN_CONTROLLER_SECTION - Macro that can be used to typedef the
// FAN_CONTROLLER_SECTION structure, which provides information about all
// fan speed controllers.
//
#define TYPEDEF_FAN_CONTROLLER_SECTION(count) \
typedef struct _FAN_CONTROLLER_SECTION \
{ \
UINT8 byCount; \
FAN_CONTROLLER_INFO stController[count]; \
\
} FAN_CONTROLLER_SECTION, *P_FAN_CONTROLLER_SECTION
//
// TYPEDEF_SENSOR_INFO_VAR - Macro that can be used to typedef the
// SENSOR_INFO_VAR structure, which provides information about all sensors
// and fan speed controllers. The other TYPEDEF macros must be invoked
// before using this one...
//
#define TYPEDEF_SENSOR_INFO_VAR \
typedef struct _SENSOR_INFO_VAR \
{ \
TEMP_SENSOR_SECTION stTemps; \
VOLT_SENSOR_SECTION stVolts; \
FAN_SENSOR_SECTION stFans; \
FAN_CONTROLLER_SECTION stCtrls; \
\
} SENSOR_INFO_VAR, *P_SENSOR_INFO_VAR
#pragma pack()
#endif
|