mb/system76/cml-u/dt: Make use of chipset devicetree
[coreboot.git] / src / soc / intel / common / block / thermal / thermal_common.c
blobba1ab062a6484019d3c884d664cd680e81145ee7
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <intelblocks/cfg.h>
5 #include <intelblocks/thermal.h>
7 /* Get PCH Thermal Trip from common chip config */
8 uint8_t get_thermal_trip_temp(void)
10 const struct soc_intel_common_config *common_config;
11 common_config = chip_get_common_soc_structure();
13 return common_config->pch_thermal_trip;
16 /* PCH Low Temp Threshold (LTT) */
17 uint32_t pch_get_ltt_value(void)
19 uint8_t thermal_config;
21 thermal_config = get_thermal_trip_temp();
22 if (!thermal_config)
23 thermal_config = DEFAULT_TRIP_TEMP;
25 if (thermal_config > MAX_TRIP_TEMP)
26 die("Input PCH temp trip is higher than allowed range!");
28 return GET_LTT_VALUE(thermal_config);