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 2021/01/21 23:00:15 UTC

[incubator-nuttx] branch master updated: Fix himem debug assert error

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


The following commit(s) were added to refs/heads/master by this push:
     new 394cfba  Fix himem debug assert error
394cfba is described below

commit 394cfba1d8d0d7220cb452d08f19b0967eae2efc
Author: Alan C. Assis <ac...@gmail.com>
AuthorDate: Thu Jan 21 14:50:43 2021 -0300

    Fix himem debug assert error
---
 arch/xtensa/src/esp32/esp32_spiram.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_spiram.c b/arch/xtensa/src/esp32/esp32_spiram.c
index e4c2d65..9880a8b 100644
--- a/arch/xtensa/src/esp32/esp32_spiram.c
+++ b/arch/xtensa/src/esp32/esp32_spiram.c
@@ -99,6 +99,10 @@ size_t __attribute__((weak)) esp_himem_reserved_area_size(void)
 
 void IRAM_ATTR esp_spiram_init_cache(void)
 {
+#ifdef CONFIG_SMP
+  uint32_t regval;
+#endif
+
   /* Enable external RAM in MMU */
 
   cache_sram_mmu_set(0, 0, SOC_EXTRAM_DATA_LOW, 0, 32, 128);
@@ -106,8 +110,9 @@ void IRAM_ATTR esp_spiram_init_cache(void)
   /* Flush and enable icache for APP CPU */
 
 #ifdef CONFIG_SMP
-  DPORT_CLEAR_PERI_REG_MASK(DPORT_APP_CACHE_CTRL1_REG,
-                            DPORT_APP_CACHE_MASK_DRAM1);
+  regval  = getreg32(DPORT_APP_CACHE_CTRL1_REG);
+  regval &= ~(1 << DPORT_APP_CACHE_MASK_DRAM1);
+  putreg32(regval, DPORT_APP_CACHE_CTRL1_REG);
   cache_sram_mmu_set(1, 0, SOC_EXTRAM_DATA_LOW, 0, 32, 128);
 #endif
 }