feat(arch/xensa): add CONFIG_SPIRAM_MEMTEST from ESP-IDF

The CONFIG item is beneficial for startup performance tuning, so
it would be better to have it in Nuttx as well.

Co-authored-by: FunatsuTaishi <51806905+FunatsuTaishi@users.noreply.github.com>
Co-authored-by: Roy Feng <roy.feng@sony.com>
Signed-off-by: Tim Kan(SSS) <tim.kan@sony.com>
This commit is contained in:
Tim Kan(SSS)
2025-02-17 19:11:17 +08:00
committed by Xiang Xiao
parent 720c6cce6f
commit 1c6b603eec
6 changed files with 38 additions and 1 deletions
+9
View File
@@ -2032,6 +2032,15 @@ config ESP32_SPIRAM_IGNORE_NOTFOUND
panic. If this is enabled, booting will complete but no PSRAM
will be available.
config ESP32_SPIRAM_MEMTEST
bool "Run write-read test on SPIRAM during startup"
default y
depends on ESP32_SPIRAM_BOOT_INIT
---help---
If enabled, SPI RAM will be tested during initial boot.
Disabling this test will reduce startup time at the expense
of testing the external memory.
config ESP32_SPIRAM_2T_MODE
bool "Enable SPI PSRAM 2T mode"
depends on ESP32_SPIRAM
+2
View File
@@ -257,11 +257,13 @@ static noreturn_function void __esp32_start(void)
else
{
esp_spiram_init_cache();
# if defined(CONFIG_ESP32_SPIRAM_MEMTEST)
if (esp_spiram_test() != OK)
{
ets_printf("SPIRAM test failed\n");
PANIC();
}
# endif // CONFIG_ESP32_SPIRAM_MEMTEST
}
/* Set external memory bss section to zero */
+9
View File
@@ -989,6 +989,15 @@ config ESP32S2_SPIRAM_IGNORE_NOTFOUND
panic. If this is enabled, booting will complete but no PSRAM
will be available.
config ESP32S2_SPIRAM_MEMTEST
bool "Run write-read test on SPIRAM during startup"
default y
depends on ESP32S2_SPIRAM_BOOT_INIT
---help---
If enabled, SPI RAM will be tested during initial boot.
Disabling this test will reduce startup time at the expense
of testing the external memory.
endmenu # SPI RAM Configuration
menu "RTC Configuration"
+7 -1
View File
@@ -404,7 +404,13 @@ static void noreturn_function IRAM_ATTR __esp32s2_start(void)
else
{
esp_spiram_init_cache();
esp_spiram_test();
# if defined(CONFIG_ESP32S2_SPIRAM_MEMTEST)
if (esp_spiram_test() != OK)
{
ets_printf("SPIRAM test failed\n");
PANIC();
}
# endif // CONFIG_ESP32S2_SPIRAM_MEMTEST
}
#endif
+9
View File
@@ -1004,6 +1004,15 @@ config ESP32S3_SPIRAM_IGNORE_NOTFOUND
panic. If this is enabled, booting will complete but no PSRAM
will be available.
config ESP32S3_SPIRAM_MEMTEST
bool "Write-Read test on SPIRAM during startup"
default y
depends on ESP32S3_SPIRAM_BOOT_INIT
---help---
If enabled, SPI RAM will be tested during initial boot.
Disabling this test will reduce startup time at the expense
of testing the external memory.
endmenu # SPI RAM Configuration
menu "Memory Configuration"
+2
View File
@@ -407,11 +407,13 @@ noinstrument_function void noreturn_function IRAM_ATTR __esp32s3_start(void)
PANIC();
}
# if defined(CONFIG_ESP32S3_SPIRAM_MEMTEST)
if (esp_spiram_test() != OK)
{
ets_printf("SPIRAM test failed\n");
PANIC();
}
# endif // CONFIG_ESP32S3_SPIRAM_MEMTEST
}
#endif