You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/11/06 15:19:59 UTC

[incubator-nuttx] 01/03: xtensa/esp32: Avoid init PSRAM when SPIRAM is not enabled

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6c37d9ff80672dee8f0d8bf3adf27b7b27ebeb86
Author: Alan C. Assis <ac...@gmail.com>
AuthorDate: Thu Nov 5 17:34:00 2020 -0300

    xtensa/esp32: Avoid init PSRAM when SPIRAM is not enabled
---
 arch/xtensa/src/esp32/Kconfig              | 1 +
 arch/xtensa/src/esp32/esp32_allocateheap.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/src/esp32/Kconfig b/arch/xtensa/src/esp32/Kconfig
index 1c92d7b..8825571 100644
--- a/arch/xtensa/src/esp32/Kconfig
+++ b/arch/xtensa/src/esp32/Kconfig
@@ -579,6 +579,7 @@ endchoice # ESP32_SPIRAM_SPEED
 
 config ESP32_SPIRAM_BOOT_INIT
 	bool "Initialize SPI RAM during startup"
+	depends on ESP32_SPIRAM
 	default "y"
 	help
 	    If this is enabled, the SPI RAM will be enabled during initial
diff --git a/arch/xtensa/src/esp32/esp32_allocateheap.c b/arch/xtensa/src/esp32/esp32_allocateheap.c
index 098a31c..41d1bee 100644
--- a/arch/xtensa/src/esp32/esp32_allocateheap.c
+++ b/arch/xtensa/src/esp32/esp32_allocateheap.c
@@ -93,7 +93,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
  *
  ****************************************************************************/
 
-#if CONFIG_MM_REGIONS > 1
+#if CONFIG_MM_REGIONS > 1 && defined(CONFIG_ESP32_SPIRAM)
 void xtensa_add_region(void)
 {
   /* Check for any additional memory regions */