diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 62fdff46d..89ea85087 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -179,6 +179,24 @@ config SPIRAM_CACHE_WORKAROUND_TEST This setting helps testing the SPIRAM cache workaround. It generates a lot of interrupts so the bug, if still existing, triggers quicker. +choice MEMMAP_SPIRAM_CACHE_TYPE + depends on !FREERTOS_UNICORE + prompt "Type of dual-core PSRAM caching strategy" + default MEMMAP_SPIRAM_CACHE_EVENODD + help + The PSRAM cache can work in two ways for dual-core operation: the cache of one CPU + can handle the even cache lines while the other one can handle the odd cache lines + (even/odd) or the cache of the PRO CPU handles the low 2MiB while the APP CPU cache + handles the high 2MiB. + +config MEMMAP_SPIRAM_CACHE_EVENODD + bool "Even/Odd" +config MEMMAP_SPIRAM_CACHE_LOWHIGH + bool "Low/High" + +endchoice + + choice MEMMAP_SPIRAM_TYPE prompt "Type of SPI RAM chip in use" default MEMMAP_SPIRAM_TYPE_ESPPSRAM32 diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index c2a1fcfed..fcf1cf21e 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -99,7 +99,11 @@ static const char* TAG = "cpu_start"; #if CONFIG_FREERTOS_UNICORE #define PSRAM_MODE PSRAM_VADDR_MODE_NORMAL #else +#if CONFIG_MEMMAP_SPIRAM_CACHE_EVENODD #define PSRAM_MODE PSRAM_VADDR_MODE_EVENODD +#else +#define PSRAM_MODE PSRAM_VADDR_MODE_LOWHIGH +#endif #endif /*