Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta-hailo support #569

Merged
merged 11 commits into from
Jan 8, 2025
Merged

Add meta-hailo support #569

merged 11 commits into from
Jan 8, 2025

Conversation

huaqianli
Copy link
Collaborator

@huaqianli huaqianli commented Dec 3, 2024

meta-hailo: Fix the CMA issue when PVU was integrated
linux-iot2050: Add support for dts overlay for PG2 and SM
meta-hailo: Pin the python-numpy to version 1.23.3
u-boot-iot2050: Make DMA ISOLATION only available for secureboot build
linux-iot2050: Add support for overlay of PG2 and SM
meta-hailo: Fix the CMA issue when PVU was integrated
linux-iot2050: Make PVU only available for secureboot build
README: Add SENS SM firmware update tool info
iot2050-conf-webui: Fix the wrong article number of SM1231 4AI
linux-iot2050: Add support for PVU-based DMA isolation on AM654
u-boot-iot2050: Add support for PVU-based DMA isolation on AM654
Add support for Hailo Card

@huaqianli huaqianli requested a review from BaochengSu December 3, 2024 07:10
@huaqianli huaqianli force-pushed the lee/hailo-card branch 3 times, most recently from d71b261 to 57d9565 Compare December 3, 2024 08:21
@huaqianli huaqianli force-pushed the lee/hailo-card branch 3 times, most recently from af68e5c to cbd7b7a Compare December 4, 2024 07:34
@huaqianli huaqianli force-pushed the lee/hailo-card branch 3 times, most recently from a5ac6ac to e0392a7 Compare December 5, 2024 06:59
Source: python-verboselogs
Section: python
Priority: optional
Maintainer: Felix Moessbauer <[email protected]>
Copy link
Member

@fmoessbauer fmoessbauer Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @huaqianli. Please change the maintainer to yourself or someone from the IOT2050 team (as this is a fork of my original PoC). We really should try to get that into Debian Trixie before the window closes. There is already a RFP. I can try to upstream if it is worth it. Just let me know.

edit Just re-read my comment below: This package is abandoned, so we should really try to get rid of the dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your kind suggestion. I am bound to considering it carefully.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have already replied to the filed bug report. However, the RFP was issued in 2017 and has not received a response yet.

@huaqianli huaqianli force-pushed the lee/hailo-card branch 3 times, most recently from e613e2d to 4432698 Compare January 3, 2025 05:06
@huaqianli huaqianli force-pushed the lee/hailo-card branch 2 times, most recently from 89fb02e to 52816a8 Compare January 7, 2025 02:59
@huaqianli huaqianli force-pushed the lee/hailo-card branch 3 times, most recently from 692abe9 to caaf610 Compare January 7, 2025 09:47
Reserve a 64M memory region and ensure that all PCI devices do their DMA
only inside that region. This is configured via a restricted-dma-pool
and enforced with the help of the first PVU.

Applying this isolation is not totally free in terms of overhead and
memory consumption. It  makes only sense for variants that support
secure booting, and generally only when this is actually enable.
Therefore model it as overlay that can be activated on demand. The
firmware will take care of this via DT fixup during boot and will also
provide a way to adjust the pool size.

Signed-off-by: Li Hua Qian <[email protected]>
The AM654 lacks an IOMMU, thus does not support isolating DMA requests
from untrusted PCI devices to selected memory regions this way. Use
static PVU-based protection instead.

For this, we use the availability of restricted-dma-pool memory regions
as trigger and register those as valid DMA targets with the PVU. In
addition, we need to enable the mapping of requester IDs to VirtIDs in
the PCI RC. We only use a single VirtID so far, catching all devices.
This may be extended later on.

Signed-off-by: Li Hua Qian <[email protected]>
This commit adds support for device tree overlays for the IOT2050
Advanced PG2 and SM variants. These overlays enable DMA isolation,
allowing for more flexible and secure memory management.

Signed-off-by: Li Hua Qian <[email protected]>
This commit integrates the following main components into image:

- hailo-pci (OSS kernel module)
- hailo-firmware (proprietary firmware for hailo8 chip)
- hailort (Userspace Libraries)
  - hailortcli (tool)
  - hailort (service)
  - libhailort (c library)
  - libhailort-dev (dev package)
  - python3-hailort (python library)
  - libgsthailo (gstreamer element)

Signed-off-by: Li Hua Qian <[email protected]>
PVU-based DMA isolation brings SWIO TLB to the table and
the maximum allowable number of contiguous slabs to map
is 128 by default, but meta-hailo requires more than 128.
Hence increase it to 256 when meta-hailo is included.

Signed-off-by: Li Hua Qian <[email protected]>
Hailort 4.18 requires the version of numpy to be 1.23.3, otherwise
the pyhailort will not work correctly.

Signed-off-by: Li Hua Qian <[email protected]>
@huaqianli huaqianli merged commit 1e7d4d5 into master Jan 8, 2025
4 checks passed
@huaqianli huaqianli deleted the lee/hailo-card branch January 8, 2025 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants