coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pmc_ipc.c File Reference
#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>
Include dependency graph for pmc_ipc.c:

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 voidpmc_reg (unsigned int pmc_reg_offset)
 
static const voidpmc_rbuf (unsigned int ix)
 
static voidpmc_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)
 

Macro Definition Documentation

◆ IPC_RBUF0

#define IPC_RBUF0   0x90

Definition at line 23 of file pmc_ipc.c.

◆ IPC_STS_ERROR_CODE

#define IPC_STS_ERROR_CODE (   sts)
Value:
(((sts) >> PMC_IPC_ERR_CODE_SHIFT & \
#define PMC_IPC_ERR_CODE_MASK
Definition: pmc_ipc.c:33
#define PMC_IPC_ERR_CODE_SHIFT
Definition: pmc_ipc.c:32

Definition at line 38 of file pmc_ipc.c.

◆ IPC_STS_HAS_ERROR

#define IPC_STS_HAS_ERROR (   status)    ((status) & PMC_IPC_STS_ERR)

Definition at line 37 of file pmc_ipc.c.

◆ IPC_WBUF0

#define IPC_WBUF0   0x80

Definition at line 17 of file pmc_ipc.c.

◆ IS_IPC_STS_BUSY

#define IS_IPC_STS_BUSY (   status)    ((status) & PMC_IPC_STS_BUSY)

Definition at line 36 of file pmc_ipc.c.

◆ PMC_IPC_CMD_OFFSET

#define PMC_IPC_CMD_OFFSET   0x0

Definition at line 28 of file pmc_ipc.c.

◆ PMC_IPC_ERR_CODE_MASK

#define PMC_IPC_ERR_CODE_MASK   0xff

Definition at line 33 of file pmc_ipc.c.

◆ PMC_IPC_ERR_CODE_SHIFT

#define PMC_IPC_ERR_CODE_SHIFT   16

Definition at line 32 of file pmc_ipc.c.

◆ PMC_IPC_STS_BUSY

#define PMC_IPC_STS_BUSY   BIT(0)

Definition at line 30 of file pmc_ipc.c.

◆ PMC_IPC_STS_ERR

#define PMC_IPC_STS_ERR   BIT(1)

Definition at line 31 of file pmc_ipc.c.

◆ PMC_IPC_STS_OFFSET

#define PMC_IPC_STS_OFFSET   0x4

Definition at line 29 of file pmc_ipc.c.

◆ PMC_IPC_XFER_TIMEOUT_MS

#define PMC_IPC_XFER_TIMEOUT_MS   (1 * MSECS_PER_SEC) /* max 1s */

Definition at line 35 of file pmc_ipc.c.

Function Documentation

◆ check_ipc_sts()

◆ pmc_ipc_acpi_fill_ssdt()

◆ pmc_ipc_acpi_set_pci_clock()

void pmc_ipc_acpi_set_pci_clock ( unsigned int  pcie_rp,
unsigned int  clock_pin,
bool  enable 
)

◆ pmc_rbuf()

static const void* pmc_rbuf ( unsigned int  ix)
static

Definition at line 47 of file pmc_ipc.c.

References IPC_RBUF0, and pmc_reg().

Here is the call graph for this function:

◆ pmc_reg()

static void* pmc_reg ( unsigned int  pmc_reg_offset)
static

Definition at line 41 of file pmc_ipc.c.

References soc_read_pmc_base().

Referenced by check_ipc_sts(), pmc_rbuf(), and pmc_wbuf().

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

◆ pmc_send_ipc_cmd()

enum cb_err pmc_send_ipc_cmd ( uint32_t  cmd,
const struct pmc_ipc_buffer wbuf,
struct pmc_ipc_buffer rbuf 
)

◆ pmc_wbuf()

static void* pmc_wbuf ( unsigned int  ix)
static

Definition at line 52 of file pmc_ipc.c.

References IPC_WBUF0, and pmc_reg().

Here is the call graph for this function: