coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tco.c File Reference
#include <arch/io.h>
#include <device/pci_ops.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_def.h>
#include <intelblocks/gpmr.h>
#include <intelblocks/pcr.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/tco.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
#include <soc/pm.h>
#include <soc/smbus.h>
Include dependency graph for tco.c:

Go to the source code of this file.

Macros

#define __SIMPLE_DEVICE__
 
#define TCOBASE   0x50
 
#define TCOCTL   0x54
 
#define TCO_BASE_EN   (1 << 8)
 
#define TCO_BASE_LOCK   (1 << 0)
 

Functions

static uint16_t tco_get_bar (void)
 
uint16_t tco_read_reg (uint16_t tco_reg)
 
void tco_write_reg (uint16_t tco_reg, uint16_t value)
 
void tco_lockdown (void)
 
uint32_t tco_reset_status (void)
 
static void tco_timer_disable (void)
 
static void tco_intruder_smi_enable (void)
 
static void tco_enable_bar (void)
 
void tco_configure (void)
 

Macro Definition Documentation

◆ __SIMPLE_DEVICE__

#define __SIMPLE_DEVICE__

Definition at line 3 of file tco.c.

◆ TCO_BASE_EN

#define TCO_BASE_EN   (1 << 8)

Definition at line 23 of file tco.c.

◆ TCO_BASE_LOCK

#define TCO_BASE_LOCK   (1 << 0)

Definition at line 24 of file tco.c.

◆ TCOBASE

#define TCOBASE   0x50

Definition at line 21 of file tco.c.

◆ TCOCTL

#define TCOCTL   0x54

Definition at line 22 of file tco.c.

Function Documentation

◆ tco_configure()

void tco_configure ( void  )

Definition at line 130 of file tco.c.

References CONFIG, tco_enable_bar(), tco_intruder_smi_enable(), and tco_timer_disable().

Referenced by bootblock_soc_early_init(), and bootblock_soc_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_enable_bar()

static void tco_enable_bar ( void  )
static

Definition at line 104 of file tco.c.

References GPMR_TCOBASE, GPMR_TCOEN, gpmr_write32(), PCH_DEV_SMBUS, pci_read_config32(), pci_write_config32(), TCO_BASE_EN, tco_get_bar(), TCOBASE, and TCOCTL.

Referenced by tco_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_get_bar()

static uint16_t tco_get_bar ( void  )
static

Definition at line 27 of file tco.c.

References TCO_BASE_ADDRESS.

Referenced by tco_enable_bar(), tco_read_reg(), and tco_write_reg().

Here is the caller graph for this function:

◆ tco_intruder_smi_enable()

static void tco_intruder_smi_enable ( void  )
static

Definition at line 92 of file tco.c.

References TCO2_CNT, TCO_INTRD_SEL_MASK, TCO_INTRD_SEL_SMI, tco_read_reg(), and tco_write_reg().

Referenced by tco_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_lockdown()

void tco_lockdown ( void  )

Definition at line 50 of file tco.c.

References PCH_DEV_SMBUS, pci_or_config32(), TCO1_CNT, TCO_BASE_LOCK, TCO_LOCK, tco_read_reg(), tco_write_reg(), and TCOCTL.

Referenced by finalize_smbus(), pch_finalize(), and pch_finalize_script().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_read_reg()

uint16_t tco_read_reg ( uint16_t  tco_reg)

Definition at line 32 of file tco.c.

References inw(), and tco_get_bar().

Referenced by bootblock_soc_init(), soc_fill_power_state(), tco_intruder_smi_enable(), tco_lockdown(), tco_reset_status(), and tco_timer_disable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_reset_status()

uint32_t tco_reset_status ( void  )

Definition at line 64 of file tco.c.

References TCO1_STS, TCO2_STS, tco_read_reg(), TCO_STS_SECOND_TO, and tco_write_reg().

Referenced by pmc_clear_tco_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_timer_disable()

static void tco_timer_disable ( void  )
static

Definition at line 81 of file tco.c.

References TCO1_CNT, tco_read_reg(), TCO_TMR_HLT, and tco_write_reg().

Referenced by tco_configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tco_write_reg()

void tco_write_reg ( uint16_t  tco_reg,
uint16_t  value 
)

Definition at line 41 of file tco.c.

References outw(), tco_get_bar(), and value.

Referenced by bootblock_soc_init(), tco_intruder_smi_enable(), tco_lockdown(), tco_reset_status(), and tco_timer_disable().

Here is the call graph for this function:
Here is the caller graph for this function: