Jump to content

device tree compiler (dtc) upgrades


ag123

Recommended Posts

there is this particular version of dtc by Pantelis Antoniou

https://github.com/pantoniou/dtc

which allows dynamic overlays and use of symbols instead of numeric addresses as references

https://events.static.linuxfound.org/sites/events/files/slides/dynamic-dt-elce14.pdf

 

after doing a bit of research i found that the more recent version of device-tree-compiler shipped with the kernel and armbian has built-in the dynamic overlays as well

https://git.kernel.org/pub/scm/utils/dtc/dtc.git

 

however, i found out that even with the nightly builds the current dtc version 1.4.2 isn't as recent as the updated version that could be found in debian repository

http://httpredir.debian.org/debian/pool/main/d/device-tree-compiler/

i tried various commands apt-get etc but did not succeed in downloading the latest release

what i did is to download that manually

$ wget http://httpredir.debian.org/debian//pool/main/d/device-tree-compiler/device-tree-compiler_1.4.7-3_armhf.deb

$ dpkg --install device-tree-compiler_1.4.7-3_armhf.deb

 

this seem to work ok so far

it might be shipped in a 'future' release / update of debian (it isn't in nightly) that has the dynamic overlay and symbol substitution features

it is actually a more recent version of dtc bundled with the linux kernel. Some how that recent version didn't get bundled with the recent kernels which uses those features
However, you could have that earlier by downloading it and installing the new version

Link to comment
Share on other sites

5 hours ago, ag123 said:

there is this particular version of dtc by Pantelis Antoniou

https://github.com/pantoniou/dtc

Yes, this is what I'm using with his dt-overlays5 branch when I compile it out-of-the-tree.

The one used by Armbian during build process is coming from linux-mainline/linux-4.18.y/scripts/dtc/dtc location, symbols has been merged into Mainliine DTC since Jan 2017, before that Armbian had a patch for it.

 

Link to comment
Share on other sites

thanks ! for now as the dtc which i used is apparently from the kernel source tree and distributed in debian / upstream from armbian, i'd make do and try that out first. it is rather likely that at some future 'upgrades' / releases of debian, this new version may be distributed instead. i'm not too sure what are the differences but in Pantelis Antoniou git, master branch seemed more updated than even dt-overlays5, but i've checked out (cloned) both branches in case there are some differences which is needed

Link to comment
Share on other sites

i tried out this dt overlay using the updated dtc 1.4.7 from debian repository, on my orange pi pc (h3) armbian (5.59 upgraded to 5.60 nightly sunxi-next 4.14.70), this is an attempt to change the keycode returned by gpio keys which maps to BTN_0 to KEY_POWER

/dts-v1/;
/plugin/;

/ {
  fragment@0 {
    target-path = "/r_gpio_keys/sw4";
    __overlay__ {
      linux,code = <116>;
    };
  };
};

saved that in a file say button.dts

  • dtc -I dts -O dtb -o button.dtbo button.dts
  • (as root) mkdir /sys/kernel/config/device-tree/overlays/button
  • (as root) cat button.dtbo > /sys/kernel/config/device-tree/overlays/button/dtbo

i've verified that it actually works, the overlay gets applied

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines