Tool to visualize the device tree file (dtb) used by the Linux kernel? [closed]

dtc -O dts

sudo apt-get install device-tree-compiler
dtc -I dtb -O dts -o a.dts a.dtb

gives a well indented textual representation of the device tree a.dtb, which is easy to understand with a text editor. Or dump it to stdout with:

dtc -I dtb -O dts -o - a.dtb

The source code for dtc is present in the kernel tree itself at scripts/dtc/dtc.c

Tested on Ubuntu 16.04, with the device tree of Raspberry Pi 2, found in the first partition of 2016-05-27-raspbian-jessie-qemu.img.

For convenience I have in my .bashrc:

dtbs() ( dtc -I dtb -O dts -o - "$1" )
dtsb() ( dtc -I dts -O dtb -o - "$1" )

dtc can also extract the DTS from /proc of a live kernel as shown at: https://unix.stackexchange.com/questions/265890/is-it-possible-to-get-the-information-for-a-device-tree-using-sys-of-a-running

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)