From 350c977fefdb85f15ce1530158ecdc2e0eb62816 Mon Sep 17 00:00:00 2001 From: Sowmya Aralguppe Date: Mon, 21 Jul 2025 18:56:53 +0530 Subject: [PATCH] soc/intel/pantherlake: Clear crashlog record using watcher After crash data extraction, the records are cleared and reinitialized to their default values. This is done using watcher interface instead of BIOS mailbox commands because of low latency and efficiency. Ref: LNL FAS 733648 BUG= b:None TEST= iotools mmio_dump 0x9c199d40 0x10 - PMC 0x000000009c199d40: 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef iotools mmio_dump 0x9c1d0058 0x10 - CPU 0x000000009c1d0058: 0xcafecafe 0xcafecafe 0xcafecafe 0xcafecafe Initial 8 bytes of header are zeroes - indicating that both header and crashlog data buffer are cleared Change-Id: I8a36e091f61833067caf9e9f94ba79149e699d68 Signed-off-by: Sowmya Aralguppe Reviewed-on: https://review.coreboot.org/c/coreboot/+/88514 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Kapil Porwal --- src/soc/intel/pantherlake/crashlog.c | 6 ++++++ src/soc/intel/pantherlake/include/soc/crashlog.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/soc/intel/pantherlake/crashlog.c b/src/soc/intel/pantherlake/crashlog.c index d9a80f46c1..a57a16863f 100644 --- a/src/soc/intel/pantherlake/crashlog.c +++ b/src/soc/intel/pantherlake/crashlog.c @@ -18,6 +18,8 @@ #define CRASHLOG_PUNIT_STORAGE_OFF_MASK BIT(24) #define CRASHLOG_RE_ARM_STATUS_MASK BIT(25) #define CRASHLOG_CONSUMED_BIOS_MASK BIT(27) +#define CRASHLOG_SET_CLEAR_TRIGGER_MASK BIT(30) +#define CRASHLOG_SET_CONSUMED_MASK BIT(18) /* Global crashLog info */ static bool m_pmc_crash_log_support; @@ -392,6 +394,10 @@ static uintptr_t get_control_status_interface(void) int cpu_cl_clear_data(void) { + /* Clear all crashlog data and CRASHLOG_SET_CONSUMED = 1 -> sets CONSUMED_BIOS bit */ + setbits64p(cl_get_cpu_bar_addr() + CRASHLOG_WATCHER_CONTROL_OFFSET, + CRASHLOG_SET_CLEAR_TRIGGER_MASK | CRASHLOG_SET_CONSUMED_MASK); + return 0; } diff --git a/src/soc/intel/pantherlake/include/soc/crashlog.h b/src/soc/intel/pantherlake/include/soc/crashlog.h index eed653ba7d..32a37bd89b 100644 --- a/src/soc/intel/pantherlake/include/soc/crashlog.h +++ b/src/soc/intel/pantherlake/include/soc/crashlog.h @@ -14,6 +14,7 @@ #define CRASHLOG_DVSEC_ID 0x04 #define TEL_DVSEC_TBIR_BAR0 0 #define TEL_DVSEC_TBIR_BAR1 1 +#define CRASHLOG_WATCHER_CONTROL_OFFSET 0x10 typedef union { struct {