From 83d91a153d600bdcce58a5f84ff1496da6001eb5 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 13 Nov 2025 14:27:00 +0800 Subject: [PATCH] feat(esp_hw_support): support unicore auto clock gating for esp32p4 rev3+ --- components/esp_system/port/cpu_start.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 2f8e202e8c..3863c7844f 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -681,6 +681,10 @@ NOINLINE_ATTR static void system_early_init(const soc_reset_reason_t *rst_reas) REG_CLR_BIT(SYSTEM_CORE_1_CONTROL_0_REG, SYSTEM_CONTROL_CORE_1_RESETING); #endif #elif CONFIG_IDF_TARGET_ESP32P4 +#if CONFIG_ESP32P4_REV_MIN_FULL >= 300 + // In single core mode, the CPU system should ignore the WFI state of core1 when entering WFI autoclock gating mode. + REG_CLR_BIT(HP_SYS_CLKRST_CPU_WAITI_CTRL0_REG, HP_SYS_CLKRST_REG_CORE1_WAITI_ICG_EN); +#endif REG_CLR_BIT(HP_SYS_CLKRST_SOC_CLK_CTRL0_REG, HP_SYS_CLKRST_REG_CORE1_CPU_CLK_EN); REG_SET_BIT(HP_SYS_CLKRST_HP_RST_EN0_REG, HP_SYS_CLKRST_REG_RST_EN_CORE1_GLOBAL); #elif CONFIG_IDF_TARGET_ESP32H4