diff --git a/.murdock b/.murdock index 73809cb328..3e7584270d 100755 --- a/.murdock +++ b/.murdock @@ -8,10 +8,12 @@ : ${TEST_BOARDS_LLVM_COMPILE:=""} : ${TEST_KCONFIG_BOARDS_AVAILABLE:=" +dwm1001 native -samr21-xpro +nrf52840dk nucleo-f103rb remote-revb +samr21-xpro "} : ${TEST_KCONFIG_ENFORCE_APP_GROUPS:=" diff --git a/boards/common/nrf52/Kconfig b/boards/common/nrf52/Kconfig index 7b34c6a290..437bb6e43a 100644 --- a/boards/common/nrf52/Kconfig +++ b/boards/common/nrf52/Kconfig @@ -9,3 +9,5 @@ config BOARD_COMMON_NRF52 select HAS_PERIPH_RTT select HAS_PERIPH_TIMER select HAS_RIOTBOOT + + select HAVE_SAUL_NRF_TEMPERATURE diff --git a/boards/common/nrf52/Makefile.dep b/boards/common/nrf52/Makefile.dep index 9a45e5e814..dd17f3762c 100644 --- a/boards/common/nrf52/Makefile.dep +++ b/boards/common/nrf52/Makefile.dep @@ -1,11 +1,3 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_nrf_temperature endif - -ifneq (,$(filter nrf52811xxaa nrf52820xxaa nrf52833xxaa nrf52840xxaa,$(CPU_MODEL))) - # include dependencies for 802.15.4 radio - include $(RIOTBOARD)/common/nrf52/Makefile.nrf802154.dep -else - # include dependencies for BLE - include $(RIOTBOARD)/common/nrf52/Makefile.nimble.dep -endif diff --git a/boards/common/nrf52xxxdk/Kconfig b/boards/common/nrf52xxxdk/Kconfig index e23578732d..49aeac424f 100644 --- a/boards/common/nrf52xxxdk/Kconfig +++ b/boards/common/nrf52xxxdk/Kconfig @@ -4,7 +4,7 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. -config BOARD_COMMON_NRF52XXXDK +config BOARDS_COMMON_NRF52XXXDK bool select BOARD_COMMON_NRF52 select HAS_PERIPH_I2C @@ -13,4 +13,10 @@ config BOARD_COMMON_NRF52XXXDK select HAS_PERIPH_UART select HAS_VDD_LC_FILTER_REG1 + select HAVE_SAUL_GPIO + +config MODULE_BOARDS_COMMON_NRF52XXDK + bool + default y + source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/dwm1001/Kconfig b/boards/dwm1001/Kconfig index 8325cfaa08..fc9cc683cf 100644 --- a/boards/dwm1001/Kconfig +++ b/boards/dwm1001/Kconfig @@ -16,5 +16,6 @@ config BOARD_DWM1001 select HAS_PERIPH_SPI select HAS_PERIPH_UART select HAS_VDD_LC_FILTER_REG1 + select HAVE_LIS2DH12 source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/e104-bt5010a-tb/Makefile.dep b/boards/e104-bt5010a-tb/Makefile.dep index 45f77b84c5..1c7262ec32 100644 --- a/boards/e104-bt5010a-tb/Makefile.dep +++ b/boards/e104-bt5010a-tb/Makefile.dep @@ -1,5 +1,10 @@ USEMODULE += boards_common_e104_bt50xxa_tb # use nrfmin for GNRC as nimble is too large for the board -include $(RIOTBOARD)/common/nrf52/Makefile.nrfmin.dep +ifneq (,$(filter netdev_default,$(USEMODULE))) + ifeq (,$(filter nimble_% nrf802154,$(USEMODULE))) + USEMODULE += nrfmin + endif +endif + include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.dep diff --git a/boards/nrf52840dk/Kconfig b/boards/nrf52840dk/Kconfig index f37c3544a5..8a0d3a5d6d 100644 --- a/boards/nrf52840dk/Kconfig +++ b/boards/nrf52840dk/Kconfig @@ -10,10 +10,11 @@ config BOARD config BOARD_NRF52840DK bool default y - select BOARD_COMMON_NRF52XXXDK + select BOARDS_COMMON_NRF52XXXDK select CPU_MODEL_NRF52840XXAA select HAS_PERIPH_PWM select HAS_PERIPH_USBDEV select HAS_VDD_LC_FILTER_REG0 + select HAVE_MTD_SPI_NOR source "$(RIOTBOARD)/common/nrf52xxxdk/Kconfig" diff --git a/boards/nrf52dk/Kconfig b/boards/nrf52dk/Kconfig index 1f2cfc16d7..301b854987 100644 --- a/boards/nrf52dk/Kconfig +++ b/boards/nrf52dk/Kconfig @@ -10,7 +10,7 @@ config BOARD config BOARD_NRF52DK bool default y - select BOARD_COMMON_NRF52XXXDK + select BOARDS_COMMON_NRF52XXXDK select CPU_MODEL_NRF52832XXAA source "$(RIOTBOARD)/common/nrf52xxxdk/Kconfig" diff --git a/cpu/nrf52/Kconfig b/cpu/nrf52/Kconfig index 7e90eb3a2d..a652b73f85 100644 --- a/cpu/nrf52/Kconfig +++ b/cpu/nrf52/Kconfig @@ -84,4 +84,7 @@ config HAS_CPU_NRF52 help Indicates that the current cpu is 'nrf52'. +rsource "periph/Kconfig" +rsource "vectors/Kconfig" + source "$(RIOTCPU)/nrf5x_common/Kconfig" diff --git a/cpu/nrf52/Makefile.dep b/cpu/nrf52/Makefile.dep index 7b32021f35..2e72e5da33 100644 --- a/cpu/nrf52/Makefile.dep +++ b/cpu/nrf52/Makefile.dep @@ -1,5 +1,13 @@ USEMODULE += nrf52_vectors +ifneq (,$(filter nrf52811xxaa nrf52820xxaa nrf52833xxaa nrf52840xxaa,$(CPU_MODEL))) + # include dependencies for 802.15.4 radio + include $(RIOTCPU)/nrf52/Makefile.nrf802154.dep +else + # include dependencies for BLE + include $(RIOTCPU)/nrf52/Makefile.nimble.dep +endif + ifneq (,$(filter nrf802154,$(USEMODULE))) FEATURES_REQUIRED += periph_timer FEATURES_REQUIRED += radio_nrf802154 diff --git a/boards/common/nrf52/Makefile.nimble.dep b/cpu/nrf52/Makefile.nimble.dep similarity index 100% rename from boards/common/nrf52/Makefile.nimble.dep rename to cpu/nrf52/Makefile.nimble.dep diff --git a/boards/common/nrf52/Makefile.nrf802154.dep b/cpu/nrf52/Makefile.nrf802154.dep similarity index 100% rename from boards/common/nrf52/Makefile.nrf802154.dep rename to cpu/nrf52/Makefile.nrf802154.dep diff --git a/boards/common/nrf52/Makefile.nrfmin.dep b/cpu/nrf52/Makefile.nrfmin.dep similarity index 100% rename from boards/common/nrf52/Makefile.nrfmin.dep rename to cpu/nrf52/Makefile.nrfmin.dep diff --git a/cpu/nrf52/periph/Kconfig b/cpu/nrf52/periph/Kconfig new file mode 100644 index 0000000000..6905a0a163 --- /dev/null +++ b/cpu/nrf52/periph/Kconfig @@ -0,0 +1,23 @@ +# Copyright (c) 2021 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +if TEST_KCONFIG + +config MODULE_PERIPH_UART_NONBLOCKING + depends on HAS_PERIPH_UART_NONBLOCKING + depends on MODULE_PERIPH_UART + select MODULE_TSRB + +config MODULE_PERIPH_SPI + depends on HAS_PERIPH_SPI + select MODULE_PERIPH_GPIO_IRQ if CPU_MODEL_NRF52832XXAA && HAS_PERIPH_GPIO_IRQ + +config MODULE_SAUL_NRF_VDDH + bool "Internal Voltage Sensor" + depends on HAS_PERIPH_ADC + +endif # TEST_KCONFIG diff --git a/cpu/nrf52/radio/nrf802154/Kconfig b/cpu/nrf52/radio/nrf802154/Kconfig index 770343e6ce..eec1c3063c 100644 --- a/cpu/nrf52/radio/nrf802154/Kconfig +++ b/cpu/nrf52/radio/nrf802154/Kconfig @@ -24,5 +24,6 @@ endif # KCONFIG_USEMODULE_NRF802154 ## Related features config HAS_RADIO_NRF802154 bool + select HAVE_NRF5X_RADIO help Indicates that a IEEE 802.15.4 NRF52 radio is present. diff --git a/cpu/nrf52/vectors/Kconfig b/cpu/nrf52/vectors/Kconfig new file mode 100644 index 0000000000..59b908a091 --- /dev/null +++ b/cpu/nrf52/vectors/Kconfig @@ -0,0 +1,11 @@ +# Copyright (c) 2021 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config MODULE_NRF52_VECTORS + bool + depends on TEST_KCONFIG + default y diff --git a/cpu/nrf5x_common/Kconfig b/cpu/nrf5x_common/Kconfig index df6ec6e8bd..35e6e7f6a9 100644 --- a/cpu/nrf5x_common/Kconfig +++ b/cpu/nrf5x_common/Kconfig @@ -35,11 +35,13 @@ config HAS_BLE_NIMBLE_NETIF config HAS_RADIO_NRFBLE bool + select HAVE_NRF5X_RADIO help Indicates that a BLE-compatible nRF radio is present. config HAS_RADIO_NRFMIN bool + select HAVE_NRF5X_RADIO help Indicates that a radio compatible with the nRF minimal radio driver is present. @@ -56,4 +58,12 @@ config HAS_VDD_LC_FILTER_REG1 Indicates that a board is equipped with an external LC filter circuit attached to the CPUs voltage regulator stage 1. + +config MODULE_CPU_COMMON + bool + depends on TEST_KCONFIG + default y + +rsource "periph/Kconfig.nrf5x" + source "$(RIOTCPU)/cortexm_common/Kconfig" diff --git a/cpu/nrf5x_common/periph/Kconfig.nrf5x b/cpu/nrf5x_common/periph/Kconfig.nrf5x new file mode 100644 index 0000000000..ea65976bbe --- /dev/null +++ b/cpu/nrf5x_common/periph/Kconfig.nrf5x @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config HAVE_SAUL_NRF_TEMPERATURE + bool + select MODULE_SAUL_NRF_TEMPERATURE if MODULE_SAUL_DEFAULT && HAS_PERIPH_TEMPERATURE + help + Indicates that a SAUL wrapper to the temperature peripheral is present. + +if TEST_KCONFIG + +config MODULE_NRF5X_COMMON_PERIPH + bool + default y + help + nrf52 common peripheral code. + +config MODULE_VDD_LC_FILTER_REG0 + bool + depends on HAS_VDD_LC_FILTER_REG0 + default y + help + Use the LC filter attached to the CPUs voltage regulator + +config MODULE_VDD_LC_FILTER_REG1 + bool + depends on HAS_VDD_LC_FILTER_REG1 + default y + help + Use the LC filter attached to the CPUs voltage regulator + +endif # TEST_KCONFIG diff --git a/cpu/nrf5x_common/radio/Kconfig.nrf5x b/cpu/nrf5x_common/radio/Kconfig.nrf5x new file mode 100644 index 0000000000..c98a0059b6 --- /dev/null +++ b/cpu/nrf5x_common/radio/Kconfig.nrf5x @@ -0,0 +1,52 @@ +# Copyright (c) 2021 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config HAVE_NRF5X_RADIO + bool + select NRF5X_RADIO if MODULE_NETDEV_DEFAULT + help + Indicates that an NRF5X radio is present. + +if TEST_KCONFIG + +menuconfig NRF5X_RADIO + bool "nrf5x radio driver" + depends on HAVE_NRF5X_RADIO + depends on TEST_KCONFIG + +if NRF5X_RADIO + +choice NRF5X_RADIO_BACKEND + bool "nrf5x radio backend" + +config MODULE_NRF802154 + bool "Implementation of the IEEE 802.15.4 for nRF52 radio" + depends on HAS_RADIO_NRF802154 + depends on HAS_PERIPH_TIMER + select MODULE_LUID + select MODULE_PERIPH_TIMER + select MODULE_IEEE802154 + +config MODULE_NRFBLE + bool "Bluetooth low energy radio driver" + depends on HAS_RADIO_NRFBLE + help + Bluetooth low energy radio driver for nRF5x SoCs + +config MODULE_NRFMIN + bool "nrfmin radio driver" + depends on HAS_RADIO_NRFMIN + help + nrfmin radio driver for nRF51 radios + +endchoice + +endif # NRF5X_RADIO + +endif # TEST_KCONFIG + +rsource "$(RIOTCPU)/nrf52/radio/nrf802154/Kconfig" diff --git a/drivers/Kconfig.net b/drivers/Kconfig.net index c2e470d35e..37738a53c5 100644 --- a/drivers/Kconfig.net +++ b/drivers/Kconfig.net @@ -9,7 +9,8 @@ rsource "at86rf215/Kconfig" rsource "ata8520e/Kconfig" rsource "can_trx/Kconfig" rsource "cc110x/Kconfig" -source "$(RIOTCPU)/cc2538/radio/Kconfig" +rsource "$(RIOTCPU)/cc2538/radio/Kconfig" +rsource "$(RIOTCPU)/nrf5x_common/radio/Kconfig.nrf5x" rsource "dose/Kconfig" rsource "mcp2515/Kconfig" rsource "mrf24j40/Kconfig" @@ -20,5 +21,4 @@ rsource "slipdev/Kconfig" rsource "sx126x/Kconfig" rsource "sx127x/Kconfig" rsource "tja1042/Kconfig" -source "$(RIOTCPU)/nrf52/radio/nrf802154/Kconfig" endmenu # Network Device Drivers diff --git a/drivers/lis2dh12/Kconfig b/drivers/lis2dh12/Kconfig index 57ab1d5c68..75a2b5d382 100644 --- a/drivers/lis2dh12/Kconfig +++ b/drivers/lis2dh12/Kconfig @@ -5,6 +5,12 @@ # directory for more details. # +config HAVE_LIS2DH12 + bool + select MODULE_LIS2DH12 if MODULE_SAUL_DEFAULT + help + Indicates that a lisdh12 is present + menuconfig MODULE_LIS2DH12 bool "LIS2DH12 Accelerometer" depends on TEST_KCONFIG diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 21deb947a7..1c57f2cc85 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -8,38 +8,38 @@ config HAVE_MTD_AT24CXXX bool depends on MODULE_AT24CXXX - select MODULE_MTD_AT24CXXX if MODULE_MTD + imply MODULE_MTD_AT24CXXX if MODULE_MTD help Indicates that a at24cxxx EEPROM MTD is present config HAVE_MTD_AT25XXX bool depends on MODULE_AT25XXX - select MODULE_MTD_AT25XXX if MODULE_MTD + imply MODULE_MTD_AT25XXX if MODULE_MTD help Indicates that a at25xxx SPI-EEPROM MTD is present config HAVE_MTD_NATIVE bool - select MODULE_MTD_NATIVE if MODULE_MTD + imply MODULE_MTD_NATIVE if MODULE_MTD help Indicates that a native MTD is present. config HAVE_MTD_SD_SCARD bool - select MODULE_MTD_SD_CARD if MODULE_MTD + imply MODULE_MTD_SD_CARD if MODULE_MTD help Indicates that a sdcard MTD is present config HAVE_MTD_SPI_NOR bool - select MODULE_MTD_SPI_NOR if MODULE_MTD + imply MODULE_MTD_SPI_NOR if MODULE_MTD help Indicates that a spi-nor MTD is present config HAVE_MTD_SPI_MCI bool - select MODULE_MTD_MCI if MODULE_MTD + imply MODULE_MTD_MCI if MODULE_MTD help Indicates that a Multimedia Card Interface (MCI) MTD is present