diff options
author | Matt DeVillier <matt.devillier@gmail.com> | 2020-08-12 10:29:11 -0500 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2020-08-14 00:51:23 +0000 |
commit | 67f80fb8f56a1ff393306fac0d2930a41e3d2a19 (patch) | |
tree | 775f05ac05d23e42c6344f0d24ac1ee220ad4a20 /src/superio/ite/common/env_ctrl.h | |
parent | deb80ea8071d38a15fa9c06be0e069be55672b25 (diff) |
superio/ite/common: Add support for closed-loop mode
Add support for tachometer closed loop mode, and programming
of initial RPM vs initial PWM value.
Change-Id: Idff29331c979f8518021103b6f8d19e75e657e3a
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44418
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/superio/ite/common/env_ctrl.h')
-rw-r--r-- | src/superio/ite/common/env_ctrl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/superio/ite/common/env_ctrl.h b/src/superio/ite/common/env_ctrl.h index 7bce8097f5..145c6c13e9 100644 --- a/src/superio/ite/common/env_ctrl.h +++ b/src/superio/ite/common/env_ctrl.h @@ -91,6 +91,7 @@ ? (0x1e + ((x)-4)) \ : (0x15 + ((x)-1)) \ ) +#define ITE_EC_FAN_PWM_CLSD_LOOP (1 << 2) #if CONFIG(SUPERIO_ITE_ENV_CTRL_5FANS) #define ITE_EC_FAN_CTL_TEMPIN_MASK (7 << 3) @@ -110,6 +111,13 @@ ? ITE_EC_FAN_MAX_PWM \ : (_p * ITE_EC_FAN_MAX_PWM) / 100; \ }) +#define ITE_EC_FAN_CTL_PWM_RPM(p) \ + ({ \ + const unsigned int _p = p; \ + (_p >= 4080) \ + ? 0xFF \ + : (_p / 16); \ + }) #define ITE_EC_HIGH_TEMP_LIMIT(x) (0x40 + ((x-1) * 2)) #define ITE_EC_LOW_TEMP_LIMIT(x) (0x41 + ((x-1) * 2)) @@ -178,6 +186,7 @@ static const u8 ITE_EC_TEMP_ADJUST[] = { 0x56, 0x57, 0x59 }; /* Common for ITE_EC_FAN_CTL_PWM_START */ #define ITE_EC_FAN_CTL_PWM_SLOPE_BIT6(s) (((s) & 0x40) << 1) #define ITE_EC_FAN_CTL_PWM_START_DUTY(p) ITE_EC_FAN_CTL_PWM_DUTY(p) +#define ITE_EC_FAN_CTL_PWM_START_RPM(p) ITE_EC_FAN_CTL_PWM_RPM(p) /* Common for ITE_EC_FAN_CTL_PWM_AUTO */ #define ITE_EC_FAN_CTL_AUTO_SMOOTHING_EN (1 << 7) |