From dc0dae62840dd0090c1aae82e07588dff4c2b89e Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 8 Mar 2023 02:30:49 +0100 Subject: [PATCH] mcu: select host dependencies based on MCU firmware type In case of some types of MCU firmware, additional tools, daemons, kernel drivers, etc. are required on the host side. For example, for Bluetooth HCI controller, at least kernel module and BlueZ should be included. This adds a simple recipe which generates dependencies list per firmware type/name and for existing 'hci_usb' and 'hci_uart', selects 3 packages: 'bluez-daemon', 'kmod-bluetooth' and 'kmod-crypto-user'. Kernel crypto interface in user space has to be also included because the BlueZ isn't able to create static address for LE-only controller without it, which results in no registration of new BT interface: bluetoothd[668]: src/adapter.c:get_static_addr() Failed to open crypto bluetoothd[668]: No Bluetooth address for index 0 Signed-off-by: Piotr Dymacz --- feeds/mcu/mcu-firmware/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/feeds/mcu/mcu-firmware/Makefile b/feeds/mcu/mcu-firmware/Makefile index 1387b720a..d49f464d0 100644 --- a/feeds/mcu/mcu-firmware/Makefile +++ b/feeds/mcu/mcu-firmware/Makefile @@ -65,7 +65,7 @@ $(foreach FW,$(ZEPHYR_VERSIONS),$(eval $(call Download,zephyr-fw,$(FW)))) define zephyr-fw define Package/$(1)-$(2)-$(3) $(call Package/mcu-fw-default) - DEPENDS:=+mcu + DEPENDS:=+mcu $(call zephyr-fw-deps,$(2)) TITLE:=Zephyr '$(2)' endef @@ -80,6 +80,10 @@ define zephyr-fw endef endef +define zephyr-fw-deps + $(if $(findstring hci_u,$1),+bluez-daemon +kmod-bluetooth +kmod-crypto-user) +endef + define zephyr-fw-unzip mkdir -p $(PKG_BUILD_DIR)/$(call word-underscore,$(1),1); \ unzip -q -d $(PKG_BUILD_DIR)/$(call word-underscore,$(1),1) \