coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pmutil.c File Reference
#include <arch/io.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_def.h>
#include <console/console.h>
#include <security/vboot/vbnv.h>
#include <security/vboot/vboot_common.h>
#include <southbridge/intel/common/rtc.h>
#include "pch.h"
Include dependency graph for pmutil.c:

Go to the source code of this file.

Macros

#define GPIO_ALT_GPI_SMI_STS   0x50
 
#define GPIO_ALT_GPI_SMI_EN   0x54
 

Functions

static void print_status_bits (u32 status, const char *bit_names[])
 
static void print_gpio_status (u32 status, int start)
 
void enable_pm1_control (u32 mask)
 
void disable_pm1_control (u32 mask)
 
static u16 reset_pm1_status (void)
 
static u16 print_pm1_status (u16 pm1_sts)
 
u16 clear_pm1_status (void)
 
void enable_pm1 (u16 events)
 
static u32 reset_smi_status (void)
 
static u32 print_smi_status (u32 smi_sts)
 
u32 clear_smi_status (void)
 
void enable_smi (u32 mask)
 
void disable_smi (u32 mask)
 
static u32 reset_alt_smi_status (void)
 
static u32 print_alt_smi_status (u32 alt_sts)
 
u32 clear_alt_smi_status (void)
 
void enable_alt_smi (u32 mask)
 
static u32 reset_tco_status (void)
 
static u32 print_tco_status (u32 tco_sts)
 
u32 clear_tco_status (void)
 
void enable_tco_sci (void)
 
static u32 reset_gpe_status (u16 sts_reg, u16 en_reg)
 
static u32 print_gpe_status (u32 gpe0_sts, const char *bit_names[])
 
static u32 print_gpe_gpio (u32 gpe0_sts, int start)
 
static u32 clear_lpt_gpe_status (void)
 
static u32 clear_lpt_lp_gpe_status (void)
 
u32 clear_gpe_status (void)
 
void enable_all_gpe (u32 set1, u32 set2, u32 set3, u32 set4)
 
void disable_all_gpe (void)
 
void enable_gpe (u32 mask)
 
void disable_gpe (u32 mask)
 

Macro Definition Documentation

◆ GPIO_ALT_GPI_SMI_EN

#define GPIO_ALT_GPI_SMI_EN   0x54

Definition at line 26 of file pmutil.c.

◆ GPIO_ALT_GPI_SMI_STS

#define GPIO_ALT_GPI_SMI_STS   0x50

Definition at line 25 of file pmutil.c.

Function Documentation

◆ clear_alt_smi_status()

u32 clear_alt_smi_status ( void  )

Definition at line 267 of file pmutil.c.

References print_alt_smi_status(), and reset_alt_smi_status().

Referenced by southbridge_smi_gpi().

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

◆ clear_gpe_status()

u32 clear_gpe_status ( void  )

Definition at line 491 of file pmutil.c.

References clear_lpt_gpe_status(), clear_lpt_lp_gpe_status(), pch_is_lp(), print_gpe_sts(), and reset_gpe_status().

Referenced by smm_southbridge_clear_state(), southbridge_smi_gpe0(), and southbridge_smi_sleep().

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

◆ clear_lpt_gpe_status()

static u32 clear_lpt_gpe_status ( void  )
static

Definition at line 408 of file pmutil.c.

References GPE0_EN, GPE0_EN_2, GPE0_STS, GPE0_STS_2, print_gpe_status(), and reset_gpe_status().

Referenced by clear_gpe_status().

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

◆ clear_lpt_lp_gpe_status()

static u32 clear_lpt_lp_gpe_status ( void  )
static

Definition at line 460 of file pmutil.c.

References LP_GPE0_EN_1, LP_GPE0_EN_2, LP_GPE0_EN_3, LP_GPE0_EN_4, LP_GPE0_STS_1, LP_GPE0_STS_2, LP_GPE0_STS_3, LP_GPE0_STS_4, print_gpe_gpio(), print_gpe_status(), and reset_gpe_status().

Referenced by clear_gpe_status().

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

◆ clear_pm1_status()

u16 clear_pm1_status ( void  )

Definition at line 117 of file pmutil.c.

References print_pm1_status(), and reset_pm1_status().

Referenced by smm_southbridge_clear_state(), and southbridge_smi_pm1().

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

◆ clear_smi_status()

u32 clear_smi_status ( void  )

Definition at line 177 of file pmutil.c.

References print_smi_status(), and reset_smi_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_tco_status()

u32 clear_tco_status ( void  )

Definition at line 348 of file pmutil.c.

References print_tco_status(), and reset_tco_status().

Referenced by smm_southbridge_clear_state(), and southbridge_smi_tco().

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

◆ disable_all_gpe()

void disable_all_gpe ( void  )

Definition at line 516 of file pmutil.c.

References disable_gpe(), and enable_all_gpe().

Referenced by southbridge_smi_sleep().

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

◆ disable_gpe()

void disable_gpe ( u32  mask)

Definition at line 531 of file pmutil.c.

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

Referenced by smm_southbridge_enable().

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

◆ disable_pm1_control()

void disable_pm1_control ( u32  mask)

Definition at line 73 of file pmutil.c.

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

Referenced by southbridge_smi_apmc(), southbridge_smi_pm1(), and southbridge_smi_sleep().

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

◆ disable_smi()

void disable_smi ( u32  mask)

Definition at line 191 of file pmutil.c.

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

Referenced by southbridge_smi_sleep().

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

◆ enable_all_gpe()

void enable_all_gpe ( u32  set1,
u32  set2,
u32  set3,
u32  set4 
)

Definition at line 500 of file pmutil.c.

References get_pmbase(), GPE0_EN, GPE0_EN_2, GPE_31_0, GPE_63_32, GPE_94_64, GPE_STD, LP_GPE0_EN_1, LP_GPE0_EN_2, LP_GPE0_EN_3, LP_GPE0_EN_4, outl(), pch_is_lp(), and pmbase.

Referenced by pch_power_options().

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

◆ enable_alt_smi()

void enable_alt_smi ( u32  mask)

Definition at line 273 of file pmutil.c.

References ALT_GP_SMI_EN, ALT_GP_SMI_EN2, get_gpiobase(), get_pmbase(), GPIO_ALT_GPI_SMI_EN, inl(), inw(), mask, outl(), outw(), pch_is_lp(), and pmbase.

Referenced by pch_power_options().

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

◆ enable_gpe()

void enable_gpe ( u32  mask)

Definition at line 522 of file pmutil.c.

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

Referenced by mainboard_smi_sleep().

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

◆ enable_pm1()

void enable_pm1 ( u16  events)

Definition at line 123 of file pmutil.c.

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

Referenced by smm_southbridge_enable().

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

◆ enable_pm1_control()

void enable_pm1_control ( u32  mask)

Definition at line 65 of file pmutil.c.

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

Referenced by southbridge_smi_apmc(), southbridge_smi_pm1(), and southbridge_smi_sleep().

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

◆ enable_smi()

void enable_smi ( u32  mask)

Definition at line 183 of file pmutil.c.

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

Referenced by smm_southbridge_enable(), and southbridge_smi_set_eos().

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

◆ enable_tco_sci()

void enable_tco_sci ( void  )

Definition at line 354 of file pmutil.c.

References enable_gpe(), get_pmbase(), GPE0_STS, LP_GPE0_STS_4, outl(), pch_is_lp(), TCOSCI_EN, and TCOSCI_STS.

Referenced by gma_enable_swsci().

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

◆ print_alt_smi_status()

static u32 print_alt_smi_status ( u32  alt_sts)
static

Definition at line 234 of file pmutil.c.

References BIOS_DEBUG, pch_is_lp(), print_gpio_status(), print_status_bits(), and printk.

Referenced by clear_alt_smi_status().

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

◆ print_gpe_gpio()

static u32 print_gpe_gpio ( u32  gpe0_sts,
int  start 
)
static

Definition at line 395 of file pmutil.c.

References BIOS_DEBUG, print_gpio_status(), and printk.

Referenced by clear_lpt_lp_gpe_status().

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

◆ print_gpe_status()

static u32 print_gpe_status ( u32  gpe0_sts,
const char *  bit_names[] 
)
static

Definition at line 382 of file pmutil.c.

References BIOS_DEBUG, print_status_bits(), and printk.

Referenced by clear_lpt_gpe_status(), and clear_lpt_lp_gpe_status().

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

◆ print_gpio_status()

static void print_gpio_status ( u32  status,
int  start 
)
static

Definition at line 47 of file pmutil.c.

References BIOS_DEBUG, and printk.

Referenced by print_alt_smi_status(), and print_gpe_gpio().

Here is the caller graph for this function:

◆ print_pm1_status()

static u16 print_pm1_status ( u16  pm1_sts)
static

Definition at line 93 of file pmutil.c.

References BIOS_SPEW, print_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 u32 print_smi_status ( u32  smi_sts)
static

Definition at line 141 of file pmutil.c.

References BIOS_DEBUG, print_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_status_bits()

static void print_status_bits ( u32  status,
const char *  bit_names[] 
)
static

Definition at line 29 of file pmutil.c.

References BIOS_DEBUG, and printk.

Referenced by print_alt_smi_status(), print_gpe_status(), print_pm1_status(), print_smi_status(), and print_tco_status().

Here is the caller graph for this function:

◆ print_tco_status()

static u32 print_tco_status ( u32  tco_sts)
static

Definition at line 318 of file pmutil.c.

References BIOS_DEBUG, print_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_smi_status()

static u32 reset_alt_smi_status ( void  )
static

Definition at line 203 of file pmutil.c.

References ALT_GP_SMI_EN, ALT_GP_SMI_EN2, ALT_GP_SMI_STS, ALT_GP_SMI_STS2, get_gpiobase(), get_pmbase(), GPIO_ALT_GPI_SMI_EN, GPIO_ALT_GPI_SMI_STS, inl(), inw(), outl(), outw(), pch_is_lp(), and pmbase.

Referenced by clear_alt_smi_status().

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

◆ reset_gpe_status()

static u32 reset_gpe_status ( u16  sts_reg,
u16  en_reg 
)
static

Definition at line 370 of file pmutil.c.

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

Referenced by clear_lpt_gpe_status(), and clear_lpt_lp_gpe_status().

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

◆ reset_pm1_status()

static u16 reset_pm1_status ( void  )
static

Definition at line 85 of file pmutil.c.

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

Here is the call graph for this function:

◆ reset_smi_status()

static u32 reset_smi_status ( void  )
static

Definition at line 133 of file pmutil.c.

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

Here is the call graph for this function:

◆ reset_tco_status()

static u32 reset_tco_status ( void  )
static

Definition at line 302 of file pmutil.c.

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

Here is the call graph for this function: