diff options
author | Matt_Wang <Matt_Wang@compal.corp-partner.google.com> | 2021-04-12 18:53:13 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-12 15:20:31 +0000 |
commit | dadb16b7bc22ba14c083570d2f2a78bcf69a8709 (patch) | |
tree | 8cd9222a91c6d63140b92016ad909720dc90c3a0 /baseboard/mancomb | |
parent | 4d7fb7b50554fa5131459fc4d9d79c8b5b6c6930 (diff) | |
download | chrome-ec-dadb16b7bc22ba14c083570d2f2a78bcf69a8709.tar.gz |
mancomb: Add fan support
Add basic fan support. More tuning will be needed.
BUG=b:178217015
BRANCH=None
TEST=Build
Change-Id: I09b598c48c74bf8c3edbe80ec0084c8d68287386
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821118
Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com>
Reviewed-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard/mancomb')
-rw-r--r-- | baseboard/mancomb/baseboard.c | 32 | ||||
-rw-r--r-- | baseboard/mancomb/baseboard.h | 17 |
2 files changed, 48 insertions, 1 deletions
diff --git a/baseboard/mancomb/baseboard.c b/baseboard/mancomb/baseboard.c index 6361d7714d..584e365410 100644 --- a/baseboard/mancomb/baseboard.c +++ b/baseboard/mancomb/baseboard.c @@ -21,6 +21,8 @@ #include "driver/tcpm/nct38xx.h" #include "driver/temp_sensor/sb_tsi.h" #include "driver/usb_mux/amd_fp6.h" +#include "fan.h" +#include "fan_chip.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" @@ -399,6 +401,36 @@ const struct pwm_t pwm_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); +const struct mft_t mft_channels[] = { + [MFT_CH_0] = { + .module = NPCX_MFT_MODULE_1, + .clk_src = TCKC_LFCLK, + .pwm_id = PWM_CH_FAN, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); + +const struct fan_conf fan_conf_0 = { + .flags = FAN_USE_RPM_MODE, + .ch = MFT_CH_0, /* Use MFT id to control fan */ + .pgood_gpio = -1, + .enable_gpio = -1, +}; + +const struct fan_rpm fan_rpm_0 = { + .rpm_min = 1800, + .rpm_start = 3000, + .rpm_max = 5200, +}; + +const struct fan_t fans[] = { + [FAN_CH_0] = { + .conf = &fan_conf_0, + .rpm = &fan_rpm_0, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT); + /* * USB C0/C1 port SBU mux use standalone FSUSB42UMX * chip and it needs a board specific driver. diff --git a/baseboard/mancomb/baseboard.h b/baseboard/mancomb/baseboard.h index 71a7466475..9a3ff1ee62 100644 --- a/baseboard/mancomb/baseboard.h +++ b/baseboard/mancomb/baseboard.h @@ -213,7 +213,9 @@ #define I2C_PORT_THERMAL_AP NPCX_I2C_PORT7_0 #define I2C_ADDR_EEPROM_FLAGS 0x50 -/* Fan features */ +/* Fan Config */ +#define CONFIG_FANS FAN_CH_COUNT +/* TODO: Set CONFIG_FAN_INIT_SPEED, defaults to 100 */ /* LED Config */ #define CONFIG_PWM @@ -290,6 +292,19 @@ enum pwm_channel { PWM_CH_COUNT }; +/* Fan Channels */ +enum fan_channel { + FAN_CH_0 = 0, + /* Number of FAN channels */ + FAN_CH_COUNT, +}; + +enum mft_channel { + MFT_CH_0 = 0, + /* Number of MFT channels */ + MFT_CH_COUNT, +}; + /* Baseboard Interrupt handlers. */ void baseboard_en_pwr_pcore_s0(enum gpio_signal signal); void baseboard_en_pwr_s0(enum gpio_signal signal); |