You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/09/23 09:49:18 UTC

[incubator-nuttx] 01/03: esp32_spiflash.c/esp32_spiram.c: Remove some unused macros/functions/variables.

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

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

commit 2834d2a46f198933d8671227208d1a8e8724d58b
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Tue Sep 21 14:34:32 2021 +0200

    esp32_spiflash.c/esp32_spiram.c: Remove some unused macros/functions/variables.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_psram.c    | 10 ------
 arch/xtensa/src/esp32/esp32_spiflash.c |  3 --
 arch/xtensa/src/esp32/esp32_spiram.c   | 60 ----------------------------------
 3 files changed, 73 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_psram.c b/arch/xtensa/src/esp32/esp32_psram.c
index 87672d0..6b9ec45 100644
--- a/arch/xtensa/src/esp32/esp32_psram.c
+++ b/arch/xtensa/src/esp32/esp32_psram.c
@@ -52,10 +52,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
 #define RTC_VDDSDIO_TIEH_1_8V      0  /* TIEH field value for 1.8V VDDSDIO */
 #define RTC_VDDSDIO_TIEH_3_3V      1  /* TIEH field value for 3.3V VDDSDIO */
 
@@ -338,12 +334,6 @@ static int psram_2t_mode_check(psram_spi_num_t spi_num);
 #endif
 
 /****************************************************************************
- * ROM function prototypes
- ****************************************************************************/
-
-extern void ets_delay_us(int delay_us);
-
-/****************************************************************************
  * Private Functions
  ****************************************************************************/
 
diff --git a/arch/xtensa/src/esp32/esp32_spiflash.c b/arch/xtensa/src/esp32/esp32_spiflash.c
index fab43c1..295bfec 100644
--- a/arch/xtensa/src/esp32/esp32_spiflash.c
+++ b/arch/xtensa/src/esp32/esp32_spiflash.c
@@ -90,9 +90,6 @@
 #  define  MIN(a, b) (((a) < (b)) ? (a) : (b))
 #endif
 
-#define DPORT_INTERRUPT_DISABLE()
-#define DPORT_INTERRUPT_RESTORE()
-
 /* Flash MMU table for PRO CPU */
 
 #define PRO_MMU_TABLE ((volatile uint32_t *)DPORT_PRO_FLASH_MMU_TABLE_REG)
diff --git a/arch/xtensa/src/esp32/esp32_spiram.c b/arch/xtensa/src/esp32/esp32_spiram.c
index c95f73a..1d82a95 100644
--- a/arch/xtensa/src/esp32/esp32_spiram.c
+++ b/arch/xtensa/src/esp32/esp32_spiram.c
@@ -47,10 +47,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
 #ifndef CONFIG_SMP
 #  define PSRAM_MODE PSRAM_VADDR_MODE_NORMAL
 #else
@@ -75,10 +71,6 @@
 #  error "FLASH speed can only be equal to or higher than SRAM speed while SRAM is enabled!"
 #endif
 
-#if defined(CONFIG_BOOT_SDRAM_DATA)
-extern uint8_t _ext_ram_bss_start;
-extern uint8_t _ext_ram_bss_end;
-#endif
 static bool spiram_inited = false;
 
 /****************************************************************************
@@ -324,58 +316,6 @@ int esp_spiram_init(void)
   return OK;
 }
 
-#if 0
-/* DMA is not supported yet */
-
-static uint8_t *dma_heap;
-
-int esp_spiram_reserve_dma_pool(size_t size)
-{
-  minfo("Reserving pool of %dK of internal memory for DMA/internal\
-        allocations", size / 1024);
-
-  /* Pool may be allocated in multiple non-contiguous chunks, depending on
-   * available RAM
-   */
-
-  while (size > 0)
-    {
-      size_t next_size = heap_caps_get_largest_free_block(MALLOC_CAP_DMA |
-                         MALLOC_CAP_INTERNAL);
-
-      next_size = MIN(next_size, size);
-
-      minfo("Allocating block of size %d bytes", next_size);
-
-      dma_heap = heap_caps_malloc(next_size, MALLOC_CAP_DMA |
-                                  MALLOC_CAP_INTERNAL);
-
-      if (!dma_heap || next_size == 0)
-        {
-          return ESP_ERR_NO_MEM;
-        }
-
-      uint32_t caps[] =
-                        {
-                          0, MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL,
-                          MALLOC_CAP_8BIT | MALLOC_CAP_32BIT
-                        };
-
-      int e = heap_caps_add_region_with_caps(caps, (intptr_t) dma_heap,
-                                   (intptr_t) dma_heap + next_size - 1);
-
-      if (e != ESP_OK)
-        {
-          return e;
-        }
-
-      size -= next_size;
-    }
-
-  return OK;
-}
-#endif
-
 size_t esp_spiram_get_size(void)
 {
   int size = esp_spiram_get_chip_size();