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 <pepe2k@gmail.com>
This commit is contained in:
Piotr Dymacz
2023-03-08 02:30:49 +01:00
committed by John Crispin
parent 7c535de60d
commit dc0dae6284

View File

@@ -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) \