FlexSPI NOR driver

This commit is contained in:
jturnsek
2021-04-06 21:52:53 +02:00
committed by Alan Carvalho de Assis
parent 8334843bad
commit 7453e76d98
11 changed files with 3184 additions and 1 deletions
+13
View File
@@ -168,6 +168,10 @@ config IMXRT_LPSPI
bool
default n
config IMXRT_FLEXSPI
bool
default n
config IMXRT_ADC
bool
default n
@@ -644,6 +648,15 @@ menuconfig IMXRT_LPSPI4
endmenu # LPSPI Peripherals
menu "FLEXSPI Peripherals"
menuconfig IMXRT_FLEXSPI1
bool "FLEXSPI1"
default n
select IMXRT_FLEXSPI
endmenu # FLEXSPI Peripherals
menu "ADC Peripherals"
menuconfig IMXRT_ADC1
+4
View File
@@ -138,6 +138,10 @@ ifeq ($(CONFIG_IMXRT_LPSPI),y)
CHIP_CSRCS += imxrt_lpspi.c
endif
ifeq ($(CONFIG_IMXRT_FLEXSPI),y)
CHIP_CSRCS += imxrt_flexspi.c
endif
ifeq ($(CONFIG_IMXRT_ENC),y)
CHIP_CSRCS += imxrt_enc.c
endif
File diff suppressed because it is too large Load Diff
@@ -175,4 +175,7 @@
#define IOMUX_ADC_DEFAULT (0)
#define IOMUX_FLEXSPI_DEFAULT (IOMUX_SLEW_FAST | IOMUX_DRIVE_40OHM | IOMUX_SPEED_MAX | \
IOMUX_PULL_DOWN_100K | IOMUX_PULL_KEEP | GPIO_SION_ENABLE )
#endif /* __ARCH_ARM_SRC_IMXRT_HARDWARE_IMXRT_IOMUXC_H */
File diff suppressed because it is too large Load Diff
+93
View File
@@ -0,0 +1,93 @@
/****************************************************************************
* arch/arm/src/imxrt/imxrt_flexspi.h
*
* 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.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_IMXRT_IMXRT_FLEXSPI_H
#define __ARCH_ARM_SRC_IMXRT_IMXRT_FLEXSPI_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include "chip.h"
#include "imxrt_config.h"
#ifdef CONFIG_IMXRT_FLEXSPI
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Inline Functions
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: imxrt_flexspi_initialize
*
* Description:
* Initialize the selected FlexSPI port in master mode
*
* Input Parameters:
* intf - Interface number(must be zero)
*
* Returned Value:
* Valid FlexSPI device structure reference on success; a NULL on failure
*
****************************************************************************/
struct flexspi_dev_s;
FAR struct flexspi_dev_s *imxrt_flexspi_initialize(int intf);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_IMXRT_FLEXSPI */
#endif /* __ARCH_ARM_SRC_IMXRT_IMXRT_FLEXSPI_H */
+19
View File
@@ -655,6 +655,25 @@ config W25QXXXJV_SECTOR512
endif # MTD_W25QXXXJV
config MTD_FLEXSPI_NOR
bool "FlexSPI-based NOR FLASH"
default n
---help---
Support the W25Q064JV, WIS25WP064
if MTD_FLEXSPI_NOR
config FLEXSPI_NOR_FREQUENCY
int "FlexSPI NOR Frequency"
default 133000000
---help---
Per data sheet:
133MHz Single, Dual/Quad SPI clocks
266/532MHz equivalent Dual/Quad SPI
66MB/S continuous data transfer rate
endif # MTD_FLEXSPI_NOR
config MTD_MX25RXX
bool "QuadSPI-based Macronix MX25RXX family FLASH"
default n
+4
View File
@@ -140,6 +140,10 @@ ifeq ($(CONFIG_MTD_IS25XP),y)
CSRCS += is25xp.c
endif
ifeq ($(CONFIG_MTD_FLEXSPI_NOR),y)
CSRCS += flexspi_nor.c
endif
ifeq ($(CONFIG_MTD_SMART),y)
ifeq ($(CONFIG_FS_SMARTFS),y)
CSRCS += smart.c
File diff suppressed because it is too large Load Diff
+14 -1
View File
@@ -90,7 +90,8 @@
* Public Types
****************************************************************************/
struct qspi_dev_s; /* Forward reference */
struct qspi_dev_s; /* Forward reference */
struct flexspi_dev_s; /* Forward reference */
/* The following defines the geometry for the device. It treats the device
* as though it were just an array of fixed size blocks. That is most likely
@@ -594,6 +595,18 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi,
FAR struct mtd_dev_s *w25qxxxjv_initialize(FAR struct qspi_dev_s *qspi,
bool unprotect);
/****************************************************************************
* Name: flexspi_nor_initialize
*
* Description:
* Create an initialized MTD device instance for the FlexSPI-based
* FLASH part.
*
****************************************************************************/
FAR struct mtd_dev_s *flexspi_nor_initialize(FAR struct flexspi_dev_s
*flexspi, bool unprotect);
/****************************************************************************
* Name: blockmtd_initialize
*
File diff suppressed because it is too large Load Diff