update cache config

This commit is contained in:
duyi
2020-01-07 16:58:14 +08:00
committed by morris
parent a8d31b0385
commit 30a525aeb1
4 changed files with 29 additions and 80 deletions

View File

@@ -65,18 +65,6 @@ menu "ESP32S2-specific"
bool "16KB"
endchoice
choice ESP32S2_INSTRUCTION_CACHE_WAYS
prompt "Instruction cache associated ways"
default ESP32S2_INSTRUCTION_CACHE_8WAYS
help
Instruction cache associated ways to be set on application startup.
config ESP32S2_INSTRUCTION_CACHE_4WAYS
bool "4 ways"
config ESP32S2_INSTRUCTION_CACHE_8WAYS
bool "8 ways"
endchoice
choice ESP32S2_INSTRUCTION_CACHE_LINE_SIZE
prompt "Instruction cache line size"
default ESP32S2_INSTRUCTION_CACHE_LINE_32B
@@ -87,8 +75,6 @@ menu "ESP32S2-specific"
bool "16 Bytes"
config ESP32S2_INSTRUCTION_CACHE_LINE_32B
bool "32 Bytes"
config ESP32S2_INSTRUCTION_CACHE_LINE_64B
bool "64 Bytes"
endchoice
choice ESP32S2_DATA_CACHE_SIZE
@@ -107,18 +93,6 @@ menu "ESP32S2-specific"
bool "16KB"
endchoice
choice ESP32S2_DATA_CACHE_ASSOCIATED_WAYS
prompt "Data cache associated ways"
default ESP32S2_DATA_CACHE_8WAYS
help
Data cache associated ways to be set on application startup.
config ESP32S2_DATA_CACHE_4WAYS
bool "4 ways"
config ESP32S2_DATA_CACHE_8WAYS
bool "8 ways"
endchoice
choice ESP32S2_DATA_CACHE_LINE_SIZE
prompt "Data cache line size"
default ESP32S2_DATA_CACHE_LINE_32B
@@ -129,18 +103,8 @@ menu "ESP32S2-specific"
bool "16 Bytes"
config ESP32S2_DATA_CACHE_LINE_32B
bool "32 Bytes"
config ESP32S2_DATA_CACHE_LINE_64B
bool "64 Bytes"
endchoice
config ESP32S2_RODATA_USE_DATA_CACHE
depends on ESP32S2_DATA_CACHE_8KB || ESP32S2_DATA_CACHE_16KB
bool "Use data cache rather than instruction cache to access read only data"
default "n"
help
If enabled, CPU will access rodata through data cache, which will reduce the overload
of instruction cache, however will increase the overload of data cache.
config ESP32S2_INSTRUCTION_CACHE_WRAP
bool "Enable instruction cache wrap"
default "n"

View File

@@ -147,7 +147,7 @@ void IRAM_ATTR call_start_cpu0(void)
/* If we need use SPIRAM, we should use data cache, or if we want to access rodata, we also should use data cache.
Configure the mode of data : cache size, cache associated ways, cache line size.
Enable data cache, so if we don't use SPIRAM, it just works. */
#if CONFIG_SPIRAM_BOOT_INIT || CONFIG_ESP32S2_RODATA_USE_DATA_CACHE
#if CONFIG_SPIRAM_BOOT_INIT
extern void esp_config_data_cache_mode(void);
esp_config_data_cache_mode();
Cache_Enable_DCache(0);
@@ -169,12 +169,6 @@ void IRAM_ATTR call_start_cpu0(void)
}
#endif
/* Start to use data cache to access rodata. */
#if CONFIG_ESP32S2_RODATA_USE_DATA_CACHE
extern void esp_switch_rodata_to_dcache(void);
esp_switch_rodata_to_dcache();
#endif
ESP_EARLY_LOGI(TAG, "Pro cpu up.");
ESP_EARLY_LOGI(TAG, "Single core mode");