MTD: Add driver for Macronix QuadSPI flash memory

This commit is contained in:
Simon Piriou
2017-08-06 10:51:17 -06:00
committed by Gregory Nutt
parent 0a4650d1ee
commit b1f50490bd
5 changed files with 854 additions and 2 deletions
+1
View File
@@ -65,6 +65,7 @@
#include "stm32l4_gpio.h"
#include "stm32l4_dma.h"
#include "stm32l4_qspi.h"
#include "stm32l4_rcc.h"
#include "chip/stm32l4_qspi.h"
#include "chip/stm32l4_pinmap.h"
+31
View File
@@ -572,6 +572,37 @@ config N25QXXX_SECTOR512
endif # MTD_N25QXXX
config MTD_MX25RXX
bool "QuadSPI-based Macronix MX25RXX family FLASH"
default n
---help---
Support the MX25R6435F chip
if MTD_MX25RXX
config MX25RXX_QSPIMODE
int "MX25RXX QuadSPI Mode"
default 0
---help---
This device can operate in SPI mode 0 or 3.
config MX25RXX_QSPI_FREQUENCY
int "MX25RXX QuadSPI Frequency"
default 33000000
---help---
Clock frequency for all SPI commands except for Read Data
command. Dual and Quad read methods need different frequency
in low power mode (Only Quad read is supported in this driver).
config MX25RXX_QSPI_READ_FREQUENCY
int "MX25RXX QuadSPI Read command frequency"
default 8000000
---help---
Clock frequency for read data command.
Only Quad read is supported in this driver.
endif # MTD_MX25RXX
config MTD_SMART
bool "Sector Mapped Allocation for Really Tiny (SMART) Flash support"
default n
+4
View File
@@ -128,6 +128,10 @@ ifeq ($(CONFIG_MTD_N25QXXX),y)
CSRCS += n25qxxx.c
endif
ifeq ($(CONFIG_MTD_MX25RXX),y)
CSRCS += mx25rxx.c
endif
ifeq ($(CONFIG_MTD_IS25XP),y)
CSRCS += is25xp.c
endif
File diff suppressed because it is too large Load Diff
+14 -2
View File
@@ -106,6 +106,8 @@
* Public Types
****************************************************************************/
struct qspi_dev_s; /* Forward reference */
/* The following defines the geometry for the device. It treats the device
* as though it where just an array of fixed size blocks. That is most likely
* not true, but the client will expect the device logic to do whatever is
@@ -520,7 +522,6 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *dev);
*
****************************************************************************/
struct qspi_dev_s; /* Forward reference */
FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi,
bool unprotect);
@@ -535,6 +536,18 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi,
FAR struct mtd_dev_s *mx25l_initialize_spi(FAR struct spi_dev_s *dev);
/****************************************************************************
* Name: mx25rxx_initialize_spi
*
* Description:
* Create an initialized MTD device instance for the SPI-based MX25Rx
* FLASH part.
*
****************************************************************************/
FAR struct mtd_dev_s *mx25rxx_initialize(FAR struct qspi_dev_s *qspi,
bool unprotect);
/****************************************************************************
* Name: n25qxxx_initialize
*
@@ -544,7 +557,6 @@ FAR struct mtd_dev_s *mx25l_initialize_spi(FAR struct spi_dev_s *dev);
*
****************************************************************************/
struct qspi_dev_s; /* Forward reference */
FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi,
bool unprotect);