From 964511ca305d44043068393131fc39e2b98a3066 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Wed, 20 May 2026 12:27:49 +0800 Subject: [PATCH] feat(soc): disable esp32s31 WFE feature at startup --- components/esp_system/port/cpu_start.c | 2 +- components/soc/esp32s31/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32s31/include/soc/soc_caps.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 752e9eef304..f3abf008924 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -252,7 +252,7 @@ void ESP_SYSTEM_IRAM_ATTR call_start_cpu1(void) esp_cpu_intr_set_mtvt_addr(&_mtvt_table); #endif #if SOC_CPU_SUPPORT_WFE - rv_utils_disable_wfe_mode(); + esp_cpu_disable_wfe_mode(); #endif ets_set_appcpu_boot_addr(0); diff --git a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in index 44d2f9a7492..19c2359ecd8 100644 --- a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in @@ -507,6 +507,10 @@ config SOC_CPU_HAS_FLEXIBLE_INTC bool default y +config SOC_CPU_SUPPORT_WFE + bool + default y + config SOC_INT_CLIC_SUPPORTED bool default y diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index f7f25426e87..426ede839da 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -173,6 +173,7 @@ #define SOC_CPU_CORES_NUM (2U) #define SOC_CPU_INTR_NUM 32 #define SOC_CPU_HAS_FLEXIBLE_INTC 1 +#define SOC_CPU_SUPPORT_WFE 1 #define SOC_INT_CLIC_SUPPORTED 1 #define SOC_INT_HW_NESTED_SUPPORTED 1 // Support for hardware interrupts nesting #define SOC_BRANCH_PREDICTOR_SUPPORTED 1