coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pmutil.c File Reference
#include <acpi/acpi_pm.h>
#include <device/mmio.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_def.h>
#include <console/console.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/rtc.h>
#include <intelblocks/tco.h>
#include <soc/espi.h>
#include <soc/gpe.h>
#include <soc/gpio.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/smbus.h>
#include <soc/soc_chip.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

const char *const * soc_smi_sts_array (size_t *a)
 
const char *const * soc_tco_sts_array (size_t *a)
 
const char *const * soc_std_gpe_sts_array (size_t *a)
 
void pmc_set_disb (void)
 
uint8_tpmc_mmio_regs (void)
 
uintptr_t soc_read_pmc_base (void)
 
uint32_tsoc_pmc_etr_addr (void)
 
void soc_get_gpi_gpe_configs (uint8_t *dw0, uint8_t *dw1, uint8_t *dw2)
 
static int rtc_failed (uint32_t gen_pmcon_b)
 
static void clear_rtc_failed (void)
 
static int check_rtc_failed (uint32_t gen_pmcon_b)
 
int soc_get_rtc_failed (void)
 
int vbnv_cmos_failed (void)
 
static int deep_s3_enabled (void)
 
int soc_prev_sleep_state (const struct chipset_power_state *ps, int prev_sleep_state)
 
void soc_fill_power_state (struct chipset_power_state *ps)
 
uint16_t get_pmbase (void)
 
void pmc_soc_set_afterg3_en (const bool on)
 

Macro Definition Documentation

◆ __SIMPLE_DEVICE__

#define __SIMPLE_DEVICE__

Definition at line 8 of file pmutil.c.

Function Documentation

◆ check_rtc_failed()

static int check_rtc_failed ( uint32_t  gen_pmcon_b)
static

Definition at line 172 of file pmutil.c.

References BIOS_DEBUG, clear_rtc_failed(), printk, and rtc_failed().

Referenced by soc_get_rtc_failed(), and vbnv_cmos_failed().

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

◆ clear_rtc_failed()

static void clear_rtc_failed ( void  )
static

Definition at line 167 of file pmutil.c.

References clrbits8, GEN_PMCON_B, pmc_mmio_regs(), and RTC_BATTERY_DEAD.

Referenced by check_rtc_failed().

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

◆ deep_s3_enabled()

static int deep_s3_enabled ( void  )
inlinestatic

Definition at line 198 of file pmutil.c.

References pmc_mmio_regs(), read32(), S3_PWRGATE_POL, S3AC_GATE_SUS, and S3DC_GATE_SUS.

Referenced by soc_prev_sleep_state().

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

◆ get_pmbase()

uint16_t get_pmbase ( void  )

Definition at line 260 of file pmutil.c.

References ACPI_BASE_ADDRESS.

◆ pmc_mmio_regs()

uint8_t* pmc_mmio_regs ( void  )

Definition at line 135 of file pmutil.c.

References PCH_PWRM_BASE_ADDRESS.

◆ pmc_set_disb()

void pmc_set_disb ( void  )

Definition at line 114 of file pmutil.c.

References addr, DISB, GEN_PMCON_A, MS4V, pmc_mmio_regs(), read8(), SUS_PWR_FLR, and write8().

Here is the call graph for this function:

◆ pmc_soc_set_afterg3_en()

void pmc_soc_set_afterg3_en ( const bool  on)

Definition at line 269 of file pmutil.c.

References GEN_PMCON_A, pmc_mmio_regs(), read8(), SLEEP_AFTER_POWER_FAIL, and write8().

Here is the call graph for this function:

◆ rtc_failed()

static int rtc_failed ( uint32_t  gen_pmcon_b)
static

Definition at line 162 of file pmutil.c.

References RTC_BATTERY_DEAD.

Referenced by check_rtc_failed().

Here is the caller graph for this function:

◆ soc_fill_power_state()

◆ soc_get_gpi_gpe_configs()

void soc_get_gpi_gpe_configs ( uint8_t dw0,
uint8_t dw1,
uint8_t dw2 
)

Definition at line 150 of file pmutil.c.

References config, config_of_soc, and DEVTREE_CONST.

◆ soc_get_rtc_failed()

int soc_get_rtc_failed ( void  )

Definition at line 183 of file pmutil.c.

References acpi_pm_state_for_rtc(), check_rtc_failed(), and chipset_power_state::gen_pmcon_b.

Here is the call graph for this function:

◆ soc_pmc_etr_addr()

uint32_t* soc_pmc_etr_addr ( void  )

Definition at line 145 of file pmutil.c.

References ETR, and soc_read_pmc_base().

Here is the call graph for this function:

◆ soc_prev_sleep_state()

int soc_prev_sleep_state ( const struct chipset_power_state ps,
int  prev_sleep_state 
)

Definition at line 207 of file pmutil.c.

References ACPI_S3, ACPI_S5, deep_s3_enabled(), chipset_power_state::gen_pmcon_a, mask, prev_sleep_state(), PWR_FLR, and SUS_PWR_FLR.

Here is the call graph for this function:

◆ soc_read_pmc_base()

uintptr_t soc_read_pmc_base ( void  )

Definition at line 140 of file pmutil.c.

References pmc_mmio_regs().

Here is the call graph for this function:

◆ soc_smi_sts_array()

◆ soc_std_gpe_sts_array()

const char* const* soc_std_gpe_sts_array ( size_t a)

Definition at line 92 of file pmutil.c.

References ARRAY_SIZE.

◆ soc_tco_sts_array()

const char* const* soc_tco_sts_array ( size_t a)

Definition at line 65 of file pmutil.c.

References ARRAY_SIZE.

◆ vbnv_cmos_failed()

int vbnv_cmos_failed ( void  )

Definition at line 193 of file pmutil.c.

References check_rtc_failed(), GEN_PMCON_B, pmc_mmio_regs(), and read32().

Here is the call graph for this function: