fix(esp_hw_support): disable BBPLL after sleep if clk_tree ref is zero

PLL_SOURCE retention may leave BBPLL on; sync HW in pmu_sleep_finish and keep is_power_on in IRAM.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzhenghui
2026-09-11 19:49:26 +08:00
committed by BOT
parent 81a97f38b0
commit a14ab4d942
2 changed files with 9 additions and 2 deletions

View File

@@ -14,10 +14,10 @@ entries:
esp_memory_utils (noflash)
clk_utils (noflash)
esp_clk_tree: esp_clk_tree_enable_src (noflash)
esp_clk_tree:esp_clk_tree_port_is_power_on (noflash)
esp_clk_tree_common:esp_clk_tree_is_power_on (noflash)
if RTC_CLK_FUNC_IN_IRAM = y:
esp_clk_tree:esp_clk_tree_enable_power (noflash)
esp_clk_tree:esp_clk_tree_port_is_power_on (noflash)
esp_clk_tree_common:esp_clk_tree_is_power_on (noflash)
if SOC_CLK_MPLL_SUPPORTED = y:
esp_clk_tree_common:esp_clk_tree_mpll_release (noflash)
if SOC_CLK_APLL_SUPPORTED = y:

View File

@@ -14,10 +14,13 @@
#include "soc/soc.h"
#include "soc/rtc.h"
#include "soc/pmu_struct.h"
#include "soc/hp_sys_clkrst_struct.h"
#include "esp_private/esp_pmu.h"
#include "esp_private/esp_clk_tree_common.h"
#include "esp_private/sleep_clock_icg.h"
#include "pmu_param.h"
#include "hal/clk_tree_hal.h"
#include "hal/clk_tree_ll.h"
#include "hal/lp_aon_hal.h"
#include "hal/efuse_ll.h"
#include "hal/efuse_hal.h"
@@ -399,6 +402,10 @@ bool pmu_sleep_finish(bool dslp)
esp_psram_impl_exit_halfsleep_mode();
#endif
#endif
/* PLL_SOURCE retention may leave BBPLL powered on; align HW to clk_tree ref. */
if (!esp_clk_tree_is_power_on(SOC_ROOT_CIRCUIT_CLK_BBPLL) && !HP_SYS_CLKRST.modem_conf.modem_pll_clk_en) {
clk_ll_bbpll_disable();
}
}
#if !SOC_APM_SUPPORTED