From 805a77b13abc710815cfb1a0c55fec0d4086a77d Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 28 Sep 2021 19:39:48 +0200 Subject: [PATCH 1/9] cpu/efm32: model Kconfig --- cpu/efm32/Kconfig | 19 ++++++--- cpu/efm32/Makefile.features | 7 ++++ cpu/efm32/drivers/coretemp/Kconfig | 19 +++++++++ cpu/efm32/efm32.config | 1 + cpu/efm32/families/efm32gg/Kconfig | 8 ++++ cpu/efm32/families/efm32hg/Kconfig | 8 ++++ cpu/efm32/families/efm32lg/Kconfig | 8 ++++ cpu/efm32/families/efm32pg12b/Kconfig | 8 ++++ cpu/efm32/families/efm32pg1b/Kconfig | 8 ++++ cpu/efm32/families/efm32zg/Kconfig | 8 ++++ cpu/efm32/families/efr32mg12p/Kconfig | 8 ++++ cpu/efm32/families/efr32mg1b/Kconfig | 8 ++++ cpu/efm32/families/efr32mg1p/Kconfig | 8 ++++ cpu/efm32/families/ezr32wg/Kconfig | 8 ++++ cpu/efm32/periph/Kconfig | 56 +++++++++++++++++++++++++++ 15 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 cpu/efm32/drivers/coretemp/Kconfig create mode 100644 cpu/efm32/efm32.config create mode 100644 cpu/efm32/periph/Kconfig diff --git a/cpu/efm32/Kconfig b/cpu/efm32/Kconfig index 61ab6abc39..b3cb7fe977 100644 --- a/cpu/efm32/Kconfig +++ b/cpu/efm32/Kconfig @@ -18,6 +18,9 @@ config CPU_COMMON_EFM32 select HAS_PERIPH_WDT select HAVE_SHARED_PERIPH_RTT_PERIPH_RTC + select PACKAGE_GECKO_SDK if TEST_KCONFIG + select PACKAGE_CMSIS-DSP if CPU_CORE_CORTEX_M0PLUS && TEST_KCONFIG + config CPU_EFM32_SERIES0 bool @@ -36,15 +39,19 @@ config HAS_CPU_EFM32 help Indicates that the CPU being used is an EFM32. -## Definition of EFM32-specific drivers ## -config HAS_EFM32_CORETEMP - bool - help - Indicates that the EFM32 coretemp driver is being used. - ## Common CPU symbols config CPU default "efm32" if CPU_COMMON_EFM32 +config ERROR_MODULES_CONFLICT + default "On the EFM32, the RTC and RTT map to the same hardware peripheral." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT + depends on CPU_COMMON_EFM32 + +menu "EFM32 drivers" +rsource "drivers/coretemp/Kconfig" +endmenu + +rsource "periph/Kconfig" + orsource "families/*/Kconfig" source "$(RIOTCPU)/cortexm_common/Kconfig" diff --git a/cpu/efm32/Makefile.features b/cpu/efm32/Makefile.features index 2d182abfda..e7bd4ce41e 100644 --- a/cpu/efm32/Makefile.features +++ b/cpu/efm32/Makefile.features @@ -33,3 +33,10 @@ ifeq (1,$(EFM32_LEUART_ENABLED)) endif include $(RIOTCPU)/cortexm_common/Makefile.features + +# Add efm32 configurations after including cortexm_common so efm32 takes precendence +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1,$(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/efm32/efm32.config +endif diff --git a/cpu/efm32/drivers/coretemp/Kconfig b/cpu/efm32/drivers/coretemp/Kconfig new file mode 100644 index 0000000000..e1c62faea3 --- /dev/null +++ b/cpu/efm32/drivers/coretemp/Kconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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_EFM32_CORETEMP + bool "EFM32 internal temperature sensor driver" + depends on TEST_KCONFIG + depends on HAS_EFM32_CORETEMP + depends on HAS_PERIPH_ADC + select MODULE_PERIPH_ADC + +config HAS_EFM32_CORETEMP + bool + select MODULE_EFM32_CORETEMP if MODULE_SAUL_DEFAULT && HAS_PERIPH_ADC + help + Indicates that the EFM32 coretemp driver is being used. diff --git a/cpu/efm32/efm32.config b/cpu/efm32/efm32.config new file mode 100644 index 0000000000..811b1f3712 --- /dev/null +++ b/cpu/efm32/efm32.config @@ -0,0 +1 @@ +CONFIG_MODULE_PM_LAYERED=y diff --git a/cpu/efm32/families/efm32gg/Kconfig b/cpu/efm32/families/efm32gg/Kconfig index 6fa14e93ac..aedf09d01a 100644 --- a/cpu/efm32/families/efm32gg/Kconfig +++ b/cpu/efm32/families/efm32gg/Kconfig @@ -11,6 +11,14 @@ config CPU_FAM_EFM32GG select CPU_EFM32_SERIES0 select HAS_CORTEXM_MPU +config MODULE_CPU_EFM32GG + bool + depends on CPU_FAM_EFM32GG + depends on TEST_KCONFIG + default y + help + EFM32GG family-specific code. + ## CPU Models config CPU_MODEL_EFM32GG330F512 bool diff --git a/cpu/efm32/families/efm32hg/Kconfig b/cpu/efm32/families/efm32hg/Kconfig index 3581caecf8..afd74eb2bf 100644 --- a/cpu/efm32/families/efm32hg/Kconfig +++ b/cpu/efm32/families/efm32hg/Kconfig @@ -10,6 +10,14 @@ config CPU_FAM_EFM32HG select CPU_COMMON_EFM32 select CPU_EFM32_SERIES0 +config MODULE_CPU_EFM32HG + bool + depends on CPU_FAM_EFM32HG + depends on TEST_KCONFIG + default y + help + EFM32HG family-specific code. + ## CPU Models config CPU_MODEL_EFM32HG210F32 bool diff --git a/cpu/efm32/families/efm32lg/Kconfig b/cpu/efm32/families/efm32lg/Kconfig index baace37b23..59a1aba849 100644 --- a/cpu/efm32/families/efm32lg/Kconfig +++ b/cpu/efm32/families/efm32lg/Kconfig @@ -11,6 +11,14 @@ config CPU_FAM_EFM32LG select CPU_EFM32_SERIES0 select HAS_CORTEXM_MPU +config MODULE_CPU_EFM32LG + bool + depends on CPU_FAM_EFM32LG + depends on TEST_KCONFIG + default y + help + EFM32LG family-specific code. + ## CPU Models config CPU_MODEL_EFM32LG990F256 bool diff --git a/cpu/efm32/families/efm32pg12b/Kconfig b/cpu/efm32/families/efm32pg12b/Kconfig index fe18fee100..ba9b78e071 100644 --- a/cpu/efm32/families/efm32pg12b/Kconfig +++ b/cpu/efm32/families/efm32pg12b/Kconfig @@ -12,6 +12,14 @@ config CPU_FAM_EFM32PG12B select HAS_PERIPH_HWRNG select HAS_CORTEXM_MPU +config MODULE_CPU_EFM32PG12B + bool + depends on CPU_FAM_EFM32PG12B + depends on TEST_KCONFIG + default y + help + EFM32PG12B family-specific code. + ## CPU Models config CPU_MODEL_EFM32PG12B500F1024IM48 bool diff --git a/cpu/efm32/families/efm32pg1b/Kconfig b/cpu/efm32/families/efm32pg1b/Kconfig index ee7b5f7f18..6abd1f0a86 100644 --- a/cpu/efm32/families/efm32pg1b/Kconfig +++ b/cpu/efm32/families/efm32pg1b/Kconfig @@ -11,6 +11,14 @@ config CPU_FAM_EFM32PG1B select CPU_EFM32_SERIES1 select HAS_CORTEXM_MPU +config MODULE_CPU_EFM32PG1B + bool + depends on CPU_FAM_EFM32PG1B + depends on TEST_KCONFIG + default y + help + EFM32PG1B family-specific code. + ## CPU Models config CPU_MODEL_EFM32PG1B200F256GM48 bool diff --git a/cpu/efm32/families/efm32zg/Kconfig b/cpu/efm32/families/efm32zg/Kconfig index d7fb299370..64a0b696b8 100644 --- a/cpu/efm32/families/efm32zg/Kconfig +++ b/cpu/efm32/families/efm32zg/Kconfig @@ -10,6 +10,14 @@ config CPU_FAM_EFM32ZG select CPU_COMMON_EFM32 select CPU_EFM32_SERIES0 +config MODULE_CPU_EFM32ZG + bool + depends on CPU_FAM_EFM32ZG + depends on TEST_KCONFIG + default y + help + EFM32ZG family-specific code. + ## CPU Models config CPU_MODEL_EFM32ZG222F16 bool diff --git a/cpu/efm32/families/efr32mg12p/Kconfig b/cpu/efm32/families/efr32mg12p/Kconfig index f6c2d5dcec..af13ca2e4e 100644 --- a/cpu/efm32/families/efr32mg12p/Kconfig +++ b/cpu/efm32/families/efr32mg12p/Kconfig @@ -12,6 +12,14 @@ config CPU_FAM_EFR32MG12P select HAS_PERIPH_HWRNG select HAS_CORTEXM_MPU +config MODULE_CPU_EFR32MG12P + bool + depends on CPU_FAM_EFR32MG12P + depends on TEST_KCONFIG + default y + help + EFR32MG12P family-specific code. + ## CPU Models config CPU_MODEL_EFR32MG12P432F1024GM68 bool diff --git a/cpu/efm32/families/efr32mg1b/Kconfig b/cpu/efm32/families/efr32mg1b/Kconfig index e9cbf23702..1d63ae4d0f 100644 --- a/cpu/efm32/families/efr32mg1b/Kconfig +++ b/cpu/efm32/families/efr32mg1b/Kconfig @@ -11,6 +11,14 @@ config CPU_FAM_EFR32MG1B select CPU_EFM32_SERIES1 select HAS_CORTEXM_MPU +config MODULE_CPU_EFR32MG1B + bool + depends on CPU_FAM_EFR32MG1B + depends on TEST_KCONFIG + default y + help + EFR32MG1B family-specific code. + ## CPU Models config CPU_MODEL_EFR32MG1B232F256GM48 bool diff --git a/cpu/efm32/families/efr32mg1p/Kconfig b/cpu/efm32/families/efr32mg1p/Kconfig index 34bade8859..012f273a68 100644 --- a/cpu/efm32/families/efr32mg1p/Kconfig +++ b/cpu/efm32/families/efr32mg1p/Kconfig @@ -11,6 +11,14 @@ config CPU_FAM_EFR32MG1P select CPU_EFM32_SERIES1 select HAS_CORTEXM_MPU +config MODULE_CPU_EFR32MG1P + bool + depends on CPU_FAM_EFR32MG1P + depends on TEST_KCONFIG + default y + help + EFR32MG1P family-specific code. + ## CPU Models config CPU_MODEL_EFR32MG1P632F256GM32 bool diff --git a/cpu/efm32/families/ezr32wg/Kconfig b/cpu/efm32/families/ezr32wg/Kconfig index 3d60b78cfb..c0d7c78376 100644 --- a/cpu/efm32/families/ezr32wg/Kconfig +++ b/cpu/efm32/families/ezr32wg/Kconfig @@ -11,6 +11,14 @@ config CPU_FAM_EZR32WG select CPU_EFM32_SERIES0 select HAS_CORTEXM_MPU +config MODULE_CPU_EZR32WG + bool + depends on CPU_FAM_EZR32WG + depends on TEST_KCONFIG + default y + help + EZR32WG family-specific code. + ## CPU Models config CPU_MODEL_EZR32WG230F128R68 bool diff --git a/cpu/efm32/periph/Kconfig b/cpu/efm32/periph/Kconfig new file mode 100644 index 0000000000..1e9b415642 --- /dev/null +++ b/cpu/efm32/periph/Kconfig @@ -0,0 +1,56 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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_PERIPH + bool + default y + +if MODULE_PERIPH + +config MODULE_PERIPH_WDT_SERIES0 + bool + depends on CPU_EFM32_SERIES0 + default MODULE_PERIPH_WDT + help + WDT driver implementation for EFM32 series 0. + +config MODULE_PERIPH_WDT_SERIES1 + bool + depends on CPU_EFM32_SERIES1 + default MODULE_PERIPH_WDT + help + WDT driver implementation for EFM32 series 1. + +config MODULE_PERIPH_RTC_SERIES0 + bool + depends on CPU_EFM32_SERIES0 + default MODULE_PERIPH_RTC + help + RTC driver implementation for EFM32 series 0. + +config MODULE_PERIPH_RTC_SERIES1 + bool + depends on CPU_EFM32_SERIES1 + default MODULE_PERIPH_RTC + help + RTC driver implementation for EFM32 series 1. + +config MODULE_PERIPH_RTT_SERIES0 + bool + depends on CPU_EFM32_SERIES0 + default MODULE_PERIPH_RTT + help + RTT driver implementation for EFM32 series 0. + +config MODULE_PERIPH_RTT_SERIES1 + bool + depends on CPU_EFM32_SERIES1 + default MODULE_PERIPH_RTT + help + RTT driver implementation for EFM32 series 1. + +endif # MODULE_PERIPH From 0e62d83edb205f9323386affe8024128e72bd86b Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 28 Sep 2021 19:40:32 +0200 Subject: [PATCH 2/9] boards: model efm32 boards Kconfig --- boards/common/silabs/Kconfig | 10 ++++++++++ boards/common/silabs/drivers/Kconfig | 10 ++++++++++ boards/common/silabs/drivers/aem/Kconfig | 13 +++++++++++++ boards/common/silabs/drivers/bc/Kconfig | 13 +++++++++++++ boards/common/silabs/drivers/pic/Kconfig | 15 +++++++++++++++ boards/common/slwstk6000b/Kconfig | 12 ++++++++++++ boards/e180-zg120b-tb/Kconfig | 2 ++ boards/ikea-tradfri/Kconfig | 3 +++ boards/slstk3400a/Kconfig | 5 +++++ boards/slstk3400a/Makefile.dep | 1 + boards/slstk3401a/Kconfig | 6 ++++++ boards/slstk3402a/Kconfig | 6 ++++++ boards/sltb001a/Kconfig | 7 +++++++ boards/slwstk6220a/Kconfig | 6 ++++++ boards/stk3200/Kconfig | 3 +++ boards/stk3600/Kconfig | 4 ++++ boards/stk3700/Kconfig | 4 ++++ 17 files changed, 120 insertions(+) create mode 100644 boards/common/silabs/drivers/Kconfig create mode 100644 boards/common/silabs/drivers/aem/Kconfig create mode 100644 boards/common/silabs/drivers/bc/Kconfig create mode 100644 boards/common/silabs/drivers/pic/Kconfig diff --git a/boards/common/silabs/Kconfig b/boards/common/silabs/Kconfig index 73d84a7f37..c425c2b2c5 100644 --- a/boards/common/silabs/Kconfig +++ b/boards/common/silabs/Kconfig @@ -9,3 +9,13 @@ config BOARD_COMMON_SILABS select HAS_ARDUINO select HAS_EFM32_CORETEMP select HAS_RIOTBOOT + +config MODULE_BOARDS_COMMON_SILABS + bool + depends on TEST_KCONFIG + depends on BOARD_COMMON_SILABS + default y + help + Common silabs board code. + +rsource "drivers/Kconfig" diff --git a/boards/common/silabs/drivers/Kconfig b/boards/common/silabs/drivers/Kconfig new file mode 100644 index 0000000000..f737042fa3 --- /dev/null +++ b/boards/common/silabs/drivers/Kconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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. +# + +rsource "aem/Kconfig" +rsource "bc/Kconfig" +rsource "pic/Kconfig" diff --git a/boards/common/silabs/drivers/aem/Kconfig b/boards/common/silabs/drivers/aem/Kconfig new file mode 100644 index 0000000000..eb69f572fc --- /dev/null +++ b/boards/common/silabs/drivers/aem/Kconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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_SILABS_AEM + bool + depends on TEST_KCONFIG + depends on BOARD_COMMON_SILABS + help + Advanced energy monitor driver for silabs boards. diff --git a/boards/common/silabs/drivers/bc/Kconfig b/boards/common/silabs/drivers/bc/Kconfig new file mode 100644 index 0000000000..203c458e71 --- /dev/null +++ b/boards/common/silabs/drivers/bc/Kconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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_SILABS_BC + bool + depends on TEST_KCONFIG + depends on BOARD_COMMON_SILABS + help + Board controller driver for silabs boards. diff --git a/boards/common/silabs/drivers/pic/Kconfig b/boards/common/silabs/drivers/pic/Kconfig new file mode 100644 index 0000000000..f86384c6d8 --- /dev/null +++ b/boards/common/silabs/drivers/pic/Kconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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_SILABS_PIC + bool + depends on TEST_KCONFIG + depends on BOARD_COMMON_SILABS + depends on HAS_PERIPH_I2C + select MODULE_PERIPH_I2C + help + Power-and-interrupt controller driver for silabs boards. diff --git a/boards/common/slwstk6000b/Kconfig b/boards/common/slwstk6000b/Kconfig index 540668e47f..46ae18bb52 100644 --- a/boards/common/slwstk6000b/Kconfig +++ b/boards/common/slwstk6000b/Kconfig @@ -15,5 +15,17 @@ config BOARD_COMMON_SLWSTK6000B select HAS_PERIPH_TIMER select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + # additional hardware present in the board + select HAVE_SAUL_GPIO + select HAVE_SI7021 + +config MODULE_BOARD_COMMON_SLWSTK6000B + bool + depends on TEST_KCONFIG + depends on BOARD_COMMON_SLWSTK6000B + select MODULE_SILABS_AEM + select MODULE_SILABS_BC + help + Common code for SLWSTK6000B silabs boards. source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/e180-zg120b-tb/Kconfig b/boards/e180-zg120b-tb/Kconfig index 7407fb8756..2d56ef67b6 100644 --- a/boards/e180-zg120b-tb/Kconfig +++ b/boards/e180-zg120b-tb/Kconfig @@ -20,4 +20,6 @@ config BOARD_E180_ZG120B_TB select HAS_EFM32_CORETEMP select HAS_RIOTBOOT + select HAVE_SAUL_GPIO + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/ikea-tradfri/Kconfig b/boards/ikea-tradfri/Kconfig index 360acedbb3..71dfa8c64b 100644 --- a/boards/ikea-tradfri/Kconfig +++ b/boards/ikea-tradfri/Kconfig @@ -20,3 +20,6 @@ config BOARD_IKEA_TRADFRI select HAS_PERIPH_UART_MODECFG select HAS_EFM32_CORETEMP select HAS_RIOTBOOT + + select HAVE_SAUL_GPIO + select HAVE_MTD_SPI_NOR diff --git a/boards/slstk3400a/Kconfig b/boards/slstk3400a/Kconfig index 9dcd10b97a..a9d76038ad 100644 --- a/boards/slstk3400a/Kconfig +++ b/boards/slstk3400a/Kconfig @@ -21,4 +21,9 @@ config BOARD_SLSTK3400A select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select MODULE_SILABS_BC if TEST_KCONFIG + # additional hardware present in the board + select HAVE_SAUL_GPIO + select HAVE_SI7021 + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/slstk3400a/Makefile.dep b/boards/slstk3400a/Makefile.dep index 36153f85fa..5f3ec86168 100644 --- a/boards/slstk3400a/Makefile.dep +++ b/boards/slstk3400a/Makefile.dep @@ -1,4 +1,5 @@ ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += efm32_coretemp USEMODULE += saul_gpio USEMODULE += si7021 endif diff --git a/boards/slstk3401a/Kconfig b/boards/slstk3401a/Kconfig index a92407ff77..46b0317a10 100644 --- a/boards/slstk3401a/Kconfig +++ b/boards/slstk3401a/Kconfig @@ -21,4 +21,10 @@ config BOARD_SLSTK3401A select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select MODULE_SILABS_AEM if TEST_KCONFIG + select MODULE_SILABS_BC if TEST_KCONFIG + # additional hardware present in the board + select HAVE_SAUL_GPIO + select HAVE_SI7021 + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/slstk3402a/Kconfig b/boards/slstk3402a/Kconfig index 51548cb3f2..002c78ab26 100644 --- a/boards/slstk3402a/Kconfig +++ b/boards/slstk3402a/Kconfig @@ -21,4 +21,10 @@ config BOARD_SLSTK3402A select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select MODULE_SILABS_AEM if TEST_KCONFIG + select MODULE_SILABS_BC if TEST_KCONFIG + # additional hardware present in the board + select HAVE_SAUL_GPIO + select HAVE_SI7021 + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/sltb001a/Kconfig b/boards/sltb001a/Kconfig index f84183f254..1c8f72e464 100644 --- a/boards/sltb001a/Kconfig +++ b/boards/sltb001a/Kconfig @@ -20,5 +20,12 @@ config BOARD_SLTB001A select HAS_PERIPH_TIMER select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select MODULE_SILABS_PIC if TEST_KCONFIG + + # additional hardware present in the board + select HAVE_SAUL_GPIO + select HAVE_BMP280_I2C + select HAVE_CCS811 + select HAVE_SI7021 source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/slwstk6220a/Kconfig b/boards/slwstk6220a/Kconfig index 2042ff533c..de84fcaed7 100644 --- a/boards/slwstk6220a/Kconfig +++ b/boards/slwstk6220a/Kconfig @@ -23,4 +23,10 @@ config BOARD_SLWSTK6220A select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select MODULE_SILABS_AEM if TEST_KCONFIG + select MODULE_SILABS_BC if TEST_KCONFIG + # additional hardware present in the board + select HAVE_SAUL_GPIO + select HAVE_SI7021 + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/stk3200/Kconfig b/boards/stk3200/Kconfig index 5ef08d3b89..bcdf27c063 100644 --- a/boards/stk3200/Kconfig +++ b/boards/stk3200/Kconfig @@ -21,4 +21,7 @@ config BOARD_STK3200 select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select HAVE_SAUL_GPIO + select MODULE_SILABS_BC if TEST_KCONFIG + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/stk3600/Kconfig b/boards/stk3600/Kconfig index 56704c4d8f..f6f8580572 100644 --- a/boards/stk3600/Kconfig +++ b/boards/stk3600/Kconfig @@ -23,4 +23,8 @@ config BOARD_STK3600 select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select HAVE_SAUL_GPIO + select MODULE_SILABS_AEM if TEST_KCONFIG + select MODULE_SILABS_BC if TEST_KCONFIG + source "$(RIOTBOARD)/common/silabs/Kconfig" diff --git a/boards/stk3700/Kconfig b/boards/stk3700/Kconfig index a083475c56..21a78fa765 100644 --- a/boards/stk3700/Kconfig +++ b/boards/stk3700/Kconfig @@ -23,4 +23,8 @@ config BOARD_STK3700 select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + select HAVE_SAUL_GPIO + select MODULE_SILABS_AEM if TEST_KCONFIG + select MODULE_SILABS_BC if TEST_KCONFIG + source "$(RIOTBOARD)/common/silabs/Kconfig" From f1902b30fff5f705fa9fcc521dae6f1ee7b59e14 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 28 Sep 2021 19:41:08 +0200 Subject: [PATCH 3/9] pkg/gecko_sdk: model Kconfig --- pkg/Kconfig | 1 + pkg/gecko_sdk/Kconfig | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 pkg/gecko_sdk/Kconfig diff --git a/pkg/Kconfig b/pkg/Kconfig index 50a70066d5..c1854bc80a 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -17,6 +17,7 @@ rsource "driver_sx126x/Kconfig" rsource "elk/Kconfig" rsource "emlearn/Kconfig" rsource "fff/Kconfig" +rsource "gecko_sdk/Kconfig" rsource "gemmlowp/Kconfig" rsource "hacl/Kconfig" rsource "heatshrink/Kconfig" diff --git a/pkg/gecko_sdk/Kconfig b/pkg/gecko_sdk/Kconfig new file mode 100644 index 0000000000..f4059241b5 --- /dev/null +++ b/pkg/gecko_sdk/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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 PACKAGE_GECKO_SDK + bool "Vendor library for EFM/EFR/EZR32 MCUs" + depends on TEST_KCONFIG + help + Vendor library for EFM/EFR/EZR32 targets by Silicon Labs. + See: https://siliconlabs.github.io/Gecko_SDK_Doc/ + +if PACKAGE_GECKO_SDK + +config MODULE_GECKO_SDK_EMLIB + bool + default y + help + EMLIB is a low-level peripheral support library that provides a unified + API for all EFM32, EZR32 and EFR32 MCUs and SoCs from Silicon Labs. + +config MODULE_GECKO_SDK_EMLIB_EXTRA + bool + default y + help + Extra utility methods from EMBLIB vendor library. + +endif # PACKAGE_GECKO_SDK From 0a3f603cf1ac6c6aa2c26a607c7ce2c8f7c8b6ae Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 29 Sep 2021 09:32:14 +0200 Subject: [PATCH 4/9] pkg/cmsis-dsp: use lowercase modules --- pkg/cmsis-dsp/Makefile | 5 ++++- pkg/cmsis-dsp/Makefile.dep | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pkg/cmsis-dsp/Makefile b/pkg/cmsis-dsp/Makefile index 680618ab5e..635bd18a29 100644 --- a/pkg/cmsis-dsp/Makefile +++ b/pkg/cmsis-dsp/Makefile @@ -5,6 +5,9 @@ PKG_LICENSE=Apache-2.0 include $(RIOTBASE)/pkg/pkg.mk +# include makefiles utils tools +include $(RIOTMAKE)/utils/strings.mk + CMSIS_DSP_MODULES = \ cmsis-dsp_BasicMathFunctions \ cmsis-dsp_CommonTables \ @@ -22,4 +25,4 @@ CMSIS_DSP_MODULES = \ all: $(CMSIS_DSP_MODULES) cmsis-dsp_%: - $(MAKE) -C $(PKG_SOURCE_DIR)/CMSIS/DSP/Source/$* -f $(CURDIR)/Makefile.cmsis-dsp MODULE=$@ + $(MAKE) -C $(PKG_SOURCE_DIR)/CMSIS/DSP/Source/$* -f $(CURDIR)/Makefile.cmsis-dsp MODULE=$(call lowercase,$@) diff --git a/pkg/cmsis-dsp/Makefile.dep b/pkg/cmsis-dsp/Makefile.dep index 464f8ab837..60d7759293 100644 --- a/pkg/cmsis-dsp/Makefile.dep +++ b/pkg/cmsis-dsp/Makefile.dep @@ -1,10 +1,10 @@ -USEMODULE += cmsis-dsp_BasicMathFunctions -USEMODULE += cmsis-dsp_CommonTables -USEMODULE += cmsis-dsp_ComplexMathFunctions -USEMODULE += cmsis-dsp_ControllerFunctions -USEMODULE += cmsis-dsp_FastMathFunctions -USEMODULE += cmsis-dsp_FilteringFunctions -USEMODULE += cmsis-dsp_MatrixFunctions -USEMODULE += cmsis-dsp_StatisticsFunctions -USEMODULE += cmsis-dsp_SupportFunctions -USEMODULE += cmsis-dsp_TransformFunctions +USEMODULE += cmsis-dsp_basicmathfunctions +USEMODULE += cmsis-dsp_commontables +USEMODULE += cmsis-dsp_complexmathfunctions +USEMODULE += cmsis-dsp_controllerfunctions +USEMODULE += cmsis-dsp_fastmathfunctions +USEMODULE += cmsis-dsp_filteringfunctions +USEMODULE += cmsis-dsp_matrixfunctions +USEMODULE += cmsis-dsp_statisticsfunctions +USEMODULE += cmsis-dsp_supportfunctions +USEMODULE += cmsis-dsp_transformfunctions From 2b20e66bc58294db4fe7805d64ae1231560d9585 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 28 Sep 2021 19:41:26 +0200 Subject: [PATCH 5/9] pkg/cmsis-dsp: model Kconfig --- pkg/Kconfig | 1 + pkg/cmsis-dsp/Kconfig | 77 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 pkg/cmsis-dsp/Kconfig diff --git a/pkg/Kconfig b/pkg/Kconfig index c1854bc80a..26f4b61513 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -10,6 +10,7 @@ rsource "arduino_sdi_12/Kconfig" rsource "c25519/Kconfig" rsource "cayenne-lpp/Kconfig" rsource "cifra/Kconfig" +rsource "cmsis-dsp/Kconfig" rsource "cn-cbor/Kconfig" rsource "driver_atwinc15x0/Kconfig" rsource "driver_bme680/Kconfig" diff --git a/pkg/cmsis-dsp/Kconfig b/pkg/cmsis-dsp/Kconfig new file mode 100644 index 0000000000..79c8a2ff50 --- /dev/null +++ b/pkg/cmsis-dsp/Kconfig @@ -0,0 +1,77 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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 PACKAGE_CMSIS-DSP + bool "DSP ARM CMSIS package" + depends on TEST_KCONFIG + help + This package uses DSP ARM CMSIS header from the official ARM github repo: + https://github.com/ARM-software/CMSIS_5. + +if PACKAGE_CMSIS-DSP + +config MODULE_CMSIS-DSP_BASICMATHFUNCTIONS + bool + default y + help + CMSIS DSP basic math functions. + +config MODULE_CMSIS-DSP_COMMONTABLES + bool + default y + help + CMSIS DSP common tables. + +config MODULE_CMSIS-DSP_COMPLEXMATHFUNCTIONS + bool + default y + help + CMSIS DSP complex math functions. + +config MODULE_CMSIS-DSP_CONTROLLERFUNCTIONS + bool + default y + help + CMSIS DSP controller functions. + +config MODULE_CMSIS-DSP_FASTMATHFUNCTIONS + bool + default y + help + CMSIS DSP fast math functions. + +config MODULE_CMSIS-DSP_FILTERINGFUNCTIONS + bool + default y + help + CMSIS DSP filtering functions. + +config MODULE_CMSIS-DSP_MATRIXFUNCTIONS + bool + default y + help + CMSIS DSP matrix functions. + +config MODULE_CMSIS-DSP_STATISTICSFUNCTIONS + bool + default y + help + CMSIS DSP statistics functions. + +config MODULE_CMSIS-DSP_SUPPORTFUNCTIONS + bool + default y + help + CMSIS DSP support functions. + +config MODULE_CMSIS-DSP_TRANSFORMFUNCTIONS + bool + default y + help + CMSIS DSP transform functions. + +endif # PACKAGE_CMSIS-DSP From 07ce49e25e1915277019bbe180707cb12aef1467 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 28 Sep 2021 19:41:45 +0200 Subject: [PATCH 6/9] .murdock: add efm32-base boards for Kconfig test --- .murdock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.murdock b/.murdock index 0e2f9fc08e..fc58063861 100755 --- a/.murdock +++ b/.murdock @@ -28,6 +28,9 @@ p-nucleo-wb55 remote-revb samr21-xpro seeedstudio-gd32 +slstk3400a +sltb001a +slwstk6220a "} : ${TEST_KCONFIG_ENFORCE_APP_GROUPS:=" From ab84ec51340cdab6aa9d6b4375e5a5f444953d2a Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 12 Nov 2021 14:57:37 +0100 Subject: [PATCH 7/9] drivers/bmx280: rework Kconfig model --- drivers/bmx280/Kconfig | 39 +++++++++++++++++++++++------ tests/driver_bmx280/app.config.test | 1 + 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/drivers/bmx280/Kconfig b/drivers/bmx280/Kconfig index 125e1fc5df..8aaa770554 100644 --- a/drivers/bmx280/Kconfig +++ b/drivers/bmx280/Kconfig @@ -5,19 +5,25 @@ # directory for more details. # -choice +menuconfig MODULE_BMX280 bool "BMx280 Temperature, pressure and humidity sensors" - optional depends on TEST_KCONFIG help The driver supports both BME280 and BMP280 connected either via SPI or I2C bus. Select one combination. +choice + bool "Sensor variant" + depends on MODULE_BMX280 + default MODULE_BME280_I2C if HAVE_BME280_I2C + default MODULE_BME280_SPI if HAVE_BME280_SPI + default MODULE_BMP280_I2C if HAVE_BMP280_I2C + default MODULE_BMP280_SPI if HAVE_BMP280_SPI + config MODULE_BME280_I2C bool "BME280 on I2C" depends on HAS_PERIPH_I2C select MODULE_PERIPH_I2C - select MODULE_BMX280 config MODULE_BME280_SPI bool "BME280 on SPI" @@ -25,13 +31,11 @@ config MODULE_BME280_SPI depends on HAS_PERIPH_GPIO select MODULE_PERIPH_SPI select MODULE_PERIPH_GPIO - select MODULE_BMX280 config MODULE_BMP280_I2C bool "BMP280 on I2C" depends on HAS_PERIPH_I2C select MODULE_PERIPH_I2C - select MODULE_BMX280 config MODULE_BMP280_SPI bool "BMP280 on SPI" @@ -39,10 +43,29 @@ config MODULE_BMP280_SPI depends on HAS_PERIPH_GPIO select MODULE_PERIPH_SPI select MODULE_PERIPH_GPIO - select MODULE_BMX280 endchoice -config MODULE_BMX280 +config HAVE_BME280_I2C bool - depends on TEST_KCONFIG + select MODULE_BMX280 if MODULE_SAUL_DEFAULT + help + Indicates that a bme280 is present on the I2C bus. + +config HAVE_BME280_SPI + bool + select MODULE_BMX280 if MODULE_SAUL_DEFAULT + help + Indicates that a bme280 is present on the SPI bus. + +config HAVE_BMP280_I2C + bool + select MODULE_BMX280 if MODULE_SAUL_DEFAULT + help + Indicates that a bmp280 is present on the I2C bus. + +config HAVE_BMP280_SPI + bool + select MODULE_BMX280 if MODULE_SAUL_DEFAULT + help + Indicates that a bmp280 is present on the SPI bus. diff --git a/tests/driver_bmx280/app.config.test b/tests/driver_bmx280/app.config.test index 1c765ce9ec..1e81884c02 100644 --- a/tests/driver_bmx280/app.config.test +++ b/tests/driver_bmx280/app.config.test @@ -1,5 +1,6 @@ # this file enables modules defined in Kconfig. Do not use this file for # application configuration. This is only needed during migration. +CONFIG_MODULE_BMX280=y CONFIG_MODULE_BME280_I2C=y CONFIG_MODULE_FMT=y CONFIG_MODULE_XTIMER=y From a8d679062a87494f41b0f6e5cbb6eef79d70e5ca Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 12 Nov 2021 14:58:14 +0100 Subject: [PATCH 8/9] drivers/ccs811/kconfig: add feature symbol --- drivers/ccs811/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/ccs811/Kconfig b/drivers/ccs811/Kconfig index fd50203f37..95c2eccbff 100644 --- a/drivers/ccs811/Kconfig +++ b/drivers/ccs811/Kconfig @@ -26,3 +26,9 @@ config MODULE_CCS811_FULL - data ready and threshold interrupt handling - compensate gas readings using an external sensor - manual baseline handling + +config HAVE_CCS811 + bool + select MODULE_CCS811 if MODULE_SAUL_DEFAULT + help + Indicates that a ccs811 sensor is present. From 6a1340da26a40c3b905262cea1d92fc31b208fcc Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 12 Nov 2021 14:59:26 +0100 Subject: [PATCH 9/9] drivers/si70xx/kconfig: rework --- drivers/si70xx/Kconfig | 75 ++++++++++++++++++----------- tests/driver_si70xx/app.config.test | 1 + 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/drivers/si70xx/Kconfig b/drivers/si70xx/Kconfig index 4b20913573..c265b7475e 100644 --- a/drivers/si70xx/Kconfig +++ b/drivers/si70xx/Kconfig @@ -5,36 +5,55 @@ # directory for more details. # -if TEST_KCONFIG - -choice - bool "Si7006/13/20/21 temperature and humidity sensors" - optional - depends on HAS_PERIPH_I2C - depends on TEST_KCONFIG - -config MODULE_SI7006 - bool "SI7006" - select MODULE_SI70XX - -config MODULE_SI7013 - bool "SI7013" - select MODULE_SI70XX - -config MODULE_SI7020 - bool "SI7020" - select MODULE_SI70XX - -config MODULE_SI7021 - bool "SI7021" - select MODULE_SI70XX - -endchoice - config MODULE_SI70XX - bool + bool "Si7006/13/20/21 temperature and humidity sensors" + depends on TEST_KCONFIG depends on HAS_PERIPH_I2C select MODULE_PERIPH_I2C select MODULE_XTIMER -endif # TEST_KCONFIG +choice + bool "Sensor variant" + depends on MODULE_SI70XX + default MODULE_SI7006 if HAVE_SI7006 + default MODULE_SI7013 if HAVE_SI7013 + default MODULE_SI7020 if HAVE_SI7020 + default MODULE_SI7021 if HAVE_SI7021 + +config MODULE_SI7006 + bool "SI7006" + +config MODULE_SI7013 + bool "SI7013" + +config MODULE_SI7020 + bool "SI7020" + +config MODULE_SI7021 + bool "SI7021" + +endchoice + +config HAVE_SI7006 + bool + select MODULE_SI70XX if MODULE_SAUL_DEFAULT + help + Indicates that a si7006 sensor is present. + +config HAVE_SI7013 + bool + select MODULE_SI70XX if MODULE_SAUL_DEFAULT + help + Indicates that a si7013 sensor is present. + +config HAVE_SI7020 + bool + select MODULE_SI70XX if MODULE_SAUL_DEFAULT + help + Indicates that a si7020 sensor is present. + +config HAVE_SI7021 + bool + select MODULE_SI70XX if MODULE_SAUL_DEFAULT + help + Indicates that a si7021 sensor is present. \ No newline at end of file diff --git a/tests/driver_si70xx/app.config.test b/tests/driver_si70xx/app.config.test index 29fa5bbaab..cb5672d30e 100644 --- a/tests/driver_si70xx/app.config.test +++ b/tests/driver_si70xx/app.config.test @@ -2,4 +2,5 @@ # application configuration. This is only needed during migration. # This test should also work with Si7006, Si7013 and Si7020 variants. +CONFIG_MODULE_SI70XX=y CONFIG_MODULE_SI7021=y