From 50e1a49c6e7ec91c820fd7f2dc5e3f367da1a8a7 Mon Sep 17 00:00:00 2001 From: "Alan C. Assis" Date: Wed, 18 Nov 2020 11:50:20 -0300 Subject: [PATCH] Fix the SPIRAM_BANKSWITCH that was defined incorrectly --- arch/xtensa/src/esp32/Kconfig | 4 ++-- arch/xtensa/src/esp32/esp32_himem.c | 2 +- boards/xtensa/esp32/esp32-core/src/esp32_bringup.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/xtensa/src/esp32/Kconfig b/arch/xtensa/src/esp32/Kconfig index dbb15b2244..a312539c18 100644 --- a/arch/xtensa/src/esp32/Kconfig +++ b/arch/xtensa/src/esp32/Kconfig @@ -591,7 +591,7 @@ config ESP32_SPIRAM_2T_MODE Applications will not be affected unless the use the esp_himem APIs, which are not supported in 2T mode. -config SPIRAM_BANKSWITCH_ENABLE +config ESP32_SPIRAM_BANKSWITCH_ENABLE bool "Enable bank switching for >4MiB external RAM" default y help @@ -610,7 +610,7 @@ config SPIRAM_BANKSWITCH_ENABLE config SPIRAM_BANKSWITCH_RESERVE int "Amount of 32K pages to reserve for bank switching" - depends on SPIRAM_BANKSWITCH_ENABLE + depends on ESP32_SPIRAM_BANKSWITCH_ENABLE default 8 range 1 62 help diff --git a/arch/xtensa/src/esp32/esp32_himem.c b/arch/xtensa/src/esp32/esp32_himem.c index f0ae9ccddf..8b2f6556c4 100644 --- a/arch/xtensa/src/esp32/esp32_himem.c +++ b/arch/xtensa/src/esp32/esp32_himem.c @@ -70,7 +70,7 @@ /* How many 32KB pages will be reserved for bank switch */ -#if CONFIG_SPIRAM_BANKSWITCH_ENABLE +#if CONFIG_ESP32_SPIRAM_BANKSWITCH_ENABLE # define SPIRAM_BANKSWITCH_RESERVE CONFIG_SPIRAM_BANKSWITCH_RESERVE #else # define SPIRAM_BANKSWITCH_RESERVE 0 diff --git a/boards/xtensa/esp32/esp32-core/src/esp32_bringup.c b/boards/xtensa/esp32/esp32-core/src/esp32_bringup.c index de5327fe9a..487880c837 100644 --- a/boards/xtensa/esp32/esp32-core/src/esp32_bringup.c +++ b/boards/xtensa/esp32/esp32-core/src/esp32_bringup.c @@ -143,7 +143,8 @@ int esp32_bringup(void) #endif -#if defined(CONFIG_ESP32_SPIRAM) +#if defined(CONFIG_ESP32_SPIRAM) && \ + defined(CONFIG_ESP32_SPIRAM_BANKSWITCH_ENABLE) ret = esp_himem_init(); if (ret < 0) {