From ddf3874995a5bb154729d09c42ecb3e2535a40c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 30 Sep 2019 18:58:51 +0200 Subject: [PATCH 1/2] boards/slwstk6000b: migrate to use a common/slwstk6000b Migrate the board to be implemented with a common/slwstk6000b. It is a pre step for splitting the board for each "BOARD_MODULE". --- boards/common/slwstk6000b/Makefile | 5 ++++ boards/common/slwstk6000b/Makefile.dep | 7 +++++ boards/common/slwstk6000b/Makefile.features | 14 ++++++++++ boards/common/slwstk6000b/Makefile.include | 26 ++++++++++++++++++ boards/{ => common}/slwstk6000b/board.c | 2 +- .../{ => common}/slwstk6000b/include/board.h | 2 +- .../slwstk6000b/include/gpio_params.h | 2 +- .../slwstk6000b/include/periph_conf.h | 2 +- .../{ => common}/slwstk6000b/module-info.mk | 9 ++++--- boards/{ => common}/slwstk6000b/modules.txt | 0 .../modules/slwrb4150a/include/board_module.h | 2 +- .../modules/slwrb4162a/include/board_module.h | 2 +- boards/slwstk6000b/Makefile | 4 +-- boards/slwstk6000b/Makefile.dep | 9 ++----- boards/slwstk6000b/Makefile.features | 15 +---------- boards/slwstk6000b/Makefile.include | 27 +++---------------- dist/tools/buildsystem_sanity_check/check.sh | 2 +- 17 files changed, 71 insertions(+), 59 deletions(-) create mode 100644 boards/common/slwstk6000b/Makefile create mode 100644 boards/common/slwstk6000b/Makefile.dep create mode 100644 boards/common/slwstk6000b/Makefile.features create mode 100644 boards/common/slwstk6000b/Makefile.include rename boards/{ => common}/slwstk6000b/board.c (95%) rename boards/{ => common}/slwstk6000b/include/board.h (96%) rename boards/{ => common}/slwstk6000b/include/gpio_params.h (96%) rename boards/{ => common}/slwstk6000b/include/periph_conf.h (98%) rename boards/{ => common}/slwstk6000b/module-info.mk (60%) rename boards/{ => common}/slwstk6000b/modules.txt (100%) rename boards/{ => common}/slwstk6000b/modules/slwrb4150a/include/board_module.h (98%) rename boards/{ => common}/slwstk6000b/modules/slwrb4162a/include/board_module.h (98%) diff --git a/boards/common/slwstk6000b/Makefile b/boards/common/slwstk6000b/Makefile new file mode 100644 index 0000000000..1fc4eed53a --- /dev/null +++ b/boards/common/slwstk6000b/Makefile @@ -0,0 +1,5 @@ +MODULE = board_common_slwstk6000b + +DIRS = $(RIOTBOARD)/common/silabs + +include $(RIOTBASE)/Makefile.base diff --git a/boards/common/slwstk6000b/Makefile.dep b/boards/common/slwstk6000b/Makefile.dep new file mode 100644 index 0000000000..e92caacf7f --- /dev/null +++ b/boards/common/slwstk6000b/Makefile.dep @@ -0,0 +1,7 @@ +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio + USEMODULE += si7021 +endif + +# include board common dependencies +include $(RIOTBOARD)/common/silabs/Makefile.dep diff --git a/boards/common/slwstk6000b/Makefile.features b/boards/common/slwstk6000b/Makefile.features new file mode 100644 index 0000000000..031f30d249 --- /dev/null +++ b/boards/common/slwstk6000b/Makefile.features @@ -0,0 +1,14 @@ +CPU = efm32 +# TODO move CPU_MODEL here + +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_adc +FEATURES_PROVIDED += periph_gpio periph_gpio_irq +FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_rtc +FEATURES_PROVIDED += periph_rtt +FEATURES_PROVIDED += periph_spi +FEATURES_PROVIDED += periph_timer +FEATURES_PROVIDED += periph_uart periph_uart_modecfg + +include $(RIOTBOARD)/common/silabs/Makefile.features diff --git a/boards/common/slwstk6000b/Makefile.include b/boards/common/slwstk6000b/Makefile.include new file mode 100644 index 0000000000..1070acdb89 --- /dev/null +++ b/boards/common/slwstk6000b/Makefile.include @@ -0,0 +1,26 @@ +include $(RIOTBOARD)/common/slwstk6000b/module-info.mk + +INCLUDES += -I$(RIOTBOARD)/common/slwstk6000b/include +# add module specific includes +INCLUDES += -I$(RIOTBOARD)/common/slwstk6000b/modules/$(BOARD_MODULE)/include + +export CPU_MODEL = $(MODULE_CPU) + +# set default port depending on operating system +PORT_LINUX ?= /dev/ttyACM0 +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) + +# setup serial terminal +include $(RIOTMAKE)/tools/serial.inc.mk + +# setup JLink for flashing +export JLINK_DEVICE := $(MODULE_JLINK_DEVICE) +include $(RIOTMAKE)/tools/jlink.inc.mk + +# add board common drivers +USEMODULE += boards_common_silabs +USEMODULE += silabs_aem +USEMODULE += silabs_bc + +# include board common +include $(RIOTBOARD)/common/silabs/Makefile.include diff --git a/boards/slwstk6000b/board.c b/boards/common/slwstk6000b/board.c similarity index 95% rename from boards/slwstk6000b/board.c rename to boards/common/slwstk6000b/board.c index 606e86415b..33935b751d 100644 --- a/boards/slwstk6000b/board.c +++ b/boards/common/slwstk6000b/board.c @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_slwstk6000b + * @ingroup boards_common_slwstk6000b * @{ * * @file diff --git a/boards/slwstk6000b/include/board.h b/boards/common/slwstk6000b/include/board.h similarity index 96% rename from boards/slwstk6000b/include/board.h rename to boards/common/slwstk6000b/include/board.h index 1b38307507..837876bec8 100644 --- a/boards/slwstk6000b/include/board.h +++ b/boards/common/slwstk6000b/include/board.h @@ -7,7 +7,7 @@ */ /** - * @defgroup boards_slwstk6000b Silicon Labs SLWSTK6000B starter kit + * @defgroup boards_common_slwstk6000b Silicon Labs SLWSTK6000B starter kit * @ingroup boards * @brief Support for the Silicon Labs SLWSTK6000B starter kit * @{ diff --git a/boards/slwstk6000b/include/gpio_params.h b/boards/common/slwstk6000b/include/gpio_params.h similarity index 96% rename from boards/slwstk6000b/include/gpio_params.h rename to boards/common/slwstk6000b/include/gpio_params.h index a95f2eae24..cf1600a67e 100644 --- a/boards/slwstk6000b/include/gpio_params.h +++ b/boards/common/slwstk6000b/include/gpio_params.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_slwstk6000b + * @ingroup boards_common_slwstk6000b * @{ * * @file diff --git a/boards/slwstk6000b/include/periph_conf.h b/boards/common/slwstk6000b/include/periph_conf.h similarity index 98% rename from boards/slwstk6000b/include/periph_conf.h rename to boards/common/slwstk6000b/include/periph_conf.h index ee5ef98178..0217045f13 100644 --- a/boards/slwstk6000b/include/periph_conf.h +++ b/boards/common/slwstk6000b/include/periph_conf.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_slwstk6000b + * @ingroup boards_common_slwstk6000b * @{ * * @file diff --git a/boards/slwstk6000b/module-info.mk b/boards/common/slwstk6000b/module-info.mk similarity index 60% rename from boards/slwstk6000b/module-info.mk rename to boards/common/slwstk6000b/module-info.mk index 7e74925165..94db0d2a88 100644 --- a/boards/slwstk6000b/module-info.mk +++ b/boards/common/slwstk6000b/module-info.mk @@ -1,15 +1,16 @@ -# Define the default board module. -BOARD_MODULE ?= slwrb4162a +ifeq (,$(BOARD_MODULE)) + $(error Board module must be defined in $(BOARD_MODULE)) +endif # Find the header file that should exist if the module is supported. -MODULE_HEADER = $(wildcard $(RIOTBOARD)/slwstk6000b/modules/$(BOARD_MODULE)/include/board_module.h) +MODULE_HEADER = $(wildcard $(RIOTBOARD)/common/slwstk6000b/modules/$(BOARD_MODULE)/include/board_module.h) ifeq (,$(MODULE_HEADER)) $(error Header file for $(BOARD_MODULE) is missing) endif # Lookup up CPU information using grep. -MODULE_INFO = $(shell grep $(BOARD_MODULE) $(RIOTBOARD)/slwstk6000b/modules.txt) +MODULE_INFO = $(shell grep $(BOARD_MODULE) $(RIOTBOARD)/common/slwstk6000b/modules.txt) ifeq (,$(MODULE_INFO)) $(error Unable to read module information for $(BOARD_MODULE)) diff --git a/boards/slwstk6000b/modules.txt b/boards/common/slwstk6000b/modules.txt similarity index 100% rename from boards/slwstk6000b/modules.txt rename to boards/common/slwstk6000b/modules.txt diff --git a/boards/slwstk6000b/modules/slwrb4150a/include/board_module.h b/boards/common/slwstk6000b/modules/slwrb4150a/include/board_module.h similarity index 98% rename from boards/slwstk6000b/modules/slwrb4150a/include/board_module.h rename to boards/common/slwstk6000b/modules/slwrb4150a/include/board_module.h index 70389a6836..04a535aa56 100644 --- a/boards/slwstk6000b/modules/slwrb4150a/include/board_module.h +++ b/boards/common/slwstk6000b/modules/slwrb4150a/include/board_module.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_slwstk6000b + * @ingroup boards_common_slwstk6000b * @{ * * @file diff --git a/boards/slwstk6000b/modules/slwrb4162a/include/board_module.h b/boards/common/slwstk6000b/modules/slwrb4162a/include/board_module.h similarity index 98% rename from boards/slwstk6000b/modules/slwrb4162a/include/board_module.h rename to boards/common/slwstk6000b/modules/slwrb4162a/include/board_module.h index 09cf74207d..26670ca209 100644 --- a/boards/slwstk6000b/modules/slwrb4162a/include/board_module.h +++ b/boards/common/slwstk6000b/modules/slwrb4162a/include/board_module.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_slwstk6000b + * @ingroup boards_common_slwstk6000b * @{ * * @file diff --git a/boards/slwstk6000b/Makefile b/boards/slwstk6000b/Makefile index 39108f4589..ee68fe10c7 100644 --- a/boards/slwstk6000b/Makefile +++ b/boards/slwstk6000b/Makefile @@ -1,5 +1,3 @@ MODULE = board - -DIRS = $(RIOTBOARD)/common/silabs - +DIRS += $(RIOTBOARD)/common/slwstk6000b include $(RIOTBASE)/Makefile.base diff --git a/boards/slwstk6000b/Makefile.dep b/boards/slwstk6000b/Makefile.dep index e92caacf7f..4554f0de45 100644 --- a/boards/slwstk6000b/Makefile.dep +++ b/boards/slwstk6000b/Makefile.dep @@ -1,7 +1,2 @@ -ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += saul_gpio - USEMODULE += si7021 -endif - -# include board common dependencies -include $(RIOTBOARD)/common/silabs/Makefile.dep +USEMODULE += board_common_slwstk6000b +include $(RIOTBOARD)/common/slwstk6000b/Makefile.dep diff --git a/boards/slwstk6000b/Makefile.features b/boards/slwstk6000b/Makefile.features index 031f30d249..a9759a3c88 100644 --- a/boards/slwstk6000b/Makefile.features +++ b/boards/slwstk6000b/Makefile.features @@ -1,14 +1 @@ -CPU = efm32 -# TODO move CPU_MODEL here - -# Put defined MCU peripherals here (in alphabetical order) -FEATURES_PROVIDED += periph_adc -FEATURES_PROVIDED += periph_gpio periph_gpio_irq -FEATURES_PROVIDED += periph_i2c -FEATURES_PROVIDED += periph_rtc -FEATURES_PROVIDED += periph_rtt -FEATURES_PROVIDED += periph_spi -FEATURES_PROVIDED += periph_timer -FEATURES_PROVIDED += periph_uart periph_uart_modecfg - -include $(RIOTBOARD)/common/silabs/Makefile.features +include $(RIOTBOARD)/common/slwstk6000b/Makefile.features diff --git a/boards/slwstk6000b/Makefile.include b/boards/slwstk6000b/Makefile.include index 622a5e233b..8b80531940 100644 --- a/boards/slwstk6000b/Makefile.include +++ b/boards/slwstk6000b/Makefile.include @@ -1,25 +1,4 @@ -include $(RIOTBOARD)/slwstk6000b/module-info.mk +# Define the default board module. +BOARD_MODULE ?= slwrb4162a -# add module specific includes -INCLUDES += -I$(RIOTBOARD)/slwstk6000b/modules/$(BOARD_MODULE)/include - -export CPU_MODEL = $(MODULE_CPU) - -# set default port depending on operating system -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# setup JLink for flashing -export JLINK_DEVICE := $(MODULE_JLINK_DEVICE) -include $(RIOTMAKE)/tools/jlink.inc.mk - -# add board common drivers -USEMODULE += boards_common_silabs -USEMODULE += silabs_aem -USEMODULE += silabs_bc - -# include board common -include $(RIOTBOARD)/common/silabs/Makefile.include +include $(RIOTBOARD)/common/slwstk6000b/Makefile.include diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 3c39994295..6c2c53abec 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -156,7 +156,7 @@ check_cpu_cpu_model_defined_in_makefile_features() { pathspec+=(':!cpu/**/Makefile.features') # Currently blacklist this non migrated file for CPU_MODEL - pathspec+=(':!boards/slwstk6000b/Makefile.include') + pathspec+=(':!boards/common/slwstk6000b/Makefile.include') git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \ | error_with_message 'CPU and CPU_MODEL definition must be done by board/BOARD/Makefile.features, board/common/**/Makefile.features or cpu/CPU/Makefile.features' From 1ab5a9390d508e55ca0272a414ea043375eacd3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 30 Sep 2019 19:12:55 +0200 Subject: [PATCH 2/2] boards/slwstk6000b-*: split one board for each module Define one board for each of the available modules. --- boards/{slwstk6000b => slwstk6000b-slwrb4150a}/Makefile | 0 boards/{slwstk6000b => slwstk6000b-slwrb4150a}/Makefile.dep | 0 .../{slwstk6000b => slwstk6000b-slwrb4150a}/Makefile.features | 0 boards/slwstk6000b-slwrb4150a/Makefile.include | 3 +++ boards/slwstk6000b-slwrb4162a/Makefile | 3 +++ boards/slwstk6000b-slwrb4162a/Makefile.dep | 2 ++ boards/slwstk6000b-slwrb4162a/Makefile.features | 1 + boards/slwstk6000b-slwrb4162a/Makefile.include | 3 +++ boards/slwstk6000b/Makefile.include | 4 ---- examples/lua_REPL/Makefile | 3 ++- tests/cpu_efm32_features/Makefile | 3 ++- tests/driver_hd44780/Makefile | 3 ++- tests/driver_pca9685/Makefile | 4 +++- tests/unittests/Makefile | 1 + 14 files changed, 22 insertions(+), 8 deletions(-) rename boards/{slwstk6000b => slwstk6000b-slwrb4150a}/Makefile (100%) rename boards/{slwstk6000b => slwstk6000b-slwrb4150a}/Makefile.dep (100%) rename boards/{slwstk6000b => slwstk6000b-slwrb4150a}/Makefile.features (100%) create mode 100644 boards/slwstk6000b-slwrb4150a/Makefile.include create mode 100644 boards/slwstk6000b-slwrb4162a/Makefile create mode 100644 boards/slwstk6000b-slwrb4162a/Makefile.dep create mode 100644 boards/slwstk6000b-slwrb4162a/Makefile.features create mode 100644 boards/slwstk6000b-slwrb4162a/Makefile.include delete mode 100644 boards/slwstk6000b/Makefile.include diff --git a/boards/slwstk6000b/Makefile b/boards/slwstk6000b-slwrb4150a/Makefile similarity index 100% rename from boards/slwstk6000b/Makefile rename to boards/slwstk6000b-slwrb4150a/Makefile diff --git a/boards/slwstk6000b/Makefile.dep b/boards/slwstk6000b-slwrb4150a/Makefile.dep similarity index 100% rename from boards/slwstk6000b/Makefile.dep rename to boards/slwstk6000b-slwrb4150a/Makefile.dep diff --git a/boards/slwstk6000b/Makefile.features b/boards/slwstk6000b-slwrb4150a/Makefile.features similarity index 100% rename from boards/slwstk6000b/Makefile.features rename to boards/slwstk6000b-slwrb4150a/Makefile.features diff --git a/boards/slwstk6000b-slwrb4150a/Makefile.include b/boards/slwstk6000b-slwrb4150a/Makefile.include new file mode 100644 index 0000000000..fc9870821d --- /dev/null +++ b/boards/slwstk6000b-slwrb4150a/Makefile.include @@ -0,0 +1,3 @@ +BOARD_MODULE = slwrb4150a + +include $(RIOTBOARD)/common/slwstk6000b/Makefile.include diff --git a/boards/slwstk6000b-slwrb4162a/Makefile b/boards/slwstk6000b-slwrb4162a/Makefile new file mode 100644 index 0000000000..ee68fe10c7 --- /dev/null +++ b/boards/slwstk6000b-slwrb4162a/Makefile @@ -0,0 +1,3 @@ +MODULE = board +DIRS += $(RIOTBOARD)/common/slwstk6000b +include $(RIOTBASE)/Makefile.base diff --git a/boards/slwstk6000b-slwrb4162a/Makefile.dep b/boards/slwstk6000b-slwrb4162a/Makefile.dep new file mode 100644 index 0000000000..4554f0de45 --- /dev/null +++ b/boards/slwstk6000b-slwrb4162a/Makefile.dep @@ -0,0 +1,2 @@ +USEMODULE += board_common_slwstk6000b +include $(RIOTBOARD)/common/slwstk6000b/Makefile.dep diff --git a/boards/slwstk6000b-slwrb4162a/Makefile.features b/boards/slwstk6000b-slwrb4162a/Makefile.features new file mode 100644 index 0000000000..a9759a3c88 --- /dev/null +++ b/boards/slwstk6000b-slwrb4162a/Makefile.features @@ -0,0 +1 @@ +include $(RIOTBOARD)/common/slwstk6000b/Makefile.features diff --git a/boards/slwstk6000b-slwrb4162a/Makefile.include b/boards/slwstk6000b-slwrb4162a/Makefile.include new file mode 100644 index 0000000000..a5d9d7c157 --- /dev/null +++ b/boards/slwstk6000b-slwrb4162a/Makefile.include @@ -0,0 +1,3 @@ +BOARD_MODULE = slwrb4162a + +include $(RIOTBOARD)/common/slwstk6000b/Makefile.include diff --git a/boards/slwstk6000b/Makefile.include b/boards/slwstk6000b/Makefile.include deleted file mode 100644 index 8b80531940..0000000000 --- a/boards/slwstk6000b/Makefile.include +++ /dev/null @@ -1,4 +0,0 @@ -# Define the default board module. -BOARD_MODULE ?= slwrb4162a - -include $(RIOTBOARD)/common/slwstk6000b/Makefile.include diff --git a/examples/lua_REPL/Makefile b/examples/lua_REPL/Makefile index 8c79ab8242..84daf23e7b 100644 --- a/examples/lua_REPL/Makefile +++ b/examples/lua_REPL/Makefile @@ -24,7 +24,8 @@ BOARD_INSUFFICIENT_MEMORY := blackpill blackpill-128kib bluepill \ remote-pa remote-reva remote-revb samd21-xpro \ saml10-xpro saml11-xpro saml21-xpro samr21-xpro \ samr30-xpro seeeduino_arch-pro sensebox_samd21 slstk3401a \ - sltb001a slwstk6220a sodaq-autonomo sodaq-explorer \ + sltb001a slwstk6000b-slwrb4150a slwstk6220a \ + sodaq-autonomo sodaq-explorer \ sodaq-one sodaq-sara-aff stk3600 stm32f3discovery \ stm32l0538-disco yunjia-nrf51822 \ esp8266-esp-12x esp8266-olimex-mod \ diff --git a/tests/cpu_efm32_features/Makefile b/tests/cpu_efm32_features/Makefile index 224d17e7fd..c67ba9c16a 100644 --- a/tests/cpu_efm32_features/Makefile +++ b/tests/cpu_efm32_features/Makefile @@ -5,7 +5,8 @@ BOARD_WHITELIST := ikea-tradfri \ slstk3401a \ slstk3402a \ sltb001a \ - slwstk6000b \ + slwstk6000b-slwrb4150a \ + slwstk6000b-slwrb4162a \ stk3600 \ stk3700 diff --git a/tests/driver_hd44780/Makefile b/tests/driver_hd44780/Makefile index b27f45e086..6aee6a5424 100644 --- a/tests/driver_hd44780/Makefile +++ b/tests/driver_hd44780/Makefile @@ -2,7 +2,8 @@ include ../Makefile.tests_common # the stm32f4discovery does not have the arduino pinout BOARD_BLACKLIST := stm32f4discovery jiminy-mega256rfr2 slstk3401a slstk3402a \ - sltb001a slwstk6000b stk3600 stk3700 + sltb001a slwstk6000b-slwrb4150a slwstk6000b-slwrb4162a \ + stk3600 stk3700 # currently the test provides config params for arduinos only FEATURES_REQUIRED += arduino diff --git a/tests/driver_pca9685/Makefile b/tests/driver_pca9685/Makefile index e8be7ac441..f5177e41e3 100644 --- a/tests/driver_pca9685/Makefile +++ b/tests/driver_pca9685/Makefile @@ -1,7 +1,9 @@ include ../Makefile.tests_common # These boards are blacklisted since efm32 CPU dosn't support PWM_RIGHT -BOARD_BLACKLIST := slstk3401a slstk3402a sltb001a slwstk6000b stk3600 stk3700 +BOARD_BLACKLIST := slstk3401a slstk3402a sltb001a \ + slwstk6000b-slwrb4150a slwstk6000b-slwrb4162a \ + stk3600 stk3700 # Boards with insufficient memory BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-nano arduino-uno diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index 3218535aba..819fa546ae 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -88,6 +88,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon \ sensebox_samd21 \ slstk3401a \ sltb001a \ + slwstk6000b-slwrb4150a \ slwstk6220a \ sodaq-autonomo \ sodaq-explorer \