diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-02-08 17:04:55 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-24 23:52:46 +0000 |
commit | 6ed74483103a1773f2d26395f4e145579326a5cb (patch) | |
tree | eb7bc61c34eee650c45bb4d634ec0142ba3da33b | |
parent | 38c6a96e4470b3a6afb276a862ec77c0265f5a40 (diff) | |
download | chrome-ec-6ed74483103a1773f2d26395f4e145579326a5cb.tar.gz |
brya: Enable AP throttling
This enables AP throttling based on thermal conditions. Brya has two
thermistors - one near the SoC and one near the charger that can be used
for deciding when to throttle.
BRANCH=none
BUG=b:173575131,b:180681346
TEST=buildall passes
Change-Id: Ieaa6959ff9fc7ee5e505c13cff2150ad70a04e3b
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2686981
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | baseboard/brya/baseboard.h | 4 | ||||
-rw-r--r-- | board/brya/board.c | 9 | ||||
-rw-r--r-- | board/brya/board.h | 6 | ||||
-rw-r--r-- | board/brya/sensors.c | 52 |
4 files changed, 57 insertions, 14 deletions
diff --git a/baseboard/brya/baseboard.h b/baseboard/brya/baseboard.h index 4d1b20c04f..189f7f5e26 100644 --- a/baseboard/brya/baseboard.h +++ b/baseboard/brya/baseboard.h @@ -51,6 +51,10 @@ /* Chipset config */ #define CONFIG_CHIPSET_ALDERLAKE_SLG4BD44540 +/* Thermal features */ +#define CONFIG_THROTTLE_AP +#define CONFIG_CHIPSET_CAN_THROTTLE + #define CONFIG_PWM /* Enable I2C Support */ diff --git a/board/brya/board.c b/board/brya/board.c index 0ea7886faf..b27eb0ce8c 100644 --- a/board/brya/board.c +++ b/board/brya/board.c @@ -7,6 +7,7 @@ #include "power.h" #include "switch.h" +#include "throttle_ap.h" #include "gpio_list.h" /* Must come after other header files. */ @@ -19,14 +20,6 @@ void power_button_interrupt(enum gpio_signal signal) } /* - * remove when we enable CONFIG_THROTTLE_AP - */ - -void throttle_ap_prochot_input_interrupt(enum gpio_signal signal) -{ -} - -/* * remove when we enable CONFIG_VOLUME_BUTTONS */ diff --git a/board/brya/board.h b/board/brya/board.h index 793c02aba3..26cd4de40b 100644 --- a/board/brya/board.h +++ b/board/brya/board.h @@ -137,12 +137,6 @@ enum mft_channel { void power_button_interrupt(enum gpio_signal signal); /* - * remove when we enable CONFIG_THROTTLE_AP - */ - -void throttle_ap_prochot_input_interrupt(enum gpio_signal signal); - -/* * remove when we enable CONFIG_VOLUME_BUTTONS */ diff --git a/board/brya/sensors.c b/board/brya/sensors.c index bb51eb245b..4dffe00d7c 100644 --- a/board/brya/sensors.c +++ b/board/brya/sensors.c @@ -7,6 +7,7 @@ #include "adc_chip.h" #include "temp_sensor.h" +#include "thermal.h" #include "thermistor.h" /* ADC configuration */ @@ -44,3 +45,54 @@ const struct temp_sensor_t temp_sensors[] = { }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); + +/* + * TODO(b/180681346): update for Alder Lake/brya + * + * 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) + */ +static const struct ec_thermal_config thermal_cpu = { + .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/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 + */ +static const struct ec_thermal_config thermal_inductor = { + .temp_host = { + [EC_TEMP_THRESH_HIGH] = C_TO_K(75), + [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(40), + .temp_fan_max = C_TO_K(55), +}; + +/* this should really be "const" */ +struct ec_thermal_config thermal_params[] = { + [TEMP_SENSOR_1_DDR_SOC] = thermal_cpu, + [TEMP_SENSOR_2_CHARGER] = thermal_inductor, +}; +BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); |