You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by tm...@apache.org on 2024/09/02 13:24:32 UTC
(nuttx) branch master updated (f084685da8 -> 53795fd497)
This is an automated email from the ASF dual-hosted git repository.
tmedicci pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from f084685da8 sched/event: clear pending events before enable the scheduler
new c06a742a63 esp32: fix a crash with PSRAM + SMP
new 6df9de8788 esp32: fix initialization with PSRAM + SMP
new 96f19aa719 esp32: enable smp for esp32-devkitc:psram config
new 53795fd497 esp32: enable smp for esp32-devkitc:psram_usrheap config
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
arch/xtensa/src/common/espressif/esp_loader.c | 8 +++++--
arch/xtensa/src/esp32/esp32_spiram.c | 27 +++++++++++-----------
.../esp32/esp32-devkitc/configs/psram/defconfig | 6 ++++-
.../esp32-devkitc/configs/psram_usrheap/defconfig | 6 ++++-
4 files changed, 29 insertions(+), 18 deletions(-)
(nuttx) 04/04: esp32: enable smp for esp32-devkitc:psram_usrheap config
Posted by tm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tmedicci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 53795fd497d5fa7650ae7f0040debd729754ead1
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Aug 31 12:52:59 2024 +0900
esp32: enable smp for esp32-devkitc:psram_usrheap config
---
boards/xtensa/esp32/esp32-devkitc/configs/psram_usrheap/defconfig | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/psram_usrheap/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/psram_usrheap/defconfig
index 171374f6b0..7633e35a5e 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/psram_usrheap/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/psram_usrheap/defconfig
@@ -15,6 +15,7 @@ CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
CONFIG_ARCH_CHIP="esp32"
CONFIG_ARCH_CHIP_ESP32=y
CONFIG_ARCH_CHIP_ESP32WROVER=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARD_LOOPSPERMSEC=16717
@@ -38,7 +39,7 @@ CONFIG_IOB_NBUFFERS=36
CONFIG_IOB_NCHAINS=36
CONFIG_IOB_THROTTLE=8
CONFIG_MM_IOB=y
-CONFIG_MM_REGIONS=3
+CONFIG_MM_REGIONS=4
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
@@ -50,6 +51,8 @@ CONFIG_RAM_START=0x20000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_WAITPID=y
+CONFIG_SMP=y
+CONFIG_SMP_NCPUS=2
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
@@ -58,4 +61,5 @@ CONFIG_SYSTEM_NSH=y
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_MM=y
CONFIG_TESTING_OSTEST=y
+CONFIG_TESTING_SMP=y
CONFIG_UART0_SERIAL_CONSOLE=y
(nuttx) 01/04: esp32: fix a crash with PSRAM + SMP
Posted by tm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tmedicci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit c06a742a636c33199bc2284780f244dae5ada545
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Aug 28 21:26:38 2024 +0900
esp32: fix a crash with PSRAM + SMP
this function is called via esp_spiram_init_cache early in the boot.
---
arch/xtensa/src/esp32/esp32_spiram.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/arch/xtensa/src/esp32/esp32_spiram.c b/arch/xtensa/src/esp32/esp32_spiram.c
index 8eeb80b8c9..eed50e1fff 100644
--- a/arch/xtensa/src/esp32/esp32_spiram.c
+++ b/arch/xtensa/src/esp32/esp32_spiram.c
@@ -93,8 +93,8 @@ unsigned int IRAM_ATTR cache_sram_mmu_set(int cpu_no, int pid,
uint32_t regval;
#ifdef CONFIG_SMP
int cpu_to_stop = 0;
- bool smp_start = OSINIT_OS_READY();
#endif
+ const bool os_ready = OSINIT_OS_READY();
unsigned int i;
unsigned int shift;
unsigned int mask_s;
@@ -176,14 +176,18 @@ unsigned int IRAM_ATTR cache_sram_mmu_set(int cpu_no, int pid,
* the flash guards to make sure the cache is disabled.
*/
- flags = enter_critical_section();
+ flags = 0; /* suppress GCC warning */
+ if (os_ready)
+ {
+ flags = enter_critical_section();
+ }
#ifdef CONFIG_SMP
/* The other CPU might be accessing the cache at the same time, just by
* using variables in external RAM.
*/
- if (smp_start)
+ if (os_ready)
{
cpu_to_stop = up_cpu_index() == 1 ? 0 : 1;
up_cpu_pause(cpu_to_stop);
@@ -222,13 +226,17 @@ unsigned int IRAM_ATTR cache_sram_mmu_set(int cpu_no, int pid,
#ifdef CONFIG_SMP
spi_enable_cache(1);
- if (smp_start)
+ if (os_ready)
{
up_cpu_resume(cpu_to_stop);
}
#endif
- leave_critical_section(flags);
+ if (os_ready)
+ {
+ leave_critical_section(flags);
+ }
+
return 0;
}
(nuttx) 02/04: esp32: fix initialization with PSRAM + SMP
Posted by tm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tmedicci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 6df9de8788be01fa98fcbf9e43026109deb76fbc
Author: Tiago Medicci Serrano <ti...@espressif.com>
AuthorDate: Sat Aug 31 12:46:26 2024 +0900
esp32: fix initialization with PSRAM + SMP
Cache flush must be done prior to the APP cpu initalization. This,
however, must be true for the case where PSRAM is not available or
not selected. To do that, this commit flushs the cache during the
device initialization.
---
arch/xtensa/src/common/espressif/esp_loader.c | 8 ++++++--
arch/xtensa/src/esp32/esp32_spiram.c | 9 ---------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/xtensa/src/common/espressif/esp_loader.c b/arch/xtensa/src/common/espressif/esp_loader.c
index bf21c5f096..ebbf128044 100644
--- a/arch/xtensa/src/common/espressif/esp_loader.c
+++ b/arch/xtensa/src/common/espressif/esp_loader.c
@@ -273,8 +273,12 @@ int map_rom_segments(uint32_t app_drom_start, uint32_t app_drom_vaddr,
#endif
#ifdef CONFIG_ARCH_CHIP_ESP32
- cache_read_disable(0);
- cache_flush(0);
+ cache_read_disable(PRO_CPU_NUM);
+ cache_flush(PRO_CPU_NUM);
+# ifdef CONFIG_SMP
+ cache_flush(APP_CPU_NUM);
+ cache_read_enable(APP_CPU_NUM);
+# endif
#else
cache_hal_disable(CACHE_TYPE_ALL);
#endif
diff --git a/arch/xtensa/src/esp32/esp32_spiram.c b/arch/xtensa/src/esp32/esp32_spiram.c
index eed50e1fff..7eaa5295ec 100644
--- a/arch/xtensa/src/esp32/esp32_spiram.c
+++ b/arch/xtensa/src/esp32/esp32_spiram.c
@@ -68,13 +68,6 @@
# error "FLASH speed can only be equal to or higher than SRAM speed while SRAM is enabled!"
#endif
-/****************************************************************************
- * ROM Function Prototypes
- ****************************************************************************/
-
-extern void cache_flush(int cpu);
-extern void cache_read_enable(int cpu);
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -253,8 +246,6 @@ void IRAM_ATTR esp_spiram_init_cache(void)
/* Flush and enable icache for APP CPU */
#ifdef CONFIG_SMP
- cache_flush(APP_CPU_NUM);
- cache_read_enable(APP_CPU_NUM);
regval = getreg32(DPORT_APP_CACHE_CTRL1_REG);
regval &= ~(1 << DPORT_APP_CACHE_MASK_DRAM1);
putreg32(regval, DPORT_APP_CACHE_CTRL1_REG);
(nuttx) 03/04: esp32: enable smp for esp32-devkitc:psram config
Posted by tm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tmedicci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 96f19aa71964957b00310d042cbc6e67022949d2
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Aug 31 12:49:25 2024 +0900
esp32: enable smp for esp32-devkitc:psram config
---
boards/xtensa/esp32/esp32-devkitc/configs/psram/defconfig | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/psram/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/psram/defconfig
index 9450b5475e..27a3d4fbf6 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/psram/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/psram/defconfig
@@ -15,6 +15,7 @@ CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
CONFIG_ARCH_CHIP="esp32"
CONFIG_ARCH_CHIP_ESP32=y
CONFIG_ARCH_CHIP_ESP32WROVER=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARD_LOOPSPERMSEC=16717
@@ -36,7 +37,7 @@ CONFIG_IOB_NBUFFERS=36
CONFIG_IOB_NCHAINS=36
CONFIG_IOB_THROTTLE=8
CONFIG_MM_IOB=y
-CONFIG_MM_REGIONS=4
+CONFIG_MM_REGIONS=5
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
@@ -48,10 +49,13 @@ CONFIG_RAM_START=0x20000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_WAITPID=y
+CONFIG_SMP=y
+CONFIG_SMP_NCPUS=2
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSTEM_NSH=y
CONFIG_TESTING_MM=y
+CONFIG_TESTING_SMP=y
CONFIG_UART0_SERIAL_CONSOLE=y