]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/PlatformDxe/SensorVar.c
SignedCapsulePkg: Change the SMM debug lib instance
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformDxe / SensorVar.c
1 /** @file
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9 Module Name:
10
11
12 SensorVar.c
13
14 Abstract:
15
16 Initialization for the Sensor Info variable.
17
18 Revision History
19
20 --*/
21
22 #include "PlatformDxe.h"
23 #include "Guid/SensorInfoVariable.h"
24
25 //
26 // Sensor Information (board specific)
27 //
28
29 #define TEMPERATURE_SENSORS_COUNT 4
30 #define VOLTAGE_SENSORS_COUNT 6
31 #define FAN_SENSORS_COUNT 4
32 #define FAN_CONTROLLERS_COUNT 3
33
34 TYPEDEF_TEMP_SENSOR_SECTION(TEMPERATURE_SENSORS_COUNT);
35 TYPEDEF_VOLT_SENSOR_SECTION(VOLTAGE_SENSORS_COUNT);
36 TYPEDEF_FAN_SENSOR_SECTION(FAN_SENSORS_COUNT);
37 TYPEDEF_FAN_CONTROLLER_SECTION(FAN_CONTROLLERS_COUNT);
38 TYPEDEF_SENSOR_INFO_VAR;
39
40 SENSOR_INFO_VAR mSensorInfoData =
41 {
42 //
43 // Temperature Sensors
44 //
45 TEMPERATURE_SENSORS_COUNT,
46 {
47 { 0, 3, CPU_CORE_TEMPERATURE, TRUE },
48 { 0, 1, MOTHERBOARD_AMBIENT_TEMPERATURE, FALSE },
49 { 0, 2, VR_TEMPERATURE, FALSE },
50 { 0, 0, IOH_TEMPERATURE, FALSE }
51 },
52
53 //
54 // Voltage Sensors
55 //
56 VOLTAGE_SENSORS_COUNT,
57 {
58 { 0, 0, PLUS_12_VOLTS },
59 { 0, 1, PLUS_5_VOLTS },
60 { 0, 2, PLUS_3P3_VOLTS },
61 { 0, 3, MCH_VCC_VOLTAGE },
62 { 0, 4, CPU_1_VCCP_VOLTAGE },
63 { 0, 5, CPU_VTT_VOLTAGE }
64 },
65
66 //
67 // Fan Speed Sensors
68 //
69 FAN_SENSORS_COUNT,
70 {
71 { 0, 0, CPU_COOLING_FAN, FAN_4WIRE, 0 },
72 { 0, 1, AUX_COOLING_FAN, FAN_4WIRE, 1 },
73 { 0, 2, CHASSIS_INLET_FAN, FAN_3WIRE_VOLTAGE, 1 },
74 { 0, 3, CHASSIS_OUTLET_FAN, FAN_3WIRE_VOLTAGE, 2 }
75 },
76
77 //
78 // Fan Speed Controllers
79 //
80 FAN_CONTROLLERS_COUNT,
81 {
82 { 0, 0, CPU_COOLING_FAN, { 0, 0xff, 0xff, 0xff } },
83 { 0, 1, CHASSIS_COOLING_FAN, { 1, 2, 0xff, 0xff } },
84 { 0, 2, CHASSIS_COOLING_FAN, { 3, 0xff, 0xff, 0xff } }
85 }
86 };
87
88 /**
89
90 Write the Sensor Info variable if it does not already exist.
91
92 **/
93 VOID
94 InitializeSensorInfoVariable (
95 )
96 {
97 //
98 // Set the Sensor Info variable. If it already exists and the data matches,
99 // the variable driver will simply return without writing; otherwise, the
100 // driver will write the variable.
101 //
102 gRT->SetVariable (
103 gEfiSensorInfoVarNameWithPassword,
104 &gEfiSensorInfoVarGuid,
105 EFI_VARIABLE_NON_VOLATILE |
106 EFI_VARIABLE_BOOTSERVICE_ACCESS |
107 EFI_VARIABLE_RUNTIME_ACCESS,
108 sizeof (SENSOR_INFO_VAR),
109 &mSensorInfoData
110 );
111 }
112