[HACK] darp10: Set FAN2 duty to FAN1

This model has a second CPU fan connected to PWM3.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2024-04-18 14:07:36 -06:00
committed by Jeremy Soller
parent 748ec13132
commit b744529960
4 changed files with 12 additions and 0 deletions

View File

@ -73,6 +73,10 @@ void fan_duty_set(uint8_t peci_fan_duty, uint8_t dgpu_fan_duty) __reentrant {
TRACE("PECI fan_duty_raw=%d\n", peci_fan_duty);
last_duty_peci = peci_fan_duty = fan_smooth(last_duty_peci, peci_fan_duty);
DCR2 = fan_max ? MAX_FAN_SPEED : peci_fan_duty;
#if HAVE_CPU_FAN2
// FIXME: Handle better
DCR3 = fan_max ? MAX_FAN_SPEED : peci_fan_duty;
#endif
TRACE("PECI fan_duty_smoothed=%d\n", peci_fan_duty);
}

View File

@ -25,6 +25,9 @@ void pwm_init(void) {
// Turn off CPU fan (temperature control in peci_get_fan_duty)
DCR2 = 0;
#if HAVE_CPU_FAN2
DCR3 = 0;
#endif
#if CONFIG_EC_ITE_IT5570E || CONFIG_EC_ITE_IT5571E
// Reload counters when they reach 0 instead of immediately

View File

@ -18,6 +18,9 @@ uint8_t __code __at(SCRATCH_OFFSET) scratch_rom[] = {
void scratch_trampoline(void) {
// Set fans to 100%
DCR2 = 0xFF;
#if HAVE_CPU_FAN2
DCR3 = 0xFF;
#endif
#if HAVE_DGPU
DCR4 = 0xFF;
#endif

View File

@ -38,5 +38,7 @@ CFLAGS += \
-DPOWER_LIMIT_AC=65 \
-DPOWER_LIMIT_DC=45
CFLAGS += -DHAVE_CPU_FAN2=1
# Add common code
include src/board/system76/common/common.mk