diff --git a/components/hal/esp32s31/include/hal/cache_ll.h b/components/hal/esp32s31/include/hal/cache_ll.h index 9fdd44413e4..ea4100ea1c0 100644 --- a/components/hal/esp32s31/include/hal/cache_ll.h +++ b/components/hal/esp32s31/include/hal/cache_ll.h @@ -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 *----------------------------------------------------------------------------*/ diff --git a/components/spi_flash/test_apps/components/test_flash_utils/test_flash_utils.c b/components/spi_flash/test_apps/components/test_flash_utils/test_flash_utils.c index fac7dbbeceb..af643720b17 100644 --- a/components/spi_flash/test_apps/components/test_flash_utils/test_flash_utils.c +++ b/components/spi_flash/test_apps/components/test_flash_utils/test_flash_utils.c @@ -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