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 <acpi/acpi.h>
#include <acpi/acpi_pm.h>
#include <arch/io.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 <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 312 of file pmutil.c.

◆ clear_gpe_status()

uint32_t clear_gpe_status ( void  )

Definition at line 265 of file pmutil.c.

◆ clear_pm1_status()

uint16_t clear_pm1_status ( void  )

Definition at line 152 of file pmutil.c.

◆ clear_pmc_status()

void clear_pmc_status ( void  )

Definition at line 317 of file pmutil.c.

◆ clear_smi_status()

uint32_t clear_smi_status ( void  )

Definition at line 84 of file pmutil.c.

◆ clear_tco_status()

uint32_t clear_tco_status ( void  )

Definition at line 189 of file pmutil.c.

◆ disable_all_gpe()

void disable_all_gpe ( void  )

Definition at line 210 of file pmutil.c.

◆ disable_gpe()

void disable_gpe ( uint32_t  mask)

Definition at line 202 of file pmutil.c.

Referenced by disable_all_gpe().

Here is the caller graph for this function:

◆ disable_pm1_control()

void disable_pm1_control ( uint32_t  mask)

Definition at line 113 of file pmutil.c.

◆ disable_smi()

void disable_smi ( uint32_t  mask)

Definition at line 97 of file pmutil.c.

◆ enable_gpe()

void enable_gpe ( uint32_t  mask)

Definition at line 194 of file pmutil.c.

Referenced by enable_tco_sci().

Here is the caller graph for this function:

◆ enable_pm1()

void enable_pm1 ( uint16_t  events)

Definition at line 157 of file pmutil.c.

◆ enable_pm1_control()

void enable_pm1_control ( uint32_t  mask)

Definition at line 105 of file pmutil.c.

◆ enable_smi()

void enable_smi ( uint32_t  mask)

Definition at line 89 of file pmutil.c.

◆ get_pmbase()

uint16_t get_pmbase ( void  )

Definition at line 22 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 353 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 278 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 223 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 27 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 129 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 44 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 162 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 270 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 215 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 121 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 76 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 179 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 330 of file pmutil.c.

Referenced by vbnv_cmos_failed().

Here is the caller graph for this function:

◆ vbnv_cmos_failed()

int vbnv_cmos_failed ( void  )

Definition at line 348 of file pmutil.c.

References rtc_failure().

Here is the call graph for this function: