Introduction
As part of our Torizon for Maivin BSP we provide the maivin-overlays project which provides device tree overlays. These are used to address differences between Maivin 1 & 2 as well as support for additional components, such as the camera modules. Customers with additional hardware can fork and extend the maivin-overlays repository to provide additional device tree configurations.
Configuration
To use the provided overlays you must edit the /boot/overlays.txt (Torizon will be /boot/ostree/torizon-*/dtb) file with a space-separated list of the desired overlays. Currently, we provide overlays for Maivin 1 & 2 plus an additional pair of overlays for their respective OS08A20 camera module configurations.
- Maivin 1
- maivin1.dtbo
- maivin1-os08a20.dtbo
- Maivin 2
- maivin2.dtbo
- maivin2-os08a20.dtbo
The maivinN.dtbo should always be included, using the correct version for your hardware. The baseline Maivin device tree (without maivinN.dtbo) provides configuration of the base system common to both versions and is enough to boot and use ethernet/wifi and the various serial consoles. To use the camera or other additional peripherals on each platform you must use the overlays.
An example base configuration of overlays.txt for the Maivin 2 with the OS08A20 camera sensor is as follows.
fdt_overlays=maivin2.dtbo maivin2-os08a20.dtbo
the order of the dtbo is EXTEREMLY IMPORTANT please follow the order above
Torizon OTA
When using Torizon OTA the overlays.txt file is managed by the ostree OTA mechanism. This means after an update the system will revert to the default overlays. To allow overlays.txt to maintain across updates we provide the "update-overlays" script and service. What this does is synchronize /etc/overlays.txt with all overlays.txt entries under /boot/ostree.
The following command can be used to enable the service, whenever it updates /boot it will trigger an update, the service is only run once on boot so whenever /boot is out of sync with /etc/overlays.txt the /boot file will be updated and the system reboot.
sudo systemctl enable update-overlays
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.
Once you've built the Linux kernel you may build the Maivin overlays. First, ensure you've cloned maivin-overlays to your local machine. We'll 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.