zephyr/drivers/flash/Kconfig.nrf

82 lines
2.6 KiB
Plaintext
Raw Normal View History

# SPDX-License-Identifier: Apache-2.0
config FLASH_NRF_FORCE_ALT
bool
depends on SOC_COMPATIBLE_NRF
help
This option can be enabled to force an alternative implementation
of the flash driver.
menuconfig SOC_FLASH_NRF
bool "Nordic Semiconductor nRF flash driver"
depends on SOC_FAMILY_NRF
kconfig: Replace some single-symbol 'if's with 'depends on' I think people might be reading differences into 'if' and 'depends on' that aren't there, like maybe 'if' being needed to "hide" a symbol, while 'depends on' just adds a dependency. There are no differences between 'if' and 'depends on'. 'if' is just a shorthand for 'depends on'. They work the same when it comes to creating implicit menus too. The way symbols get "hidden" is through their dependencies not being satisfied ('if'/'depends on' get copied up as a dependency on the prompt). Since 'if' and 'depends on' are the same, an 'if' with just a single symbol in it can be replaced with a 'depends on'. IMO, it's best to avoid 'if' there as a style choice too, because it confuses people into thinking there's deep Kconfig magic going on that requires 'if'. Going for 'depends on' can also remove some nested 'if's, which generates nicer symbol information and docs, because nested 'if's really are so simple/dumb that they just add the dependencies from both 'if's to all symbols within. Replace a bunch of single-symbol 'if's with 'depends on' to despam the Kconfig files a bit and make it clearer how things work. Also do some other minor related dependency refactoring. The replacement isn't complete. Will fix up the rest later. Splitting it a bit to make it more manageable. (Everything above is true for choices, menus, and comments as well.) Detected by tweaking the Kconfiglib parsing code. It's impossible to detect after parsing, because 'if' turns into 'depends on'. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 10:45:50 +08:00
depends on !FLASH_NRF_FORCE_ALT
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select NRFX_NVMC
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
default y
help
Enables Nordic Semiconductor nRF flash driver.
kconfig: Replace some single-symbol 'if's with 'depends on' I think people might be reading differences into 'if' and 'depends on' that aren't there, like maybe 'if' being needed to "hide" a symbol, while 'depends on' just adds a dependency. There are no differences between 'if' and 'depends on'. 'if' is just a shorthand for 'depends on'. They work the same when it comes to creating implicit menus too. The way symbols get "hidden" is through their dependencies not being satisfied ('if'/'depends on' get copied up as a dependency on the prompt). Since 'if' and 'depends on' are the same, an 'if' with just a single symbol in it can be replaced with a 'depends on'. IMO, it's best to avoid 'if' there as a style choice too, because it confuses people into thinking there's deep Kconfig magic going on that requires 'if'. Going for 'depends on' can also remove some nested 'if's, which generates nicer symbol information and docs, because nested 'if's really are so simple/dumb that they just add the dependencies from both 'if's to all symbols within. Replace a bunch of single-symbol 'if's with 'depends on' to despam the Kconfig files a bit and make it clearer how things work. Also do some other minor related dependency refactoring. The replacement isn't complete. Will fix up the rest later. Splitting it a bit to make it more manageable. (Everything above is true for choices, menus, and comments as well.) Detected by tweaking the Kconfiglib parsing code. It's impossible to detect after parsing, because 'if' turns into 'depends on'. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 10:45:50 +08:00
if SOC_FLASH_NRF
choice SOC_FLASH_NRF_RADIO_SYNC_CHOICE
prompt "Nordic nRFx flash driver synchronization"
default SOC_FLASH_NRF_RADIO_SYNC_TICKER if BT_LL_SW_SPLIT
default SOC_FLASH_NRF_RADIO_SYNC_NONE
help
synchronization between flash memory driver and radio.
config SOC_FLASH_NRF_RADIO_SYNC_TICKER
bool "Nordic nRFx flash driver synchronized with radio"
depends on BT_LL_SW_SPLIT
help
Enable synchronization between flash memory driver and radio using
BLE LL controller ticker API.
config SOC_FLASH_NRF_RADIO_SYNC_NONE
bool "none"
help
disable synchronization between flash memory driver and radio.
endchoice
config SOC_FLASH_NRF_PARTIAL_ERASE
bool "Nordic nRFx flash driver partial erase"
depends on HAS_HW_NRF_NVMC_PE
help
Enable partial erase feature. Partial erase is performed in time
slices instead of blocking MCU, for the time it is needed to
complete operation over given area.
This allows interrupting flash erase between operations
to perform other task by MCU.
This feature may also be used for better syncing flash erase
operations, when compiled with SOC_FLASH_NRF_RADIO_SYNC_TICKER,
with Bluetooth.
config SOC_FLASH_NRF_PARTIAL_ERASE_MS
int "Partial erase timeout in MS"
depends on SOC_FLASH_NRF_PARTIAL_ERASE
default 3
help
This is maximum time, in ms, that NVMC will use to erase part
of Flash, before stopping to let CPU resume operation.
Minimal timeout is 2ms maximum should not exceed half of
FLASH_PAGE_ERASE_MAX_TIME_US im ms.
config SOC_FLASH_NRF_UICR
bool "Access to UICR"
kconfig: Replace some single-symbol 'if's with 'depends on' I think people might be reading differences into 'if' and 'depends on' that aren't there, like maybe 'if' being needed to "hide" a symbol, while 'depends on' just adds a dependency. There are no differences between 'if' and 'depends on'. 'if' is just a shorthand for 'depends on'. They work the same when it comes to creating implicit menus too. The way symbols get "hidden" is through their dependencies not being satisfied ('if'/'depends on' get copied up as a dependency on the prompt). Since 'if' and 'depends on' are the same, an 'if' with just a single symbol in it can be replaced with a 'depends on'. IMO, it's best to avoid 'if' there as a style choice too, because it confuses people into thinking there's deep Kconfig magic going on that requires 'if'. Going for 'depends on' can also remove some nested 'if's, which generates nicer symbol information and docs, because nested 'if's really are so simple/dumb that they just add the dependencies from both 'if's to all symbols within. Replace a bunch of single-symbol 'if's with 'depends on' to despam the Kconfig files a bit and make it clearer how things work. Also do some other minor related dependency refactoring. The replacement isn't complete. Will fix up the rest later. Splitting it a bit to make it more manageable. (Everything above is true for choices, menus, and comments as well.) Detected by tweaking the Kconfiglib parsing code. It's impossible to detect after parsing, because 'if' turns into 'depends on'. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 10:45:50 +08:00
depends on !TRUSTED_EXECUTION_NONSECURE
help
Enable operations on UICR. Once enabled UICR are written or read as
ordinary flash memory. Erase is possible for whole UICR at once.
config SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS
bool "8-bit write block size emulation"
help
When this option is enabled writing chunks less than minimal write
block size parameter (imposed by manufacturer) is possible but operation
is more complex and requires basic user knowledge about NVMC controller.
kconfig: Replace some single-symbol 'if's with 'depends on' I think people might be reading differences into 'if' and 'depends on' that aren't there, like maybe 'if' being needed to "hide" a symbol, while 'depends on' just adds a dependency. There are no differences between 'if' and 'depends on'. 'if' is just a shorthand for 'depends on'. They work the same when it comes to creating implicit menus too. The way symbols get "hidden" is through their dependencies not being satisfied ('if'/'depends on' get copied up as a dependency on the prompt). Since 'if' and 'depends on' are the same, an 'if' with just a single symbol in it can be replaced with a 'depends on'. IMO, it's best to avoid 'if' there as a style choice too, because it confuses people into thinking there's deep Kconfig magic going on that requires 'if'. Going for 'depends on' can also remove some nested 'if's, which generates nicer symbol information and docs, because nested 'if's really are so simple/dumb that they just add the dependencies from both 'if's to all symbols within. Replace a bunch of single-symbol 'if's with 'depends on' to despam the Kconfig files a bit and make it clearer how things work. Also do some other minor related dependency refactoring. The replacement isn't complete. Will fix up the rest later. Splitting it a bit to make it more manageable. (Everything above is true for choices, menus, and comments as well.) Detected by tweaking the Kconfiglib parsing code. It's impossible to detect after parsing, because 'if' turns into 'depends on'. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 10:45:50 +08:00
endif # SOC_FLASH_NRF