Merged in ziggurat29/nuttx/stm32l4_qspi_001 (pull request #1)
add MTD support for Micron N25Qxxx family of QSPI flash
This commit is contained in:
commit
329acb075f
@ -16,7 +16,7 @@ config MTD_PARTITION
|
|||||||
accesses do not extend outside of the partition.
|
accesses do not extend outside of the partition.
|
||||||
|
|
||||||
A FLASH device may be broken up into several partitions managed,
|
A FLASH device may be broken up into several partitions managed,
|
||||||
each managed by a separate MTD driver. The MTD parition interface
|
each managed by a separate MTD driver. The MTD partition interface
|
||||||
is described in:
|
is described in:
|
||||||
|
|
||||||
include/nuttx/mtd/mtd.h
|
include/nuttx/mtd/mtd.h
|
||||||
@ -43,7 +43,7 @@ config MTD_SECT512
|
|||||||
If enabled, a MTD driver will be created that will convert the
|
If enabled, a MTD driver will be created that will convert the
|
||||||
sector size of any other MTD driver to a 512 byte "apparent" sector
|
sector size of any other MTD driver to a 512 byte "apparent" sector
|
||||||
size. The managed MTD driver in this case must have an erase block
|
size. The managed MTD driver in this case must have an erase block
|
||||||
size that is greater than 512B and an event multiple of 512B.
|
size that is greater than 512B and an even multiple of 512B.
|
||||||
|
|
||||||
if MTD_SECT512
|
if MTD_SECT512
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ config MTD_CONFIG_RAM_CONSOLIDATE
|
|||||||
(For configurations that have only a single erase block assigned
|
(For configurations that have only a single erase block assigned
|
||||||
to the config device, RAM consolidation is the ONLY option.)
|
to the config device, RAM consolidation is the ONLY option.)
|
||||||
|
|
||||||
Another apporach is to allow the driver to use the entire MTD
|
Another approach is to allow the driver to use the entire MTD
|
||||||
device (or partition) to save config data, and then allocate a
|
device (or partition) to save config data, and then allocate a
|
||||||
RAM buffer (the size of one erase block) to perform the
|
RAM buffer (the size of one erase block) to perform the
|
||||||
consolidation. Enabling this feature basically trades off RAM
|
consolidation. Enabling this feature basically trades off RAM
|
||||||
@ -305,7 +305,7 @@ config AT24XX_MULTI
|
|||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Build in additional support for multiple AT24XX devices, each with
|
Build in additional support for multiple AT24XX devices, each with
|
||||||
dynamically allocated device structures wiath a separate I2C
|
dynamically allocated device structures with a separate I2C
|
||||||
addresses (but otherwise identical -- support for multiple, different
|
addresses (but otherwise identical -- support for multiple, different
|
||||||
AT24xx, devices not yet supported).
|
AT24xx, devices not yet supported).
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ config AT24XX_EXTENDED
|
|||||||
bool "Extended memory"
|
bool "Extended memory"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
If the device supports extended memory, then this operion may be set
|
If the device supports extended memory, then this operation may be set
|
||||||
to enabled the MTDIOC_EXTENDED ioctl() operation. When the
|
to enabled the MTDIOC_EXTENDED ioctl() operation. When the
|
||||||
extended operation is selected, calls to the driver read method will
|
extended operation is selected, calls to the driver read method will
|
||||||
return data from the extended memory region.
|
return data from the extended memory region.
|
||||||
@ -482,7 +482,7 @@ config S25FL1_SCRAMBLE
|
|||||||
bool "Scramble data"
|
bool "Scramble data"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Requires drviver support for data scrambling/descrambling.
|
Requires driver support for data scrambling/descrambling.
|
||||||
|
|
||||||
config S25FL1_SCRAMBLE_KEY
|
config S25FL1_SCRAMBLE_KEY
|
||||||
hex "Scramble key"
|
hex "Scramble key"
|
||||||
@ -491,6 +491,36 @@ config S25FL1_SCRAMBLE_KEY
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
config MTD_N25QXXX
|
||||||
|
bool "QuadSPI-based Micron N25QXXX family FLASH"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Support the N25Q016A, N25Q032A, N25Q064A, N25Q128A, N25Q256A
|
||||||
|
|
||||||
|
|
||||||
|
if MTD_N25QXXX
|
||||||
|
|
||||||
|
config N25QXXX_QSPIMODE
|
||||||
|
int "N25QXXX QuadSPI Mode"
|
||||||
|
default 0
|
||||||
|
---help---
|
||||||
|
This device can operate in SPI mode 0 or 3.
|
||||||
|
|
||||||
|
config N25QXXX_QSPI_FREQUENCY
|
||||||
|
int "N25QXXX QuadSPI Frequency"
|
||||||
|
default 108000000
|
||||||
|
---help---
|
||||||
|
- Clock frequency for all SPI commands except for Read Data
|
||||||
|
command (0x03)
|
||||||
|
- Clock frequency for Read Data command (0x03): 54 MHz
|
||||||
|
In this implementation, only "Quad" reads are performed.
|
||||||
|
|
||||||
|
config N25QXXX_SECTOR512
|
||||||
|
bool "Simulate 512 byte Erase Blocks"
|
||||||
|
default n
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config MTD_SMART
|
config MTD_SMART
|
||||||
bool "Sector Mapped Allocation for Really Tiny (SMART) Flash support"
|
bool "Sector Mapped Allocation for Really Tiny (SMART) Flash support"
|
||||||
default n
|
default n
|
||||||
|
@ -104,6 +104,10 @@ ifeq ($(CONFIG_MTD_S25FL1),y)
|
|||||||
CSRCS += s25fl1.c
|
CSRCS += s25fl1.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_MTD_N25QXXX),y)
|
||||||
|
CSRCS += n25qxxx.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTD_SMART),y)
|
ifeq ($(CONFIG_MTD_SMART),y)
|
||||||
ifeq ($(CONFIG_FS_SMARTFS),y)
|
ifeq ($(CONFIG_FS_SMARTFS),y)
|
||||||
CSRCS += smart.c
|
CSRCS += smart.c
|
||||||
|
1503
drivers/mtd/n25qxxx.c
Normal file
1503
drivers/mtd/n25qxxx.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -513,6 +513,19 @@ struct qspi_dev_s; /* Forward reference */
|
|||||||
FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi,
|
FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi,
|
||||||
bool unprotect);
|
bool unprotect);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: n25qxxx_initialize
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Create an initialize MTD device instance for the QuadSPI-based N25Qxxx
|
||||||
|
* FLASH part from Micron.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
struct qspi_dev_s; /* Forward reference */
|
||||||
|
FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi,
|
||||||
|
bool unprotect);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_flashinitialize
|
* Name: up_flashinitialize
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user