change(cache): added cache size kconfig macro on s2

This commit is contained in:
Armando 2024-07-23 15:01:24 +08:00
parent 074ed08251
commit 23fcfcae8b
2 changed files with 11 additions and 14 deletions

View File

@ -15,20 +15,6 @@
#include "sdkconfig.h"
#include "ld.common"
#ifdef CONFIG_ESP32S2_INSTRUCTION_CACHE_8KB
#define CONFIG_ESP32S2_INSTRUCTION_CACHE_SIZE 0x2000
#else
#define CONFIG_ESP32S2_INSTRUCTION_CACHE_SIZE 0x4000
#endif
#ifdef CONFIG_ESP32S2_DATA_CACHE_0KB
#define CONFIG_ESP32S2_DATA_CACHE_SIZE 0
#elif defined CONFIG_ESP32S2_DATA_CACHE_8KB
#define CONFIG_ESP32S2_DATA_CACHE_SIZE 0x2000
#else
#define CONFIG_ESP32S2_DATA_CACHE_SIZE 0x4000
#endif
#define RAM_IRAM_START 0x40020000
#define RAM_DRAM_START 0x3FFB0000

View File

@ -14,6 +14,11 @@ menu "Cache config"
bool "16KB"
endchoice
config ESP32S2_INSTRUCTION_CACHE_SIZE
hex
default 0x2000 if ESP32S2_INSTRUCTION_CACHE_8KB
default 0x4000 if ESP32S2_INSTRUCTION_CACHE_16KB
choice ESP32S2_INSTRUCTION_CACHE_LINE_SIZE
prompt "Instruction cache line size"
default ESP32S2_INSTRUCTION_CACHE_LINE_32B
@ -43,6 +48,12 @@ menu "Cache config"
bool "16KB"
endchoice
config ESP32S2_DATA_CACHE_SIZE
hex
default 0 if ESP32S2_DATA_CACHE_0KB
default 0x2000 if ESP32S2_DATA_CACHE_8KB
default 0x4000 if ESP32S2_DATA_CACHE_16KB
choice ESP32S2_DATA_CACHE_LINE_SIZE
prompt "Data cache line size"
default ESP32S2_DATA_CACHE_LINE_32B