pub/scm/utils/dtc/dtc.git  about / heads / tags
The Device Tree Compiler
$ git log --pretty=format:'%h %s (%cs)%d'
ce1d858 tests: When building .so from -O asm output mark as non-executable stack (2025-02-05)
	(HEAD -> master, main)
915daad Start with empty __local_fixups__ and __fixups__ nodes (2025-01-24)
4ea851f Let get_subnode() not return deleted nodes (2025-01-24)
175d2a5 Use build_root_node() instead of open-coding it (2025-01-24)
18f4f30 build: fix -Dtools=false build (2024-12-18)
267efc7 checks: Warn about missing #address-cells for interrupt parents (2024-12-18)
755db11 libfdt: Add fdt_setprop_namelen_string() (2024-12-06)
bdca861 libfdt: Add fdt_setprop_namelen() (2024-12-06)
0f69ced libfdt_internal: fdt_find_string_len_() (2024-12-06)
56b2b30 libfdt: add fdt_get_property_namelen_w() (2024-12-06)
...

$ git cat-file blob HEAD:README.md
# Device Tree Compiler and libfdt

The source tree contains the Device Tree Compiler (dtc) toolchain for
working with device tree source and binary files and also libfdt, a
utility library for reading and manipulating the binary format.

dtc and libfdt are maintained by:

* [David Gibson `<david@gibson.dropbear.id.au>`](mailto:david@gibson.dropbear.id.au)

## Python library

A Python library wrapping libfdt is also available. To build this you
will need to install `swig` and Python development files. On Debian
distributions:

```
$ sudo apt-get install swig python3-dev
```

The library provides an `Fdt` class which you can use like this:

```
$ PYTHONPATH=../pylibfdt python3
>>> import libfdt
>>> fdt = libfdt.Fdt(open('test_tree1.dtb', mode='rb').read())
>>> node = fdt.path_offset('/subnode@1')
>>> print(node)
124
>>> prop_offset = fdt.first_property_offset(node)
>>> prop = fdt.get_property_by_offset(prop_offset)
>>> print('%s=%s' % (prop.name, prop.as_str()))
compatible=subnode1
>>> node2 = fdt.path_offset('/')
>>> print(fdt.getprop(node2, 'compatible').as_str())
test_tree1
```

You will find tests in `tests/pylibfdt_tests.py` showing how to use each
method. Help is available using the Python help command, e.g.:

```
$ cd pylibfdt
$ python3 -c "import libfdt; help(libfdt)"
```

If you add new features, please check code coverage:

```
$ sudo apt-get install python3-coverage
$ cd tests
# It's just 'coverage' on most other distributions
$ python3-coverage run pylibfdt_tests.py
$ python3-coverage html
# Open 'htmlcov/index.html' in your browser
```

The library can be installed with pip from a local source tree:

```
$ pip install . [--user|--prefix=/path/to/install_dir]
```

Or directly from a remote git repo:

```
$ pip install git+git://git.kernel.org/pub/scm/utils/dtc/dtc.git@main
```

The install depends on libfdt shared library being installed on the
host system first. Generally, using `--user` or `--prefix` is not
necessary and pip will use the default location for the Python
installation which varies if the user is root or not.

You can also install everything via make if you like, but pip is
recommended.

To install both libfdt and pylibfdt you can use:

```
$ make install [PREFIX=/path/to/install_dir]
```

To disable building the python library, even if swig and Python are available,
use:

```
$ make NO_PYTHON=1
```

More work remains to support all of libfdt, including access to numeric
values.

## Mailing lists

* The [devicetree-compiler](mailto:devicetree-compiler@vger.kernel.org)
  list is for discussion about dtc and libfdt implementation.
* Core device tree bindings are discussed on the
  [devicetree-spec](mailto:devicetree-spec@vger.kernel.org) list.

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
  main         tests: When building .so from -O asm output mark as non-executable stack (2025-02-05)
* master       tests: When building .so from -O asm output mark as non-executable stack (2025-02-05)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
v1.7.2       DTC 1.7.2 (2024-11-06) tar.gz
v1.7.1       DTC 1.7.1 (2024-08-17) tar.gz
v1.7.0       DTC 1.7.0 (2023-02-09) tar.gz
v1.6.1       DTC 1.6.1 (2021-06-08) tar.gz
v1.6.0       DTC 1.6.0 (2020-03-04) tar.gz
v1.5.1       DTC 1.5.1 (2019-09-04) tar.gz
v1.5.0       DTC 1.5.0 (2019-03-06) tar.gz
v1.4.7       DTC 1.4.7 (2018-07-23) tar.gz
v1.4.6       DTC 1.4.6 (2018-01-03) tar.gz
v1.4.5       DTC 1.4.5 (2017-09-27) tar.gz
...

# associated public inboxes:
# (number on the left is used for dev purposes)
        731 linux-devicetree
        547 devicetree-compiler
        292 lkml
        232 u-boot
        122 linuxppc-dev
         64 linux-arm-kernel
         46 xen-devel
         22 kvmarm
         20 qemu-devel
         20 kexec
         12 dri-devel
          9 netdev
          9 linux-kbuild
          8 linux-omap
          7 alsa-devel
          7 linux-sh
          6 linux-samsung-soc
          6 linux-mm
          6 openembedded-core
          5 linux-acpi
          5 netfilter-devel
          5 linux-fsdevel
          5 linux-media
          5 stable
          5 linux-mips
          5 linux-renesas-soc
          5 linux-rdma
          5 dpdk-dev
          5 linux-bluetooth
          5 intel-gfx
          5 linux-s390
          5 linux-um
          4 linux-wireless
          4 linux-riscv
          4 linux-nfs
          4 linux-crypto
          4 linux-rtc
          4 linux-scsi
          4 linux-gpio
          4 git
          4 amd-gfx
          4 linux-api
          4 linux-arch
          4 linux-perf-users
          4 linux-alpha
          3 linux-xfs
          3 linux-mediatek
          3 linux-cifs
          3 linux-arm-msm
          3 linux-snps-arc
          3 linux-btrfs
          3 linux-usb
          3 selinux
          3 linux-ext4
          3 linux-security-module
          3 kvm
          3 linux-serial
          3 util-linux
          3 linux-doc
          3 linux-mmc
          3 linux-fbdev
          3 nouveau
          3 sparclinux
          3 buildroot
          3 ofono
          3 ltp
          3 yocto
          3 openembedded-devel
          3 yocto-meta-virtualization
          3 yocto-meta-ti
          3 openrisc
          3 intel-wired-lan
          3 intel-xe
          3 poky
          3 qemu-riscv
          3 linux-ia64
          3 cluster-devel
          3 kvm-ppc
          3 linux-hexagon
          2 linux-mtd
          2 linux-nvme
          2 bpf
          2 linux-amlogic
          2 linux-erofs
          2 linux-iommu
          2 fstests
          2 linux-pm
          2 linux-input
          2 driverdev-devel
          2 linux-kselftest
          2 linux-clk
          2 linux-iio
          2 linux-parisc
          2 linux-pci
          2 linux-f2fs-devel
          2 linux-modules
          2 linux-rt-users
          2 linux-ide
          2 linux-watchdog
          2 linux-trace-devel
          2 linux-m68k
          2 linux-i3c
          2 backports
          2 linux-csky
          2 linux-man
          2 linux-audit
          2 linux-spi
          2 linux-i2c
          2 linux-sparse
          2 linux-pwm
          2 linux-tegra
          2 lttng-dev
          2 virtualization
          2 linux-can
          2 containers
          2 linux-rockchip
          2 linux-raid
          2 platform-driver-x86
          2 openbmc
          2 linux-hardening
          2 dm-devel
          2 linux-cxl
          2 target-devel
          2 linux-staging
          2 linux-coco
          2 fio
          2 iwd
          2 yocto-meta-freescale
          2 yocto-toaster
          2 yocto-meta-arm
          2 bitbake-devel
          2 yocto-meta-arago
          2 outreachy
          2 virtio-comment
          2 grub-devel
          2 autofs
          2 reiserfs-devel
          2 lvm-devel
          2 virtio-fs
          2 fuego
          2 igt-dev
          1 linux-fscrypt
          1 cocci
          1 linux-block
          1 live-patching
          1 linux-efi
          1 linux-integrity
          1 linux-edac
          1 linux-nvdimm
          1 linux-hwmon
          1 kernel-hardening
          1 dmaengine
          1 linux-next
          1 linux-leds
          1 kernelnewbies
          1 linux-sgx
          1 linux-hyperv
          1 workflows
          1 rcu
          1 selinux-refpolicy
          1 linux-spdx
          1 linux-wpan
          1 ksummit-discuss
          1 wireguard
          1 io-uring
          1 linux-kernel-mentees
          1 tpmdd-devel
          1 linux-unionfs
          1 linux-firmware
          1 cip-dev
          1 linux-remoteproc
          1 linux-dash
          1 linux-bcache
          1 mm-commits
          1 linux-fpga
          1 ceph-devel
          1 xdp-newbies
          1 phone-devel
          1 dash
          1 keyrings
          1 linux-sctp
          1 lustre-devel
          1 soc
          1 ocfs2-devel
          1 rust-for-linux
          1 ath10k
          1 ath11k
          1 linux-phy
          1 kernel-janitors
          1 linux-sunxi
          1 mptcp
          1 regressions
          1 ksummit
          1 b43-dev
          1 nvdimm
          1 linux-nfc
          1 linux-bcachefs
          1 ath9k-devel
          1 ntfs3
          1 llvm
          1 ell
          1 yocto-docs
          1 linux-patches
          1 chrome-platform
          1 ntb
          1 xenomai
          1 damon
          1 asahi
          1 loongarch
          1 imx
          1 ath12k
          1 b4-sent
          1 linux-trace-kernel
          1 oe-linux-nfc
          1 oe-kbuild-all
          1 oe-chipsec
          1 batman
          1 virtio-dev
          1 v9fs
          1 ecryptfs
          1 kbd
          1 cpufreq
          1 dccp
          1 cgroups
          1 devicetree-spec
          1 initramfs
          1 hail-devel
          1 kvm-ia64
          1 linux-8086
          1 kernel-testers
          1 linux-btrace
          1 linux-embedded
          1 linux-hams
          1 linux-hotplug
          1 linux-laptop
          1 linux-sound
          1 trinity
          1 linux-metag
          1 linux-x25
          1 linux-nilfs
          1 lvs-devel
          1 netfilter
          1 linux-oxnas
          1 u-boot-amlogic
          1 lm-sensors
          1 acpica-devel
          1 perfbook
          1 smatch
          1 wireless-regdb
          1 powertop

git clone https://yhbt.net/lore/pub/scm/utils/dtc/dtc.git