How to correctly compile own dts

  • Hi.

    I would like to try compile dts for x96 Max Plus (S905X3 with IP1001N ethernet).
    I have dts for it, but I'm still fighting with compilation.
    The box is able to start with meson-sm1-x96-air-gbit.dtb, but without any network.

    I have working build environment and I made first image build without any changes (12.2).
    Now I'm struggling with the dts compilation (I'm pretty new to compiling whole Linux).
    I found steps for coreelec, but it doesn't work with LibreElec: https://discourse.coreelec.org/t/step-by-step…e-files/18792/3

    When I tried to build the dtb manually (using cpp and dtc), even the air-gbit.dtb doesn't work for me (bootlooping, no display output).

    Can you please share right steps to do it? I tried to search online but without success :/

    Thank you

  • Fork my amlogic-6.16.y branch on GitHub then checkout a branch for your change, and then add your device tree file to arch/arm64/boot/dts/amlogic/ with a matching entry in the Makefile. Commit the change to your branch and then generate a patch with “git format-patch HEAD~1” and then rename from 0001-* to 9999-* and copy the patch file to projects/Amlogic/devices/AMLGX/patches/linux/ .. then rebuild the image and it should be compiled. If there are issues compile will fail with line/char references to the first failing problem. Note that you will not be able to just reuse a dts from CE as their kernels are diverged from upstream.

  • Thank you for the reply!

    I see, I will test it out :)

    Yes, I noticed that Coreelec has some custom dtb, but there is also unifreq kernel, which has dts for Max+, so I will try it out.
    I will also try to pull original dtb from the Android system to check it.