You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "donghengqaz (via GitHub)" <gi...@apache.org> on 2023/05/10 11:04:46 UTC
[GitHub] [nuttx] donghengqaz commented on a diff in pull request #9136: xtensa/esp32s3: Support octal lines mode SPIRAM
donghengqaz commented on code in PR #9136:
URL: https://github.com/apache/nuttx/pull/9136#discussion_r1189743883
##########
arch/xtensa/src/esp32s3/esp32s3_psram_octal.c:
##########
@@ -0,0 +1,647 @@
+/****************************************************************************
+ * arch/xtensa/src/esp32s3/esp32s3_psram_octal.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 <stdint.h>
+#include <stddef.h>
+#include <errno.h>
+#include <debug.h>
+
+#include "xtensa.h"
+
+#include "esp32s3_gpio.h"
+#include "esp32s3_psram.h"
+#include "esp32s3_spi_timing.h"
+
+#include "hardware/esp32s3_spi_mem_reg.h"
+#include "hardware/esp32s3_iomux.h"
+#include "hardware/esp32s3_gpio.h"
+#include "hardware/esp32s3_gpio_sigmap.h"
+#include "rom/esp32s3_spiflash.h"
+#include "rom/esp32s3_opi_flash.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define OPI_PSRAM_SYNC_READ 0x0000
+#define OPI_PSRAM_SYNC_WRITE 0x8080
+#define OPI_PSRAM_REG_READ 0x4040
+#define OPI_PSRAM_REG_WRITE 0xC0C0
+#define OCT_PSRAM_RD_CMD_BITLEN 16
+#define OCT_PSRAM_WR_CMD_BITLEN 16
+#define OCT_PSRAM_ADDR_BITLEN 32
+#define OCT_PSRAM_RD_DUMMY_BITLEN (2 * (10 - 1))
+#define OCT_PSRAM_WR_DUMMY_BITLEN (2 * (5 - 1))
+
+#define OCT_PSRAM_CS_SETUP_TIME 3
+#define OCT_PSRAM_CS_HOLD_TIME 3
+#define OCT_PSRAM_CS_HOLD_DELAY 2
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct opi_psram_reg
+{
+ union mr0_u
+ {
+ struct
+ {
+ uint8_t drive_str: 2;
+ uint8_t read_latency: 3;
+ uint8_t lt: 1;
+ uint8_t rsvd0_1: 2;
+ };
+
+ uint8_t val;
+ }
+ mr0;
+
+ union mr1_u
+ {
+ struct
+ {
+ uint8_t vendor_id: 5;
+ uint8_t rsvd0_2: 3;
+ };
+
+ uint8_t val;
+ }
+ mr1;
Review Comment:
https://github.com/apache/nuttx/pull/9240, PTAL.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org