diff options
author | Joel Linn <jl@conductive.de> | 2024-03-26 18:19:15 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2024-03-30 12:58:00 +0000 |
commit | 82ff48c1b11f673bca6c1cef3c9e01f164572bd4 (patch) | |
tree | 7ec0afc210d9ef00486b95fa80e2a5ca9a8dfe36 /src | |
parent | cccada28f71f97e7d61d6e50b797c9fa694e5c11 (diff) |
superio/ite: Fix incorrect warnings
Fix warning for disabled thermal inputs.
Fix warning for PECI thermal inputs if one was set up previously.
Depending on the mb, the superio will not go through power-on reset and
retain its registers. Do not trigger a warning if the current register
value aligns with the desired value. Don't return early if some input is
already configured for PECI, simply overwrite the configuration.
Both warnings were observed while porting the "HP Pro 3500 Series" mb.
Change-Id: Ibabe1b1ef55f2acb2074eceb535ec684bffc8155
Signed-off-by: Joel Linn <jl@conductive.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81516
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/superio/ite/common/env_ctrl.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/superio/ite/common/env_ctrl.c b/src/superio/ite/common/env_ctrl.c index 9149c5828c..d624a9233e 100644 --- a/src/superio/ite/common/env_ctrl.c +++ b/src/superio/ite/common/env_ctrl.c @@ -67,6 +67,8 @@ static void enable_tmpin(const u16 base, const u8 tmpin, reg_extra = pnp_read_hwm5_index(base, ITE_EC_ADC_TEMP_EXTRA_CHANNEL_ENABLE); switch (conf->mode) { + case THERMAL_MODE_DISABLED: + return; case THERMAL_PECI: /* Some chips can set any TMPIN as the target for PECI readings while others can only read to TMPIN3. In the latter case a @@ -78,12 +80,15 @@ static void enable_tmpin(const u16 base, const u8 tmpin, "PECI to TMPIN2 not supported on IT8721F\n"); return; } - if (reg & ITE_EC_ADC_TEMP_EXT_REPORTS_TO_MASK) { + u8 reg_new = (reg & ~ITE_EC_ADC_TEMP_EXT_REPORTS_TO_MASK) + | ITE_EC_ADC_TEMP_EXT_REPORTS_TO(tmpin); + /* Registers stick on reboot and resume, + don't warn for correct reg values */ + if (reg & ITE_EC_ADC_TEMP_EXT_REPORTS_TO_MASK && reg != reg_new) { printk(BIOS_WARNING, - "PECI specified for multiple TMPIN\n"); - return; + "PECI specified for another TMPIN, overwriting\n"); } - reg |= ITE_EC_ADC_TEMP_EXT_REPORTS_TO(tmpin); + reg = reg_new; } else if (tmpin == 3) { reg_extra |= ITE_EC_ADC_TEMP_EXTRA_TMPIN3_EXT; pnp_write_hwm5_index(base, ITE_EC_ADC_TEMP_EXTRA_CHANNEL_ENABLE, |