![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <acpi/acpigen.h>
#include <device/mmio.h>
#include <console/console.h>
#include <delay.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/pmc_ipc.h>
#include <soc/pci_devs.h>
#include <stdint.h>
#include <timer.h>
Go to the source code of this file.
Macros | |
#define | IPC_WBUF0 0x80 |
#define | IPC_RBUF0 0x90 |
#define | PMC_IPC_CMD_OFFSET 0x0 |
#define | PMC_IPC_STS_OFFSET 0x4 |
#define | PMC_IPC_STS_BUSY BIT(0) |
#define | PMC_IPC_STS_ERR BIT(1) |
#define | PMC_IPC_ERR_CODE_SHIFT 16 |
#define | PMC_IPC_ERR_CODE_MASK 0xff |
#define | PMC_IPC_XFER_TIMEOUT_MS (1 * MSECS_PER_SEC) /* max 1s */ |
#define | IS_IPC_STS_BUSY(status) ((status) & PMC_IPC_STS_BUSY) |
#define | IPC_STS_HAS_ERROR(status) ((status) & PMC_IPC_STS_ERR) |
#define | IPC_STS_ERROR_CODE(sts) |
Functions | |
static void * | pmc_reg (unsigned int pmc_reg_offset) |
static const void * | pmc_rbuf (unsigned int ix) |
static void * | pmc_wbuf (unsigned int ix) |
static int | check_ipc_sts (void) |
enum cb_err | pmc_send_ipc_cmd (uint32_t cmd, const struct pmc_ipc_buffer *wbuf, struct pmc_ipc_buffer *rbuf) |
void | pmc_ipc_acpi_fill_ssdt (void) |
void | pmc_ipc_acpi_set_pci_clock (unsigned int pcie_rp, unsigned int clock_pin, bool enable) |
#define IPC_STS_ERROR_CODE | ( | sts | ) |
#define IPC_STS_HAS_ERROR | ( | status | ) | ((status) & PMC_IPC_STS_ERR) |
#define IS_IPC_STS_BUSY | ( | status | ) | ((status) & PMC_IPC_STS_BUSY) |
#define PMC_IPC_XFER_TIMEOUT_MS (1 * MSECS_PER_SEC) /* max 1s */ |
|
static |
Definition at line 57 of file pmc_ipc.c.
References BIOS_ERR, IPC_STS_ERROR_CODE, IPC_STS_HAS_ERROR, IS_IPC_STS_BUSY, PMC_IPC_ERROR, PMC_IPC_STS_OFFSET, PMC_IPC_SUCCESS, PMC_IPC_TIMEOUT, PMC_IPC_XFER_TIMEOUT_MS, pmc_reg(), printk, read32(), stopwatch_expired(), stopwatch_init_msecs_expire(), and udelay().
Definition at line 100 of file pmc_ipc.c.
References acpigen_emit_byte(), acpigen_pop_len(), acpigen_set_package_element_int(), acpigen_set_package_element_namestr(), acpigen_write_debug_namestr(), acpigen_write_debug_string(), acpigen_write_field(), acpigen_write_if_lequal_namestr_int(), acpigen_write_integer(), acpigen_write_len_f(), acpigen_write_method_serialized(), acpigen_write_name(), acpigen_write_opregion(), acpigen_write_package(), acpigen_write_return_namestr(), acpigen_write_shiftleft_op_int(), acpigen_write_sleep(), acpigen_write_store_int_to_op(), acpigen_write_store_op_to_namestr(), ADD_OP, ARG0_OP, ARG1_OP, ARG2_OP, ARG3_OP, ARG4_OP, ARG5_OP, ARG6_OP, ARRAY_SIZE, DECREMENT_OP, FIELD_DWORDACC, FIELD_NOLOCK, FIELD_PRESERVE, FIELDLIST_NAMESTR, FIELDLIST_OFFSET, FIELDLIST_RESERVED, IPC_RBUF0, IPC_WBUF0, LGREATER_OP, LOCAL0_OP, LOCAL1_OP, OPREGION, PMC_IPC_CMD_COMMAND_SHIFT, PMC_IPC_CMD_MSI_SHIFT, PMC_IPC_CMD_NO_MSI, PMC_IPC_CMD_OFFSET, PMC_IPC_CMD_SIZE_SHIFT, PMC_IPC_CMD_SUB_COMMAND_SHIFT, PMC_IPC_ERROR, PMC_IPC_STS_OFFSET, PMC_IPC_SUCCESS, PMC_IPC_TIMEOUT, PMC_IPC_XFER_TIMEOUT_MS, soc_read_pmc_base(), SYSTEMMEMORY, WHILE_OP, and ZERO_OP.
Referenced by soc_pmc_fill_ssdt().
Definition at line 219 of file pmc_ipc.c.
References acpi_device_path_join(), acpigen_emit_namestring(), acpigen_write_dword(), acpigen_write_integer(), BIOS_ERR, PCH_DEVFN_PMC, pcidev_path_on_root(), PMC_IPC_CMD_ID_SET_PCIE_CLOCK, and printk.
Referenced by pcie_rtd3_acpi_method_off(), pcie_rtd3_acpi_method_on(), and pcie_rtd3_acpi_method_srck().
Definition at line 41 of file pmc_ipc.c.
References soc_read_pmc_base().
Referenced by check_ipc_sts(), pmc_rbuf(), and pmc_wbuf().
enum cb_err pmc_send_ipc_cmd | ( | uint32_t | cmd, |
const struct pmc_ipc_buffer * | wbuf, | ||
struct pmc_ipc_buffer * | rbuf | ||
) |
Definition at line 57 of file pmc_ipc.c.
Referenced by cl_pmc_clear(), cl_pmc_en_gen_on_all_reboot(), cl_pmc_re_arm_after_reset(), cse_disable_mei_devices(), pmc_cl_discovery(), read_pmc_lpm_requirements(), and send_pmc_req().