diff options
author | raymondchou <raymond_chou@compal.corp-partner.google.com> | 2018-02-07 11:04:38 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-03 02:50:48 -0800 |
commit | d87c684288ed1c40615b1c2784ba426ad9655dcd (patch) | |
tree | 718f1bdbb5b4eab743d7ba88c7f22d26b391eed9 /board/nami | |
parent | 6790a884a46f18e858a6b308d3b00f86ef915e3f (diff) | |
download | chrome-ec-d87c684288ed1c40615b1c2784ba426ad9655dcd.tar.gz |
Nami: Enable fan feature
1. Enable fan feature and update fan setting.
2. Enable SW and chipset throttle feature.
3. Fix the issue that cannot set fan duty by "fanduty" in EC console.
BUG=b:72974136
BRANCH=none
TEST=Check fan command(fanduty/fanset/fanauto) in EC console can work and
check below condition.
1.AP throttling soft
--> Increased temperature to over trigger point, then to check
EC notify event in EC console.
2.AP throttling hard
--> Increased temperature to over trigger point, then to check
EC notify event and CPU_PROCHOT pin status in EC console.
3.Fan controlled in s3/s5 as expected (by EC)
--> Check Fan turn off in s3/s5.
4.Fan controlled in S0 as expected (by DPTF)
--> Check Fan keep 100% duty and no see DPTF to set fan duty.
But fan duty can be control by "fanduty" in EC console.
Change-Id: If9fd7f64c123ff54742052b6310023f0d4b0113a
Signed-off-by: raymondchou <raymond_chou@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/906086
Commit-Ready: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/nami')
-rw-r--r-- | board/nami/board.c | 46 | ||||
-rw-r--r-- | board/nami/board.h | 17 |
2 files changed, 60 insertions, 3 deletions
diff --git a/board/nami/board.c b/board/nami/board.c index 8bb9eef9d3..2c17571d51 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -55,6 +55,8 @@ #include "usb_pd_tcpm.h" #include "util.h" #include "espi.h" +#include "fan.h" +#include "fan_chip.h" #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) @@ -138,6 +140,28 @@ const struct adc_t adc_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); +/******************************************************************************/ +/* Physical fans. These are logically separate from pwm_channels. */ +const struct fan_t fans[] = { + [FAN_CH_0] = { + .flags = FAN_USE_RPM_MODE, + .rpm_min = 2800, + .rpm_start = 3000, + .rpm_max = 6000, + .ch = MFT_CH_0, /* Use MFT id to control fan */ + .pgood_gpio = -1, + .enable_gpio = -1, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(fans) == FAN_CH_COUNT); + +/******************************************************************************/ +/* MFT channels. These are logically separate from pwm_channels. */ +const struct mft_t mft_channels[] = { + [MFT_CH_0] = {NPCX_MFT_MODULE_2, TCKC_LFCLK, PWM_CH_FAN}, +}; +BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); + /* I2C port map */ const struct i2c_port_t i2c_ports[] = { {"tcpc0", NPCX_I2C_PORT0_0, 400, GPIO_I2C0_0_SCL, GPIO_I2C0_0_SDA}, @@ -235,16 +259,34 @@ uint16_t tcpc_get_alert_status(void) } /* - * F75303_Remote1 is near CPU, and F75303_Remote2 is near 5V power ic. + * F75303_Remote1 is near CPU, and F75303_Remote2 is near 5V power IC. */ const struct temp_sensor_t temp_sensors[] = { - {"F75303_Remote1", TEMP_SENSOR_TYPE_BOARD, f75303_get_val, + {"F75303_Remote1", TEMP_SENSOR_TYPE_CPU, f75303_get_val, F75303_IDX_REMOTE1, 4}, {"F75303_Remote2", TEMP_SENSOR_TYPE_BOARD, f75303_get_val, F75303_IDX_REMOTE2, 4}, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); +/* + * Thermal limits for each temp sensor. All temps are in degrees K. Must be in + * same order as enum temp_sensor_id. To always ignore any temp, use 0. + */ +struct ec_thermal_config thermal_params[] = { + /* {Twarn, Thigh, Thalt}, <on> + * {Twarn, Thigh, X }, <off> + * fan_off, fan_max + */ + {{C_TO_K(80), C_TO_K(85), C_TO_K(88)}, + {C_TO_K(75), C_TO_K(80), C_TO_K(83)}, + C_TO_K(40), C_TO_K(80)}, /* TEMP_SENSOR_I2C_F75303_REMOTE1*/ + {{C_TO_K(75), C_TO_K(80), C_TO_K(83)}, + {C_TO_K(70), C_TO_K(75), C_TO_K(78)}, + C_TO_K(35), C_TO_K(75)}, /* TEMP_SENSOR_I2C_F75303_REMOTE2*/ +}; +BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); + #define I2C_PMIC_READ(reg, data) \ i2c_read8(I2C_PORT_PMIC, TPS650X30_I2C_ADDR1, (reg), (data)) #define I2C_PMIC_WRITE(reg, data) \ diff --git a/board/nami/board.h b/board/nami/board.h index 2d1d256c92..6f13ca741d 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -52,6 +52,9 @@ (EC_WIRELESS_SWITCH_WLAN | EC_WIRELESS_SWITCH_WLAN_POWER) #define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_DX_WLAN #undef CONFIG_SUPPORT_CHIP_HIBERNATION +#define CONFIG_FANS 1 +#define CONFIG_THROTTLE_AP +#define CONFIG_CHIPSET_CAN_THROTTLE /* EC console commands */ #define CONFIG_CMD_ACCELS @@ -168,7 +171,7 @@ /* Optional feature to configure npcx chip */ #define NPCX_UART_MODULE2 1 /* 1:GPIO64/65 as UART */ #define NPCX_JTAG_MODULE2 0 /* 0:GPIO21/17/16/20 as JTAG */ -#define NPCX_TACH_SEL2 0 /* 0:GPIO40/73 as TACH */ +#define NPCX_TACH_SEL2 1 /* 0:GPIO40/73 1:GPIO93/A6 as TACH */ /* I2C ports */ #define I2C_PORT_TCPC0 NPCX_I2C_PORT0_0 @@ -241,6 +244,18 @@ enum pwm_channel { PWM_CH_COUNT, }; +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, +}; + /* TODO(crosbug.com/p/61098): Verify the numbers below. */ /* * delay to turn on the power supply max is ~16ms. |