mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user