fix(spi_flash): fixed no_os flash API not consider branch predictor on c5/c61

This commit is contained in:
Armando 2024-12-11 16:26:59 +08:00 committed by BOT
parent 49826c241b
commit 8c8f8836e5

View File

@ -9,6 +9,7 @@
#include "esp_flash.h"
#include "esp_attr.h"
#include "esp_rom_sys.h"
#include "esp_cpu.h"
#include "rom/cache.h"
#include "hal/cache_hal.h"
#include "hal/cache_ll.h"
@ -16,6 +17,11 @@
static IRAM_ATTR esp_err_t start(void *arg)
{
#if SOC_BRANCH_PREDICTOR_SUPPORTED
//branch predictor will start cache request as well
esp_cpu_branch_prediction_disable();
#endif
#if CONFIG_IDF_TARGET_ESP32
Cache_Read_Disable(0);
Cache_Read_Disable(1);
@ -35,6 +41,10 @@ static IRAM_ATTR esp_err_t end(void *arg)
cache_hal_resume(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
#endif
#if SOC_BRANCH_PREDICTOR_SUPPORTED
esp_cpu_branch_prediction_enable();
#endif
return ESP_OK;
}