diff options
author | loganliao <Logan_Liao@compal.corp-partner.google.com> | 2020-02-05 13:53:01 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-19 04:07:41 +0000 |
commit | d69491b0fa316c4d34173fd93e2cec7af1af3906 (patch) | |
tree | 38608c628a88bd475f59d35c6273a7ca5f39ae58 /board/mushu | |
parent | bae110aab1c0858861e01b681f98d35ad6bfef81 (diff) | |
download | chrome-ec-d69491b0fa316c4d34173fd93e2cec7af1af3906.tar.gz |
mushu: add FAN2 support
BRANCH=none
BUG=b:148968367
TEST=make BOARD=mushu
Change-Id: If367d96dfa992109097e3aa7e843861a6a287082
Signed-off-by: loganliao <Logan_Liao@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2040753
Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
Reviewed-by: Bob Moragues <moragues@chromium.org>
Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com>
Diffstat (limited to 'board/mushu')
-rw-r--r-- | board/mushu/board.c | 33 | ||||
-rw-r--r-- | board/mushu/board.h | 5 | ||||
-rw-r--r-- | board/mushu/gpio.inc | 2 |
3 files changed, 38 insertions, 2 deletions
diff --git a/board/mushu/board.c b/board/mushu/board.c index 4670c2bb0f..1656e4adf0 100644 --- a/board/mushu/board.c +++ b/board/mushu/board.c @@ -120,6 +120,8 @@ const struct pwm_t pwm_channels[] = { [PWM_CH_KBLIGHT] = { .channel = 3, .flags = 0, .freq = 10000 }, [PWM_CH_FAN] = {.channel = 5, .flags = PWM_CONFIG_OPEN_DRAIN, .freq = 25000}, + [PWM_CH_FAN2] = {.channel = 6, .flags = PWM_CONFIG_OPEN_DRAIN, + .freq = 25000}, }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); @@ -363,6 +365,12 @@ const struct fan_conf fan_conf_0 = { .enable_gpio = GPIO_EN_PP5000_FAN, }; +const struct fan_conf fan_conf_1 = { + .flags = FAN_USE_RPM_MODE, + .ch = MFT_CH_1, /* Use MFT id to control fan */ + .pgood_gpio = -1, + .enable_gpio = GPIO_EN_PP5000_FAN, +}; /* Default */ const struct fan_rpm fan_rpm_0 = { .rpm_min = 3100, @@ -370,14 +378,21 @@ const struct fan_rpm fan_rpm_0 = { .rpm_max = 6900, }; +const struct fan_rpm fan_rpm_1 = { + .rpm_min = 3100, + .rpm_start = 3100, + .rpm_max = 6900, +}; const struct fan_t fans[FAN_CH_COUNT] = { [FAN_CH_0] = { .conf = &fan_conf_0, .rpm = &fan_rpm_0, }, + [FAN_CH_1] = { .conf = &fan_conf_1, .rpm = &fan_rpm_1, }, }; /******************************************************************************/ /* MFT channels. These are logically separate from pwm_channels. */ const struct mft_t mft_channels[] = { [MFT_CH_0] = {NPCX_MFT_MODULE_1, TCKC_LFCLK, PWM_CH_FAN}, + [MFT_CH_1] = {NPCX_MFT_MODULE_2, TCKC_LFCLK, PWM_CH_FAN2}, }; BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); @@ -424,12 +439,28 @@ const static struct ec_thermal_config thermal_a = { .temp_fan_max = C_TO_K(50), }; +const static struct ec_thermal_config thermal_b = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), + [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = C_TO_K(25), + .temp_fan_max = C_TO_K(50), +}; + + struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT]; static void setup_fans(void) { thermal_params[TEMP_SENSOR_1] = thermal_a; - thermal_params[TEMP_SENSOR_2] = thermal_a; + thermal_params[TEMP_SENSOR_2] = thermal_b; } /* Sets the gpio flags correct taking into account warm resets */ diff --git a/board/mushu/board.h b/board/mushu/board.h index 215747b7e4..64338f60e3 100644 --- a/board/mushu/board.h +++ b/board/mushu/board.h @@ -86,7 +86,7 @@ #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL /* Fan features */ -#define CONFIG_FANS 1 +#define CONFIG_FANS 2 #undef CONFIG_FAN_INIT_SPEED #define CONFIG_FAN_INIT_SPEED 50 #define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_A_RAILS @@ -145,17 +145,20 @@ enum sensor_id { enum pwm_channel { PWM_CH_KBLIGHT, PWM_CH_FAN, + PWM_CH_FAN2, PWM_CH_COUNT }; enum fan_channel { FAN_CH_0 = 0, + FAN_CH_1, /* Number of FAN channels */ FAN_CH_COUNT, }; enum mft_channel { MFT_CH_0 = 0, + MFT_CH_1, /* Number of MFT channels */ MFT_CH_COUNT, }; diff --git a/board/mushu/gpio.inc b/board/mushu/gpio.inc index 384243d1ec..21b202eac5 100644 --- a/board/mushu/gpio.inc +++ b/board/mushu/gpio.inc @@ -121,7 +121,9 @@ ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UA /* PWM */ ALTERNATE(PIN_MASK(8, 0x01), 0, MODULE_PWM, 0) /* PWM3 - Keyboard backlight */ ALTERNATE(PIN_MASK(B, 0x80), 0, MODULE_PWM, 0) /* PWM5 - FAN */ +ALTERNATE(PIN_MASK(C, 0x01), 0, MODULE_PWM, 0) /* PWM6 - FAN2 */ ALTERNATE(PIN_MASK(4, 0x01), 0, MODULE_PWM, 0) /* TA1 - Fan Tachometer */ +ALTERNATE(PIN_MASK(7, 0x08), 0, MODULE_PWM, 0) /* TA2 - Fan Tachometer */ /* ADC */ ALTERNATE(PIN_MASK(4, 0x30), 0, MODULE_ADC, 0) /* ADC0-1 */ |