mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
refactor(hal): extract cache && mmu HAL into esp_hal_cache
This commit is contained in:
@@ -10,12 +10,25 @@
|
||||
#include "soc/hwcrypto_reg.h"
|
||||
#include "hal/sha_types.h"
|
||||
#include "soc/dport_reg.h"
|
||||
#include "hal/mmu_ll.h"
|
||||
#include "soc/ext_mem_defs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Check if the external memory vaddr belongs to the DPORT bus region
|
||||
*
|
||||
* @param vaddr start of the virtual address
|
||||
*
|
||||
* @return True for valid
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline bool _vaddr_in_dport_bus_region(uint32_t vaddr)
|
||||
{
|
||||
return (vaddr >= SOC_DPORT_CACHE_ADDRESS_LOW && vaddr < SOC_DPORT_CACHE_ADDRESS_HIGH);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the bus clock for SHA peripheral module
|
||||
*
|
||||
@@ -158,7 +171,7 @@ static inline void sha_ll_fill_text_block(const void *input_text, size_t block_w
|
||||
* Thus, when accessing data from these addresses we need to ensure
|
||||
* the operations are word-aligned.
|
||||
*/
|
||||
if (mmu_ll_vaddr_in_dport_bus_region((uint32_t)input_text)) {
|
||||
if (_vaddr_in_dport_bus_region((uint32_t)input_text)) {
|
||||
force_word_aligned_access = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user