coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
crashlog.h File Reference
#include <console/console.h>
#include <device/pci_ops.h>
#include <device/pci_def.h>
#include <device/mmio.h>
#include <fsp/util.h>
#include <intelblocks/pmc_ipc.h>
#include <types.h>
#include <arch/io.h>
Include dependency graph for crashlog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  __packed
 

Macros

#define PMC_IPC_CMD_CRASHLOG   0xA6
 
#define PMC_IPC_CMD_ID_CRASHLOG_DISCOVERY   0x01
 
#define PMC_IPC_CMD_ID_CRASHLOG_DISABLE   0x02
 
#define PMC_IPC_CMD_ID_CRASHLOG_ERASE   0x04
 
#define PMC_IPC_CMD_ID_CRASHLOG_ON_RESET   0x05
 
#define PMC_IPC_CMD_ID_CRASHLOG_RE_ARM_ON_RESET   0x06
 
#define CPU_CRASHLOG_CMD_DISABLE   0
 
#define CPU_CRASHLOG_CMD_CLEAR   2
 
#define CPU_CRASHLOG_MAILBOX_WAIT_STALL   1
 
#define CPU_CRASHLOG_MAILBOX_WAIT_TIMEOUT   1000
 
#define CPU_CRASHLOG_DISC_TAB_GUID_VALID   0x1600
 
#define CRASHLOG_SIZE_DEBUG_PURPOSE   0x640
 

Functions

int cl_get_cpu_record_size (void)
 
int cl_get_pmc_record_size (void)
 
u32 cl_get_cpu_bar_addr (void)
 
u32 cl_get_cpu_tmp_bar (void)
 
u32 cl_get_cpu_mb_int_addr (void)
 
int cl_get_total_data_size (void)
 
bool cl_pmc_sram_has_mmio_access (void)
 
bool cpu_crashlog_support (void)
 
bool pmc_crashlog_support (void)
 
bool cl_cpu_data_present (void)
 
bool cl_pmc_data_present (void)
 
void cl_get_cpu_sram_data (void)
 
void cl_get_pmc_sram_data (void)
 
void reset_discovery_buffers (void)
 
void update_new_pmc_crashlog_size (u32 *pmc_crash_size)
 
void update_new_cpu_crashlog_size (u32 *cpu_crash_size)
 
pmc_ipc_discovery_buf_t cl_get_pmc_discovery_buf (void)
 
pmc_crashlog_desc_table_t cl_get_pmc_descriptor_table (void)
 
cpu_crashlog_discovery_table_t cl_get_cpu_discovery_table (void)
 
u32 cl_gen_cpu_bar_addr (void)
 
int cpu_cl_poll_mailbox_ready (u32 cl_mailbox_addr)
 
int cpu_cl_mailbox_cmd (u8 cmd, u8 param)
 
int cpu_cl_clear_data (void)
 
int pmc_cl_gen_descriptor_table (u32 desc_table_addr, pmc_crashlog_desc_table_t *descriptor_table)
 
bool pmc_cl_discovery (void)
 
bool cpu_cl_discovery (void)
 
int cl_pmc_re_arm_after_reset (void)
 
int cl_pmc_clear (void)
 
int cl_pmc_en_gen_on_all_reboot (void)
 
bool discover_crashlog (void)
 
bool cl_copy_data_from_sram (u32 src_bar, u32 offset, u32 size, u32 *dest_addr, u32 buffer_index, bool pmc_sram)
 
void collect_pmc_and_cpu_crashlog_from_srams (void)
 
bool cl_fill_cpu_records (void *cl_record)
 
bool cl_fill_pmc_records (void *cl_record)
 

Variables

static const EFI_GUID FW_ERR_SECTION_GUID
 

Macro Definition Documentation

◆ CPU_CRASHLOG_CMD_CLEAR

#define CPU_CRASHLOG_CMD_CLEAR   2

Definition at line 25 of file crashlog.h.

◆ CPU_CRASHLOG_CMD_DISABLE

#define CPU_CRASHLOG_CMD_DISABLE   0

Definition at line 24 of file crashlog.h.

◆ CPU_CRASHLOG_DISC_TAB_GUID_VALID

#define CPU_CRASHLOG_DISC_TAB_GUID_VALID   0x1600

Definition at line 28 of file crashlog.h.

◆ CPU_CRASHLOG_MAILBOX_WAIT_STALL

#define CPU_CRASHLOG_MAILBOX_WAIT_STALL   1

Definition at line 26 of file crashlog.h.

◆ CPU_CRASHLOG_MAILBOX_WAIT_TIMEOUT

#define CPU_CRASHLOG_MAILBOX_WAIT_TIMEOUT   1000

Definition at line 27 of file crashlog.h.

◆ CRASHLOG_SIZE_DEBUG_PURPOSE

#define CRASHLOG_SIZE_DEBUG_PURPOSE   0x640

Definition at line 30 of file crashlog.h.

◆ PMC_IPC_CMD_CRASHLOG

#define PMC_IPC_CMD_CRASHLOG   0xA6

Definition at line 16 of file crashlog.h.

◆ PMC_IPC_CMD_ID_CRASHLOG_DISABLE

#define PMC_IPC_CMD_ID_CRASHLOG_DISABLE   0x02

Definition at line 18 of file crashlog.h.

◆ PMC_IPC_CMD_ID_CRASHLOG_DISCOVERY

#define PMC_IPC_CMD_ID_CRASHLOG_DISCOVERY   0x01

Definition at line 17 of file crashlog.h.

◆ PMC_IPC_CMD_ID_CRASHLOG_ERASE

#define PMC_IPC_CMD_ID_CRASHLOG_ERASE   0x04

Definition at line 19 of file crashlog.h.

◆ PMC_IPC_CMD_ID_CRASHLOG_ON_RESET

#define PMC_IPC_CMD_ID_CRASHLOG_ON_RESET   0x05

Definition at line 20 of file crashlog.h.

◆ PMC_IPC_CMD_ID_CRASHLOG_RE_ARM_ON_RESET

#define PMC_IPC_CMD_ID_CRASHLOG_RE_ARM_ON_RESET   0x06

Definition at line 21 of file crashlog.h.

Function Documentation

◆ cl_copy_data_from_sram()

bool cl_copy_data_from_sram ( u32  src_bar,
u32  offset,
u32  size,
u32 dest_addr,
u32  buffer_index,
bool  pmc_sram 
)

Definition at line 254 of file crashlog.c.

References BIOS_DEBUG, BIOS_ERR, BIT, offset, printk, and read32().

Referenced by cl_get_cpu_sram_data(), and cl_get_pmc_sram_data().

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

◆ cl_cpu_data_present()

bool cl_cpu_data_present ( void  )

Definition at line 255 of file crashlog.c.

References m_cpu_crashLog_present.

Referenced by cl_fill_cpu_records(), and collect_pmc_and_cpu_crashlog_from_srams().

Here is the caller graph for this function:

◆ cl_fill_cpu_records()

bool cl_fill_cpu_records ( void cl_record)

Definition at line 469 of file crashlog.c.

References BIOS_DEBUG, cbmem_find(), CBMEM_ID_CPU_CRASHLOG, cl_cpu_data_present(), cl_get_cpu_record_size(), m_cpu_crashLog_size, memcpy(), NULL, and printk.

Here is the call graph for this function:

◆ cl_fill_pmc_records()

bool cl_fill_pmc_records ( void cl_record)

Definition at line 487 of file crashlog.c.

References BIOS_DEBUG, cbmem_find(), CBMEM_ID_PMC_CRASHLOG, cl_get_pmc_record_size(), cl_pmc_data_present(), m_pmc_crashLog_size, memcpy(), NULL, and printk.

Here is the call graph for this function:

◆ cl_gen_cpu_bar_addr()

u32 cl_gen_cpu_bar_addr ( void  )

◆ cl_get_cpu_bar_addr()

u32 cl_get_cpu_bar_addr ( void  )

Definition at line 94 of file crashlog.c.

References BIOS_ERR, cpu_cl_devsc_cap, PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_1, PCI_BASE_ADDRESS_MEM_ATTR_MASK, pci_read_config32(), printk, SA_DEV_TMT, TEL_DVSEC_TBIR_BAR0, and TEL_DVSEC_TBIR_BAR1.

Referenced by cl_get_cpu_sram_data(), cpu_cl_gen_discovery_table(), and cpu_cl_mailbox_cmd().

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

◆ cl_get_cpu_discovery_table()

cpu_crashlog_discovery_table_t cl_get_cpu_discovery_table ( void  )

Definition at line 280 of file crashlog.c.

References cpu_cl_disc_tab, and memset().

Referenced by cl_get_cpu_sram_data().

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

◆ cl_get_cpu_mb_int_addr()

u32 cl_get_cpu_mb_int_addr ( void  )

Definition at line 24 of file crashlog.c.

References CRASHLOG_MAILBOX_INTF_ADDRESS.

Referenced by cpu_cl_mailbox_cmd().

Here is the caller graph for this function:

◆ cl_get_cpu_record_size()

int cl_get_cpu_record_size ( void  )

Definition at line 250 of file crashlog.c.

References m_cpu_crashLog_size.

Referenced by cl_fill_cpu_records(), cl_get_cpu_sram_data(), cl_get_total_data_size(), and collect_pmc_and_cpu_crashlog_from_srams().

Here is the caller graph for this function:

◆ cl_get_cpu_sram_data()

void cl_get_cpu_sram_data ( void  )

◆ cl_get_cpu_tmp_bar()

u32 cl_get_cpu_tmp_bar ( void  )

Definition at line 112 of file crashlog.c.

References SPI_BASE_ADDRESS.

Referenced by cl_get_pmc_sram_data().

Here is the caller graph for this function:

◆ cl_get_pmc_descriptor_table()

pmc_crashlog_desc_table_t cl_get_pmc_descriptor_table ( void  )

Definition at line 240 of file crashlog.c.

References descriptor_table, and memset().

Referenced by cl_get_pmc_sram_data().

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

◆ cl_get_pmc_discovery_buf()

pmc_ipc_discovery_buf_t cl_get_pmc_discovery_buf ( void  )

Definition at line 235 of file crashlog.c.

References discovery_buf, and memset().

Referenced by cl_get_pmc_sram_data().

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

◆ cl_get_pmc_record_size()

int cl_get_pmc_record_size ( void  )

Definition at line 245 of file crashlog.c.

References m_pmc_crashLog_size.

Referenced by cl_fill_pmc_records(), cl_get_pmc_sram_data(), cl_get_total_data_size(), and collect_pmc_and_cpu_crashlog_from_srams().

Here is the caller graph for this function:

◆ cl_get_pmc_sram_data()

◆ cl_get_total_data_size()

int cl_get_total_data_size ( void  )

Definition at line 230 of file crashlog.c.

References cl_get_cpu_record_size(), cl_get_pmc_record_size(), m_cpu_crashLog_size, and m_pmc_crashLog_size.

Referenced by acpi_soc_get_bert_region().

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

◆ cl_pmc_clear()

int cl_pmc_clear ( void  )

Definition at line 193 of file crashlog.c.

References BIOS_ERR, PMC_IPC_CMD_CRASHLOG, PMC_IPC_CMD_ID_CRASHLOG_ERASE, PMC_IPC_CMD_SIZE_SHIFT, pmc_make_ipc_cmd(), pmc_send_ipc_cmd(), and printk.

Referenced by cl_get_pmc_sram_data().

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

◆ cl_pmc_data_present()

bool cl_pmc_data_present ( void  )

Definition at line 260 of file crashlog.c.

References m_pmc_crashLog_present.

Referenced by cl_fill_pmc_records(), and collect_pmc_and_cpu_crashlog_from_srams().

Here is the caller graph for this function:

◆ cl_pmc_en_gen_on_all_reboot()

int cl_pmc_en_gen_on_all_reboot ( void  )

Definition at line 218 of file crashlog.c.

References BIOS_ERR, PMC_IPC_CMD_CRASHLOG, PMC_IPC_CMD_ID_CRASHLOG_ON_RESET, PMC_IPC_CMD_SIZE_SHIFT, pmc_make_ipc_cmd(), pmc_send_ipc_cmd(), and printk.

Referenced by collect_pmc_and_cpu_crashlog_from_srams().

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

◆ cl_pmc_re_arm_after_reset()

int cl_pmc_re_arm_after_reset ( void  )

Definition at line 170 of file crashlog.c.

References BIOS_ERR, PMC_IPC_CMD_CRASHLOG, PMC_IPC_CMD_ID_CRASHLOG_RE_ARM_ON_RESET, PMC_IPC_CMD_SIZE_SHIFT, pmc_make_ipc_cmd(), pmc_send_ipc_cmd(), and printk.

Referenced by cl_get_pmc_sram_data().

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

◆ cl_pmc_sram_has_mmio_access()

bool cl_pmc_sram_has_mmio_access ( void  )

Definition at line 117 of file crashlog.c.

References BIOS_ERR, PCH_DEV_SRAM, pci_read_config16(), PCI_VENDOR_ID, and printk.

Referenced by cl_get_pmc_sram_data().

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

◆ collect_pmc_and_cpu_crashlog_from_srams()

void collect_pmc_and_cpu_crashlog_from_srams ( void  )

◆ cpu_cl_clear_data()

int cpu_cl_clear_data ( void  )

Definition at line 133 of file crashlog.c.

References cpu_cl_mailbox_cmd(), and CPU_CRASHLOG_CMD_CLEAR.

Referenced by cl_get_cpu_sram_data().

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

◆ cpu_cl_discovery()

◆ cpu_cl_mailbox_cmd()

int cpu_cl_mailbox_cmd ( u8  cmd,
u8  param 
)

Definition at line 112 of file crashlog.c.

References cl_get_cpu_bar_addr(), cl_get_cpu_mb_int_addr(), cpu_cl_poll_mailbox_ready(), memset(), and write32().

Referenced by cpu_cl_clear_data().

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

◆ cpu_cl_poll_mailbox_ready()

int cpu_cl_poll_mailbox_ready ( u32  cl_mailbox_addr)

Definition at line 91 of file crashlog.c.

References BIOS_ERR, CPU_CRASHLOG_MAILBOX_WAIT_STALL, CPU_CRASHLOG_MAILBOX_WAIT_TIMEOUT, printk, read32(), and udelay().

Referenced by cpu_cl_mailbox_cmd().

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

◆ cpu_crashlog_support()

bool cpu_crashlog_support ( void  )

Definition at line 265 of file crashlog.c.

References m_cpu_crashLog_support.

Referenced by collect_pmc_and_cpu_crashlog_from_srams().

Here is the caller graph for this function:

◆ discover_crashlog()

bool discover_crashlog ( void  )

Definition at line 239 of file crashlog.c.

References cpu_cl_discovery(), pmc_cl_discovery(), and reset_discovery_buffers().

Referenced by acpi_soc_get_bert_region().

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

◆ pmc_cl_discovery()

◆ pmc_cl_gen_descriptor_table()

int pmc_cl_gen_descriptor_table ( u32  desc_table_addr,
pmc_crashlog_desc_table_t *  descriptor_table 
)

Definition at line 138 of file crashlog.c.

References BIOS_DEBUG, BIOS_ERR, descriptor_table, printk, and read32().

Referenced by pmc_cl_discovery().

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

◆ pmc_crashlog_support()

bool pmc_crashlog_support ( void  )

Definition at line 270 of file crashlog.c.

References m_pmc_crashLog_support.

Referenced by collect_pmc_and_cpu_crashlog_from_srams().

Here is the caller graph for this function:

◆ reset_discovery_buffers()

void reset_discovery_buffers ( void  )

Definition at line 223 of file crashlog.c.

References cpu_cl_devsc_cap, descriptor_table, discovery_buf, and memset().

Referenced by discover_crashlog().

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

◆ update_new_cpu_crashlog_size()

void update_new_cpu_crashlog_size ( u32 cpu_crash_size)

Definition at line 285 of file crashlog.c.

References m_cpu_crashLog_size.

Referenced by cl_get_cpu_sram_data().

Here is the caller graph for this function:

◆ update_new_pmc_crashlog_size()

void update_new_pmc_crashlog_size ( u32 pmc_crash_size)

Definition at line 275 of file crashlog.c.

References m_pmc_crashLog_size.

Referenced by cl_get_pmc_sram_data().

Here is the caller graph for this function:

Variable Documentation

◆ FW_ERR_SECTION_GUID

const EFI_GUID FW_ERR_SECTION_GUID
static
Initial value:
= {
0x81212a96, 0x09ed, 0x4996,
{ 0x94, 0x71, 0x8d, 0x72, 0x9c, 0x8e, 0x69, 0xed }
}

Definition at line 178 of file crashlog.h.