mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
bugfix: fix esp32s3 psram access failed when dfs is enabled
This commit is contained in:
parent
dd7e8b7955
commit
65e8cb55eb
@ -574,7 +574,9 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
|
|||||||
|
|
||||||
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
||||||
// Restore mspi clock freq
|
// Restore mspi clock freq
|
||||||
spi_timing_change_speed_mode_cache_safe(false);
|
if (cpu_freq_config.source == SOC_CPU_CLK_SRC_PLL) {
|
||||||
|
spi_timing_change_speed_mode_cache_safe(false);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!deep_sleep) {
|
if (!deep_sleep) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
idf_component_register(SRCS "pm_locks.c" "pm_trace.c" "pm_impl.c"
|
idf_component_register(SRCS "pm_locks.c" "pm_trace.c" "pm_impl.c"
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
PRIV_REQUIRES esp_system driver esp_timer
|
PRIV_REQUIRES esp_system driver esp_timer spi_flash
|
||||||
LDFRAGMENTS linker.lf)
|
LDFRAGMENTS linker.lf)
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "esp_private/crosscore_int.h"
|
#include "esp_private/crosscore_int.h"
|
||||||
|
|
||||||
#include "soc/rtc.h"
|
#include "soc/rtc.h"
|
||||||
|
#include "soc/soc_caps.h"
|
||||||
#include "hal/uart_ll.h"
|
#include "hal/uart_ll.h"
|
||||||
#include "hal/uart_types.h"
|
#include "hal/uart_types.h"
|
||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
@ -35,6 +36,10 @@
|
|||||||
#include "esp_private/esp_timer_private.h"
|
#include "esp_private/esp_timer_private.h"
|
||||||
#include "esp_private/esp_clk.h"
|
#include "esp_private/esp_clk.h"
|
||||||
|
|
||||||
|
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
||||||
|
#include "esp_private/spi_flash_os.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "esp_sleep.h"
|
#include "esp_sleep.h"
|
||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
@ -503,7 +508,19 @@ static void IRAM_ATTR do_switch(pm_mode_t new_mode)
|
|||||||
if (switch_down) {
|
if (switch_down) {
|
||||||
on_freq_update(old_ticks_per_us, new_ticks_per_us);
|
on_freq_update(old_ticks_per_us, new_ticks_per_us);
|
||||||
}
|
}
|
||||||
rtc_clk_cpu_freq_set_config_fast(&new_config);
|
|
||||||
|
if (new_config.source == SOC_CPU_CLK_SRC_PLL) {
|
||||||
|
rtc_clk_cpu_freq_set_config_fast(&new_config);
|
||||||
|
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
||||||
|
spi_timing_change_speed_mode_cache_safe(false);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
#if SOC_SPI_MEM_SUPPORT_TIME_TUNING
|
||||||
|
spi_timing_change_speed_mode_cache_safe(true);
|
||||||
|
#endif
|
||||||
|
rtc_clk_cpu_freq_set_config_fast(&new_config);
|
||||||
|
}
|
||||||
|
|
||||||
if (!switch_down) {
|
if (!switch_down) {
|
||||||
on_freq_update(old_ticks_per_us, new_ticks_per_us);
|
on_freq_update(old_ticks_per_us, new_ticks_per_us);
|
||||||
}
|
}
|
||||||
|
@ -470,8 +470,8 @@ void spi_timing_enter_mspi_high_speed_mode(bool control_spi1)
|
|||||||
|
|
||||||
void spi_timing_change_speed_mode_cache_safe(bool switch_down)
|
void spi_timing_change_speed_mode_cache_safe(bool switch_down)
|
||||||
{
|
{
|
||||||
Cache_Freeze_ICache_Enable(1);
|
Cache_Freeze_ICache_Enable(CACHE_FREEZE_ACK_BUSY);
|
||||||
Cache_Freeze_DCache_Enable(1);
|
Cache_Freeze_DCache_Enable(CACHE_FREEZE_ACK_BUSY);
|
||||||
if (switch_down) {
|
if (switch_down) {
|
||||||
//enter MSPI low speed mode, extra delays should be removed
|
//enter MSPI low speed mode, extra delays should be removed
|
||||||
spi_timing_enter_mspi_low_speed_mode(false);
|
spi_timing_enter_mspi_low_speed_mode(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user