summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/include
diff options
context:
space:
mode:
authorPratikkumar Prajapati <pratikkumar.v.prajapati@intel.com>2023-10-05 13:12:12 -0700
committerSubrata Banik <subratabanik@google.com>2023-12-20 04:29:12 +0000
commit4db921317fe1eec77e93b3c1628dac14fd812d39 (patch)
treee039c66e4713a6874640ef7f79c605a89180b3e9 /src/soc/intel/common/block/include
parent9b3c5afc00ebbc22c0d5b400bfb8ed8946fe67d1 (diff)
soc/intel/common,mtl: Refactor BERT generation flow for crashlog
With earlier flow, a chunk of CBMEM region was allocated for each SRAM e.g., PUNIT SRAM, SOC PMC SRAM and IOE PMC SRAM. Then entire SRAM content was copied to dedicated CBMEM region. Later in acpi_bert.c, the BERT table was getting created for each chunk of CBMEM. This flow was not considering creating separate entries for each region of crashlog records. It resulted in only the first entry getting decoded from each SRAM. New flow aims to fix this issue. With new flow, a simple singly linked list is created to store each region of crashlog records from all SRAMs. The crashlog data is not copied to CBMEM. The nodes are allocated dynamically and then copied to ACPI BERT table and then freed. This flow also makes the overall crashlog code much simpler. BUG=b:298234592 TEST=With this change decoding crashlog show comprehensive details, tested on REX. Change-Id: I43bb61485b77d786647900ca284b7f492f412aee Signed-off-by: Pratikkumar Prajapati <pratikkumar.v.prajapati@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78257 Reviewed-by: Kapil Porwal <kapilporwal@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block/include')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/crashlog.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/crashlog.h b/src/soc/intel/common/block/include/intelblocks/crashlog.h
index 38d1a09de6..ff80b1c426 100644
--- a/src/soc/intel/common/block/include/intelblocks/crashlog.h
+++ b/src/soc/intel/common/block/include/intelblocks/crashlog.h
@@ -170,6 +170,14 @@ typedef struct {
cpu_crashlog_buffer_info_t buffers[256];
} __packed cpu_crashlog_discovery_table_t;
+typedef struct cl_node_t {
+ u32 size;
+ void *data;
+ struct cl_node_t *next;
+} cl_node_t;
+
+cl_node_t *malloc_cl_node(size_t len);
+void free_cl_node(cl_node_t *node);
int cl_get_cpu_record_size(void);
int cl_get_pmc_record_size(void);
int cl_get_ioe_record_size(void);
@@ -184,8 +192,8 @@ bool pmc_crashlog_support(void);
bool cl_cpu_data_present(void);
bool cl_pmc_data_present(void);
bool cl_ioe_data_present(void);
-void cl_get_cpu_sram_data(void);
-void cl_get_pmc_sram_data(void);
+void cl_get_cpu_sram_data(cl_node_t *head);
+void cl_get_pmc_sram_data(cl_node_t *head);
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);
@@ -213,11 +221,7 @@ bool cl_copy_data_from_sram(u32 src_bar,
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);
-bool cl_fill_ioe_records(void *cl_record);
-
+void collect_pmc_and_cpu_crashlog_from_srams(cl_node_t *head);
static const EFI_GUID FW_ERR_SECTION_GUID = {
0x81212a96, 0x09ed, 0x4996,
{ 0x94, 0x71, 0x8d, 0x72, 0x9c, 0x8e, 0x69, 0xed }