diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2021-08-06 09:30:47 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-06 14:28:49 +0000 |
commit | 6e9c1b3a27c96267cda3329fdb50114a26bef9c3 (patch) | |
tree | bcab1a4bf140e7a65a899350a1917c8f6e7b7cf6 | |
parent | f0985f8a11585f6a704aa94a8354bd5b934619ac (diff) | |
download | chrome-ec-6e9c1b3a27c96267cda3329fdb50114a26bef9c3.tar.gz |
redrix: Configure thermal sensors
There are 4 thermal sensors on Redrix.
The sensor map as following:
ADC_TEMP_SENSOR_1_DDR: Close to DDR.
ADC_TEMP_SENSOR_2_SOC: Close to SOC.
ADC_TEMP_SENSOR_3_CHARGER: Close to charger.
ADC_TEMP_SENSOR_4_REGULATOR: Close to 5V regulator.
BUG=b:195673113
BRANCH=none
TEST=EC console "temps".
> temps
DDR : 319 K = 46 C 73%
SOC : 322 K = 49 C 93%
Charger : 316 K = 43 C 20%
Regulator : 319 K = 46 C 40%
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I51548faa34e70ffcbd809d18b2ca5996992e3753
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3076600
Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r-- | board/redrix/board.h | 12 | ||||
-rw-r--r-- | board/redrix/sensors.c | 96 |
2 files changed, 72 insertions, 36 deletions
diff --git a/board/redrix/board.h b/board/redrix/board.h index bf616872d8..7d455f72cb 100644 --- a/board/redrix/board.h +++ b/board/redrix/board.h @@ -195,16 +195,18 @@ #include "usbc_config.h" enum adc_channel { - ADC_TEMP_SENSOR_1_DDR_SOC, - ADC_TEMP_SENSOR_2_FAN, + ADC_TEMP_SENSOR_1_DDR, + ADC_TEMP_SENSOR_2_SOC, ADC_TEMP_SENSOR_3_CHARGER, - ADC_TEMP_SENSOR_4_WWAN, + ADC_TEMP_SENSOR_4_REGULATOR, ADC_CH_COUNT }; enum temp_sensor_id { - TEMP_SENSOR_1_DDR_SOC, - TEMP_SENSOR_2_FAN, + TEMP_SENSOR_1_DDR, + TEMP_SENSOR_2_SOC, + TEMP_SENSOR_3_CHARGER, + TEMP_SENSOR_4_REGULATOR, TEMP_SENSOR_COUNT }; diff --git a/board/redrix/sensors.c b/board/redrix/sensors.c index 8f94ff6110..0f8484fbf0 100644 --- a/board/redrix/sensors.c +++ b/board/redrix/sensors.c @@ -17,15 +17,15 @@ /* ADC configuration */ const struct adc_t adc_channels[] = { - [ADC_TEMP_SENSOR_1_DDR_SOC] = { - .name = "TEMP_DDR_SOC", + [ADC_TEMP_SENSOR_1_DDR] = { + .name = "TEMP_DDR", .input_ch = NPCX_ADC_CH0, .factor_mul = ADC_MAX_VOLT, .factor_div = ADC_READ_MAX + 1, .shift = 0, }, - [ADC_TEMP_SENSOR_2_FAN] = { - .name = "TEMP_FAN", + [ADC_TEMP_SENSOR_2_SOC] = { + .name = "TEMP_SOC", .input_ch = NPCX_ADC_CH1, .factor_mul = ADC_MAX_VOLT, .factor_div = ADC_READ_MAX + 1, @@ -38,8 +38,8 @@ const struct adc_t adc_channels[] = { .factor_div = ADC_READ_MAX + 1, .shift = 0, }, - [ADC_TEMP_SENSOR_4_WWAN] = { - .name = "TEMP_WWAN", + [ADC_TEMP_SENSOR_4_REGULATOR] = { + .name = "TEMP_REGULATOR", .input_ch = NPCX_ADC_CH7, .factor_mul = ADC_MAX_VOLT, .factor_div = ADC_READ_MAX + 1, @@ -266,27 +266,54 @@ DECLARE_HOOK(HOOK_INIT, board_sensors_init, HOOK_PRIO_INIT_I2C + 1); /* Temperature sensor configuration */ const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_1_DDR_SOC] = { - .name = "DDR and SOC", + [TEMP_SENSOR_1_DDR] = { + .name = "DDR", .type = TEMP_SENSOR_TYPE_BOARD, .read = get_temp_3v3_30k9_47k_4050b, - .idx = ADC_TEMP_SENSOR_1_DDR_SOC + .idx = ADC_TEMP_SENSOR_1_DDR }, - [TEMP_SENSOR_2_FAN] = { - .name = "FAN", + [TEMP_SENSOR_2_SOC] = { + .name = "SOC", .type = TEMP_SENSOR_TYPE_BOARD, .read = get_temp_3v3_30k9_47k_4050b, - .idx = ADC_TEMP_SENSOR_2_FAN + .idx = ADC_TEMP_SENSOR_2_SOC + }, + [TEMP_SENSOR_3_CHARGER] = { + .name = "Charger", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_30k9_47k_4050b, + .idx = ADC_TEMP_SENSOR_3_CHARGER + }, + [TEMP_SENSOR_4_REGULATOR] = { + .name = "Regulator", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_30k9_47k_4050b, + .idx = ADC_TEMP_SENSOR_4_REGULATOR }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); /* - * TODO(b/180681346): update for Alder Lake/brya + * TODO(b/195673113): Need to update for Alder Lake/redrix + */ +static const struct ec_thermal_config thermal_ddr = { + .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(70), + [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_host_release = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + }, + .temp_fan_off = C_TO_K(35), + .temp_fan_max = C_TO_K(50), +}; + +/* + * TODO(b/195673113): Need to update for Alder Lake/redrix * * Tiger Lake specifies 100 C as maximum TDP temperature. THRMTRIP# occurs at - * 130 C. However, sensor is located next to DDR, so we need to use the lower - * DDR temperature limit (85 C) + * 130 C. However, sensor is located next to SOC, so we need to use the lower + * SOC temperature limit (85 C) */ static const struct ec_thermal_config thermal_cpu = { .temp_host = { @@ -301,25 +328,30 @@ static const struct ec_thermal_config thermal_cpu = { }; /* - * TODO(b/180681346): update for Alder Lake/brya - * - * Inductor limits - used for both charger and PP3300 regulator - * - * Need to use the lower of the charger IC, PP3300 regulator, and the inductors - * - * Charger max recommended temperature 100C, max absolute temperature 125C - * PP3300 regulator: operating range -40 C to 145 C - * - * Inductors: limit of 125c - * PCB: limit is 80c + * TODO(b/195673113): Need to update for Alder Lake/redrix */ -static const struct ec_thermal_config thermal_fan = { +static const struct ec_thermal_config thermal_charger = { .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(80), + [EC_TEMP_THRESH_HALT] = C_TO_K(85), + }, + .temp_host_release = { [EC_TEMP_THRESH_HIGH] = C_TO_K(75), - [EC_TEMP_THRESH_HALT] = C_TO_K(80), + }, + .temp_fan_off = C_TO_K(40), + .temp_fan_max = C_TO_K(55), +}; + +/* + * TODO(b/195673113): Need to update for Alder Lake/redrix + */ +static const struct ec_thermal_config thermal_regulator = { + .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(80), + [EC_TEMP_THRESH_HALT] = C_TO_K(85), }, .temp_host_release = { - [EC_TEMP_THRESH_HIGH] = C_TO_K(65), + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), }, .temp_fan_off = C_TO_K(40), .temp_fan_max = C_TO_K(55), @@ -327,7 +359,9 @@ static const struct ec_thermal_config thermal_fan = { /* this should really be "const" */ struct ec_thermal_config thermal_params[] = { - [TEMP_SENSOR_1_DDR_SOC] = thermal_cpu, - [TEMP_SENSOR_2_FAN] = thermal_fan, + [TEMP_SENSOR_1_DDR] = thermal_ddr, + [TEMP_SENSOR_2_SOC] = thermal_cpu, + [TEMP_SENSOR_3_CHARGER] = thermal_charger, + [TEMP_SENSOR_4_REGULATOR] = thermal_regulator, }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); |