drivers: flash: Update drivers to use devicetree Kconfig symbol

Update flash drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

We remove 'depend on' Kconfig for symbols that would be implied by
the devicetree node existing.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-22 01:53:16 -05:00 committed by Kumar Gala
parent 21f1c54089
commit a529c4511d
18 changed files with 47 additions and 38 deletions

View file

@ -3,6 +3,8 @@
menuconfig SPI_FLASH_AT45
bool "AT45 family flash driver"
default y
depends on DT_HAS_ATMEL_AT45_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
depends on SPI

View file

@ -3,9 +3,9 @@
config SOC_FLASH_TELINK_B91
bool "Telink Semiconductor B91 flash driver"
depends on SOC_RISCV_TELINK_B91
default y
depends on DT_HAS_TELINK_B91_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
default y
help
Enables Telink B91 flash driver.

View file

@ -3,10 +3,10 @@
config SOC_FLASH_CC13XX_CC26XX
bool "TI SimpleLink CC13xx/CC26xx flash controller driver"
depends on SOC_SERIES_CC13X2_CC26X2
default y
depends on DT_HAS_TI_CC13XX_CC26XX_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
default y
help
Enables TI SimpleLink CC13xx/CC26xx flash controller driver.

View file

@ -4,9 +4,9 @@
config SOC_FLASH_ESP32
bool "Espressif ESP32 flash driver"
default y
depends on DT_HAS_ESPRESSIF_ESP32_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
depends on SOC_ESP32 || SOC_ESP32S2 || SOC_ESP32C3
help
Enable ESP32 internal flash driver.

View file

@ -5,14 +5,11 @@
config SOC_FLASH_GECKO
bool "Silicon Labs Gecko flash driver"
depends on SOC_FAMILY_EXX32
default y
depends on DT_HAS_SILABS_GECKO_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select SOC_GECKO_MSC
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
help
Enable Silicon Labs Gecko series internal flash driver.
if SOC_FLASH_GECKO
endif # SOC_FLASH_GECKO

View file

@ -5,7 +5,8 @@
config SOC_FLASH_ITE_IT8XXX2
bool "ITE IT8XXX2 flash driver"
depends on SOC_FAMILY_RISCV_ITE
default y
depends on DT_HAS_ITE_IT8XXX2_FLASH_CONTROLLER_ENABLED
select SOC_FLASH_RAMCODE_SECTION
help
The flash driver includes support for read, write and
@ -14,6 +15,7 @@ config SOC_FLASH_ITE_IT8XXX2
config SOC_FLASH_RAMCODE_SECTION
bool
depends on SOC_FLASH_ITE_IT8XXX2
help
Enable this config to map the __ram_code section
operations of flash(flash_it8xxx2_erase,

View file

@ -3,7 +3,8 @@
config SOC_FLASH_LPC
bool "LPC flash shim driver"
depends on HAS_MCUX_IAP_LEGACY
default y
depends on DT_HAS_NXP_LPC_IAP_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
help

View file

@ -2,7 +2,11 @@
config SOC_FLASH_MCUX
bool "MCUX flash shim driver"
depends on (HAS_MCUX_FTFX || HAS_MCUX_IAP)
default y
depends on DT_HAS_NXP_LPC_IAP_ENABLED || \
DT_HAS_NXP_KINETIS_FTFA_ENABLED || \
DT_HAS_NXP_KINETIS_FTFE_ENABLED || \
DT_HAS_NXP_KINETIS_FTFL_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
@ -25,12 +29,14 @@ config CHECK_BEFORE_READING
endif # SOC_FLASH_MCUX
if HAS_MCUX_FLEXSPI
if DT_HAS_NXP_IMX_FLEXSPI_ENABLED
menu "Flexspi flash driver"
config FLASH_MCUX_FLEXSPI_NOR
bool "MCUX FlexSPI NOR driver"
default y
depends on DT_HAS_NXP_IMX_FLEXSPI_NOR_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MEMC
@ -38,6 +44,8 @@ config FLASH_MCUX_FLEXSPI_NOR
config FLASH_MCUX_FLEXSPI_MX25UM51345G
bool "MCUX FlexSPI MX25UM51345G driver"
default y
depends on DT_HAS_NXP_IMX_FLEXSPI_MX25UM51345G_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MEMC
@ -45,6 +53,8 @@ config FLASH_MCUX_FLEXSPI_MX25UM51345G
config FLASH_MCUX_FLEXSPI_HYPERFLASH
bool "MCUX FlexSPI HYPERFLASH driver"
default y
depends on DT_HAS_NXP_IMX_FLEXSPI_HYPERFLASH_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MEMC

View file

@ -1,15 +1,14 @@
# Copyright (c) 2018 Savoir-Faire Linux.
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_JEDEC_SPI_NOR := jedec,spi-nor
menuconfig SPI_NOR
bool "SPI NOR Flash"
default y
depends on DT_HAS_JEDEC_SPI_NOR_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_JESD216
depends on SPI
default $(dt_compat_enabled,$(DT_COMPAT_JEDEC_SPI_NOR))
if SPI_NOR

View file

@ -3,11 +3,11 @@
menuconfig NORDIC_QSPI_NOR
bool "QSPI NOR Flash"
default y
depends on DT_HAS_NORDIC_QSPI_NOR_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select NRFX_QSPI
select FLASH_JESD216
depends on HAS_HW_NRF_QSPI
default y
help
Enable support for nrfx QSPI driver with EasyDMA.

View file

@ -9,13 +9,16 @@ config FLASH_NRF_FORCE_ALT
menuconfig SOC_FLASH_NRF
bool "Nordic Semiconductor nRF flash driver"
depends on SOC_FAMILY_NRF
default y
depends on DT_HAS_NORDIC_NRF51_FLASH_CONTROLLER_ENABLED || \
DT_HAS_NORDIC_NRF52_FLASH_CONTROLLER_ENABLED || \
DT_HAS_NORDIC_NRF53_FLASH_CONTROLLER_ENABLED || \
DT_HAS_NORDIC_NRF91_FLASH_CONTROLLER_ENABLED
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.

View file

@ -3,7 +3,8 @@
config SOC_FLASH_RV32M1
bool "RV32M1 flash shim driver"
depends on HAS_RV32M1_FTFX
default y
depends on DT_HAS_OPENISA_RV32M1_FTFE_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
help

View file

@ -6,10 +6,9 @@
config SOC_FLASH_SAM
bool "Atmel SAM flash driver"
default y
depends on DT_HAS_ATMEL_SAM_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
depends on SOC_SERIES_SAME70 || \
SOC_SERIES_SAMV71
help
Enable the Atmel SAM series internal flash driver.

View file

@ -6,7 +6,7 @@
menuconfig SOC_FLASH_SAM0
bool "Atmel SAM0 flash driver"
default y
depends on SOC_FAMILY_SAM0
depends on DT_HAS_ATMEL_SAM0_NVMCTRL_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MPU_ALLOW_FLASH_WRITE if ARM_MPU

View file

@ -5,6 +5,8 @@
menuconfig FLASH_SIMULATOR
bool "Flash simulator"
default y
depends on DT_HAS_ZEPHYR_SIM_FLASH_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
help

View file

@ -4,14 +4,10 @@
# Copyright (c) 2017 BayLibre, SAS
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_ST_STM32_FLASH_CONTROLLER := st,stm32-flash-controller
DT_COMPAT_ST_STM32H7_FLASH_CONTROLLER := st,stm32h7-flash-controller
config SOC_FLASH_STM32
bool "STM32 flash driver"
depends on SOC_FAMILY_STM32
depends on $(dt_compat_enabled,$(DT_COMPAT_ST_STM32_FLASH_CONTROLLER)) || \
$(dt_compat_enabled,$(DT_COMPAT_ST_STM32H7_FLASH_CONTROLLER))
depends on DT_HAS_ST_STM32_FLASH_CONTROLLER_ENABLED || \
DT_HAS_ST_STM32H7_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_DRIVER_ENABLED
default y
select SOC_FLASH_STM32_V1 if SOC_SERIES_STM32F0X

View file

@ -3,12 +3,10 @@
# Copyright (c) 2022 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_ST_STM32_OSPI_NOR := st,stm32-ospi-nor
config FLASH_STM32_OSPI
bool "STM32 Octo SPI Flash driver"
depends on SOC_FAMILY_STM32
default $(dt_compat_enabled,$(DT_COMPAT_ST_STM32_OSPI_NOR))
default y
depends on DT_HAS_ST_STM32_OSPI_NOR_ENABLED
select USE_STM32_HAL_OSPI
select USE_STM32_LL_DLYB if SOC_SERIES_STM32U5X
select USE_STM32_HAL_MDMA if SOC_SERIES_STM32H7X

View file

@ -4,13 +4,12 @@
# Copyright (c) 2020 Linaro Limited
# SPDX-License-Identifier: Apache-2.0
DT_COMPAT_ST_STM32_QSPI_NOR := st,stm32-qspi-nor
DT_STM32_QUADSPI_HAS_DMA := $(dt_nodelabel_has_prop,quadspi,dmas)
config FLASH_STM32_QSPI
bool "STM32 Quad SPI Flash driver"
depends on SOC_FAMILY_STM32
default $(dt_compat_enabled,$(DT_COMPAT_ST_STM32_QSPI_NOR))
default y
depends on DT_HAS_ST_STM32_QSPI_NOR_ENABLED
select USE_STM32_HAL_QSPI
select USE_STM32_HAL_MDMA if SOC_SERIES_STM32H7X
select FLASH_HAS_DRIVER_ENABLED