esp_mm: cache_msync API

This commit is contained in:
Armando
2023-02-15 12:29:34 +08:00
parent 8486a2c3ad
commit fda9746bb8
37 changed files with 740 additions and 39 deletions
+47 -1
View File
@@ -15,11 +15,12 @@ extern "C" {
/**
* Cache init and cache hal context init
*
*/
void cache_hal_init(void);
/**
* @brief Disable cache
*
* Disable the ICache or DCache or both, all the items in the corresponding Cache(s) will be invalideated.
* Next request to these items will trigger a transaction to the external memory (flash / psram)
*
@@ -30,6 +31,8 @@ void cache_hal_init(void);
void cache_hal_disable(cache_type_t type);
/**
* @brief Enable cache
*
* Enable the ICache or DCache or both.
*
* @param type see `cache_type_t`
@@ -37,6 +40,8 @@ void cache_hal_disable(cache_type_t type);
void cache_hal_enable(cache_type_t type);
/**
* @brief Invalidate cache supported addr
*
* Invalidate a Cache item for either ICache or DCache.
*
* @param vaddr Start address of the region to be invalidated
@@ -44,6 +49,47 @@ void cache_hal_enable(cache_type_t type);
*/
void cache_hal_invalidate_addr(uint32_t vaddr, uint32_t size);
#if SOC_CACHE_WRITEBACK_SUPPORTED
/**
* @brief Writeback cache supported addr
*
* Writeback the DCache item to external memory
*
* @param vaddr Start address of the region to writeback
* @param size Size of the region to writeback
*/
void cache_hal_writeback_addr(uint32_t vaddr, uint32_t size);
#endif //#if SOC_CACHE_WRITEBACK_SUPPORTED
#if SOC_CACHE_FREEZE_SUPPORTED
/**
* @brief Freeze cache
*
* Freeze cache, CPU access to cache will be suspended, until the cache is unfrozen.
*
* @param type see `cache_type_t`
*/
void cache_hal_freeze(cache_type_t type);
/**
* @brief Unfreeze cache
*
* Unfreeze cache, CPU access to cache will be restored
*
* @param type see `cache_type_t`
*/
void cache_hal_unfreeze(cache_type_t type);
#endif //#if SOC_CACHE_FREEZE_SUPPORTED
/**
* @brief Get cache line size, in bytes
*
* @param type see `cache_type_t`
*
* @return cache line size, in bytes
*/
uint32_t cache_hal_get_cache_line_size(cache_type_t type);
#ifdef __cplusplus
}
#endif