diff --git a/feeds/mcu/mcu-firmware/Makefile b/feeds/mcu/mcu-firmware/Makefile index d49f464d0..40bd486f7 100644 --- a/feeds/mcu/mcu-firmware/Makefile +++ b/feeds/mcu/mcu-firmware/Makefile @@ -32,6 +32,11 @@ ZEPHYR_VERSIONS := \ ZEPHYR_FW_CI_URL := https://gitlab.com/pepe2k/zephyr/-/jobs/ +ZEPHYR_FW_TYPES := \ + hello_world \ + hci_uart \ + hci_usb + # Zephyr 'hello_world' targets ZEPHYR_HELLO_WORLD_TARGETS := \ cig_wf196_nrf52833 \ @@ -59,6 +64,20 @@ define Download/zephyr-fw endef $(foreach FW,$(ZEPHYR_VERSIONS),$(eval $(call Download,zephyr-fw,$(FW)))) +# $(1) firmware name (e.g. hci_usb) +define zephyr-fw-host-support + define Package/zephyr-$(1)-host-support + $(call Package/mcu-fw-default) + DEPENDS:=+mcu + TITLE:=Zephyr '$(1)' common host side support + HIDDEN:=1 + endef + + define Package/zephyr-$(1)-host-support/install + $(CP) ./files/$(1)/* $$(1)/ + endef +endef + # $(1) version (e.g zephyr-v3.3.x) # $(2) firmware name (e.g. hci_usb) # $(3) target/board name (e.g. nrf52840dongle_nrf52840) @@ -81,6 +100,7 @@ define zephyr-fw endef define zephyr-fw-deps + $(if $(wildcard ./files/$(1)/*),+zephyr-$(1)-host-support) \ $(if $(findstring hci_u,$1),+bluez-daemon +kmod-bluetooth +kmod-crypto-user) endef @@ -102,6 +122,15 @@ define Build/Compile endef +# Generate host side support packages (per firmware type) +$(foreach FW,$(ZEPHYR_FW_TYPES),\ + $(if $(wildcard ./files/$(FW)/*),$(eval $(call zephyr-fw-host-support,$(FW))))) + +$(foreach FW,$(ZEPHYR_FW_TYPES),\ + $(if $(wildcard ./files/$(FW)/*),$(eval $(call BuildPackage,zephyr-$(FW)-host-support)))) + + +# Generate dedicated Zephyr firmware packages (per firmware version, type and board) $(foreach VER,$(ZEPHYR_VERSIONS),\ $(foreach TARGET,$(ZEPHYR_HELLO_WORLD_TARGETS),\ $(eval $(call zephyr-fw,$(call word-underscore,$(VER),1),hello_world,$(TARGET)))))