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 <bootmode.h>
#include <device/pci_ops.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_def.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 <stdint.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 uint16_t get_gpiobase (void)
 
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)
 
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)
 
int platform_is_resuming (void)
 
uint16_t get_pmbase (void)
 

Macro Definition Documentation

◆ GPIO_ALT_GPI_SMI_EN

#define GPIO_ALT_GPI_SMI_EN   0x54

Definition at line 24 of file pmutil.c.

◆ GPIO_ALT_GPI_SMI_STS

#define GPIO_ALT_GPI_SMI_STS   0x50

Definition at line 23 of file pmutil.c.

Function Documentation

◆ clear_alt_smi_status()

u32 clear_alt_smi_status ( void  )

Definition at line 236 of file pmutil.c.

◆ clear_gpe_status()

u32 clear_gpe_status ( void  )

Definition at line 361 of file pmutil.c.

References GPE0_EN, GPE0_STS, GPE_31_0, GPE_63_32, GPE_94_64, GPE_STD, print_gpe_gpio(), print_gpe_status(), and reset_gpe_status().

Here is the call graph for this function:

◆ clear_pm1_status()

u16 clear_pm1_status ( void  )

Definition at line 120 of file pmutil.c.

References print_pm1_status(), and reset_pm1_status().

Here is the call graph for this function:

◆ clear_smi_status()

u32 clear_smi_status ( void  )

Definition at line 180 of file pmutil.c.

References print_smi_status(), and reset_smi_status().

Here is the call graph for this function:

◆ clear_tco_status()

u32 clear_tco_status ( void  )

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

References enable_all_gpe().

Here is the call graph for this function:

◆ disable_gpe()

void disable_gpe ( u32  mask)

Definition at line 410 of file pmutil.c.

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

Here is the call graph for this function:

◆ disable_pm1_control()

void disable_pm1_control ( u32  mask)

Definition at line 76 of file pmutil.c.

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

Here is the call graph for this function:

◆ disable_smi()

void disable_smi ( u32  mask)

Definition at line 194 of file pmutil.c.

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

Here is the call graph for this function:

◆ enable_all_gpe()

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

Definition at line 385 of file pmutil.c.

Referenced by disable_all_gpe().

Here is the caller graph for this function:

◆ enable_alt_smi()

void enable_alt_smi ( u32  mask)

Definition at line 242 of file pmutil.c.

◆ enable_gpe()

void enable_gpe ( u32  mask)

Definition at line 402 of file pmutil.c.

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

Here is the call graph for this function:

◆ enable_pm1()

void enable_pm1 ( u16  events)

Definition at line 126 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 ( u32  mask)

Definition at line 68 of file pmutil.c.

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

Here is the call graph for this function:

◆ enable_smi()

void enable_smi ( u32  mask)

Definition at line 186 of file pmutil.c.

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

Here is the call graph for this function:

◆ enable_tco_sci()

void enable_tco_sci ( void  )

Definition at line 309 of file pmutil.c.

◆ get_gpiobase()

static uint16_t get_gpiobase ( void  )
inlinestatic

Definition at line 26 of file pmutil.c.

References GPIO_BASE_ADDRESS.

Referenced by enable_alt_smi(), pch_lpc_add_io_resources(), and reset_alt_smi_status().

Here is the caller graph for this function:

◆ get_pmbase()

uint16_t get_pmbase ( void  )

Definition at line 426 of file pmutil.c.

References ACPI_BASE_ADDRESS.

◆ platform_is_resuming()

int platform_is_resuming ( void  )

Definition at line 417 of file pmutil.c.

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

Here is the call graph for this function:

◆ print_alt_smi_status()

static u32 print_alt_smi_status ( u32  alt_sts)
static

Definition at line 220 of file pmutil.c.

References BIOS_DEBUG, print_gpio_status(), 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 348 of file pmutil.c.

References BIOS_DEBUG, print_gpio_status(), and printk.

Referenced by clear_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 335 of file pmutil.c.

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

static void print_gpio_status ( u32  status,
int  start 
)
static

Definition at line 50 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 96 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 144 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 32 of file pmutil.c.

References BIOS_DEBUG, and printk.

Referenced by 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 273 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 206 of file pmutil.c.

References get_gpiobase(), GPIO_ALT_GPI_SMI_EN, GPIO_ALT_GPI_SMI_STS, inl(), and outl().

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

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

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 u16 reset_pm1_status ( void  )
static

Definition at line 88 of file pmutil.c.

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

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 u32 reset_smi_status ( void  )
static

Definition at line 136 of file pmutil.c.

References get_pmbase(), inl(), outl(), 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 u32 reset_tco_status ( void  )
static

Definition at line 256 of file pmutil.c.

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

Referenced by clear_tco_status().

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