3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
17 GUID used for Sensor Info variable.
23 // Module: SensorInfoVariable.h
25 // Description: Provides structure and literal definitions for the
26 // Sensor Information Variable. The BIOS will provide
27 // this variable to runtime applications via the EFI
28 // GetVariable function.
30 // Notes: 1. When defining and initializing the variable within the
31 // BIOS, the module will define the structure using the
32 // typedef macros in a block. For an ATX board using a
33 // single Heceta 6P, which has 4 temperature sensors, 6
34 // voltage sensors, 4 fan speed sensors and 3 fan speed
35 // controllers, this block would be declared as follows:
37 // TYPEDEF_TEMP_SENSOR_SECTION(4);
38 // TYPEDEF_VOLT_SENSOR_SECTION(6);
39 // TYPEDEF_FAN_SENSOR_SECTION(4);
40 // TYPEDEF_FAN_CONTROLLER_SENSOR(3);
41 // TYPEDEF_SENSOR_INFO_VAR;
43 // 2. When crafting code to access the variable, the module
44 // will also need to invoke the typedef macros in a
45 // block but, since it cannot declare a structure for the
46 // overall variable (because array lengths will vary), it
47 // cannot use TYPEDEF_SENSOR_INFO_VAR. The block will
48 // typically be used as follows:
50 // TYPEDEF_TEMP_SENSOR_SECTION(1);
51 // TYPEDEF_VOLT_SENSOR_SECTION(1);
52 // TYPEDEF_FAN_SENSOR_SECTION(1);
53 // TYPEDEF_FAN_CONTROLLER_SENSOR(1);
55 // The structure buffer should instead be declared as a
56 // BYTE array. Pointers to the various sections can then
57 // be built using the XXXX_SECTION_LEN macros...
61 #ifndef _SENSOR_INFO_VAR_GUID_H_
62 #define _SENSOR_INFO_VAR_GUID_H_
64 #define SENSOR_INFO_VAR_GUID \
66 0xE59E7B4D, 0x06DC, 0x44AB, 0xB3, 0x6D, 0x5E, 0xD7, 0x78, 0x9C, 0x53, 0x0A \
69 extern EFI_GUID gEfiSensorInfoVarGuid
;
70 extern CHAR16 gEfiSensorInfoVarName
[];
71 extern CHAR16 gEfiSensorInfoVarNameWithPassword
[];
73 #define SENSOR_INFO_VAR_NAME L"SensorInfoVar"
74 #define SENSOR_INFO_VAR_NAME_WITH_PASSWORD SENSOR_INFO_VAR_NAME L"S4k?A^7!"
77 // Sensor/Controller usage definitions
80 #define UNKNOWN_OTHER 0
83 // Temperature Sensors
85 #define CPU_CORE_TEMPERATURE 1
86 #define CPU_DIE_TEMPERATURE 2
87 #define ICH_TEMPERATURE 3
88 #define MCH_TEMPERATURE 4
89 #define VR_TEMPERATURE 5
90 #define MEMORY_TEMPERATURE 6
91 #define MOTHERBOARD_AMBIENT_TEMPERATURE 7
92 #define SYSTEM_AMBIENT_AIR_TEMPERATURE 8
93 #define CPU_INLET_AIR_TEMPERATURE 9
94 #define SYSTEM_INLET_AIR_TEMPERATURE 10
95 #define SYSTEM_OUTLET_AIR_TEMPERATURE 11
96 #define PSU_HOTSPOT_TEMPERATURE 12
97 #define PSU_INLET_AIR_TEMPERATURE 13
98 #define PSU_OUTLET_AIR_TEMPERATURE 14
99 #define DRIVE_TEMPERATURE 15
100 #define GPU_TEMPERATURE 16
101 #define IOH_TEMPERATURE 17
103 #define LAST_TEMPERATURE 17
108 #define PLUS_12_VOLTS 1
109 #define NEG_12_VOLTS 2
110 #define PLUS_5_VOLTS 3
111 #define PLUS_5_VOLT_BACKUP 4
112 #define NEG_5_VOLTS 5
113 #define PLUS_3P3_VOLTS 6
114 #define PLUS_2P5_VOLTS 7
115 #define PLUS_1P5_VOLTS 8
116 #define CPU_1_VCCP_VOLTAGE 9
117 #define CPU_2_VCCP_VOLTAGE 10
118 #define CPU_3_VCCP_VOLTAGE 11
119 #define CPU_4_VCCP_VOLTAGE 12
120 #define PSU_INPUT_VOLTAGE 13
121 #define MCH_VCC_VOLTAGE 14
122 #define PLUS_3P3_VOLT_STANDBY 15
123 #define CPU_VTT_VOLTAGE 16
124 #define PLUS_1P8_VOLTS 17
126 #define LAST_VOLTAGE 17
129 // Fan Speed Sensors and Controllers.
131 #define CPU_COOLING_FAN 1
132 #define SYSTEM_COOLING_FAN 2
133 #define MCH_COOLING_FAN 3
134 #define VR_COOLING_FAN 4
135 #define CHASSIS_COOLING_FAN 5
136 #define CHASSIS_INLET_FAN 6
137 #define CHASSIS_OUTLET_FAN 7
138 #define PSU_COOLING_FAN 8
139 #define PSU_INLET_FAN 9
140 #define PSU_OUTLET_FAN 10
141 #define DRIVE_COOLING_FAN 11
142 #define GPU_COOLING_FAN 12
143 #define AUX_COOLING_FAN 13
144 #define IOH_COOLING_FAN 14
149 // Fan Type Definitions
151 #define FAN_TYPE_UNKNOWN 0
152 #define FAN_3WIRE_PULSE 1
153 #define FAN_3WIRE_VOLTAGE 2
159 // TEMP_SENSOR_INFO - Structure providing info for a temperature sensor.
161 typedef struct _TEMP_SENSOR_INFO
163 UINT8 byDevice
; // Device index
164 UINT8 byIndex
; // Physical sensor index
165 UINT8 byUsage
; // Usage indicator
166 UINT8 bRelative
; // Relative vs. Absolute readings
168 } TEMP_SENSOR_INFO
, *P_TEMP_SENSOR_INFO
;
171 // TYPEDEF_TEMP_SENSOR_SECTION - Macro that can be used to typedef the
172 // TEMP_SENSOR_SECTION structure, which provides information about all
173 // temperature sensors.
175 #define TYPEDEF_TEMP_SENSOR_SECTION(count) \
176 typedef struct _TEMP_SENSOR_SECTION \
179 TEMP_SENSOR_INFO stSensor[count]; \
181 } TEMP_SENSOR_SECTION, *P_TEMP_SENSOR_SECTION
184 // VOLT_SENSOR_INFO - Structure providing info for a voltage sensor.
186 typedef struct _VOLT_SENSOR_INFO
188 UINT8 byDevice
; // Device index
189 UINT8 byIndex
; // Physical sensor index
190 UINT8 byUsage
; // Usage indicator
192 } VOLT_SENSOR_INFO
, *P_VOLT_SENSOR_INFO
;
195 // TYPEDEF_VOLT_SENSOR_SECTION - Macro that can be used to typedef the
196 // VOLT_SENSOR_SECTION structure, which provides information about all
199 #define TYPEDEF_VOLT_SENSOR_SECTION(count) \
200 typedef struct _VOLT_SENSOR_SECTION \
203 VOLT_SENSOR_INFO stSensor[count]; \
205 } VOLT_SENSOR_SECTION, *P_VOLT_SENSOR_SECTION
208 // FAN_SENSOR_INFO - Structure providing info for a fan speed sensor.
210 typedef struct _FAN_SENSOR_INFO
212 UINT8 byDevice
; // Device index
213 UINT8 byIndex
; // Physical sensor index
214 UINT8 byUsage
; // Usage indicator
215 UINT8 byType
; // Fan type
216 UINT8 byController
; // Associated Fan Controller
218 } FAN_SENSOR_INFO
, *P_FAN_SENSOR_INFO
;
221 // TYPEDEF_FAN_SENSOR_SECTION - Macro that can be used to typedef the
222 // FAN_SENSOR_SECTION structure, which provides information about all fan
225 #define TYPEDEF_FAN_SENSOR_SECTION(count) \
226 typedef struct _FAN_SENSOR_SECTION \
229 FAN_SENSOR_INFO stSensor[count]; \
231 } FAN_SENSOR_SECTION, *P_FAN_SENSOR_SECTION
234 // FAN_CONTROLLER_INFO - Structure providing info for a fan speed controller.
236 #define MAX_ASSOC_FANS 4
237 #define ASSOC_UNUSED 0xFF
239 typedef struct _FAN_CONTROLLER_INFO
241 UINT8 byDevice
; // Device index
242 UINT8 byIndex
; // Physical Controller Index
243 UINT8 byUsage
; // Usage Indicator
244 UINT8 byFan
[MAX_ASSOC_FANS
]; // Associated Fan Sensors
246 } FAN_CONTROLLER_INFO
, *P_FAN_CONTROLLER_INFO
;
249 // TYPEDEF_FAN_CONTROLLER_SECTION - Macro that can be used to typedef the
250 // FAN_CONTROLLER_SECTION structure, which provides information about all
251 // fan speed controllers.
253 #define TYPEDEF_FAN_CONTROLLER_SECTION(count) \
254 typedef struct _FAN_CONTROLLER_SECTION \
257 FAN_CONTROLLER_INFO stController[count]; \
259 } FAN_CONTROLLER_SECTION, *P_FAN_CONTROLLER_SECTION
262 // TYPEDEF_SENSOR_INFO_VAR - Macro that can be used to typedef the
263 // SENSOR_INFO_VAR structure, which provides information about all sensors
264 // and fan speed controllers. The other TYPEDEF macros must be invoked
265 // before using this one...
267 #define TYPEDEF_SENSOR_INFO_VAR \
268 typedef struct _SENSOR_INFO_VAR \
270 TEMP_SENSOR_SECTION stTemps; \
271 VOLT_SENSOR_SECTION stVolts; \
272 FAN_SENSOR_SECTION stFans; \
273 FAN_CONTROLLER_SECTION stCtrls; \
275 } SENSOR_INFO_VAR, *P_SENSOR_INFO_VAR