superio/ite: configure EC for fans to full at thermal limit
This applies to the automatic fan control mode of the environment controller (EC). Previously the affected bit was always cleared while the default value is 1 according to datasheets. Add a variable that can be set per mainboard in devicetree.cb. In the IT8783E datasheet that bit is marked as reserved. Signed-off-by: Michael Büchler <michael.buechler@posteo.net> Change-Id: Ie74102ac0d54be33558c161c9c84594d121772b1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/44165 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
parent
a2bb4553a5
commit
e693b1d549
|
@ -113,6 +113,7 @@ static void fan_smartconfig(const u16 base, const u8 fan,
|
|||
u8 pwm_ctrl;
|
||||
u8 pwm_start = 0;
|
||||
u8 pwm_auto = 0;
|
||||
u8 delta_temp;
|
||||
|
||||
if (mode == FAN_SMART_SOFTWARE) {
|
||||
pwm_ctrl = ITE_EC_FAN_CTL_PWM_MODE_SOFTWARE;
|
||||
|
@ -145,8 +146,11 @@ static void fan_smartconfig(const u16 base, const u8 fan,
|
|||
/* Full speed above 127°C by default */
|
||||
pnp_write_hwm5_index(base, ITE_EC_FAN_CTL_TEMP_LIMIT_FULL(fan),
|
||||
conf->tmp_full ? conf->tmp_full : 127);
|
||||
|
||||
delta_temp = ITE_EC_FAN_CTL_DELTA_TEMP_INTRVL(conf->tmp_delta);
|
||||
delta_temp |= ITE_EC_FAN_CTL_FULL_AT_THRML_LMT(conf->full_lmt);
|
||||
pnp_write_hwm5_index(base, ITE_EC_FAN_CTL_DELTA_TEMP(fan),
|
||||
ITE_EC_FAN_CTL_DELTA_TEMP_INTRVL(conf->tmp_delta));
|
||||
delta_temp);
|
||||
}
|
||||
|
||||
pnp_write_hwm5_index(base, ITE_EC_FAN_CTL_PWM_CONTROL(fan), pwm_ctrl);
|
||||
|
|
|
@ -185,6 +185,7 @@ static const u8 ITE_EC_TEMP_ADJUST[] = { 0x56, 0x57, 0x59 };
|
|||
|
||||
/* Common for ITE_EC_FAN_CTL_DELTA_TEMP */
|
||||
#define ITE_EC_FAN_CTL_DELTA_TEMP_INTRVL(c) ((c) & 0x1f)
|
||||
#define ITE_EC_FAN_CTL_FULL_AT_THRML_LMT(x) (((x) & 0x1) << 6)
|
||||
#define ITE_EC_FAN_CTL_TARGET_ZONE(x) (0x66 + ((x)-1) * 8)
|
||||
#define ITE_EC_FAN_CTL_TARGET_ZONE_MASK 0x0f
|
||||
|
||||
|
|
|
@ -50,15 +50,16 @@ enum ite_ec_fan_mode {
|
|||
};
|
||||
|
||||
struct ite_ec_fan_smartconfig {
|
||||
u8 tmpin; /* select TMPINx (1, 2 or 3) */
|
||||
u8 tmp_off; /* turn fan off below (°C) */
|
||||
u8 tmp_start; /* turn fan on above (°C) */
|
||||
u8 tmp_full; /* 100% duty cycle above (°C) */
|
||||
u8 tmp_delta; /* adapt fan speed when temperature
|
||||
changed by at least `tmp_delta`°C */
|
||||
u8 smoothing; /* enable smoothing */
|
||||
u8 pwm_start; /* start at this duty cycle (%) */
|
||||
u8 slope; /* increase duty cycle by `slope`%/°C */
|
||||
u8 tmpin; /* select TMPINx (1, 2 or 3) */
|
||||
u8 tmp_off; /* turn fan off below (°C) */
|
||||
u8 tmp_start; /* turn fan on above (°C) */
|
||||
u8 tmp_full; /* 100% duty cycle above (°C) */
|
||||
u8 tmp_delta; /* adapt fan speed when temperature changed by
|
||||
at least `tmp_delta`°C */
|
||||
u8 full_lmt; /* force fan to full PWM at thermal limit */
|
||||
u8 smoothing; /* enable smoothing */
|
||||
u8 pwm_start; /* start at this duty cycle (%) */
|
||||
u8 slope; /* increase duty cycle by `slope`%/°C */
|
||||
};
|
||||
|
||||
struct ite_ec_fan_config {
|
||||
|
|
Loading…
Reference in New Issue