Bump Hailo-8 driver/firmware to v4.23.0 and add Hailo-10H support#4690
Bump Hailo-8 driver/firmware to v4.23.0 and add Hailo-10H support#4690mikehailodev wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR adds support for Hailo-10H PCIe devices by introducing new buildroot external packages for Hailo10H firmware and a PCI kernel driver, updates existing Hailo package versions from 4.21.0 to 4.23.0, and enables these new packages across multiple device configurations. ChangesHailo-10H Device Support Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@buildroot-external/package/hailo10h-firmware/hailo10h-firmware.mk`:
- Around line 7-10: The HAILO10H firmware package sets HAILO10H_FIRMWARE_LICENSE
= PROPRIETARY but is missing HAILO10H_FIRMWARE_REDISTRIBUTE = NO, causing
Buildroot to treat the firmware tarball as redistributable; add the variable
HAILO10H_FIRMWARE_REDISTRIBUTE = NO to the hailo10h-firmware.mk file (next to
HAILO10H_FIRMWARE_LICENSE) so Buildroot’s legal-info skips archiving the
proprietary source, and apply the same change for the corresponding
hailo8-firmware.mk package (use the package-specific prefix
HAILO8_FIRMWARE_REDISTRIBUTE = NO).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7e7a298c-2e9e-4804-a987-78d81c14666a
📒 Files selected for processing (16)
buildroot-external/Config.inbuildroot-external/configs/generic_aarch64_defconfigbuildroot-external/configs/generic_x86_64_defconfigbuildroot-external/configs/ova_defconfigbuildroot-external/configs/rpi5_64_defconfigbuildroot-external/configs/yellow_defconfigbuildroot-external/package/hailo-pci/hailo-pci.hashbuildroot-external/package/hailo-pci/hailo-pci.mkbuildroot-external/package/hailo10h-firmware/Config.inbuildroot-external/package/hailo10h-firmware/hailo10h-firmware.hashbuildroot-external/package/hailo10h-firmware/hailo10h-firmware.mkbuildroot-external/package/hailo10h-pci/Config.inbuildroot-external/package/hailo10h-pci/hailo10h-pci.hashbuildroot-external/package/hailo10h-pci/hailo10h-pci.mkbuildroot-external/package/hailo8-firmware/hailo8-firmware.hashbuildroot-external/package/hailo8-firmware/hailo8-firmware.mk
| HAILO10H_FIRMWARE_VERSION = 5.3.0 | ||
| HAILO10H_FIRMWARE_LICENSE = PROPRIETARY | ||
| HAILO10H_FIRMWARE_SOURCE = hailo10h_fw.tar.gz | ||
| HAILO10H_FIRMWARE_SITE = https://hailo-hailort.s3.eu-west-2.amazonaws.com/Hailo10H/$(HAILO10H_FIRMWARE_VERSION)/FW |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check whether hailo8-firmware.mk sets REDISTRIBUTE = NO for comparison,
# and confirm hailo10h-firmware.mk is missing it.
rg -n "REDISTRIBUTE" --type=makeRepository: home-assistant/operating-system
Length of output: 57
🏁 Script executed:
# Locate the firmware package files
fd -type f -name "*firmware.mk" | head -20Repository: home-assistant/operating-system
Length of output: 246
🏁 Script executed:
# Also check the directory structure to understand the layout
fd -type d -name "buildroot-external" | head -5Repository: home-assistant/operating-system
Length of output: 246
🏁 Script executed:
# Locate the firmware package files
fd -t f "firmware.mk"Repository: home-assistant/operating-system
Length of output: 203
🏁 Script executed:
# Check the buildroot-external directory structure
fd -t d "buildroot-external"Repository: home-assistant/operating-system
Length of output: 95
🏁 Script executed:
# Read hailo10h-firmware.mk to check current state
cat buildroot-external/package/hailo10h-firmware/hailo10h-firmware.mkRepository: home-assistant/operating-system
Length of output: 872
🏁 Script executed:
# Read hailo8-firmware.mk to check if it has REDISTRIBUTE = NO
cat buildroot-external/package/hailo8-firmware/hailo8-firmware.mkRepository: home-assistant/operating-system
Length of output: 908
Add HAILO10H_FIRMWARE_REDISTRIBUTE = NO for this proprietary package.
Per Buildroot's own legal-info documentation, "the source code for packages that set _REDISTRIBUTE = NO will not be saved" when running make legal-info. Without this declaration, Buildroot will attempt to archive the proprietary firmware tarball from the S3 bucket into the legal-info sources directory — incorrectly treating it as redistributable content.
The standard Buildroot pattern for proprietary packages is to pair LICENSE = PROPRIETARY with REDISTRIBUTE = NO. Note that hailo8-firmware.mk also lacks this declaration and has the same vulnerability.
🛡️ Proposed fix
HAILO10H_FIRMWARE_VERSION = 5.3.0
HAILO10H_FIRMWARE_LICENSE = PROPRIETARY
+HAILO10H_FIRMWARE_REDISTRIBUTE = NO
HAILO10H_FIRMWARE_SOURCE = hailo10h_fw.tar.gz
HAILO10H_FIRMWARE_SITE = https://hailo-hailort.s3.eu-west-2.amazonaws.com/Hailo10H/$(HAILO10H_FIRMWARE_VERSION)/FW📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| HAILO10H_FIRMWARE_VERSION = 5.3.0 | |
| HAILO10H_FIRMWARE_LICENSE = PROPRIETARY | |
| HAILO10H_FIRMWARE_SOURCE = hailo10h_fw.tar.gz | |
| HAILO10H_FIRMWARE_SITE = https://hailo-hailort.s3.eu-west-2.amazonaws.com/Hailo10H/$(HAILO10H_FIRMWARE_VERSION)/FW | |
| HAILO10H_FIRMWARE_VERSION = 5.3.0 | |
| HAILO10H_FIRMWARE_LICENSE = PROPRIETARY | |
| HAILO10H_FIRMWARE_REDISTRIBUTE = NO | |
| HAILO10H_FIRMWARE_SOURCE = hailo10h_fw.tar.gz | |
| HAILO10H_FIRMWARE_SITE = https://hailo-hailort.s3.eu-west-2.amazonaws.com/Hailo10H/$(HAILO10H_FIRMWARE_VERSION)/FW |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@buildroot-external/package/hailo10h-firmware/hailo10h-firmware.mk` around
lines 7 - 10, The HAILO10H firmware package sets HAILO10H_FIRMWARE_LICENSE =
PROPRIETARY but is missing HAILO10H_FIRMWARE_REDISTRIBUTE = NO, causing
Buildroot to treat the firmware tarball as redistributable; add the variable
HAILO10H_FIRMWARE_REDISTRIBUTE = NO to the hailo10h-firmware.mk file (next to
HAILO10H_FIRMWARE_LICENSE) so Buildroot’s legal-info skips archiving the
proprietary source, and apply the same change for the corresponding
hailo8-firmware.mk package (use the package-specific prefix
HAILO8_FIRMWARE_REDISTRIBUTE = NO).
sairon
left a comment
There was a problem hiding this comment.
Thanks for the contribution! There are some linter nits which need to be addressed but formally it looks sound otherwise. The biggest issue is that it doesn't build for ova:
>>> hailo10h-pci v5.3.0 Building kernel module(s)
GIT_DIR=. PATH="/build/output_ova/host/bin:/build/output_ova/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" PKG_CONFIG="/build/output_ova/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/build/output_ova/host/lib/pkgconfig:/build/output_ova/host/share/pkgconfig" BR_BINARIES_DIR=/build/output_ova/images /usr/bin/make -j33 -C /build/output_ova/build/linux-6.18.26 HOSTCC="/build/output_ova/host/bin/ccache /usr/bin/gcc -O2 -isystem /build/output_ova/host/include -L/build/output_ova/host/lib -Wl,-rpath,/build/output_ova/host/lib" ARCH=x86_64 KCFLAGS="-Wno-attribute-alias" INSTALL_MOD_PATH=/build/output_ova/target CROSS_COMPILE="/build/output_ova/host/bin/x86_64-buildroot-linux-gnu-" WERROR=0 REGENERATE_PARSERS=1 DEPMOD=/build/output_ova/host/sbin/depmod INSTALL_MOD_STRIP=1 PWD=/build/output_ova/build/hailo10h-pci-v5.3.0/linux/pcie M=/build/output_ova/build/hailo10h-pci-v5.3.0/linux/pcie modules
make[2]: Entering directory '/build/output_ova/build/linux-6.18.26'
make[3]: Entering directory '/build/output_ova/build/hailo10h-pci-v5.3.0/linux/pcie'
CC [M] src/pcie.o
CC [M] src/fops.o
CC [M] src/sysfs.o
CC [M] src/nnc.o
CC [M] src/soc.o
CC [M] ../../common/fw_validation.o
CC [M] ../../common/fw_operation.o
CC [M] ../../common/pcie_common.o
CC [M] ../../common/vdma_common.o
CC [M] ../../common/hailo_resource.o
CC [M] ../utils/logs.o
CC [M] ../vdma/vdma.o
CC [M] ../vdma/memory.o
CC [M] ../vdma/monitor.o
CC [M] ../vdma/ioctl.o
../vdma/monitor.c: In function 'hailo_vdma_monitor_stop':
../vdma/monitor.c:53:5: error: implicit declaration of function 'del_timer_sync' [-Werror=implicit-function-declaration]
53 | del_timer_sync(&monitor->timer);
| ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [/build/output_ova/build/linux-6.18.26/scripts/Makefile.build:287: ../vdma/monitor.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [/build/output_ova/build/linux-6.18.26/Makefile:2021: .] Error 2
make[3]: *** [/build/output_ova/build/linux-6.18.26/Makefile:248: __sub-make] Error 2
make[3]: Leaving directory '/build/output_ova/build/hailo10h-pci-v5.3.0/linux/pcie'
make[2]: *** [Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/build/output_ova/build/linux-6.18.26'
make[1]: *** [package/pkg-generic.mk:274: /build/output_ova/build/hailo10h-pci-v5.3.0/.stamp_built] Error 2
make[1]: Leaving directory '/build/buildroot'
make: *** [Makefile:42: default] Error 2
The driver will need some changes for 6.18 kernel, as del_timer_sync is not defined there. It builds fine for Raspberry Pi which is still on 6.12 but it will be switching to 6.18 soon too.
I'm not able to test it myself, as I don't have AI HAT 2/Hailo 10H available. Have you done some testing, and if so, on what setup?
|
|
Hailo-8/8L (hailo_pci kernel module): - Bump hailo-pci driver from v4.21.0 to v4.23.0 - Bump hailo8-firmware from 4.21.0 to 4.23.0 - Keep mmap_read_lock patch (still needed for v4.23.0) Hailo-10H (hailo1x_pci kernel module, NEW): - Add hailo10h-pci driver package (v5.3.0, master branch) - Add hailo10h-firmware package (v5.3.0, multi-stage boot firmware) - Firmware installed to /lib/firmware/hailo/hailo10h/ - Patch del_timer_sync -> timer_delete_sync for Linux 6.16+ compat Both driver families coexist: hailo_pci (v4.x, hailo8 branch) handles Hailo-8/8R/8L devices, hailo1x_pci (v5.x, master branch) handles Hailo-10H/15L/12L devices. They produce different kernel modules and bind to different PCI device IDs. Upstream driver repo: https://github.com/hailo-ai/hailort-drivers - hailo8 branch (v4.x): Hailo-8/8R/8L - master branch (v5.x): Hailo-10H/15L/12L Fixes: - Fix hailo10h-pci build on Linux 6.18 (del_timer_sync removed in 6.16) - Add HAILO10H_FIRMWARE_REDISTRIBUTE = NO for proprietary package - Fix check-package linter warnings (headers, help text wrapping)
9b239a6 to
fbed70d
Compare
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Thanks for the review @sairon! All feedback addressed in the force-pushed commit: Linux 6.18 build fix - Added patch replacing del_timer_sync → timer_delete_sync (unconditional, since HAOS targets ≥6.12). Confirmed it's a direct alias since 6.2, removed in 6.15. Linter nits - Fixed check-package warnings: added standard 80-hash headers to .mk files, wrapped Config.in help text to ≤62 chars. HAILO10H_FIRMWARE_REDISTRIBUTE = NO - Added per Buildroot convention for proprietary packages. Testing: Tested on Raspberry Pi 5 + Hailo-10H (AI HAT+) |
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
@sairon We'd like to send you a Hailo-10H module so you can test directly. Could you reach me via private message on the Hailo Community Forum (Michael) We'll coordinate shipping. Thanks, |
sairon
left a comment
There was a problem hiding this comment.
Actually, this will need more changes :( The hailo10h-firmware package is too bloated to even fit to the rootfs partition on ova target (x86-64 will be even worse):
part hassos-system0 size (268435456) too small for /build/output_ova/images/rootfs.erofs (294191104)
The biggest contributor is the image-fs file which is almost 100M:
$ ls -lah output_ova/target/usr/lib/firmware/hailo/hailo10h
total 108M
drwxr-xr-x 2 builder builder 4.0K May 7 10:53 .
drwxr-xr-x 3 builder builder 4.0K May 7 11:13 ..
-rw-r--r-- 1 builder builder 2.6K May 7 10:53 customer_certificate.bin
-rw-r--r-- 1 builder builder 11M May 7 10:53 fitImage
-rw-r--r-- 1 builder builder 96M May 7 10:53 image-fs
-rw-r--r-- 1 builder builder 199K May 7 10:53 scu_fw.bin
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-0.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-1.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-10.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-11.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-12.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-13.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-14.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-3.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-4.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-5.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-6.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-9.dtb.signed
-rw-r--r-- 1 builder builder 29K May 7 10:53 u-boot-default.dtb.signed
-rw-r--r-- 1 builder builder 86K May 7 10:53 u-boot-spl.bin
Any chance it could be slimmed down?
I just tried to build OVA and saw it too - on it... |
@sairon Am I correct here? Total space is 256MB, 189MB already used and 67MB left, and we're bringing in FW of size 108MB. If we could theoretically slim it down to under 67MB - would that be acceptable? Thx |
|
@mikehailodev I'm afraid that won't be enough - it would be still a problem on generic-x86-64 target, where we only have ~10M headroom (and some of it will be taken by #4611 in OS 18.0). Such big "firmware" is quite unprecedented compared to standard Linux drivers, does it really need to be present during probing or could the provisioning be delayed to later stage? |
Hailo-8/8L (hailo_pci kernel module):
Hailo-10H (hailo1x_pci kernel module, NEW):
Both driver families coexist: hailo_pci (v4.x, hailo8 branch) handles Hailo-8/8R/8L devices, hailo1x_pci (v5.x, master branch) handles Hailo-10H/15L/12L devices. They produce different kernel modules and bind to different PCI device IDs.
Upstream driver repo: https://github.com/hailo-ai/hailort-drivers
Note: This merge should be coordinated with the corresponding Frigate PR (unified Hailo detector with dual-HailoRT support). HailoRT requires an exact version match between kernel driver and userspace library - if the OS ships driver v4.23.0 before Frigate bundles HailoRT v4.23.0, the detector will gracefully disable due to version mismatch. The Frigate PR maintains full backwards compatibility with existing user configurations (no config changes required).
Disclosure: Contributed by Hailo. We're happy to address review feedback and coordinate merge timing.
Summary by CodeRabbit
Release Notes
New Features
Updates