coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pmutil.c File Reference
#include <acpi/acpi.h>
#include <arch/io.h>
#include <assert.h>
#include <bootmode.h>
#include <device/device.h>
#include <device/mmio.h>
#include <device/pci.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <soc/iomap.h>
#include <soc/lpc.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <stdint.h>
#include <security/vboot/vbnv.h>
Include dependency graph for pmutil.c:

Go to the source code of this file.

Macros

#define __SIMPLE_DEVICE__
 

Functions

uint16_t get_pmbase (void)
 
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)
 
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)
 
static uint32_t reset_alt_status (void)
 
static uint32_t print_alt_sts (uint32_t alt_gpio_smi)
 
uint32_t clear_alt_status (void)
 
void clear_pmc_status (void)
 
int rtc_failure (void)
 
int vbnv_cmos_failed (void)
 
int platform_is_resuming (void)
 

Macro Definition Documentation

◆ __SIMPLE_DEVICE__

#define __SIMPLE_DEVICE__

Definition at line 3 of file pmutil.c.

Function Documentation

◆ clear_alt_status()

uint32_t clear_alt_status ( void  )

Definition at line 311 of file pmutil.c.

References print_alt_sts(), and reset_alt_status().

Referenced by smm_southbridge_clear_state(), and southbridge_smi_handler().

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

◆ clear_gpe_status()

uint32_t clear_gpe_status ( void  )

Definition at line 264 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 151 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 316 of file pmutil.c.

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

Here is the call graph for this function:

◆ clear_smi_status()

uint32_t clear_smi_status ( void  )

Definition at line 83 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 209 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 201 of file pmutil.c.

References get_pmbase(), GPE0_EN, 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 112 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 96 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 193 of file pmutil.c.

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

Here is the call graph for this function:

◆ enable_pm1()

void enable_pm1 ( uint16_t  events)

Definition at line 156 of file pmutil.c.

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

Here is the call graph for this function:

◆ enable_pm1_control()

void enable_pm1_control ( uint32_t  mask)

Definition at line 104 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 88 of file pmutil.c.

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

Here is the call graph for this function:

◆ get_pmbase()

uint16_t get_pmbase ( void  )

Definition at line 21 of file pmutil.c.

References ABASE, PCI_DEV, pci_read_config16(), and PCU_DEV.

Here is the call graph for this function:

◆ platform_is_resuming()

int platform_is_resuming ( void  )

Definition at line 352 of file pmutil.c.

References ACPI_BASE_ADDRESS, ACPI_S3, inl(), inw(), PM1_CNT, PM1_STS, and WAK_STS.

Here is the call graph for this function:

◆ print_alt_sts()

static uint32_t print_alt_sts ( uint32_t  alt_gpio_smi)
static

Definition at line 277 of file pmutil.c.

References BIOS_DEBUG, print_num_status_bits(), and printk.

Referenced by clear_alt_status().

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

◆ print_gpe_sts()

static uint32_t print_gpe_sts ( uint32_t  gpe_sts)
static

Definition at line 222 of file pmutil.c.

References 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 26 of file pmutil.c.

References BIOS_DEBUG, and printk.

Referenced by print_alt_sts(), 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 128 of file pmutil.c.

References BIOS_SPEW, 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 43 of file pmutil.c.

References 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 161 of file pmutil.c.

References 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_alt_status()

static uint32_t reset_alt_status ( void  )
static

Definition at line 269 of file pmutil.c.

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

Referenced by clear_alt_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 214 of file pmutil.c.

References get_pmbase(), GPE0_STS, 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 120 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 75 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_pmbase(), inl(), outl(), pmbase, TCO1_CNT, and TCO_STS.

Referenced by clear_tco_status().

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

◆ rtc_failure()

int rtc_failure ( void  )

Definition at line 329 of file pmutil.c.

References BIOS_DEBUG, dead_code, ENV_RAMSTAGE, GEN_PMCON1, PMC_BASE_ADDRESS, printk, read32(), and RPS.

Here is the call graph for this function:

◆ vbnv_cmos_failed()

int vbnv_cmos_failed ( void  )

Definition at line 347 of file pmutil.c.

References rtc_failure().

Here is the call graph for this function: