Device Tree Compiler - notro/rpi-bcm2835 GitHub Wiki

Install

$ sudo apt-get install device-tree-compiler
Setting up device-tree-compiler (1.3.0-4) ...

This version can't expand the binary file (FDT_ERR_NOSPACE). See Build dtc from source if you need this.

Examples

$ fdtdump /boot/bcm2835-rpi-b.dtb
$ fdtget /boot/bcm2835-rpi-b.dtb /soc/mmc@7e300000 status
okay
$ fdtget /boot/bcm2835-rpi-b.dtb /soc/sdhci@7e300000 status
disabled

# disable i2c
$ fdtget /boot/bcm2835-rpi-b.dtb /soc/i2c@20205000 status
okay
$ sudo fdtput -t s /boot/bcm2835-rpi-b.dtb /soc/i2c@20205000 status 'disabled'
Error at 'status': FDT_ERR_NOSPACE
# The current 'okay' gives us space for 4 characters. Anything other than okay,ok will disable.
$ sudo fdtput -t s /boot/bcm2835-rpi-b.dtb /soc/i2c@20205000 status 'dis'
$ fdtget /boot/bcm2835-rpi-b.dtb /soc/i2c@20205000 status
dis

'status' property

The status property determines whether the device is enabled or not.
Absent property, "okay" or "ok" value, means the device is enabled. Any other value means disabled.
Ref: http://lxr.free-electrons.com/ident?a=arm;i=__of_device_is_available

Build dtc from source

Build dtc from source to get the ability to add/expand properties

sudo apt-get install flex bison
git clone http://git.jdl.com/software/dtc.git
cd dtc
make

# make install, puts the files in ~/, instead we do:
sudo cp -v libfdt/libfdt*.so /usr/lib/
sudo cp -v dtc fdtdump fdtget fdtput /usr/bin/

dtc -v
Version: DTC 1.4.0