![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <acpi/acpi_pm.h>
#include <arch/io.h>
#include <assert.h>
#include <bootmode.h>
#include <device/mmio.h>
#include <device/pci.h>
#include <cbmem.h>
#include <cpu/x86/smm.h>
#include <console/console.h>
#include <halt.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/gpio.h>
#include <intelblocks/tco.h>
#include <option.h>
#include <security/vboot/vboot_common.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <stdint.h>
#include <string.h>
#include <timer.h>
Go to the source code of this file.
Data Structures | |
struct | cfg_assert_dur |
Macros | |
#define | PCH_PM_PWR_CYC_DUR 0 |
Enumerations | |
enum | min_assert_dur { MinAssertDur0s = 0 , MinAssertDur60us = 60 , MinAssertDur1ms = 1000 , MinAssertDur50ms = 50000 , MinAssertDur98ms = 98000 , MinAssertDur500ms = 500000 , MinAssertDur1s = 1000000 , MinAssertDur2s = 2000000 , MinAssertDur3s = 3000000 , MinAssertDur4s = 4000000 } |
Variables | |
static struct chipset_power_state | power_state |
enum min_assert_dur |
int acpi_get_gpe | ( | int | gpe | ) |
Definition at line 478 of file pmclib.c.
References ACPI_BASE_ADDRESS, GPE0_STS, GPE_MAX, inl(), mask, outl(), stopwatch_expired(), and stopwatch_init_msecs_expire().
int acpi_get_sleep_type | ( | void | ) |
Definition at line 109 of file pmclib.c.
References ACPI_S0, pmc_get_power_state(), chipset_power_state::prev_sleep_state, and prev_sleep_state().
|
static |
Definition at line 623 of file pmclib.c.
References BIOS_INFO, BIOS_WARNING, get_uint_option(), MAINBOARD_POWER_STATE_OFF, MAINBOARD_POWER_STATE_ON, MAINBOARD_POWER_STATE_PREVIOUS, pmc_soc_set_afterg3_en(), and printk.
Referenced by get_pm_pwr_cyc_dur().
|
static |
Definition at line 674 of file pmclib.c.
References ARRAY_SIZE, MinAssertDur0s, MinAssertDur1ms, MinAssertDur1s, MinAssertDur2s, MinAssertDur3s, MinAssertDur4s, MinAssertDur50ms, MinAssertDur60us, MinAssertDur98ms, cfg_assert_dur::pm_pwr_cyc_dur, cfg_assert_dur::slp_a, cfg_assert_dur::slp_s3, and cfg_assert_dur::slp_s4.
Referenced by get_pm_pwr_cyc_dur().
uint8_t get_pm_pwr_cyc_dur | ( | uint8_t | slp_s4_min_assert, |
uint8_t | slp_s3_min_assert, | ||
uint8_t | slp_a_min_assert, | ||
uint8_t | pm_pwr_cyc_dur | ||
) |
Definition at line 724 of file pmclib.c.
References BIOS_DEBUG, get_high_assert_width(), get_min_assert_dur(), MinAssertDur1s, MinAssertDur2s, MinAssertDur4s, MinAssertDur50ms, PCH_PM_PWR_CYC_DUR, cfg_assert_dur::pm_pwr_cyc_dur, printk, and cfg_assert_dur::slp_a.
Referenced by fill_fsps_misc_power_params(), and platform_fsp_silicon_init_params_cb().
|
static |
Definition at line 72 of file pmclib.c.
References BIOS_DEBUG, cbmem_add(), CBMEM_ID_POWER_STATE, memcpy(), NULL, power_state, and printk.
int platform_is_resuming | ( | void | ) |
Definition at line 469 of file pmclib.c.
References ACPI_BASE_ADDRESS, ACPI_S3, inw(), PM1_STS, pmc_read_pm1_control(), and WAK_STS.
Referenced by southbridge_detect_s3_resume().
Definition at line 355 of file pmclib.c.
References pmc_clear_gpi_gpe_status(), and pmc_clear_std_gpe_status().
Referenced by smihandler_southbridge_gpe0(), smihandler_southbridge_sleep(), and smm_southbridge_clear_state().
Definition at line 313 of file pmclib.c.
References ACPI_BASE_ADDRESS, GPE0_REG_MAX, GPE0_STS, GPE_STD, inl(), and outl().
Referenced by pmc_clear_all_gpe_status().
Definition at line 250 of file pmclib.c.
References print_pm1_status(), and reset_pm1_status().
Referenced by ec_init(), smihandler_southbridge_pm1(), smihandler_southbridge_sleep(), and smm_southbridge_clear_state().
Definition at line 366 of file pmclib.c.
References PRSTS, chipset_power_state::prsts, read32p(), soc_clear_pm_registers(), soc_read_pmc_base(), and write32p().
Referenced by pmc_soc_init().
Definition at line 164 of file pmclib.c.
References pmc_reset_smi_status(), and print_smi_status().
Referenced by smm_southbridge_clear_state(), and southbridge_smi_handler().
Definition at line 350 of file pmclib.c.
References print_std_gpe_sts(), and reset_std_gpe_status().
Referenced by pmc_clear_all_gpe_status().
Definition at line 275 of file pmclib.c.
References print_tco_status(), and tco_reset_status().
Referenced by smihandler_southbridge_tco(), and smm_southbridge_clear_state().
Definition at line 305 of file pmclib.c.
References GPE0_REG_MAX, and pmc_disable_gpe().
Referenced by smihandler_southbridge_sleep(), and smm_southbridge_enable().
Definition at line 288 of file pmclib.c.
References ACPI_BASE_ADDRESS, GPE0_EN, chipset_power_state::gpe0_en, inl(), mask, and outl().
Referenced by pmc_disable_all_gpe(), and pmc_disable_std_gpe().
Definition at line 213 of file pmclib.c.
References mask, chipset_power_state::pm1_cnt, pmc_read_pm1_control(), and pmc_write_pm1_control().
Referenced by smihandler_southbridge_apmc(), smihandler_southbridge_pm1(), and smihandler_southbridge_sleep().
Definition at line 183 of file pmclib.c.
References ACPI_BASE_ADDRESS, inl(), mask, outl(), and SMI_EN.
Referenced by smihandler_southbridge_sleep().
Definition at line 300 of file pmclib.c.
References GPE_STD, mask, and pmc_disable_gpe().
Referenced by smm_southbridge_enable().
Definition at line 281 of file pmclib.c.
References ACPI_BASE_ADDRESS, GPE0_EN, chipset_power_state::gpe0_en, inl(), mask, and outl().
Referenced by pmc_enable_std_gpe().
Definition at line 191 of file pmclib.c.
References ACPI_BASE_ADDRESS, outw(), and PM1_EN.
Referenced by pmc_update_pm1_enable(), and smm_southbridge_enable().
Definition at line 206 of file pmclib.c.
References mask, chipset_power_state::pm1_cnt, pmc_read_pm1_control(), and pmc_write_pm1_control().
Referenced by ec_init(), poweroff(), smihandler_southbridge_apmc(), smihandler_southbridge_pm1(), and smihandler_southbridge_sleep().
Definition at line 176 of file pmclib.c.
References ACPI_BASE_ADDRESS, inl(), mask, outl(), and SMI_EN.
Referenced by smm_southbridge_enable(), and southbridge_smi_set_eos().
Definition at line 295 of file pmclib.c.
References GPE_STD, mask, and pmc_enable_gpe().
void pmc_fill_pm_reg_info | ( | struct chipset_power_state * | ps | ) |
Definition at line 413 of file pmclib.c.
References ACPI_BASE_ADDRESS, BIOS_DEBUG, GPE0_EN, chipset_power_state::gpe0_en, GPE0_REG_MAX, GPE0_STS, chipset_power_state::gpe0_sts, inl(), inw(), memset(), chipset_power_state::pm1_cnt, PM1_EN, chipset_power_state::pm1_en, PM1_STS, chipset_power_state::pm1_sts, pmc_read_pm1_control(), printk, and soc_fill_power_state().
Referenced by elog_gsmi_cb_platform_log_wake_source(), and pmc_fill_power_state().
int pmc_fill_power_state | ( | struct chipset_power_state * | ps | ) |
Definition at line 437 of file pmclib.c.
References BIOS_DEBUG, pmc_fill_pm_reg_info(), pmc_prev_sleep_state(), chipset_power_state::prev_sleep_state, and printk.
Referenced by mainboard_romstage_entry().
struct chipset_power_state* pmc_get_power_state | ( | void | ) |
Definition at line 58 of file pmclib.c.
References acpi_get_pm_state(), cbmem_possibly_online(), ENV_POSTCAR, ENV_RAMSTAGE, NULL, and power_state.
Referenced by acpi_get_sleep_type(), check_full_retrain(), mainboard_romstage_entry(), and pch_log_state().
Definition at line 171 of file pmclib.c.
References ACPI_BASE_ADDRESS, inl(), and SMI_EN.
Referenced by smihandler_southbridge_periodic(), and smm_southbridge_clear_state().
enum pch_pmc_xtal pmc_get_xtal_freq | ( | void | ) |
Definition at line 754 of file pmclib.c.
Referenced by fill_fsps_tsn_params(), and soc_fill_soundwire_controller().
Definition at line 535 of file pmclib.c.
References BIOS_INFO, GPE0_DW_SHIFT, GPE0_DWX_MASK, GPIO_GPE_CFG, gpio_route_gpe(), printk, read32p(), soc_get_gpi_gpe_configs(), soc_read_pmc_base(), and write32p().
Referenced by bootblock_pch_init(), bootblock_soc_early_init(), pmc_init(), pmc_soc_init(), and soc_pmc_enable().
|
static |
Definition at line 391 of file pmclib.c.
References ACPI_S0, ACPI_S3, ACPI_S5, CONFIG, chipset_power_state::pm1_cnt, chipset_power_state::pm1_sts, pmc_write_pm1_control(), prev_sleep_state(), SLP_TYP, soc_prev_sleep_state(), and WAK_STS.
Referenced by pmc_fill_power_state().
Definition at line 196 of file pmclib.c.
References ACPI_BASE_ADDRESS, inl(), and PM1_CNT.
Referenced by platform_is_resuming(), pmc_disable_pm1_control(), pmc_enable_pm1_control(), pmc_fill_pm_reg_info(), smihandler_southbridge_sleep(), soc_get_smi_status(), southbridge_smi_handler(), and vboot_platform_prepare_reboot().
Definition at line 159 of file pmclib.c.
References ACPI_BASE_ADDRESS, inw(), and PM1_EN.
Referenced by pmc_update_pm1_enable(), and smihandler_southbridge_pm1().
Definition at line 121 of file pmclib.c.
References ACPI_BASE_ADDRESS, inl(), outl(), SMI_STS, and soc_get_smi_status().
Referenced by pmc_clear_smi_status().
Definition at line 754 of file pmclib.c.
Referenced by pmc_init(), pmc_soc_init(), and soc_pmc_init().
Definition at line 623 of file pmclib.c.
Referenced by pmc_init(), pmc_soc_init(), smihandler_southbridge_sleep(), and soc_pmc_enable().
Definition at line 151 of file pmclib.c.
References chipset_power_state::pm1_en, pmc_enable_pm1(), and pmc_read_pm1_enable().
Referenced by pm1_enable_pwrbtn_smi(), and pm1_handle_wake_pin().
Definition at line 201 of file pmclib.c.
References ACPI_BASE_ADDRESS, outl(), PM1_CNT, and chipset_power_state::pm1_cnt.
Referenced by pmc_disable_pm1_control(), pmc_enable_pm1_control(), pmc_prev_sleep_state(), and vboot_platform_prepare_reboot().
Definition at line 522 of file pmclib.c.
References ENV_SMM, halt(), pmc_enable_pm1_control(), SLP_EN, SLP_TYP_S5, and SLP_TYP_SHIFT.
|
static |
Definition at line 86 of file pmclib.c.
References BIOS_DEBUG, and printk.
Referenced by print_pm1_status(), print_smi_status(), print_std_gpe_sts(), and print_tco_status().
Definition at line 227 of file pmclib.c.
References ARRAY_SIZE, BIOS_SPEW, chipset_power_state::pm1_sts, print_num_status_bits(), and printk.
Referenced by pmc_clear_pm1_status().
Definition at line 129 of file pmclib.c.
References BIOS_DEBUG, print_num_status_bits(), printk, and soc_smi_sts_array().
Referenced by pmc_clear_smi_status().
Definition at line 333 of file pmclib.c.
References BIOS_DEBUG, print_num_status_bits(), printk, and soc_std_gpe_sts_array().
Referenced by pmc_clear_std_gpe_status().
Definition at line 257 of file pmclib.c.
References BIOS_DEBUG, print_num_status_bits(), printk, soc_tco_sts_array(), and chipset_power_state::tco_sts.
Referenced by pmc_clear_tco_status().
Definition at line 220 of file pmclib.c.
References ACPI_BASE_ADDRESS, inw(), outw(), PM1_STS, and chipset_power_state::pm1_sts.
Referenced by pmc_clear_pm1_status().
Definition at line 326 of file pmclib.c.
References ACPI_BASE_ADDRESS, GPE0_STS, GPE_STD, inl(), and outl().
Referenced by pmc_clear_std_gpe_status().
Definition at line 362 of file pmclib.c.
Referenced by pmc_clear_prsts().
Definition at line 104 of file pmclib.c.
Referenced by pmc_reset_smi_status().
__weak int soc_prev_sleep_state | ( | const struct chipset_power_state * | ps, |
int | prev_sleep_state | ||
) |
Definition at line 381 of file pmclib.c.
References prev_sleep_state().
Referenced by pmc_prev_sleep_state().
Definition at line 514 of file pmclib.c.
References pmc_read_pm1_control(), pmc_write_pm1_control(), SLP_TYP, SLP_TYP_S5, and SLP_TYP_SHIFT.
|
static |
Definition at line 1 of file pmclib.c.
Referenced by migrate_power_state(), and pmc_get_power_state().