coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pmutil.c File Reference
#include <stdint.h>
#include <arch/io.h>
#include <console/console.h>
#include <device/pci.h>
#include <intelblocks/pmclib.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/soc_util.h>
Include dependency graph for pmutil.c:

Go to the source code of this file.

Macros

#define __SIMPLE_DEVICE__
 

Functions

static void print_num_status_bits (int num_bits, uint32_t status, const char *const bit_names[])
 
static uint32_t print_smi_status (uint32_t smi_sts)
 
static uint32_t reset_smi_status (void)
 
uint32_t clear_smi_status (void)
 
void enable_smi (uint32_t mask)
 
uint8_tpmc_mmio_regs (void)
 
void disable_smi (uint32_t mask)
 
void enable_pm1_control (uint32_t mask)
 
void disable_pm1_control (uint32_t mask)
 
static uint16_t reset_pm1_status (void)
 
static uint16_t print_pm1_status (uint16_t pm1_sts)
 
uint16_t clear_pm1_status (void)
 
void enable_pm1 (uint16_t events)
 
static uint32_t print_tco_status (uint32_t tco_sts)
 
static uint32_t reset_tco_status (void)
 
uint32_t clear_tco_status (void)
 
void enable_gpe (uint32_t mask)
 
void disable_gpe (uint32_t mask)
 
void disable_all_gpe (void)
 
static uint32_t reset_gpe_status (void)
 
static uint32_t print_gpe_sts (uint32_t gpe_sts)
 
uint32_t clear_gpe_status (void)
 
void clear_pmc_status (void)
 

Macro Definition Documentation

◆ __SIMPLE_DEVICE__

#define __SIMPLE_DEVICE__

Definition at line 3 of file pmutil.c.

Function Documentation

◆ clear_gpe_status()

uint32_t clear_gpe_status ( void  )

Definition at line 247 of file pmutil.c.

References print_gpe_sts(), and reset_gpe_status().

Here is the call graph for this function:

◆ clear_pm1_status()

uint16_t clear_pm1_status ( void  )

Definition at line 149 of file pmutil.c.

References print_pm1_status(), and reset_pm1_status().

Here is the call graph for this function:

◆ clear_pmc_status()

void clear_pmc_status ( void  )

Definition at line 249 of file pmutil.c.

References GEN_PMCON1, PMC_BASE_ADDRESS, PRSTS, read32(), RPS, and write32().

Referenced by smm_southbridge_clear_state().

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

◆ clear_smi_status()

uint32_t clear_smi_status ( void  )

Definition at line 77 of file pmutil.c.

References print_smi_status(), and reset_smi_status().

Here is the call graph for this function:

◆ clear_tco_status()

uint32_t clear_tco_status ( void  )

Definition at line 188 of file pmutil.c.

References print_tco_status(), and reset_tco_status().

Here is the call graph for this function:

◆ disable_all_gpe()

void disable_all_gpe ( void  )

Definition at line 206 of file pmutil.c.

References disable_gpe().

Here is the call graph for this function:

◆ disable_gpe()

void disable_gpe ( uint32_t  mask)

Definition at line 198 of file pmutil.c.

References get_pmbase(), GPE0_EN, GPE_STD, inl(), mask, outl(), and pmbase.

Here is the call graph for this function:

◆ disable_pm1_control()

void disable_pm1_control ( uint32_t  mask)

Definition at line 115 of file pmutil.c.

References get_pmbase(), inl(), mask, outl(), PM1_CNT, and pmbase.

Here is the call graph for this function:

◆ disable_smi()

void disable_smi ( uint32_t  mask)

Definition at line 99 of file pmutil.c.

References get_pmbase(), inl(), mask, outl(), pmbase, and SMI_EN.

Here is the call graph for this function:

◆ enable_gpe()

void enable_gpe ( uint32_t  mask)

Definition at line 190 of file pmutil.c.

References get_pmbase(), GPE0_EN, GPE_STD, inl(), mask, outl(), and pmbase.

Here is the call graph for this function:

◆ enable_pm1()

void enable_pm1 ( uint16_t  events)

Definition at line 151 of file pmutil.c.

References get_pmbase(), outw(), PM1_EN, and pmbase.

Here is the call graph for this function:

◆ enable_pm1_control()

void enable_pm1_control ( uint32_t  mask)

Definition at line 107 of file pmutil.c.

References get_pmbase(), inl(), mask, outl(), PM1_CNT, and pmbase.

Here is the call graph for this function:

◆ enable_smi()

void enable_smi ( uint32_t  mask)

Definition at line 79 of file pmutil.c.

References get_pmbase(), inl(), mask, outl(), pmbase, and SMI_EN.

Here is the call graph for this function:

◆ pmc_mmio_regs()

uint8_t* pmc_mmio_regs ( void  )

Definition at line 87 of file pmutil.c.

References PCH_DEV_PMC, pci_read_config32(), and PMC_PWRM_BASE.

Here is the call graph for this function:

◆ print_gpe_sts()

static uint32_t print_gpe_sts ( uint32_t  gpe_sts)
static

Definition at line 216 of file pmutil.c.

References ARRAY_SIZE, BIOS_DEBUG, print_num_status_bits(), and printk.

Referenced by clear_gpe_status().

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

◆ print_num_status_bits()

static void print_num_status_bits ( int  num_bits,
uint32_t  status,
const char *const  bit_names[] 
)
static

Definition at line 15 of file pmutil.c.

References BIOS_DEBUG, and printk.

Referenced by print_gpe_sts(), print_pm1_status(), print_smi_status(), and print_tco_status().

Here is the caller graph for this function:

◆ print_pm1_status()

static uint16_t print_pm1_status ( uint16_t  pm1_sts)
static

Definition at line 131 of file pmutil.c.

References ARRAY_SIZE, BIOS_DEBUG, print_num_status_bits(), and printk.

Referenced by clear_pm1_status().

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

◆ print_smi_status()

static uint32_t print_smi_status ( uint32_t  smi_sts)
static

Definition at line 33 of file pmutil.c.

References ARRAY_SIZE, BIOS_DEBUG, print_num_status_bits(), and printk.

Referenced by clear_smi_status().

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

◆ print_tco_status()

static uint32_t print_tco_status ( uint32_t  tco_sts)
static

Definition at line 157 of file pmutil.c.

References ARRAY_SIZE, BIOS_DEBUG, print_num_status_bits(), and printk.

Referenced by clear_tco_status().

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

◆ reset_gpe_status()

static uint32_t reset_gpe_status ( void  )
static

Definition at line 208 of file pmutil.c.

References get_pmbase(), GPE0_STS, GPE_STD, inl(), outl(), and pmbase.

Referenced by clear_gpe_status().

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

◆ reset_pm1_status()

static uint16_t reset_pm1_status ( void  )
static

Definition at line 123 of file pmutil.c.

References get_pmbase(), inw(), outw(), PM1_STS, and pmbase.

Referenced by clear_pm1_status().

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

◆ reset_smi_status()

static uint32_t reset_smi_status ( void  )
static

Definition at line 69 of file pmutil.c.

References get_pmbase(), inl(), outl(), pmbase, and SMI_STS.

Referenced by clear_smi_status().

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

◆ reset_tco_status()

static uint32_t reset_tco_status ( void  )
static

Definition at line 178 of file pmutil.c.

References get_tcobase(), inl(), outl(), TCO1_CNT, and TCO1_STS.

Referenced by clear_tco_status().

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