mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-31 22:24:28 +00:00
fix(esp_hw_support): fix mspi clock freq changed after lightsleep
This commit is contained in:
@@ -58,12 +58,14 @@
|
||||
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/cache_ll.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
#include "hal/wdt_hal.h"
|
||||
#include "hal/uart_hal.h"
|
||||
#if SOC_TOUCH_SENSOR_SUPPORTED
|
||||
#include "hal/touch_sensor_hal.h"
|
||||
#include "hal/touch_sens_hal.h"
|
||||
#endif
|
||||
#include "hal/mspi_timing_tuning_ll.h"
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_rom_uart.h"
|
||||
@@ -75,7 +77,9 @@
|
||||
#include "esp_private/esp_clk.h"
|
||||
#include "esp_private/esp_task_wdt.h"
|
||||
#include "esp_private/sar_periph_ctrl.h"
|
||||
#if MSPI_TIMING_LL_FLASH_CPU_CLK_SRC_BINDED
|
||||
#include "esp_private/mspi_timing_tuning.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#include "esp32/rom/cache.h"
|
||||
@@ -159,7 +163,7 @@
|
||||
#define DEFAULT_SLEEP_OUT_OVERHEAD_US (318)
|
||||
#define DEFAULT_HARDWARE_OUT_OVERHEAD_US (56)
|
||||
#elif CONFIG_IDF_TARGET_ESP32C61
|
||||
#define DEFAULT_SLEEP_OUT_OVERHEAD_US (1148) //TODO: PM-231
|
||||
#define DEFAULT_SLEEP_OUT_OVERHEAD_US (318)
|
||||
#define DEFAULT_HARDWARE_OUT_OVERHEAD_US (107)
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
#define DEFAULT_SLEEP_OUT_OVERHEAD_US (118)
|
||||
@@ -795,8 +799,10 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MSPI_TIMING_LL_FLASH_CPU_CLK_SRC_BINDED
|
||||
// Will switch to XTAL turn down MSPI speed
|
||||
mspi_timing_change_speed_mode_cache_safe(true);
|
||||
#endif
|
||||
|
||||
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
|
||||
if (!deep_sleep && (pd_flags & PMU_SLEEP_PD_TOP)) {
|
||||
@@ -1132,8 +1138,8 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m
|
||||
misc_modules_wake_prepare(pd_flags);
|
||||
}
|
||||
|
||||
#if SOC_SPI_MEM_SUPPORT_TIMING_TUNING
|
||||
if (cpu_freq_config.source == SOC_CPU_CLK_SRC_PLL) {
|
||||
#if MSPI_TIMING_LL_FLASH_CPU_CLK_SRC_BINDED
|
||||
if (cpu_freq_config.source_freq_mhz > clk_ll_xtal_load_freq_mhz()) {
|
||||
// Turn up MSPI speed if switch to PLL
|
||||
mspi_timing_change_speed_mode_cache_safe(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user