coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
env_ctrl_chip.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef SUPERIO_ITE_ENV_CTRL_CHIP_H
4 #define SUPERIO_ITE_ENV_CTRL_CHIP_H
5 
6 #define ITE_EC_TMPIN_CNT 3
7 
8 #if CONFIG(SUPERIO_ITE_ENV_CTRL_5FANS)
9 #define ITE_EC_FAN_CNT 5
10 #else
11 #define ITE_EC_FAN_CNT 3
12 #endif
13 
14 /* Supported thermal mode on TMPINx */
20 };
21 
24  /* Offset is used for diode sensors and PECI */
26  /* Limits */
29 };
30 
31 /* Bit mask for voltage pins VINx */
33  VIN0 = 0x01,
34  VIN1 = 0x02,
35  VIN2 = 0x04,
36  VIN3 = 0x08,
37  VIN4 = 0x10,
38  VIN5 = 0x20,
39  VIN6 = 0x40,
40  VIN7 = 0x80,
41  VIN_ALL = 0xff
42 };
43 
50 };
51 
53  u8 tmpin; /* select TMPINx (1, 2 or 3) */
54  u8 tmp_off; /* turn fan off below (°C) */
55  u8 tmp_start; /* turn fan on above (°C) */
56  u8 tmp_full; /* 100% duty cycle above (°C) */
57  u8 tmp_delta; /* adapt fan speed when temperature changed by
58  at least `tmp_delta`°C */
59  u8 full_lmt; /* force fan to full PWM at thermal limit */
60  u8 smoothing; /* enable smoothing */
61  u8 pwm_start; /* start at this duty cycle (%) */
62  u8 slope; /* increase duty cycle by `slope`%/°C */
63  u8 clsd_loop; /* tachometer closed-loop mode enable */
64  u16 rpm_start; /* start at this RPM (clsd_loop = 1) */
65 };
66 
68  enum ite_ec_fan_mode mode;
70 };
71 
72 struct ite_ec_config {
73  /*
74  * Enable reading of voltage pins VINx.
75  */
77 
78  /*
79  * Enable temperature sensors in given mode.
80  */
82 
83  /*
84  * Enable a FAN in given mode.
85  */
87 
88  bool tmpin_beep;
89  bool fan_beep;
90  bool vin_beep;
91 
92  /*
93  * Enable SMBus for external thermal sensor.
94  */
95  bool smbus_en;
96  /*
97  * Select 24 MHz clock for external host instead of an
98  * internally generated 32 MHz clock.
99  */
101 };
102 
103 /* Some shorthands for device trees */
104 #define TMPIN1 ec.tmpin[0]
105 #define TMPIN2 ec.tmpin[1]
106 #define TMPIN3 ec.tmpin[2]
107 
108 #define FAN1 ec.fan[0]
109 #define FAN2 ec.fan[1]
110 #define FAN3 ec.fan[2]
111 #define FAN4 ec.fan[3]
112 #define FAN5 ec.fan[4]
113 
114 #endif /* SUPERIO_ITE_ENV_CTRL_CHIP_H */
ite_ec_fan_mode
Definition: env_ctrl_chip.h:44
@ FAN_IGNORE
Definition: env_ctrl_chip.h:45
@ FAN_SMART_SOFTWARE
Definition: env_ctrl_chip.h:48
@ FAN_MODE_ON
Definition: env_ctrl_chip.h:46
@ FAN_MODE_OFF
Definition: env_ctrl_chip.h:47
@ FAN_SMART_AUTOMATIC
Definition: env_ctrl_chip.h:49
ite_ec_voltage_pin
Definition: env_ctrl_chip.h:32
@ VIN3
Definition: env_ctrl_chip.h:36
@ VIN4
Definition: env_ctrl_chip.h:37
@ VIN5
Definition: env_ctrl_chip.h:38
@ VIN6
Definition: env_ctrl_chip.h:39
@ VIN7
Definition: env_ctrl_chip.h:40
@ VIN0
Definition: env_ctrl_chip.h:33
@ VIN2
Definition: env_ctrl_chip.h:35
@ VIN_ALL
Definition: env_ctrl_chip.h:41
@ VIN1
Definition: env_ctrl_chip.h:34
#define ITE_EC_FAN_CNT
Definition: env_ctrl_chip.h:11
#define ITE_EC_TMPIN_CNT
Definition: env_ctrl_chip.h:6
ite_ec_thermal_mode
Definition: env_ctrl_chip.h:15
@ THERMAL_RESISTOR
Definition: env_ctrl_chip.h:18
@ THERMAL_MODE_DISABLED
Definition: env_ctrl_chip.h:16
@ THERMAL_PECI
Definition: env_ctrl_chip.h:19
@ THERMAL_DIODE
Definition: env_ctrl_chip.h:17
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
struct ite_ec_thermal_config tmpin[ITE_EC_TMPIN_CNT]
Definition: env_ctrl_chip.h:81
enum ite_ec_voltage_pin vin_mask
Definition: env_ctrl_chip.h:76
struct ite_ec_fan_config fan[ITE_EC_FAN_CNT]
Definition: env_ctrl_chip.h:86
struct ite_ec_fan_smartconfig smart
Definition: env_ctrl_chip.h:69
enum ite_ec_fan_mode mode
Definition: env_ctrl_chip.h:68
enum ite_ec_thermal_mode mode
Definition: env_ctrl_chip.h:23