mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-19 14:26:01 -04:00
fix(cache): disable branch predictor before disable cache
branch predictor will start cache request
This commit is contained in:
parent
893c04702f
commit
873068d3fe
@ -371,12 +371,19 @@ void IRAM_ATTR spi_flash_enable_cache(uint32_t cpuid)
|
|||||||
|
|
||||||
void IRAM_ATTR spi_flash_disable_cache(uint32_t cpuid, uint32_t *saved_state)
|
void IRAM_ATTR spi_flash_disable_cache(uint32_t cpuid, uint32_t *saved_state)
|
||||||
{
|
{
|
||||||
|
#if SOC_BRANCH_PREDICTOR_SUPPORTED
|
||||||
|
//branch predictor will start cache request as well
|
||||||
|
esp_cpu_branch_prediction_disable();
|
||||||
|
#endif
|
||||||
cache_hal_suspend(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
cache_hal_suspend(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_state)
|
void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_state)
|
||||||
{
|
{
|
||||||
cache_hal_resume(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
cache_hal_resume(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||||
|
#if SOC_BRANCH_PREDICTOR_SUPPORTED
|
||||||
|
esp_cpu_branch_prediction_enable();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IRAM_ATTR spi_flash_cache_enabled(void)
|
bool IRAM_ATTR spi_flash_cache_enabled(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user