drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2019-12-19 13:33:37 +01:00
|
|
|
# Copyright (c) 2019, Nordic Semiconductor ASA
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menuconfig NORDIC_QSPI_NOR
|
|
|
|
bool "QSPI NOR Flash"
|
2022-07-22 01:53:16 -05:00
|
|
|
default y
|
|
|
|
depends on DT_HAS_NORDIC_QSPI_NOR_ENABLED
|
drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2019-12-19 13:33:37 +01:00
|
|
|
select FLASH_HAS_DRIVER_ENABLED
|
2024-04-12 12:02:24 +00:00
|
|
|
select FLASH_HAS_PAGE_LAYOUT
|
2024-02-08 21:47:11 +00:00
|
|
|
select FLASH_HAS_EXPLICIT_ERASE
|
drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2019-12-19 13:33:37 +01:00
|
|
|
select NRFX_QSPI
|
2020-12-29 12:11:29 -06:00
|
|
|
select FLASH_JESD216
|
2023-09-19 14:02:22 +02:00
|
|
|
select PINCTRL
|
drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2019-12-19 13:33:37 +01:00
|
|
|
help
|
|
|
|
Enable support for nrfx QSPI driver with EasyDMA.
|
|
|
|
|
|
|
|
if NORDIC_QSPI_NOR
|
|
|
|
|
|
|
|
config NORDIC_QSPI_NOR_INIT_PRIORITY
|
2023-09-08 14:53:45 +01:00
|
|
|
int "Init priority"
|
|
|
|
default 41
|
drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2019-12-19 13:33:37 +01:00
|
|
|
help
|
|
|
|
Device driver initialization priority.
|
|
|
|
|
|
|
|
config NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE
|
|
|
|
int "Page size to use for FLASH_LAYOUT feature"
|
|
|
|
default 65536
|
|
|
|
help
|
|
|
|
When CONFIG_FLASH_PAGE_LAYOUT is used this driver will support
|
|
|
|
that API. By default the page size corresponds to the block
|
|
|
|
size (65536). Other option include the sector size (4096).
|
|
|
|
|
2020-06-04 12:15:02 -05:00
|
|
|
config NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE
|
2023-07-13 08:57:48 +02:00
|
|
|
int "Size of a stack-based buffer to handle writes not supported by QSPI"
|
2021-10-05 11:00:50 +00:00
|
|
|
default 4
|
2020-06-04 12:15:02 -05:00
|
|
|
help
|
2023-07-13 08:57:48 +02:00
|
|
|
The QSPI peripheral uses DMA and can only write data that is read
|
|
|
|
from a word-aligned location in RAM. A non-zero value here enables
|
|
|
|
a stack buffer to be used for any source data that does not meet
|
|
|
|
these restrictions. Such data will be copied into this buffer to
|
|
|
|
allow the write to proceed. Multiple transfers will be initiated
|
|
|
|
if the data is larger than the configured size.
|
|
|
|
Must be a multiple of 4. When set to 0, the feature is disabled.
|
2020-06-04 12:15:02 -05:00
|
|
|
|
2023-09-08 14:53:45 +01:00
|
|
|
config NORDIC_QSPI_NOR_XIP
|
|
|
|
bool "XIP (eXecute in place)"
|
|
|
|
depends on SOC_NRF5340_CPUAPP
|
|
|
|
help
|
|
|
|
Enable setting up the QSPI NOR driver to allow for execution of code
|
|
|
|
stored in QSPI XIP region. Note that for this functionality to work,
|
|
|
|
the QSPI NOR init priority must be set so that no XIP code in the
|
|
|
|
QSPI NOR flash chip is executed until the driver has been setup.
|
|
|
|
This will also disable power management for the QSPI NOR flash chip.
|
|
|
|
|
2023-12-21 14:00:12 -05:00
|
|
|
config NORDIC_QSPI_NOR_TIMEOUT_MS
|
|
|
|
int "Timeout for QSPI operations (ms)"
|
|
|
|
default 500
|
|
|
|
help
|
|
|
|
The QSPI peripheral operation timeout in milliseconds.
|
|
|
|
Primarily intended for long running operations such as
|
|
|
|
a flash sector erase. The 500 ms default allows for
|
|
|
|
most typical NOR flash chips to erase a sector.
|
|
|
|
|
drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2019-12-19 13:33:37 +01:00
|
|
|
endif # NORDIC_QSPI_NOR
|