diff --git a/components/esp_system/ld/esp32s2/memory.ld.in b/components/esp_system/ld/esp32s2/memory.ld.in index 8a732b2b09..ec64034637 100644 --- a/components/esp_system/ld/esp32s2/memory.ld.in +++ b/components/esp_system/ld/esp32s2/memory.ld.in @@ -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 diff --git a/components/esp_system/port/soc/esp32s2/Kconfig.cache b/components/esp_system/port/soc/esp32s2/Kconfig.cache index fcb244ed31..06f0ebcdd1 100644 --- a/components/esp_system/port/soc/esp32s2/Kconfig.cache +++ b/components/esp_system/port/soc/esp32s2/Kconfig.cache @@ -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