Skip to content

Commit

Permalink
Add Hailo-8 firmware for Raspberry Pi AI Kit/HAT on RPi 5 (#3680)
Browse files Browse the repository at this point in the history
Add Hailo-8 firmware binary for Rasperry Pi AI accelerators. The version needs
to be determined from the Git history of the kernel sources, as the driver
source code is included in the RPi downstream kernel and the version string
can't be found in the code directly.

Fixes #3663
  • Loading branch information
sairon authored Nov 18, 2024
1 parent f169f78 commit eec6dfb
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions buildroot-external/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-rtl8723/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/eq3_char_loop/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/gasket/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/generic_raw_uart/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hailo8-firmware/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hardkernel-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hassio/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/khadas-boot/Config.in"
Expand Down
1 change: 1 addition & 0 deletions buildroot-external/configs/rpi5_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ BR2_PACKAGE_HOST_GPTFDISK=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_RAUC=y
BR2_PACKAGE_GASKET=y
BR2_PACKAGE_HAILO8_FIRMWARE=y
BR2_PACKAGE_HASSIO=y
BR2_PACKAGE_HASSIO_ARCH="aarch64"
BR2_PACKAGE_HASSIO_MACHINE="raspberrypi5-64"
Expand Down
6 changes: 6 additions & 0 deletions buildroot-external/package/hailo8-firmware/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config BR2_PACKAGE_HAILO8_FIRMWARE
bool "Hailo-8 Firmware"
help
Firmware for Hailo-8 PCIe device found e.g. on Raspberry Pi AI
Kit and Raspberry Pi AI HAT+. Requires the hailo kernel driver
(included in Raspberry Pi's downstream kernel).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sha256 bfa576dd782359d74cabcb19e87c3a934dce03dea0785e41f86fecc9a687a92b hailo8_fw.4.18.0.bin
25 changes: 25 additions & 0 deletions buildroot-external/package/hailo8-firmware/hailo8-firmware.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
################################################################################
#
# Hailo-8 Firmware
#
################################################################################

HAILO8_FIRMWARE_VERSION = 4.18.0
HAILO8_FIRMWARE_LICENSE = PROPRIETARY
HAILO8_FIRMWARE_SOURCE= hailo8_fw.$(HAILO8_FIRMWARE_VERSION).bin
HAILO8_FIRMWARE_SITE="https://hailo-hailort.s3.eu-west-2.amazonaws.com/Hailo8/$(HAILO8_FIRMWARE_VERSION)/FW"

define HAILO8_FIRMWARE_EXTRACT_CMDS
cp $(HAILO8_FIRMWARE_DL_DIR)/$(HAILO8_FIRMWARE_SOURCE) $(@D)
endef

define HAILO8_FIRMWARE_BUILD_CMDS
cp $(@D)/$(HAILO8_FIRMWARE_SOURCE) $(@D)/hailo8_fw.bin
endef

define HAILO8_FIRMWARE_INSTALL_TARGET_CMDS
$(INSTALL) -d $(TARGET_DIR)/lib/firmware/hailo
$(INSTALL) -m 0644 $(@D)/hailo8_fw.bin $(TARGET_DIR)/lib/firmware/hailo/
endef

$(eval $(generic-package))

0 comments on commit eec6dfb

Please sign in to comment.