Linux kernel driver providing userspace I/O (UIO) access to DMA-capable memory regions.
The UIO DMA driver is an out-of-tree Linux kernel module that enables userspace applications to allocate and manage DMA (Direct Memory Access) buffers through the UIO (Userspace I/O) framework. This allows zero-copy data transfers between hardware devices and userspace applications.
The UIO DMA driver enables:
- Zero-copy data transfer to the Ara240 NPU
- Efficient input tensor allocation
- Direct memory access for inference results
- Reduced latency for AI/ML pipelines
This repository contains two versions of the driver:
- Platform: x86/x86_64 architectures
- Cache Model: Cache-coherent systems
- Use Case: Standard PC/server platforms with hardware cache coherency
- Platform: ARM-based NXP i.MX SoCs (i.MX 8M Plus, i.MX 95, etc.)
- Cache Model: Implements explicit cache management operations
- Use Case: Embedded ARM platforms requiring manual cache synchronization
Features:
- Manual cache flush/invalidate operations
- Proper handling of non-coherent DMA
- Optimized for ARM memory subsystems
💡 Important: Always use
uiodma_cache_management/for NXP i.MX devices to ensure data coherency between the CPU and DMA operations.
- Linux kernel headers matching your running kernel
- GCC compiler
- Make build system
- Root/sudo privileges for module installation
sudo apt-get update
sudo apt-get install linux-headers-$(uname -r)Ensure kernel headers are available in your BSP. The kernel version must match your target device (e.g., 6.18.20-2.0.0 for recent i.MX releases).
cd uiodma/
make clean
makesource <toolchain-path>/environment-setup-armv8-2a-poky-linux
cd uiodma_cache_management/
make clean
make KERNEL_SRC=<path-to-kernel-source>Note: The kernel specified by KERNEL_SRC must be built beforehand.
sudo insmod uiodma/uiodma.koWhen using uiodma with rt-sdk-ara2 (Ara240 Runtime SDK) on i.MX devices, the module must be placed at:
/usr/share/rt-sdk-ara240/driver/uiodma.ko
scp uiodma_cache_management/uiodma.ko root@<i.mx_ip_addr>:/usr/share/rt-sdk-ara240/driver/Note: Modifying this path will require an update to the Ara240 SDK configuration.
This driver is licensed under GPL-2.0-only.
Note: This is an out-of-tree kernel module. It is not part of the mainline Linux kernel and must be maintained separately for each kernel version.