Introduction
Maivin is a modular platform with support for various imaging sensors and expansion slots which are enabled through Device Tree Overlays. Device drivers in Linux are enabled through the Device Tree and Linux provides Device Tree Overlays which allow smaller targeted changes to the Device Tree to be defined.
This article focuses on the configuration of the Device Tree Overlays for the Maivin platforms and common expansion configurations. For deeper details refer to the Customization section at the end of this article.
Configuration
Configuration of overlays is done through the overlays.txt file which lives under the /boot section and is managed by ostree updates. To ensure the overlays.txt is consistent across system updates we recommend saving to /etc/overlays.txt instead as Maivin has a service (update-overlays) that manages synchronizing /etc/overlays.txt with the /boot sections.
Maivin Version Overlay
The minimal overlays.txt should load the correct overlay for either the Maivin 1 or Maivin 2 platform. This includes all the core differences between the two platforms but does not include camera configurations that live in dedicated overlays.
For example, the minimum configuration in /etc/overlays.txt for a Maivin 2 would be the following. For a Maivin 1 simply adjust the 2 to a 1.
fdt_overlays=maivin2.dtbo
M.2 Expansion Port
Maivin includes an M.2 expansion port that supports various devices such as LTE Modems, SSD Storage, or additional Neural Network Accelerators. M.2 devices can be either PCI-e or USB devices, you will need to know which your device uses to enable the correct overlay for your device.
The configuration is the same for Maivin 1 and 2 but you must use the correct overlay for your platform. In the following examples we use Maivin 2, if you're using Maivin 1 change the 2 to a 1 in the configuration.
Enable M.2 for USB
fdt_overlays=maivin2.dtbo maivin2-m2usb.dtbo
Enable M.2 for PCI-e
fdt_overlays=maivin2.dtbo maivin2-m2pcie.dtbo
Maivin 1 Camera Sensors
Maivin 1 currently supports either the AR0521 or the OS08A20 image sensors. The AR0521 is the default sensor which provides 5 Mega-Pixels while the OS08A20 is an optional upgrade to Maivin 1 providing 8 Mega-Pixels, full 4K UHD at 3840x2160 resolution, the same sensor used by Maivin 2.
Enable AR0521
Note: there's a known issue with the current AR0521 driver which limits operations to VGA. Refer to the Maivin 1 AR0521 Sensor using Torizon for Maivin 6.5.0.2 KB for details.
fdt_overlays=maivin1.dtbo maivin1-ar0521.dtbo
Enable OS08A20
fdt_overlays=maivin1.dtbo maivin1-os08a20.dtbo
Maivin 2 Camera Sensors
Maivin 2 currently supports the OS08A20 4K image sensor in either landscape or portrait orientations. A single overlay is required for either configuration which will auto-detect the correct setup on boot.
fdt_overlays=maivin2.dtbo maivin2-os08a20.dtbo
While the correct orientation is detected at boot, they each use a unique MIPI connector which means the camera device node will be different from Linux. When using portrait mode the device will be /dev/video2 while using landscape mode will have the camera on /dev/video3.
Customization
You may customize or add additional overlays. To do so you will first need to have the Linux Kernel for Maivin setup and compiled as this is needed for building overlays. Next, you will need to clone the Maivin Overlays repository on GitHub.
Once you've built the Linux kernel you may build the Maivin overlays. for simplicty, we will assume both linux-maivin and maivin-overlays have been cloned to your $HOME on a Linux machine configured for cross-compiling Linux ARM64.
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export DTC_FLAGS=-@
export STAGING_KERNEL_DIR=$HOME/linux-maivin
You can now customize or add additional overlays to build. If adding new overlays ensure they have an entry in overlays/Makefile along with the other dtb-y entries. For example, if adding myoverlay.dts you would add the following to the Makefile where other dtb-y entries are found.
dtb-y += myoverlay.dtbo
Once you're ready to build, simply use make.
make -C overlays
Your overlays will be found under overlays/*.dtbo and can be copied to your Maivin under the /boot/overlays folder and applied by adding them to /boot/overlays.txt as documented above.
Comments
0 comments
Please sign in to leave a comment.