How to load device tree overlay on allwinner board

I am trying to build an olimex A20 som board using the balena-allwinner repository.
I have tried to modify machine conf and I was able to boot balenaOs on the device.
I have added device tree overlays over KERNEL_DEVICETREE and the repo is able to compile dtbo from and by using BALENA_BOOT_PARTITION_FILES I have copied them to boot/dtb/overlay folder.
I am still not able to see any overlays loaded by checking /proc/device-tree.

I have tried adding the overlays over to boot/extra_uEnv.txt using dtoverlay=uart2
but I still do not see it loaded over the kernel.

Hello @rohitsharmar2p welcome to the balena community!

Are you following this instructions? Customer Board Support - Balena Documentation

Did you follow the tutorial here? IoT Happy Hour #45: Building balenaOS for a Device - YouTube

Could you please share more logs?

Hi Marc ( @mpous )

Sorry for responding late.
I was able to figure out how to enable device tree overlay.
So I found there are 2 ways -

  1. Direct patching of DTS file - Patch DTS file of the device and add/modify changes for device tree overlay over to this file.
    Pros.
    • No extra overlay file required.
    • Faster
      Cons.
    • Requires building of device tree with the Operating system
  2. Adding device tree overlay to boot/dts/overlay folder and update init of Balena os to load the device tree when system starts ( Dynamic loading ) into the kernel using
mkdir -p /sys/kernel/config/device-tree/overlays/uart2
cat uart2.dtbo > /sys/kernel/config/device-tree/overlays/uart2/dtbo

Pros.
* Easier to manage
Cons.
* Slower than direct DTS patching

2 Likes

Hello @rohitsharmar2p thanks for sharing your solutions.

Let us know if we can help you more!