2018-11-12 23:36:24 +08:00
|
|
|
# Copyright (c) 2018 Savoir-Faire Linux.
|
2024-02-06 04:15:30 +08:00
|
|
|
# Copyright (c) 2024 Nordic Semiconductor ASA
|
|
|
|
#
|
2018-11-12 23:36:24 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menuconfig SPI_NOR
|
2019-02-27 04:12:10 +08:00
|
|
|
bool "SPI NOR Flash"
|
2022-07-22 14:53:16 +08:00
|
|
|
default y
|
|
|
|
depends on DT_HAS_JEDEC_SPI_NOR_ENABLED
|
2018-11-12 23:36:24 +08:00
|
|
|
select FLASH_HAS_DRIVER_ENABLED
|
2024-02-06 04:15:30 +08:00
|
|
|
select FLASH_HAS_EXPLICIT_ERASE
|
2020-09-06 22:28:31 +08:00
|
|
|
select FLASH_HAS_PAGE_LAYOUT
|
2020-05-31 06:44:08 +08:00
|
|
|
select FLASH_JESD216
|
2023-08-01 12:14:55 +08:00
|
|
|
select FLASH_HAS_EX_OP
|
2022-10-25 17:29:23 +08:00
|
|
|
select SPI
|
2018-11-12 23:36:24 +08:00
|
|
|
|
|
|
|
if SPI_NOR
|
|
|
|
|
2020-06-27 22:24:46 +08:00
|
|
|
choice SPI_NOR_SFDP
|
|
|
|
prompt "Source for Serial Flash Discoverable Parameters"
|
|
|
|
default SPI_NOR_SFDP_MINIMAL
|
|
|
|
|
|
|
|
config SPI_NOR_SFDP_MINIMAL
|
|
|
|
bool "Fixed flash configuration"
|
|
|
|
help
|
2023-07-12 23:02:06 +08:00
|
|
|
Synthesize a minimal configuration assuming 256 By page size (or as
|
|
|
|
set by the page-size devicetree property) and
|
2020-06-27 22:24:46 +08:00
|
|
|
standard 4 KiBy and 64 KiBy erase instructions. Requires the size and
|
|
|
|
jedec-id properties in the devicetree jedec,spi-nor node.
|
|
|
|
|
|
|
|
config SPI_NOR_SFDP_DEVICETREE
|
|
|
|
bool "Basic Flash Parameters from devicetree node"
|
|
|
|
help
|
|
|
|
The JESD216 Basic Flash Parameters table must be provided in the
|
|
|
|
sfdp-bfp property in devicetree. The size and jedec-id properties are
|
|
|
|
also required.
|
|
|
|
|
|
|
|
config SPI_NOR_SFDP_RUNTIME
|
|
|
|
bool "Read flash parameters at runtime"
|
|
|
|
help
|
|
|
|
Read all flash device characteristics from the device at runtime.
|
|
|
|
This option is the most flexible as it should provide functionality
|
|
|
|
for all supported JESD216-compatible devices.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2018-11-12 23:36:24 +08:00
|
|
|
config SPI_NOR_INIT_PRIORITY
|
2024-09-24 17:49:54 +08:00
|
|
|
int "Init priority"
|
2018-11-12 23:36:24 +08:00
|
|
|
default 80
|
|
|
|
help
|
|
|
|
Device driver initialization priority.
|
|
|
|
Device is connected to SPI bus, it has to
|
|
|
|
be initialized after SPI driver.
|
|
|
|
|
2019-01-29 02:32:26 +08:00
|
|
|
config SPI_NOR_CS_WAIT_DELAY
|
|
|
|
int "Delay time in us"
|
2018-11-12 23:36:24 +08:00
|
|
|
default 0
|
|
|
|
help
|
2019-11-01 17:24:07 +08:00
|
|
|
This is the wait delay (in us) to allow for CS switching to take effect
|
2018-11-12 23:36:24 +08:00
|
|
|
|
2024-01-23 11:49:50 +08:00
|
|
|
config SPI_NOR_SLEEP_WHILE_WAITING_UNTIL_READY
|
|
|
|
bool "Sleep while waiting for flash operations to complete"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Flash operations can take anywhere from 1ms to 240 seconds to
|
|
|
|
complete. Enabling this option adds a delay between polls on the
|
|
|
|
status register for slow operations. Disabling this option can
|
|
|
|
result in significant flash savings if this driver is the only user
|
|
|
|
of "k_sleep". This can be the case when building as a bootloader.
|
|
|
|
|
2019-07-21 07:47:11 +08:00
|
|
|
config SPI_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 options include the 32K-byte erase size
|
2019-10-29 18:18:46 +08:00
|
|
|
(32768), the sector size (4096), or any non-zero multiple of the
|
|
|
|
sector size.
|
2019-07-21 07:47:11 +08:00
|
|
|
|
2024-05-24 08:36:19 +08:00
|
|
|
config SPI_NOR_ACTIVE_DWELL_MS
|
|
|
|
int "Dwell period (ms) after last use to stay in active mode"
|
|
|
|
depends on PM_DEVICE_RUNTIME
|
|
|
|
default 10
|
|
|
|
help
|
|
|
|
Flash accesses commonly occur in bursts, where entering and exiting DPD
|
|
|
|
mode between each access adds significantly to the total operation time.
|
|
|
|
This option controls how long to remain in active mode after each API
|
|
|
|
call, eliminating the active->idle->active transition sequence if another
|
|
|
|
transaction occurs before the dwell period expires.
|
|
|
|
|
2018-11-12 23:36:24 +08:00
|
|
|
endif # SPI_NOR
|