summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-10-03 15:05:06 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-12 23:39:31 +0000
commitaebccf721edad727dfa011a48eb12ff75015be79 (patch)
treecf5eef6e23f67611e5be966b8d916c1a90b01ef3
parentc2ac97e9c24566451d2e24df2b4b2af9f4076ba4 (diff)
downloadchrome-ec-aebccf721edad727dfa011a48eb12ff75015be79.tar.gz
tree: Remove CONFIG_SOFTWARE_PANIC
It's always enabled in the core/<core>/core_config.h files. The following script demonstrates that it's enabled in all boards: for board in `make print-boards`; do make print-configs board="${board}" | grep -q CONFIG_SOFTWARE_PANIC if [ $? -ne 0 ]; then echo "${board} failed" exit 1 fi done BRANCH=none BUG=none TEST=make buildall Cq-Depend: chromium:3943248 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If683b244f17b48bedf3699f2b24e83b5ad6e849e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3933255 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--baseboard/kukui/baseboard.h1
-rw-r--r--board/atlas/board.h1
-rw-r--r--board/eve/board.h1
-rw-r--r--board/nami/board.h1
-rw-r--r--board/nautilus/board.h1
-rw-r--r--board/poppy/board.h1
-rw-r--r--board/rainier/board.h1
-rw-r--r--board/rammus/board.h1
-rw-r--r--board/scarlet/board.h1
-rw-r--r--chip/it83xx/watchdog.c2
-rw-r--r--chip/stm32/bkpdata.h4
-rw-r--r--chip/stm32/system.c6
-rw-r--r--common/panic_output.c9
-rw-r--r--common/system.c2
-rw-r--r--core/cortex-m/config_core.h2
-rw-r--r--core/cortex-m/panic.c2
-rw-r--r--core/cortex-m/task.c2
-rw-r--r--core/cortex-m0/config_core.h1
-rw-r--r--core/cortex-m0/panic.c2
-rw-r--r--core/cortex-m0/task.c2
-rw-r--r--core/cortex-m0/watchdog.c2
-rw-r--r--core/minute-ia/config_core.h2
-rw-r--r--core/minute-ia/task.c4
-rw-r--r--core/nds32/config_core.h2
-rw-r--r--core/nds32/panic.c4
-rw-r--r--core/nds32/task.c2
-rw-r--r--core/riscv-rv32i/config_core.h1
-rw-r--r--core/riscv-rv32i/panic.c6
-rw-r--r--core/riscv-rv32i/task.c2
-rw-r--r--include/config.h6
-rw-r--r--include/panic.h3
-rw-r--r--zephyr/shim/include/config_chip.h5
-rw-r--r--zephyr/shim/src/panic.c4
33 files changed, 4 insertions, 82 deletions
diff --git a/baseboard/kukui/baseboard.h b/baseboard/kukui/baseboard.h
index fc87b3441b..d1ba87702e 100644
--- a/baseboard/kukui/baseboard.h
+++ b/baseboard/kukui/baseboard.h
@@ -192,7 +192,6 @@
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_IGNORE_LID
#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_VBOOT_HASH
#define CONFIG_CHARGER
diff --git a/board/atlas/board.h b/board/atlas/board.h
index 0882b5742e..9718ab7cdd 100644
--- a/board/atlas/board.h
+++ b/board/atlas/board.h
@@ -27,7 +27,6 @@
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_LTO
#define CONFIG_CHIP_PANIC_BACKUP
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_PWM
#define CONFIG_PWM_KBLIGHT
#define CONFIG_SHA256_UNROLLED
diff --git a/board/eve/board.h b/board/eve/board.h
index defc3e746e..064bce4b60 100644
--- a/board/eve/board.h
+++ b/board/eve/board.h
@@ -38,7 +38,6 @@
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_LTO
#define CONFIG_CHIP_PANIC_BACKUP
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_PWM
#define CONFIG_PWM_KBLIGHT
#define CONFIG_SHA256_UNROLLED
diff --git a/board/nami/board.h b/board/nami/board.h
index 879fb443be..51cde41acb 100644
--- a/board/nami/board.h
+++ b/board/nami/board.h
@@ -38,7 +38,6 @@
#define CONFIG_LTO
#define CONFIG_CHIP_PANIC_BACKUP
#define CONFIG_PWM
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_SPI_FLASH_REGS
#define CONFIG_SPI_FLASH_W25X40
#define CONFIG_VBOOT_HASH
diff --git a/board/nautilus/board.h b/board/nautilus/board.h
index 10d31f8555..cbca28a71f 100644
--- a/board/nautilus/board.h
+++ b/board/nautilus/board.h
@@ -34,7 +34,6 @@
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_LTO
#define CONFIG_CHIP_PANIC_BACKUP
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_SPI_FLASH_REGS
#define CONFIG_SPI_FLASH_W25X40
#define CONFIG_VBOOT_HASH
diff --git a/board/poppy/board.h b/board/poppy/board.h
index 6f95a9abeb..b55dc1d818 100644
--- a/board/poppy/board.h
+++ b/board/poppy/board.h
@@ -34,7 +34,6 @@
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_LTO
#define CONFIG_CHIP_PANIC_BACKUP
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_SPI_FLASH_REGS
#define CONFIG_SPI_FLASH_W25X40
#define CONFIG_VBOOT_HASH
diff --git a/board/rainier/board.h b/board/rainier/board.h
index 3cf5405f9a..463a1e4a05 100644
--- a/board/rainier/board.h
+++ b/board/rainier/board.h
@@ -55,7 +55,6 @@
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_IGNORE_LID
#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_VBOOT_HASH
#define CONFIG_VOLUME_BUTTONS
diff --git a/board/rammus/board.h b/board/rammus/board.h
index 77515a40ba..c0c8238c3e 100644
--- a/board/rammus/board.h
+++ b/board/rammus/board.h
@@ -38,7 +38,6 @@
#define CONFIG_CHIP_PANIC_BACKUP
#define CONFIG_PWM
#define CONFIG_PWM_KBLIGHT
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_SPI_FLASH_REGS
#define CONFIG_SPI_FLASH_W25X40
#define CONFIG_VBOOT_HASH
diff --git a/board/scarlet/board.h b/board/scarlet/board.h
index 1d1a7ced79..4691d74391 100644
--- a/board/scarlet/board.h
+++ b/board/scarlet/board.h
@@ -65,7 +65,6 @@
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_IGNORE_LID
#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_VBOOT_HASH
#define CONFIG_VOLUME_BUTTONS
diff --git a/chip/it83xx/watchdog.c b/chip/it83xx/watchdog.c
index b1e45127f0..4acea9d1b8 100644
--- a/chip/it83xx/watchdog.c
+++ b/chip/it83xx/watchdog.c
@@ -38,7 +38,6 @@ static void watchdog_set_warning_timer(int32_t ms, int init)
void watchdog_warning_irq(void)
{
-#ifdef CONFIG_SOFTWARE_PANIC
struct panic_data *const pdata_ptr = get_panic_data_write();
#if defined(CHIP_CORE_NDS32)
@@ -46,7 +45,6 @@ void watchdog_warning_irq(void)
#elif defined(CHIP_CORE_RISCV)
pdata_ptr->riscv.mepc = get_mepc();
#endif
-#endif
/* clear interrupt status */
task_clear_pending_irq(et_ctrl_regs[WDT_EXT_TIMER].irq);
diff --git a/chip/stm32/bkpdata.h b/chip/stm32/bkpdata.h
index 14ef33483e..5b656b16dc 100644
--- a/chip/stm32/bkpdata.h
+++ b/chip/stm32/bkpdata.h
@@ -25,23 +25,19 @@ enum bkpdata_index {
#ifdef CONFIG_STM32_EXTENDED_RESET_FLAGS
BKPDATA_INDEX_SAVED_RESET_FLAGS_2, /* Saved reset flags (cont) */
#endif
-#ifdef CONFIG_SOFTWARE_PANIC
BKPDATA_INDEX_SAVED_PANIC_REASON, /* Saved panic reason */
BKPDATA_INDEX_SAVED_PANIC_INFO, /* Saved panic data */
BKPDATA_INDEX_SAVED_PANIC_EXCEPTION, /* Saved panic exception code */
-#endif
#ifdef CONFIG_USB_PD_DUAL_ROLE
BKPDATA_INDEX_PD0, /* USB-PD saved port0 state */
BKPDATA_INDEX_PD1, /* USB-PD saved port1 state */
BKPDATA_INDEX_PD2, /* USB-PD saved port2 state */
#endif
-#ifdef CONFIG_SOFTWARE_PANIC
/**
* Saving the panic flags in case that AP thinks the panic is new
* after a hard reset.
*/
BKPDATA_INDEX_SAVED_PANIC_FLAGS, /* Saved panic flags */
-#endif
BKPDATA_COUNT
};
BUILD_ASSERT(STM32_BKP_ENTRIES >= BKPDATA_COUNT);
diff --git a/chip/stm32/system.c b/chip/stm32/system.c
index dc53022c8b..53ba7c3f52 100644
--- a/chip/stm32/system.c
+++ b/chip/stm32/system.c
@@ -265,11 +265,9 @@ DECLARE_IRQ(STM32_IRQ_PVD, pvd_interrupt, HOOK_PRIO_FIRST);
void system_pre_init(void)
{
-#ifdef CONFIG_SOFTWARE_PANIC
uint16_t reason, info;
uint8_t exception, panic_flags;
struct panic_data *pdata;
-#endif
/* enable clock on Power module */
#ifndef CHIP_FAMILY_STM32H7
@@ -345,7 +343,6 @@ void system_pre_init(void)
check_reset_cause();
-#ifdef CONFIG_SOFTWARE_PANIC
/* Restore then clear saved panic reason */
reason = bkpdata_read(BKPDATA_INDEX_SAVED_PANIC_REASON);
info = bkpdata_read(BKPDATA_INDEX_SAVED_PANIC_INFO);
@@ -370,7 +367,6 @@ void system_pre_init(void)
pdata->flags = panic_flags;
bkpdata_write(BKPDATA_INDEX_SAVED_PANIC_FLAGS, 0);
}
-#endif
#ifdef CONFIG_PVD
configure_pvd();
@@ -421,7 +417,6 @@ void system_reset(int flags)
#endif
if (flags & SYSTEM_RESET_HARD) {
-#ifdef CONFIG_SOFTWARE_PANIC
/* Panic data will be wiped by hard reset, so save it */
uint32_t reason, info;
uint8_t exception, panic_flags;
@@ -441,7 +436,6 @@ void system_reset(int flags)
bkpdata_write(BKPDATA_INDEX_SAVED_PANIC_FLAGS,
panic_flags);
}
-#endif
#if defined(CHIP_FAMILY_STM32L) || defined(CHIP_FAMILY_STM32L4)
/*
diff --git a/common/panic_output.c b/common/panic_output.c
index 27c7e1e202..c08e895ecf 100644
--- a/common/panic_output.c
+++ b/common/panic_output.c
@@ -35,11 +35,9 @@ static struct panic_data *const pdata_ptr = PANIC_DATA_PTR;
/* Common SW Panic reasons strings */
const char *const panic_sw_reasons[] = {
-#ifdef CONFIG_SOFTWARE_PANIC
"PANIC_SW_DIV_ZERO", "PANIC_SW_STACK_OVERFLOW", "PANIC_SW_PD_CRASH",
"PANIC_SW_ASSERT", "PANIC_SW_WATCHDOG", "PANIC_SW_RNG",
"PANIC_SW_PMIC_FAULT",
-#endif
};
/**
@@ -49,7 +47,7 @@ const char *const panic_sw_reasons[] = {
*/
int panic_sw_reason_is_valid(uint32_t reason)
{
- return (IS_ENABLED(CONFIG_SOFTWARE_PANIC) && reason >= PANIC_SW_BASE &&
+ return (reason >= PANIC_SW_BASE &&
(reason - PANIC_SW_BASE) < ARRAY_SIZE(panic_sw_reasons));
}
@@ -128,10 +126,7 @@ test_mockable_static
void
complete_panic(int linenum)
{
- if (IS_ENABLED(CONFIG_SOFTWARE_PANIC))
- software_panic(PANIC_SW_ASSERT, linenum);
- else
- panic_reboot();
+ software_panic(PANIC_SW_ASSERT, linenum);
}
#ifdef CONFIG_DEBUG_ASSERT_BRIEF
diff --git a/common/system.c b/common/system.c
index baceabc110..047b96e799 100644
--- a/common/system.c
+++ b/common/system.c
@@ -875,7 +875,6 @@ system_get_build_info(void)
void system_common_pre_init(void)
{
-#ifdef CONFIG_SOFTWARE_PANIC
/*
* Log panic cause if watchdog caused reset and panic cause
* was not already logged. This must happen before calculating
@@ -890,7 +889,6 @@ void system_common_pre_init(void)
if (reason != PANIC_SW_WATCHDOG)
panic_set_reason(PANIC_SW_WATCHDOG, 0, 0);
}
-#endif
jdata = get_jump_data();
diff --git a/core/cortex-m/config_core.h b/core/cortex-m/config_core.h
index 949df7ee21..3b9ccb89e6 100644
--- a/core/cortex-m/config_core.h
+++ b/core/cortex-m/config_core.h
@@ -10,6 +10,4 @@
#define BFD_ARCH arm
#define BFD_FORMAT "elf32-littlearm"
-#define CONFIG_SOFTWARE_PANIC
-
#endif /* __CROS_EC_CONFIG_CORE_H */
diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c
index 3a59fcf201..0f803dc8e5 100644
--- a/core/cortex-m/panic.c
+++ b/core/cortex-m/panic.c
@@ -416,7 +416,6 @@ void exception_panic(void)
"r8", "r9", "r10", "r11", "cc", "memory");
}
-#ifdef CONFIG_SOFTWARE_PANIC
void software_panic(uint32_t reason, uint32_t info)
{
__asm__("mov " STRINGIFY(
@@ -463,7 +462,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception)
*exception = *reason = *info = 0;
}
}
-#endif
void bus_fault_handler(void)
{
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index ce6c8c9615..03e069df8c 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -304,9 +304,7 @@ void svc_handler(int desched, task_id_t resched)
if (*current->stack != STACK_UNUSED_VALUE) {
panic_printf("\n\nStack overflow in %s task!\n",
task_names[current - tasks]);
-#ifdef CONFIG_SOFTWARE_PANIC
software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks);
-#endif
}
#endif
diff --git a/core/cortex-m0/config_core.h b/core/cortex-m0/config_core.h
index e954e5e0af..9ef52f848a 100644
--- a/core/cortex-m0/config_core.h
+++ b/core/cortex-m0/config_core.h
@@ -18,7 +18,6 @@
#define CONFIG_SOFTWARE_CLZ
#define CONFIG_SOFTWARE_CTZ
#endif /* __clang__ */
-#define CONFIG_SOFTWARE_PANIC
#define CONFIG_ASSEMBLY_MULA32
diff --git a/core/cortex-m0/panic.c b/core/cortex-m0/panic.c
index f20908eb7c..3714d771a2 100644
--- a/core/cortex-m0/panic.c
+++ b/core/cortex-m0/panic.c
@@ -179,7 +179,6 @@ void exception_panic(void)
"r8", "r9", "r10", "r11", "cc", "memory");
}
-#ifdef CONFIG_SOFTWARE_PANIC
void software_panic(uint32_t reason, uint32_t info)
{
__asm__("mov " STRINGIFY(
@@ -226,7 +225,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception)
*exception = *reason = *info = 0;
}
}
-#endif
void bus_fault_handler(void)
{
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index b34e920e09..03490025b5 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -234,9 +234,7 @@ task_ __attribute__((noinline)) * __svc_handler(int desched, task_id_t resched)
if (*current->stack != STACK_UNUSED_VALUE) {
panic_printf("\n\nStack overflow in %s task!\n",
task_names[current - tasks]);
-#ifdef CONFIG_SOFTWARE_PANIC
software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks);
-#endif
}
#endif
diff --git a/core/cortex-m0/watchdog.c b/core/cortex-m0/watchdog.c
index b4d5c086f0..0b5a038168 100644
--- a/core/cortex-m0/watchdog.c
+++ b/core/cortex-m0/watchdog.c
@@ -34,10 +34,8 @@ void watchdog_trace(uint32_t excep_lr, uint32_t excep_sp)
}
/* Log PC. If we were in task context, log task id too. */
-#ifdef CONFIG_SOFTWARE_PANIC
panic_set_reason(PANIC_SW_WATCHDOG, stack[STACK_IDX_REG_PC],
(excep_lr & 0xf) == 1 ? 0xff : task_get_current());
-#endif
panic_printf("### WATCHDOG PC=%08x / LR=%08x / pSP=%08x ",
stack[STACK_IDX_REG_PC], stack[STACK_IDX_REG_LR], psp);
diff --git a/core/minute-ia/config_core.h b/core/minute-ia/config_core.h
index 1dce51720d..d8a9b3adb1 100644
--- a/core/minute-ia/config_core.h
+++ b/core/minute-ia/config_core.h
@@ -10,8 +10,6 @@
#define BFD_ARCH "i386"
#define BFD_FORMAT "elf32-i386"
-#define CONFIG_SOFTWARE_PANIC
-
/*
* Since all implementations minute-ia are a single core, we do not need a
* "lock;" prefix on any instructions. We use the below define in places where
diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c
index 79ce82fd89..b4b747baa0 100644
--- a/core/minute-ia/task.c
+++ b/core/minute-ia/task.c
@@ -225,9 +225,7 @@ uint32_t switch_handler(int desched, task_id_t resched)
panic_printf("\n\nStack overflow in %s task!\n",
task_get_name(current - tasks));
- if (IS_ENABLED(CONFIG_SOFTWARE_PANIC))
- software_panic(PANIC_SW_STACK_OVERFLOW,
- current - tasks);
+ software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks);
}
if (desched && !current->events) {
diff --git a/core/nds32/config_core.h b/core/nds32/config_core.h
index 096b244643..094a86f76a 100644
--- a/core/nds32/config_core.h
+++ b/core/nds32/config_core.h
@@ -10,8 +10,6 @@
#define BFD_ARCH nds32
#define BFD_FORMAT "elf32-nds32le"
-#define CONFIG_SOFTWARE_PANIC
-
/*
* The Andestar v3m architecture has no CLZ/CTZ instructions (contrary to v3),
* so let's use the software implementation.
diff --git a/core/nds32/panic.c b/core/nds32/panic.c
index a1eca1574f..5a877f8572 100644
--- a/core/nds32/panic.c
+++ b/core/nds32/panic.c
@@ -75,7 +75,6 @@ static const char *const itype_exc_type[16] = {
};
#endif /* CONFIG_DEBUG_EXCEPTIONS */
-#ifdef CONFIG_SOFTWARE_PANIC
void software_panic(uint32_t reason, uint32_t info)
{
asm volatile("mov55 $r6, %0" : : "r"(reason));
@@ -133,7 +132,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception)
*exception = *reason = *info = 0;
}
}
-#endif /* CONFIG_SOFTWARE_PANIC */
static void print_panic_information(uint32_t *regs, uint32_t itype,
uint32_t ipc, uint32_t ipsw)
@@ -159,13 +157,11 @@ static void print_panic_information(uint32_t *regs, uint32_t itype,
#ifdef CONFIG_DEBUG_EXCEPTIONS
panic_printf("SWID of ITYPE: %x\n", ((itype >> 16) & 0x7fff));
if (panic_sw_reason_is_valid(regs[SOFT_PANIC_GPR_REASON])) {
-#ifdef CONFIG_SOFTWARE_PANIC
panic_printf("Software panic reason %s\n",
panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] -
PANIC_SW_BASE)]);
panic_printf("Software panic info 0x%x\n",
regs[SOFT_PANIC_GPR_INFO]);
-#endif
} else {
panic_printf("Exception type: General exception [%s]\n",
itype_exc_type[(itype & 0xf)]);
diff --git a/core/nds32/task.c b/core/nds32/task.c
index d9ea6f191f..427f0e1202 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -311,9 +311,7 @@ task_ *next_sched_task(void)
int i = task_get_current();
panic_printf("\n\nStack overflow in %s task!\n", task_names[i]);
-#ifdef CONFIG_SOFTWARE_PANIC
software_panic(PANIC_SW_STACK_OVERFLOW, i);
-#endif
}
#endif
diff --git a/core/riscv-rv32i/config_core.h b/core/riscv-rv32i/config_core.h
index 2adcd2783f..c5863efb25 100644
--- a/core/riscv-rv32i/config_core.h
+++ b/core/riscv-rv32i/config_core.h
@@ -16,6 +16,5 @@
*/
#define CONFIG_SOFTWARE_CLZ
#define CONFIG_SOFTWARE_CTZ
-#define CONFIG_SOFTWARE_PANIC
#endif /* __CROS_EC_CONFIG_CORE_H */
diff --git a/core/riscv-rv32i/panic.c b/core/riscv-rv32i/panic.c
index a2ce9213d9..3ac34c7774 100644
--- a/core/riscv-rv32i/panic.c
+++ b/core/riscv-rv32i/panic.c
@@ -34,7 +34,6 @@ static const char *const exc_type[16] = {
};
#endif /* CONFIG_DEBUG_EXCEPTIONS */
-#ifdef CONFIG_SOFTWARE_PANIC
/* General purpose register (s0) for saving software panic reason */
#define SOFT_PANIC_GPR_REASON 11
/* General purpose register (s1) for saving software panic information */
@@ -97,7 +96,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception)
*exception = *reason = *info = 0;
}
}
-#endif /* CONFIG_SOFTWARE_PANIC */
static void print_panic_information(uint32_t *regs, uint32_t mcause,
uint32_t mepc)
@@ -122,13 +120,11 @@ static void print_panic_information(uint32_t *regs, uint32_t mcause,
#ifdef CONFIG_DEBUG_EXCEPTIONS
if ((regs[SOFT_PANIC_GPR_REASON] & 0xfffffff0) == PANIC_SW_BASE) {
-#ifdef CONFIG_SOFTWARE_PANIC
panic_printf("Software panic reason: %s\n",
panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] -
PANIC_SW_BASE)]);
panic_printf("Software panic info: %d\n",
regs[SOFT_PANIC_GPR_INFO]);
-#endif
} else {
panic_printf("Exception type: %s\n", exc_type[(mcause & 0xf)]);
}
@@ -195,13 +191,11 @@ static void ccprint_panic_information(uint32_t *regs, uint32_t mcause,
#ifdef CONFIG_DEBUG_EXCEPTIONS
if ((regs[SOFT_PANIC_GPR_REASON] & 0xfffffff0) == PANIC_SW_BASE) {
-#ifdef CONFIG_SOFTWARE_PANIC
ccprintf("Software panic reason: %s\n",
panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] -
PANIC_SW_BASE)]);
ccprintf("Software panic info: %d\n",
regs[SOFT_PANIC_GPR_INFO]);
-#endif /* CONFIG_SOFTWARE_PANIC */
} else {
ccprintf("Exception type: %s\n", exc_type[(mcause & 0xf)]);
}
diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c
index 84415dcda9..fd0d3938cb 100644
--- a/core/riscv-rv32i/task.c
+++ b/core/riscv-rv32i/task.c
@@ -291,9 +291,7 @@ task_ *__ram_code next_sched_task(void)
int i = task_get_current();
panic_printf("\n\nStack overflow in %s task!\n", task_names[i]);
-#ifdef CONFIG_SOFTWARE_PANIC
software_panic(PANIC_SW_STACK_OVERFLOW, i);
-#endif
}
#endif
diff --git a/include/config.h b/include/config.h
index 76a7f5dcc6..15e6231b3d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1670,12 +1670,6 @@
#define CONFIG_COMMON_PANIC_OUTPUT
/*
- * Store a panic log and halt the system for a software-related reasons, such as
- * stack overflow or assertion failure.
- */
-#undef CONFIG_SOFTWARE_PANIC
-
-/*
* Certain platforms(e.g. eve, poppy) cannot retain panic info in data ram since
* VCC is powered down on EC reset. On such platforms, panic data needs to be
* saved/restored to persistent storage by using chip specific
diff --git a/include/panic.h b/include/panic.h
index 7f2cb9a813..d74ed34063 100644
--- a/include/panic.h
+++ b/include/panic.h
@@ -13,6 +13,7 @@
#include <stdint.h>
#include <stdnoreturn.h>
+#include "common.h"
#include "software_panic.h"
#ifdef __cplusplus
@@ -231,7 +232,6 @@ noreturn
void
panic_reboot(void);
-#ifdef CONFIG_SOFTWARE_PANIC
/**
* Store a panic log and halt the system for a software-related reason, such as
* stack overflow or assertion failure.
@@ -261,7 +261,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception);
__override_proto void arch_panic_set_reason(uint32_t reason, uint32_t info,
uint8_t exception);
#endif /* CONFIG_ZEPHYR */
-#endif /* CONFIG_SOFTWARE_PANIC */
/**
* Enable/disable bus fault handler
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 87764a00fd..c2dc2ebf93 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -2067,11 +2067,6 @@ extern char mock_jump_data[sizeof(struct jump_data) + 256];
#define CONFIG_COMMON_PANIC_OUTPUT
#endif
-#undef CONFIG_SOFTWARE_PANIC
-#ifdef CONFIG_PLATFORM_EC_SOFTWARE_PANIC
-#define CONFIG_SOFTWARE_PANIC
-#endif
-
#undef CONFIG_DEBUG_ASSSERT_BRIEF
#ifdef CONFIG_PLATFORM_EC_DEBUG_ASSERT_BRIEF
#define CONFIG_DEBUG_ASSSERT_BRIEF
diff --git a/zephyr/shim/src/panic.c b/zephyr/shim/src/panic.c
index 20f0e9977e..9ff8a46f62 100644
--- a/zephyr/shim/src/panic.c
+++ b/zephyr/shim/src/panic.c
@@ -95,14 +95,12 @@
/* Not implemented for this arch */
#define PANIC_ARCH 0
#define PANIC_REG_LIST(M)
-#ifdef CONFIG_PLATFORM_EC_SOFTWARE_PANIC
static uint8_t placeholder_exception_reg;
static uint32_t placeholder_reason_reg;
static uint32_t placeholder_info_reg;
#define PANIC_REG_EXCEPTION(unused) placeholder_exception_reg
#define PANIC_REG_REASON(unused) placeholder_reason_reg
#define PANIC_REG_INFO(unused) placeholder_info_reg
-#endif /* CONFIG_PLATFORM_EC_SOFTWARE_PANIC */
#endif
/* Macros to be applied to PANIC_REG_LIST as M */
@@ -157,7 +155,6 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf)
CODE_UNREACHABLE;
}
-#ifdef CONFIG_PLATFORM_EC_SOFTWARE_PANIC
void panic_set_reason(uint32_t reason, uint32_t info, uint8_t exception)
{
struct panic_data *const pdata = get_panic_data_write();
@@ -196,4 +193,3 @@ __overridable void arch_panic_set_reason(uint32_t reason, uint32_t info,
{
/* Default implementation, do nothing. */
}
-#endif /* CONFIG_PLATFORM_EC_SOFTWARE_PANIC */