feat(cache): added cache invalidate all

This commit is contained in:
armando
2026-04-20 16:58:29 +08:00
parent ab026ecc01
commit 8fc4f9c108
2 changed files with 15 additions and 4 deletions
@@ -460,6 +460,21 @@ static inline void cache_ll_invalidate_addr(uint32_t cache_level, cache_type_t t
}
}
/**
* @brief Invalidate all cache
*
* Invalidate all cache
*
* @param cache_level level of the cache
* @param type see `cache_type_t`
* @param cache_id id of the cache in this type and level
*/
__attribute__((always_inline))
static inline void cache_ll_invalidate_all(uint32_t cache_level, cache_type_t type, uint32_t cache_id)
{
Cache_Invalidate_All(CACHE_MAP_MASK);
}
/*------------------------------------------------------------------------------
* Writeback
*----------------------------------------------------------------------------*/
@@ -138,11 +138,7 @@ esp_err_t spi_flash_suspend_test_deinit(flash_test_handle_t *handle)
void spi_flash_suspend_test_invalidate_cache(void)
{
#if CONFIG_IDF_TARGET_ESP32S31
Cache_Invalidate_All(CACHE_MAP_MASK);
#else
cache_ll_invalidate_all(CACHE_LL_LEVEL_ALL, CACHE_TYPE_ALL, CACHE_LL_ID_ALL);
#endif
}
#endif // SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND