1 /* 2 * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #pragma once 7 8 #if defined(CONFIG_SOC_SERIES_ESP32) 9 #include "soc/dport_reg.h" 10 #include "esp_attr.h" 11 #elif defined(CONFIG_SOC_SERIES_ESP32S2) 12 #include "esp_attr.h" 13 #include "esp32s2/rom/cache.h" 14 #elif defined(CONFIG_SOC_SERIES_ESP32S3) 15 #include "esp_attr.h" 16 #include "esp32s3/rom/cache.h" 17 #elif defined(CONFIG_SOC_SERIES_ESP32C3) 18 #include "soc/soc.h" 19 #include "esp32c3/rom/cache.h" 20 #endif 21 22 #include <zephyr/kernel.h> 23 #include <soc.h> 24 #include "esp_err.h" 25 26 void IRAM_ATTR esp32_spiflash_start(void); 27 28 void IRAM_ATTR esp32_spiflash_end(void); 29 30 //config cache mode 31 #if !CONFIG_IDF_TARGET_ESP32 32 //config instrcutin cache size and cache block size by menuconfig 33 void esp_config_instruction_cache_mode(void); 34 //config data cache size and cache block size by menuconfig 35 void esp_config_data_cache_mode(void); 36 //enable cache wrap mode for instruction cache and data cache 37 esp_err_t esp_enable_cache_wrap(bool icache_wrap_enable, bool dcache_wrap_enable); 38 #endif 39