From 195d6617b2d239973a8f8091f764c38b4f321b6c Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 28 May 2024 20:52:53 +0200 Subject: [PATCH 1/4] dist/tools/buildsystem_sanity_check: Relax on Makefile.features In order to extend features based on provided features, we need to check contents of `FEATURES_PROVIDED`. --- dist/tools/buildsystem_sanity_check/check.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 9ee0eb0eee37..777caa12a59a 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -74,6 +74,12 @@ check_not_parsing_features() { # These two files contain sanity checks using FEATURES_ so are allowed pathspec+=(':!Makefile.include' ':!makefiles/info-global.inc.mk') + # We extend features provided in Makefile.features based on what is + # already provided to avoid clutter in each boards Makefile.features. + # E.g. `periph_eth` will pull in `netif_ethernet`, which + # will pull in `netif`. + pathspec+=(':!Makefile.features') + git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \ | error_with_message 'Modules should not check the content of FEATURES_PROVIDED/REQUIRED/OPTIONAL' } From 8e375548ad34f88009310bafdd17616804cd5cf7 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 27 May 2024 15:56:36 +0200 Subject: [PATCH 2/4] build system: provide netif feature implicitly If a board already provided a netif_% feature (currently only netif_ethernet), the netif feature is automagically provided. --- Makefile.features | 5 +++++ boards/native/common_features.inc.mk | 3 +-- boards/nucleo-f207zg/Makefile.features | 1 - boards/nucleo-f429zi/Makefile.features | 1 - boards/nucleo-f439zi/Makefile.features | 1 - boards/nucleo-f767zi/Makefile.features | 1 - boards/same54-xpro/Makefile.features | 1 - boards/stm32f746g-disco/features-shared.mk | 1 - 8 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile.features b/Makefile.features index 05b5df0c51d3..f34a7bd8c7e9 100644 --- a/Makefile.features +++ b/Makefile.features @@ -31,3 +31,8 @@ FEATURES_CONFLICT_MSG += "Only one GPIO IRQ implementation can be used." FEATURES_CONFLICT += periph_usbdev:tinyusb_device FEATURES_CONFLICT += periph_usbdev:tinyusb_host FEATURES_CONFLICT_MSG += "Package tinyUSB is not yet compatible with periph_usbdev." + +# Features provided implicitly +ifneq (,$(filter netif_%,$(FEATURES_PROVIDED))) + FEATURES_PROVIDED += netif +endif diff --git a/boards/native/common_features.inc.mk b/boards/native/common_features.inc.mk index cb405da7ba8c..229a188f6cf0 100644 --- a/boards/native/common_features.inc.mk +++ b/boards/native/common_features.inc.mk @@ -8,6 +8,5 @@ FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_qdec # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += motor_driver -FEATURES_PROVIDED += netif +FEATURES_PROVIDED += netif_ethernet diff --git a/boards/nucleo-f207zg/Makefile.features b/boards/nucleo-f207zg/Makefile.features index 0cc2f12a09bb..adc07443e988 100644 --- a/boards/nucleo-f207zg/Makefile.features +++ b/boards/nucleo-f207zg/Makefile.features @@ -15,7 +15,6 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += netif_ethernet -FEATURES_PROVIDED += netif FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/nucleo-f429zi/Makefile.features b/boards/nucleo-f429zi/Makefile.features index 115f29aff3a3..0fce4461747f 100644 --- a/boards/nucleo-f429zi/Makefile.features +++ b/boards/nucleo-f429zi/Makefile.features @@ -15,7 +15,6 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += netif_ethernet -FEATURES_PROVIDED += netif FEATURES_PROVIDED += tinyusb_device # load the common Makefile.features for Nucleo boards diff --git a/boards/nucleo-f439zi/Makefile.features b/boards/nucleo-f439zi/Makefile.features index 6a0f72abbce1..5b33844d3e1b 100644 --- a/boards/nucleo-f439zi/Makefile.features +++ b/boards/nucleo-f439zi/Makefile.features @@ -14,7 +14,6 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += netif_ethernet -FEATURES_PROVIDED += netif FEATURES_PROVIDED += tinyusb_device # load the common Makefile.features for Nucleo boards diff --git a/boards/nucleo-f767zi/Makefile.features b/boards/nucleo-f767zi/Makefile.features index cef84ab51d9b..0a22806cb3c8 100644 --- a/boards/nucleo-f767zi/Makefile.features +++ b/boards/nucleo-f767zi/Makefile.features @@ -21,7 +21,6 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += netif_ethernet -FEATURES_PROVIDED += netif FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/same54-xpro/Makefile.features b/boards/same54-xpro/Makefile.features index 9e34d364a0b8..5ae944c4bf57 100644 --- a/boards/same54-xpro/Makefile.features +++ b/boards/same54-xpro/Makefile.features @@ -20,6 +20,5 @@ FEATURES_PROVIDED += periph_can # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += netif_ethernet -FEATURES_PROVIDED += netif FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/stm32f746g-disco/features-shared.mk b/boards/stm32f746g-disco/features-shared.mk index db01f25e0c6a..d117b6be8031 100644 --- a/boards/stm32f746g-disco/features-shared.mk +++ b/boards/stm32f746g-disco/features-shared.mk @@ -18,5 +18,4 @@ FEATURES_PROVIDED += periph_usbdev_hs_ulpi # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += netif_ethernet -FEATURES_PROVIDED += netif FEATURES_PROVIDED += tinyusb_device From 9187d16c7837c39f93ddd70230c8226d2488cf52 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 27 May 2024 16:12:24 +0200 Subject: [PATCH 3/4] features.yaml: s/esp_eth/periph_eth/ Use periph_eth instead of esp_eth for the Ethernet peripheral on ESP MCUs for consistency --- boards/esp32-ethernet-kit-v1_0/Makefile.features | 2 +- boards/esp32-olimex-evb/Makefile.features | 2 +- cpu/esp32/Makefile.dep | 2 +- features.yaml | 4 ---- makefiles/features_existing.inc.mk | 1 - 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/boards/esp32-ethernet-kit-v1_0/Makefile.features b/boards/esp32-ethernet-kit-v1_0/Makefile.features index 806d8882f54e..e22f96a983a9 100644 --- a/boards/esp32-ethernet-kit-v1_0/Makefile.features +++ b/boards/esp32-ethernet-kit-v1_0/Makefile.features @@ -4,8 +4,8 @@ CPU_MODEL = esp32-wrover include $(RIOTBOARD)/common/esp32/Makefile.features # additional features provided by the board -FEATURES_PROVIDED += esp_eth FEATURES_PROVIDED += periph_adc +FEATURES_PROVIDED += periph_eth FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm diff --git a/boards/esp32-olimex-evb/Makefile.features b/boards/esp32-olimex-evb/Makefile.features index c6259a44e64f..42f118c15e24 100644 --- a/boards/esp32-olimex-evb/Makefile.features +++ b/boards/esp32-olimex-evb/Makefile.features @@ -19,7 +19,7 @@ FEATURES_CONFLICT += periph_sdmmc:periph_spi FEATURES_CONFLICT_MSG += "SD/MMC and SPI cannot be used at the same time on this board." # unique features of the board -FEATURES_PROVIDED += esp_eth # Ethernet MAC (EMAC) FEATURES_PROVIDED += periph_can # CAN peripheral interface +FEATURES_PROVIDED += periph_eth # Ethernet MAC (EMAC) FEATURES_PROVIDED += arduino_pins diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 9d4b62ab470a..ab43157e2900 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -32,7 +32,7 @@ ifneq (,$(filter esp_ble,$(USEMODULE))) endif ifneq (,$(filter esp_eth,$(USEMODULE))) - FEATURES_REQUIRED += esp_eth + FEATURES_REQUIRED += periph_eth USEMODULE += esp_idf_eth USEMODULE += esp_idf_event USEMODULE += esp_idf_gpio diff --git a/features.yaml b/features.yaml index 7ce8ffe75d94..7cd1641c1696 100644 --- a/features.yaml +++ b/features.yaml @@ -138,10 +138,6 @@ groups: - title: ESP Specific Features help: These features are only available on (some) ESP MCUs. features: - - name: esp_eth - help: > - An ESP Ethernet peripherals is available. - (FIXME: `periph_eth` instead.) - name: esp_jtag help: The MCU supports JTAG for programming and debugging. Enable this feature to expose the interface at the cost of having fewer pins as diff --git a/makefiles/features_existing.inc.mk b/makefiles/features_existing.inc.mk index 9fdd0f6424cb..acf01e62f9ae 100644 --- a/makefiles/features_existing.inc.mk +++ b/makefiles/features_existing.inc.mk @@ -114,7 +114,6 @@ FEATURES_EXISTING := \ esp_ble \ esp_ble_esp32 \ esp_ble_esp32c3 \ - esp_eth \ esp_hw_counter \ esp_jtag \ esp_now \ From 47f52bd7500f520df0093f01b674f566b452a967 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 27 May 2024 16:15:20 +0200 Subject: [PATCH 4/4] build system: provide netif_ethernet implicitly If there is an Ethernet peripheral (periph_eth feature provided), we can conclude that an Ethernet network interface can be provided. Co-authored-by: mguetschow --- Makefile.features | 4 ++++ boards/nucleo-f207zg/Makefile.features | 1 - boards/nucleo-f429zi/Makefile.features | 1 - boards/nucleo-f439zi/Makefile.features | 1 - boards/nucleo-f767zi/Makefile.features | 1 - boards/same54-xpro/Makefile.features | 1 - boards/stm32f746g-disco/features-shared.mk | 1 - dist/tools/buildsystem_sanity_check/check.sh | 2 +- 8 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile.features b/Makefile.features index f34a7bd8c7e9..267b4445d2cc 100644 --- a/Makefile.features +++ b/Makefile.features @@ -33,6 +33,10 @@ FEATURES_CONFLICT += periph_usbdev:tinyusb_host FEATURES_CONFLICT_MSG += "Package tinyUSB is not yet compatible with periph_usbdev." # Features provided implicitly +ifneq (,$(filter periph_eth,$(FEATURES_PROVIDED))) + FEATURES_PROVIDED += netif_ethernet +endif + ifneq (,$(filter netif_%,$(FEATURES_PROVIDED))) FEATURES_PROVIDED += netif endif diff --git a/boards/nucleo-f207zg/Makefile.features b/boards/nucleo-f207zg/Makefile.features index adc07443e988..ebf78f92ed44 100644 --- a/boards/nucleo-f207zg/Makefile.features +++ b/boards/nucleo-f207zg/Makefile.features @@ -14,7 +14,6 @@ FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/nucleo-f429zi/Makefile.features b/boards/nucleo-f429zi/Makefile.features index 0fce4461747f..92e2f945a8a9 100644 --- a/boards/nucleo-f429zi/Makefile.features +++ b/boards/nucleo-f429zi/Makefile.features @@ -14,7 +14,6 @@ FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += tinyusb_device # load the common Makefile.features for Nucleo boards diff --git a/boards/nucleo-f439zi/Makefile.features b/boards/nucleo-f439zi/Makefile.features index 5b33844d3e1b..8abb89362d09 100644 --- a/boards/nucleo-f439zi/Makefile.features +++ b/boards/nucleo-f439zi/Makefile.features @@ -13,7 +13,6 @@ FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += tinyusb_device # load the common Makefile.features for Nucleo boards diff --git a/boards/nucleo-f767zi/Makefile.features b/boards/nucleo-f767zi/Makefile.features index 0a22806cb3c8..94380f44bd5a 100644 --- a/boards/nucleo-f767zi/Makefile.features +++ b/boards/nucleo-f767zi/Makefile.features @@ -20,7 +20,6 @@ FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/same54-xpro/Makefile.features b/boards/same54-xpro/Makefile.features index 5ae944c4bf57..ecf8e7b7f0b4 100644 --- a/boards/same54-xpro/Makefile.features +++ b/boards/same54-xpro/Makefile.features @@ -19,6 +19,5 @@ FEATURES_PROVIDED += periph_freqm FEATURES_PROVIDED += periph_can # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/stm32f746g-disco/features-shared.mk b/boards/stm32f746g-disco/features-shared.mk index d117b6be8031..8a613b74b9b8 100644 --- a/boards/stm32f746g-disco/features-shared.mk +++ b/boards/stm32f746g-disco/features-shared.mk @@ -17,5 +17,4 @@ FEATURES_PROVIDED += periph_usbdev_hs FEATURES_PROVIDED += periph_usbdev_hs_ulpi # Put other features for this board (in alphabetical order) -FEATURES_PROVIDED += netif_ethernet FEATURES_PROVIDED += tinyusb_device diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 777caa12a59a..b3f536c0b028 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -74,7 +74,7 @@ check_not_parsing_features() { # These two files contain sanity checks using FEATURES_ so are allowed pathspec+=(':!Makefile.include' ':!makefiles/info-global.inc.mk') - # We extend features provided in Makefile.features based on what is + # We extend FEATURES_PROVIDED in Makefile.features based on what is # already provided to avoid clutter in each boards Makefile.features. # E.g. `periph_eth` will pull in `netif_ethernet`, which # will pull in `netif`.