diff --git a/Makefile.features b/Makefile.features index 05b5df0c51..267b4445d2 100644 --- a/Makefile.features +++ b/Makefile.features @@ -31,3 +31,12 @@ 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 periph_eth,$(FEATURES_PROVIDED))) + FEATURES_PROVIDED += netif_ethernet +endif + +ifneq (,$(filter netif_%,$(FEATURES_PROVIDED))) + FEATURES_PROVIDED += netif +endif diff --git a/boards/esp32-ethernet-kit-v1_0/Makefile.features b/boards/esp32-ethernet-kit-v1_0/Makefile.features index 806d8882f5..e22f96a983 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 c6259a44e6..42f118c15e 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/boards/native/common_features.inc.mk b/boards/native/common_features.inc.mk index cb405da7ba..229a188f6c 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 0cc2f12a09..ebf78f92ed 100644 --- a/boards/nucleo-f207zg/Makefile.features +++ b/boards/nucleo-f207zg/Makefile.features @@ -14,8 +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 += netif FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/nucleo-f429zi/Makefile.features b/boards/nucleo-f429zi/Makefile.features index 115f29aff3..92e2f945a8 100644 --- a/boards/nucleo-f429zi/Makefile.features +++ b/boards/nucleo-f429zi/Makefile.features @@ -14,8 +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 += 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 6a0f72abbc..8abb89362d 100644 --- a/boards/nucleo-f439zi/Makefile.features +++ b/boards/nucleo-f439zi/Makefile.features @@ -13,8 +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 += 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 cef84ab51d..94380f44bd 100644 --- a/boards/nucleo-f767zi/Makefile.features +++ b/boards/nucleo-f767zi/Makefile.features @@ -20,8 +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 += netif FEATURES_PROVIDED += riotboot FEATURES_PROVIDED += tinyusb_device diff --git a/boards/same54-xpro/Makefile.features b/boards/same54-xpro/Makefile.features index 9e34d364a0..ecf8e7b7f0 100644 --- a/boards/same54-xpro/Makefile.features +++ b/boards/same54-xpro/Makefile.features @@ -19,7 +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 += 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 db01f25e0c..8a613b74b9 100644 --- a/boards/stm32f746g-disco/features-shared.mk +++ b/boards/stm32f746g-disco/features-shared.mk @@ -17,6 +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 += netif FEATURES_PROVIDED += tinyusb_device diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 9d4b62ab47..ab43157e29 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/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 9ee0eb0eee..b3f536c0b0 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' } diff --git a/features.yaml b/features.yaml index 7ce8ffe75d..7cd1641c16 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 9fdd0f6424..acf01e62f9 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 \