coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
thermal_pci.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <device/mmio.h>
6 #include <intelblocks/thermal.h>
7 #include <soc/pci_devs.h>
8 
9 #define THERMAL_SENSOR_POWER_MANAGEMENT 0x1c
10 #define CATASTROPHIC_TRIP_POINT_MASK 0x1ff
11 
12 /* Enable thermal sensor power management */
14 {
15  uintptr_t thermalbar;
16  uintptr_t thermalbar_pm;
17  const struct device *dev;
18  struct resource *res;
19 
21  if (!dev) {
22  printk(BIOS_ERR, "PCH_DEVFN_THERMAL device not found!\n");
23  return;
24  }
25 
27  if (!res) {
28  printk(BIOS_ERR, "PCH thermal device not found!\n");
29  return;
30  }
31 
32  /* Get the base address of the resource */
33  thermalbar = res->base;
34 
35  /* Get the required thermal address to write the register value */
36  thermalbar_pm = thermalbar + THERMAL_SENSOR_POWER_MANAGEMENT;
37 
38  /* Set Low Temp Threshold (LTT) at TSPM offset 0x1c[8:0] */
40 }
#define printk(level,...)
Definition: stdlib.h:16
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
Definition: device_const.c:255
struct resource * probe_resource(const struct device *dev, unsigned int index)
See if a resource structure already exists for a given index.
Definition: device_util.c:323
#define clrsetbits32(addr, clear, set)
Definition: mmio.h:16
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define PCI_BASE_ADDRESS_0
Definition: pci_def.h:63
#define PCH_DEVFN_THERMAL
Definition: pci_devs.h:77
uint32_t pch_get_ltt_value(void)
unsigned long uintptr_t
Definition: stdint.h:21
Definition: device.h:107
resource_t base
Definition: resource.h:45
#define CATASTROPHIC_TRIP_POINT_MASK
Definition: thermal_pci.c:10
#define THERMAL_SENSOR_POWER_MANAGEMENT
Definition: thermal_pci.c:9
void pch_thermal_configuration(void)
Definition: thermal_pci.c:13