diff --git a/drivers/clock_control/Kconfig b/drivers/clock_control/Kconfig index 748fe5f6af8..8cc74500e61 100644 --- a/drivers/clock_control/Kconfig +++ b/drivers/clock_control/Kconfig @@ -9,6 +9,14 @@ # # Clock controller drivers # + +config CLOCK_CONTROL_HAS_SUBSYS_DRIVER + bool + default false + help + This option can be enabled by an external library if it + needs to take control over the clock controller. + menuconfig CLOCK_CONTROL bool "Hardware clock controller support" help @@ -23,6 +31,8 @@ module = CLOCK_CONTROL module-str = clock control source "subsys/logging/Kconfig.template.log_config" + +if !CLOCK_CONTROL_HAS_SUBSYS_DRIVER source "drivers/clock_control/Kconfig.nrf" source "drivers/clock_control/Kconfig.quark_se" @@ -37,4 +47,5 @@ source "drivers/clock_control/Kconfig.mcux_sim" source "drivers/clock_control/Kconfig.rv32m1" +endif # !CLOCK_CONTROL_HAS_SUBSYS_DRIVER endif # CLOCK_CONTROL diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index 6ac71700143..30b0aceae40 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -7,6 +7,7 @@ menuconfig CLOCK_CONTROL_NRF bool "NRF Clock controller support" depends on SOC_COMPATIBLE_NRF + default y help Enable support for the Nordic Semiconductor nRFxx series SoC clock driver. @@ -28,7 +29,7 @@ config CLOCK_CONTROL_NRF_K32SRC_DRV_NAME string "NRFx 32KHz clock device name" default "clk_k32src" -choice +choice CLOCK_CONTROL_NRF_SOURCE prompt "32KHz clock source" default CLOCK_CONTROL_NRF_K32SRC_XTAL @@ -49,7 +50,7 @@ config CLOCK_CONTROL_NRF_K32SRC_BLOCKING initially start running and automatically switch to crystal when ready. -choice +choice CLOCK_CONTROL_NRF_ACCURACY prompt "32KHz clock accuracy" default CLOCK_CONTROL_NRF_K32SRC_500PPM if CLOCK_CONTROL_NRF_K32SRC_RC default CLOCK_CONTROL_NRF_K32SRC_20PPM diff --git a/drivers/entropy/CMakeLists.txt b/drivers/entropy/CMakeLists.txt index 5e1a321a758..381a68dc3fd 100644 --- a/drivers/entropy/CMakeLists.txt +++ b/drivers/entropy/CMakeLists.txt @@ -1,10 +1,8 @@ -zephyr_library() - -zephyr_library_sources_ifdef(CONFIG_ENTROPY_ESP32_RNG entropy_esp32.c) -zephyr_library_sources_ifdef(CONFIG_ENTROPY_MCUX_RNGA entropy_mcux_rnga.c) -zephyr_library_sources_ifdef(CONFIG_ENTROPY_MCUX_TRNG entropy_mcux_trng.c) -zephyr_library_sources_ifdef(CONFIG_ENTROPY_NRF5_RNG entropy_nrf5.c) -zephyr_library_sources_ifdef(CONFIG_ENTROPY_SAM_RNG entropy_sam.c) -zephyr_library_sources_ifdef(CONFIG_ENTROPY_STM32_RNG entropy_stm32.c) -zephyr_library_sources_ifdef(CONFIG_FAKE_ENTROPY_NATIVE_POSIX fake_entropy_native_posix.c) -zephyr_library_sources_ifdef(CONFIG_USERSPACE entropy_handlers.c) +zephyr_sources_ifdef(CONFIG_ENTROPY_ESP32_RNG entropy_esp32.c) +zephyr_sources_ifdef(CONFIG_ENTROPY_MCUX_RNGA entropy_mcux_rnga.c) +zephyr_sources_ifdef(CONFIG_ENTROPY_MCUX_TRNG entropy_mcux_trng.c) +zephyr_sources_ifdef(CONFIG_ENTROPY_NRF5_RNG entropy_nrf5.c) +zephyr_sources_ifdef(CONFIG_ENTROPY_SAM_RNG entropy_sam.c) +zephyr_sources_ifdef(CONFIG_ENTROPY_STM32_RNG entropy_stm32.c) +zephyr_sources_ifdef(CONFIG_FAKE_ENTROPY_NATIVE_POSIX fake_entropy_native_posix.c) +zephyr_sources_ifdef(CONFIG_USERSPACE entropy_handlers.c) diff --git a/drivers/entropy/Kconfig b/drivers/entropy/Kconfig index ca0803f7249..27f70972229 100644 --- a/drivers/entropy/Kconfig +++ b/drivers/entropy/Kconfig @@ -6,19 +6,28 @@ # SPDX-License-Identifier: Apache-2.0 # +config ENTROPY_HAS_SUBSYS_DRIVER + bool + default false + help + This option can be enabled by an external library if it + needs to take control over the entropy driver. + menuconfig ENTROPY_GENERATOR bool "Entropy Drivers" help Include entropy drivers in system config. -if ENTROPY_GENERATOR +if ENTROPY_GENERATOR +if !ENTROPY_HAS_SUBSYS_DRIVER source "drivers/entropy/Kconfig.mcux" source "drivers/entropy/Kconfig.stm32" source "drivers/entropy/Kconfig.esp32" source "drivers/entropy/Kconfig.nrf5" source "drivers/entropy/Kconfig.sam" source "drivers/entropy/Kconfig.native_posix" +endif config ENTROPY_HAS_DRIVER bool diff --git a/drivers/entropy/Kconfig.nrf5 b/drivers/entropy/Kconfig.nrf5 index b02a49ffaee..80125646d5c 100644 --- a/drivers/entropy/Kconfig.nrf5 +++ b/drivers/entropy/Kconfig.nrf5 @@ -15,8 +15,6 @@ menuconfig ENTROPY_NRF5_RNG generator, based on internal thermal noise, that provides a random 8-bit value to the host when read. -if ENTROPY_NRF5_RNG - config ENTROPY_NRF5_BIAS_CORRECTION bool "Enable bias correction (uniform distribution)" depends on ENTROPY_NRF5_RNG @@ -61,15 +59,11 @@ config ENTROPY_NRF5_ISR_THRESHOLD buffer goes below this number hardware entropy generation will be started. - config ENTROPY_NRF5_PRI int "RNG interrupt priority" - depends on ENTROPY_NRF5_RNG range 0 2 if SOC_SERIES_NRF51X range 0 5 if SOC_COMPATIBLE_NRF52X default 2 if SOC_SERIES_NRF51X default 5 if SOC_COMPATIBLE_NRF52X help nRF5X RNG IRQ priority. - -endif #ENTROPY_NRF5_RNG diff --git a/drivers/flash/Kconfig b/drivers/flash/Kconfig index eec8f8b683b..a8b3d68e1a2 100644 --- a/drivers/flash/Kconfig +++ b/drivers/flash/Kconfig @@ -20,6 +20,13 @@ config FLASH_HAS_PAGE_LAYOUT This option is enabled when the SoC flash driver supports retrieving the layout of flash memory pages. +config FLASH_HAS_SUBSYS_DRIVER + bool + default n + help + This option can be enabled by an external library if it + needs to take control over the flash memory peripheral. + menuconfig FLASH bool "Flash hardware support" help @@ -44,9 +51,12 @@ config FLASH_PAGE_LAYOUT help Enables API for retrieving the layout of flash memory pages. +if !FLASH_HAS_SUBSYS_DRIVER + config SOC_FLASH_NRF bool "Nordic Semiconductor nRF flash driver" depends on SOC_FAMILY_NRF + default y select FLASH_HAS_PAGE_LAYOUT select FLASH_HAS_DRIVER_ENABLED help @@ -106,4 +116,5 @@ source "drivers/flash/Kconfig.sam" source "drivers/flash/Kconfig.w25qxxdv" +endif # FLASH_HAS_SUBSYS_DRIVER endif diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index 7987cc8b974..490297b62f7 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -111,7 +111,8 @@ config ALTERA_AVALON_TIMER config NRF_RTC_TIMER bool "nRF Real Time Counter (NRF_RTC1) Timer" default y - depends on CLOCK_CONTROL_NRF + depends on CLOCK_CONTROL + depends on SOC_COMPATIBLE_NRF select TICKLESS_CAPABLE help This module implements a kernel device driver for the nRF Real Time diff --git a/soc/arm/nordic_nrf/Kconfig.defconfig b/soc/arm/nordic_nrf/Kconfig.defconfig index c5294880832..6ecda95b20c 100644 --- a/soc/arm/nordic_nrf/Kconfig.defconfig +++ b/soc/arm/nordic_nrf/Kconfig.defconfig @@ -12,19 +12,19 @@ source "soc/arm/nordic_nrf/*/Kconfig.defconfig.series" config BUILD_OUTPUT_HEX default y -if FLASH +if SERIAL -config SOC_FLASH_NRF +config GPIO default y -endif # FLASH +endif # SERIAL -if ENTROPY_GENERATOR +if GPIO -config ENTROPY_NRF5_RNG +config GPIO_NRFX default y -endif # ENTROPY_GENERATOR +endif # GPIO if SPI diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.series b/soc/arm/nordic_nrf/nrf52/Kconfig.series index 73db7743f3e..ce16e9b309f 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.series +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.series @@ -13,7 +13,6 @@ config SOC_SERIES_NRF52X select SOC_FAMILY_NRF select NRF_RTC_TIMER select CLOCK_CONTROL - select CLOCK_CONTROL_NRF select SYS_POWER_DEEP_SLEEP_SUPPORTED select SYS_POWER_STATE_DEEP_SLEEP_SUPPORTED select XIP @@ -21,4 +20,4 @@ config SOC_SERIES_NRF52X select HAS_NRFX select HAS_SEGGER_RTT help - Enable support for NRF52 MCU series + Enable support for NRF52 MCU series diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 054a83f9092..693d3218430 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -144,6 +144,47 @@ source "subsys/bluetooth/common/Kconfig" source "subsys/bluetooth/host/Kconfig" source "subsys/bluetooth/controller/Kconfig" source "subsys/bluetooth/shell/Kconfig" + +config BT_HAS_HCI_VS + bool + help + This option can be enabled by an external library if it + supports the Zephyr HCI Vendor-Specific Commands and Events. + +config BT_HCI_VS + bool "Zephyr HCI Vendor-Specific Commands" + depends on BT_HAS_HCI_VS + default y + help + Enable support for the Zephyr HCI Vendor-Specific Commands in the + Host and/or Controller. This enables Set Version Information, + Supported Commands, Supported Features vendor commands. + +config BT_HCI_VS_EXT + bool "Zephyr HCI Vendor-Specific Extensions" + depends on BT_HCI_VS + default y + help + Enable support for the Zephyr HCI Vendor-Specific Extensions in the + Host and/or Controller. This enables Write BD_ADDR, Read Build Info, + Read Static Addresses and Read Key Hierarchy Roots vendor commands. + +config BT_HCI_VS_EXT_DETECT + bool "Use heuristics to guess HCI vendor extensions support in advance" + depends on BT_HCI_VS_EXT && !BT_CTLR + default y if BOARD_QEMU_X86 || BOARD_QEMU_CORTEX_M3 || BOARD_NATIVE_POSIX + help + Use some heuristics to try to guess in advance whether the controller + supports the HCI vendor extensions in advance, in order to prevent + sending vendor commands to controller which may interpret them in + completely different ways. + +config BT_HCI_MESH_EXT + bool "Mesh HCI Command support" + depends on BT_BROADCASTER && BT_OBSERVER && !BT_LL_SW_SPLIT + help + Enable support for the Bluetooth Mesh HCI Commands. + endif # BT_HCI endif # BT diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 1a7ab57ee9a..9a85efb63de 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -8,39 +8,6 @@ if BT_HCI -config BT_HCI_VS - bool "Zephyr HCI Vendor-Specific Commands" - default y - help - Enable support for the Zephyr HCI Vendor-Specific Commands in the - Host and/or Controller. This enables Set Version Information, - Supported Commands, Supported Features vendor commands. - -config BT_HCI_VS_EXT - bool "Zephyr HCI Vendor-Specific Extensions" - depends on BT_HCI_VS - default y - help - Enable support for the Zephyr HCI Vendor-Specific Extensions in the - Host and/or Controller. This enables Write BD_ADDR, Read Build Info, - Read Static Addresses and Read Key Hierarchy Roots vendor commands. - -config BT_HCI_VS_EXT_DETECT - bool "Use heuristics to guess HCI vendor extensions support in advance" - depends on BT_HCI_VS_EXT && !BT_CTLR - default y if BOARD_QEMU_X86 || BOARD_QEMU_CORTEX_M3 || BOARD_NATIVE_POSIX - help - Use some heuristics to try to guess in advance whether the controller - supports the HCI vendor extensions in advance, in order to prevent - sending vendor commands to controller which may interpret them in - completely different ways. - -config BT_HCI_MESH_EXT - bool "Mesh HCI Command support" - depends on BT_BROADCASTER && BT_OBSERVER && !BT_LL_SW_SPLIT - help - Enable support for the Bluetooth Mesh HCI Commands. - config BT_RPA # Virtual/hidden option bool diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 30658c52601..97f6e7b07fc 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -23,6 +23,7 @@ choice BT_LL_CHOICE config BT_LL_SW bool "Software-based BLE Link Layer" select BT_RECV_IS_RX_THREAD + select BT_HAS_HCI_VS select ENTROPY_GENERATOR select ENTROPY_NRF5_RNG if SOC_COMPATIBLE_NRF select ENTROPY_NRF5_BIAS_CORRECTION if SOC_COMPATIBLE_NRF diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 947d9cb6a13..899e8ac7d67 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -48,16 +48,18 @@ config BT_RX_BUF_LEN (4 bytes) and the ACL header (also 4 bytes) which yields 73 bytes. config BT_HCI_TX_STACK_SIZE + # NOTE: By _not_ having a prompt here, Kconfig will fall back on + # the default value if none of the other values are set. int default 512 if BT_H4 default 512 if BT_H5 default 416 if BT_SPI - default 940 if BT_CTLR && NO_OPTIMIZATIONS - default 640 if BT_CTLR + default 940 if BT_CTLR && (BT_LL_SW || BT_LL_SW_SPLIT) && NO_OPTIMIZATIONS + default 640 if BT_CTLR && (BT_LL_SW || BT_LL_SW_SPLIT) default 512 if BT_USERCHAN # Even if no driver is selected the following default is still # needed e.g. for unit tests. - default 512 + default 1024 help Stack size needed for executing bt_send with specified driver diff --git a/subsys/fs/Kconfig b/subsys/fs/Kconfig index de3691455fa..2eb51a6cbe1 100644 --- a/subsys/fs/Kconfig +++ b/subsys/fs/Kconfig @@ -37,7 +37,7 @@ config FAT_FILESYSTEM_ELM config FILE_SYSTEM_NFFS bool "NFFS file system support" - select FLASH_PAGE_LAYOUT + depends on FLASH_PAGE_LAYOUT select FS_FLASH_STORAGE_PARTITION help Enables NFFS file system support. diff --git a/subsys/net/l2/Kconfig b/subsys/net/l2/Kconfig index f4b0955f7fd..6459407dbf2 100644 --- a/subsys/net/l2/Kconfig +++ b/subsys/net/l2/Kconfig @@ -16,11 +16,11 @@ config NET_L2_DUMMY config NET_L2_BT bool "Enable Bluetooth support" depends on NET_IPV6 - select BT - select BT_PERIPHERAL - select BT_CENTRAL - select BT_SMP - select BT_L2CAP_DYNAMIC_CHANNEL + depends on BT + depends on BT_PERIPHERAL + depends on BT_CENTRAL + depends on BT_SMP + depends on BT_L2CAP_DYNAMIC_CHANNEL select NET_6LO help Enable Bluetooth driver that send and receives IPv6 packets, diff --git a/subsys/net/l2/openthread/Kconfig b/subsys/net/l2/openthread/Kconfig index 8a27ef72eb4..de067195528 100644 --- a/subsys/net/l2/openthread/Kconfig +++ b/subsys/net/l2/openthread/Kconfig @@ -11,8 +11,8 @@ # menuconfig NET_L2_OPENTHREAD bool "OpenThread L2" - depends on FLASH - depends on FLASH_PAGE_LAYOUT + depends on FLASH_HAS_DRIVER_ENABLED + depends on FLASH_HAS_PAGE_LAYOUT depends on CPLUSPLUS depends on REBOOT select OPENTHREAD_PLAT