diff options
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/CMakeLists.txt | 1 | ||||
-rw-r--r-- | zephyr/Kconfig.temperature | 14 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 | ||||
-rw-r--r-- | zephyr/shim/src/util.c | 8 |
4 files changed, 28 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 214c2ccf7e..2bb9e731de 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -194,6 +194,7 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_RAMP_SW zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CBI "${PLATFORM_EC}/common/cbi.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_MEM "${PLATFORM_EC}/common/memory_commands.c") +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_DPTF "${PLATFORM_EC}/common/dptf.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ "${PLATFORM_EC}/common/chipset.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ESPI "${PLATFORM_EC}/common/espi.c") diff --git a/zephyr/Kconfig.temperature b/zephyr/Kconfig.temperature index 3aa6e17509..19ce5e3146 100644 --- a/zephyr/Kconfig.temperature +++ b/zephyr/Kconfig.temperature @@ -10,6 +10,20 @@ menuconfig PLATFORM_EC_TEMP_SENSOR if PLATFORM_EC_TEMP_SENSOR +config PLATFORM_EC_DPTF + bool "Dynamic Platform and Thermal Framework" + default y if PLATFORM_EC_ACPI + help + Enables the Dynamic Platform and Thermal Framework (DPTF). DPTF + exposes the temperature sensors and the fan controls to the + Applicaiton Processor (AP) using Advanced Configuration and Power + Interface (ACPI). This permits the AP to control thermal management + independent of the EC. + + Even when DPTF is enabled, the EC still monitors temperature sensors + and will take corrective actions for high temperatures such as turning + on the fans or powering down the AP. + config PLATFORM_EC_THERMISTOR bool "Thermistor support" depends on PLATFORM_EC_ADC diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index f5b5645b13..0e33f124ea 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -1236,4 +1236,9 @@ enum battery_type { #define CONFIG_USB_PD_TCPC_VCONN #endif +#undef CONFIG_DPTF +#ifdef CONFIG_PLATFORM_EC_DPTF +#define CONFIG_DPTF +#endif + #endif /* __CROS_EC_CONFIG_CHIP_H */ diff --git a/zephyr/shim/src/util.c b/zephyr/shim/src/util.c index 38a254bf47..ca45025cd7 100644 --- a/zephyr/shim/src/util.c +++ b/zephyr/shim/src/util.c @@ -234,6 +234,14 @@ enum cond_internal_bits { COND_FALL_MASK = BIT(2), /* set if 1->0 */ }; +void cond_init(cond_t *c, int val) +{ + if (val) + *c = COND_CURR_MASK; + else + *c = 0; +} + void cond_set(cond_t *c, int val) { if (val && cond_is(c, 0)) |