gustavonihei commented on a change in pull request #5827:
URL: https://github.com/apache/incubator-nuttx/pull/5827#discussion_r832747519



##########
File path: arch/xtensa/src/esp32s2/esp32s2_spiram.c
##########
@@ -0,0 +1,450 @@
+/****************************************************************************
+ * arch/xtensa/src/esp32s2/esp32s2_spiram.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <debug.h>
+#include <string.h>
+#include <sys/param.h>
+#include <nuttx/config.h>
+#include <nuttx/spinlock.h>
+
+#include "xtensa.h"
+#include "xtensa_attr.h"
+#include "esp32s2_psram.h"
+#include "esp32s2_spiram.h"
+#include "hardware/esp32s2_soc.h"
+#include "hardware/esp32s2_cache_memory.h"
+#include "hardware/esp32s2_extmem.h"
+#include "hardware/esp32s2_iomux.h"
+
+/****************************************************************************
+ * Pre-processor Prototypes
+ ****************************************************************************/
+
+#define PSRAM_MODE PSRAM_VADDR_MODE_NORMAL
+
+#if defined(CONFIG_ESP32S2_SPIRAM)
+
+#define MMU_PAGE_TO_BYTES(page_id)      ((page_id) << 16)
+#define BYTES_TO_MMU_PAGE(bytes)        ((bytes) / MMU_PAGE_SIZE)
+
+#if defined(CONFIG_ESP32S2_SPIRAM_SPEED_40M)
+#  define PSRAM_SPEED PSRAM_CACHE_S40M
+#else  /* #if CONFIG_ESP32S2_SPIRAM_SPEED_80M */
+#  define PSRAM_SPEED PSRAM_CACHE_S80M
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+static bool g_spiram_inited;
+
+/* These variables are in bytes */
+
+static uint32_t g_allocable_vaddr_start;
+static uint32_t g_allocable_vaddr_end;
+static DRAM_ATTR uint32_t g_mapped_vaddr_start;
+
+static uint32_t g_instruction_in_spiram;
+static uint32_t g_rodata_in_spiram;
+
+#if defined(CONFIG_ESP32S2_SPIRAM_FETCH_INSTRUCTIONS)
+static int      g_instr_flash2spiram_offs;
+static uint32_t g_instr_start_page;
+static uint32_t g_instr_end_page;
+#endif
+
+#if defined(CONFIG_ESP32S2_SPIRAM_RODATA)
+static int      g_rodata_flash2spiram_offs;
+static uint32_t g_rodata_start_page;
+static uint32_t g_rodata_end_page;
+#endif
+
+#if defined(CONFIG_ESP32S2_SPIRAM_FETCH_INSTRUCTIONS) || \
+    defined(CONFIG_ES32S3_SPIRAM_RODATA)

Review comment:
       Please, double check these definitions, the second one has a typo




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to