coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
thermal_common.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <intelblocks/cfg.h>
5 #include <intelblocks/thermal.h>
6 
7 /* Get PCH Thermal Trip from common chip config */
9 {
10  const struct soc_intel_common_config *common_config;
11  common_config = chip_get_common_soc_structure();
12 
13  return common_config->pch_thermal_trip;
14 }
15 
16 /* PCH Low Temp Threshold (LTT) */
18 {
19  uint8_t thermal_config;
20 
21  thermal_config = get_thermal_trip_temp();
22  if (!thermal_config)
23  thermal_config = DEFAULT_TRIP_TEMP;
24 
25  if (thermal_config > MAX_TRIP_TEMP)
26  die("Input PCH temp trip is higher than allowed range!");
27 
28  return GET_LTT_VALUE(thermal_config);
29 }
void __noreturn die(const char *fmt,...)
Definition: die.c:17
const struct soc_intel_common_config * chip_get_common_soc_structure(void)
Definition: chip.c:5
#define DEFAULT_TRIP_TEMP
Definition: thermal.h:8
#define MAX_TRIP_TEMP
Definition: thermal.h:6
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
uint8_t pch_thermal_trip
Definition: cfg.h:26
uint8_t get_thermal_trip_temp(void)
Definition: thermal_common.c:8
uint32_t pch_get_ltt_value(void)