From ddfe1f6affbd8c0dcbdca823a17e7a0bd3c4b187 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Mon, 14 Feb 2022 10:12:01 +0100 Subject: [PATCH] boards: Use BOARD.config pattern for kconfig Many simple kconfig configurations are added to boards and brought in with the board name. This makes a common import of these configs so one only requires adding a BOARD.config without having to alter the makefile. --- boards/bastwan/Makefile.features | 6 ------ boards/esp32-wemos-lolin-d32-pro/Makefile.features | 6 ------ boards/esp32-wrover-kit/Makefile.features | 6 ------ boards/hamilton/Makefile.features | 6 ------ boards/mulle/Makefile.features | 6 ------ boards/pinetime/Makefile.features | 6 ------ boards/ruuvitag/Makefile.features | 6 ------ boards/stm32f429i-disco/Makefile.features | 6 ------ boards/stm32mp157c-dk2/Makefile.features | 6 ------ boards/yarm/Makefile.features | 6 ------ makefiles/kconfig.mk | 6 ++++++ 11 files changed, 6 insertions(+), 60 deletions(-) diff --git a/boards/bastwan/Makefile.features b/boards/bastwan/Makefile.features index 6fe3facd51..34844a03b4 100644 --- a/boards/bastwan/Makefile.features +++ b/boards/bastwan/Makefile.features @@ -15,9 +15,3 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += highlevel_stdio - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/bastwan.config -endif diff --git a/boards/esp32-wemos-lolin-d32-pro/Makefile.features b/boards/esp32-wemos-lolin-d32-pro/Makefile.features index 98d65e5c62..34ad97fa54 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Makefile.features +++ b/boards/esp32-wemos-lolin-d32-pro/Makefile.features @@ -11,9 +11,3 @@ FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += arduino - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(BOARDDIR)/esp32-wemos-lolin-d32-pro.config -endif diff --git a/boards/esp32-wrover-kit/Makefile.features b/boards/esp32-wrover-kit/Makefile.features index 4061dc907c..2a0f9909d0 100644 --- a/boards/esp32-wrover-kit/Makefile.features +++ b/boards/esp32-wrover-kit/Makefile.features @@ -15,9 +15,3 @@ FEATURES_PROVIDED += esp_rtc_timer_32k FEATURES_PROVIDED += esp_jtag FEATURES_PROVIDED += arduino - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/$(BOARD).config -endif diff --git a/boards/hamilton/Makefile.features b/boards/hamilton/Makefile.features index 37ff3dfe0b..d22e086b51 100644 --- a/boards/hamilton/Makefile.features +++ b/boards/hamilton/Makefile.features @@ -10,9 +10,3 @@ FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(BOARDDIR)/hamilton.config -endif diff --git a/boards/mulle/Makefile.features b/boards/mulle/Makefile.features index 58744387ea..2898318971 100644 --- a/boards/mulle/Makefile.features +++ b/boards/mulle/Makefile.features @@ -18,9 +18,3 @@ FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/mulle.config -endif diff --git a/boards/pinetime/Makefile.features b/boards/pinetime/Makefile.features index e3296d8ec1..53578f9b44 100644 --- a/boards/pinetime/Makefile.features +++ b/boards/pinetime/Makefile.features @@ -6,10 +6,4 @@ FEATURES_PROVIDED += periph_spi #FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += vdd_lc_filter_reg1 -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/pinetime.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/ruuvitag/Makefile.features b/boards/ruuvitag/Makefile.features index 5b18c93a3d..8c1feef43f 100644 --- a/boards/ruuvitag/Makefile.features +++ b/boards/ruuvitag/Makefile.features @@ -5,10 +5,4 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += vdd_lc_filter_reg1 -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1,$(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/ruuvitag.config -endif - include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/stm32f429i-disco/Makefile.features b/boards/stm32f429i-disco/Makefile.features index fae01d5a11..56052cb132 100644 --- a/boards/stm32f429i-disco/Makefile.features +++ b/boards/stm32f429i-disco/Makefile.features @@ -1,9 +1,3 @@ FEATURES_PROVIDED += highlevel_stdio include $(RIOTBOARD)/stm32f429i-disc1/Makefile.features - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_ADD_CONFIG += $(BOARDDIR)/stm32f429i-disco.config -endif diff --git a/boards/stm32mp157c-dk2/Makefile.features b/boards/stm32mp157c-dk2/Makefile.features index 9a97fe19ec..8849551dd9 100644 --- a/boards/stm32mp157c-dk2/Makefile.features +++ b/boards/stm32mp157c-dk2/Makefile.features @@ -5,9 +5,3 @@ CPU_MODEL = stm32mp157cac FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/$(BOARD).config -endif diff --git a/boards/yarm/Makefile.features b/boards/yarm/Makefile.features index cefe1dd6b3..579f61f0a5 100644 --- a/boards/yarm/Makefile.features +++ b/boards/yarm/Makefile.features @@ -14,9 +14,3 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += riotboot - -# This configuration enables modules that are only available when using Kconfig -# module modelling -ifeq (1, $(TEST_KCONFIG)) - KCONFIG_BOARD_CONFIG += $(BOARDDIR)/yarm.config -endif diff --git a/makefiles/kconfig.mk b/makefiles/kconfig.mk index 20a94d1f86..de1c216c70 100644 --- a/makefiles/kconfig.mk +++ b/makefiles/kconfig.mk @@ -37,6 +37,12 @@ export KCONFIG_EXTERNAL_PKG_CONFIGS = $(GENERATED_DIR)/Kconfig.external_pkgs ifeq (1,$(TEST_KCONFIG)) # This file will contain application default configurations KCONFIG_APP_CONFIG = $(APPDIR)/app.config.test + # This configuration enables modules that are only available when using Kconfig + # module modelling + # Bring in all board specific configurations if present + ifneq (,$(wildcard $(BOARDDIR)/$(BOARD).config)) + KCONFIG_BOARD_CONFIG += $(BOARDDIR)/$(BOARD).config + endif else # This file will contain application default configurations KCONFIG_APP_CONFIG = $(APPDIR)/app.config