Name Date Size #Lines LOC

..--

Documentation/H25-Apr-2025-1,8551,477

fuzzing/H25-Apr-2025-194120

libfdt/H25-Apr-2025-6,2733,098

pylibfdt/H25-Apr-2025-1,221907

scripts/H25-Apr-2025-5731

tests/H25-Apr-2025-13,1179,912

.cirrus.ymlH A D25-Apr-2025405 2421

.editorconfigH A D25-Apr-2025562 3124

.gitignoreH A D25-Apr-2025234 3228

.travis.ymlH A D25-Apr-20251.4 KiB6655

Android.bpH A D25-Apr-20253.8 KiB167150

BSD-2-ClauseH A D25-Apr-20251.6 KiB3327

BUILD.bazelH A D25-Apr-20252 KiB117106

CONTRIBUTING.mdH A D25-Apr-20253.4 KiB8059

GPLH A D25-Apr-202517.7 KiB340281

LGPLH A D25-Apr-202526.8 KiB504419

LICENSEH A D25-Apr-202546.2 KiB881729

MANIFEST.inH A D25-Apr-2025247 1210

METADATAH A D25-Apr-2025531 2018

METADATA_version.sedH A D25-Apr-2025131 21

MODULE_LICENSE_BSDHD25-Apr-20250

MODULE_LICENSE_GPLHD25-Apr-20250

MODULE_LICENSE_LGPLHD25-Apr-20250

MakefileH A D25-Apr-20258.9 KiB400273

Makefile.convert-dtsv0H A D25-Apr-2025330 155

Makefile.dtcH A D25-Apr-2025467 2415

Makefile.utilsH A D25-Apr-2025499 3216

OWNERSH A D25-Apr-2025146 65

README.licenseH A D25-Apr-20252.8 KiB5747

README.mdH A D25-Apr-20252.7 KiB10174

README.versionH A D25-Apr-2025149 43

TODOH A D25-Apr-2025260 98

WORKSPACEHD25-Apr-20250

checks.cH A D25-Apr-202553.8 KiB2,0711,636

convert-dtsv0-lexer.lH A D25-Apr-20254.3 KiB236187

data.cH A D25-Apr-20254.5 KiB257187

dtc-lexer.lH A D25-Apr-20256.1 KiB298233

dtc-parser.yH A D25-Apr-202511.2 KiB600498

dtc.cH A D25-Apr-20259.2 KiB372316

dtc.hH A D25-Apr-20259.6 KiB369269

dtdiffH A D25-Apr-2025680 4026

fdtdump.cH A D25-Apr-20256.1 KiB249204

fdtget.cH A D25-Apr-20258.6 KiB381268

fdtoverlay.cH A D25-Apr-20254.2 KiB209160

fdtput.cH A D25-Apr-202510.7 KiB469335

flattree.cH A D25-Apr-202521.5 KiB927689

fstree.cH A D25-Apr-20251.5 KiB7755

livetree.cH A D25-Apr-202520.8 KiB1,066784

meson.buildH A D25-Apr-20252.9 KiB140119

meson_options.txtH A D25-Apr-2025601 1312

setup.pyH A D25-Apr-20252.1 KiB7859

srcpos.cH A D25-Apr-20258.6 KiB407290

srcpos.hH A D25-Apr-20252.9 KiB10457

treesource.cH A D25-Apr-20256.8 KiB338290

util.cH A D25-Apr-20258.7 KiB480358

util.hH A D25-Apr-20257.1 KiB25086

version_gen.h.inH A D25-Apr-202536 21

yamltree.cH A D25-Apr-20256.3 KiB236185

README.license

1Licensing and contribution policy of dtc and libfdt
2===================================================
3
4This dtc package contains two pieces of software: dtc itself, and
5libfdt which comprises the files in the libfdt/ subdirectory.  These
6two pieces of software, although closely related, are quite distinct.
7dtc does not incorporate or rely on libfdt for its operation, nor vice
8versa.  It is important that these two pieces of software have
9different license conditions.
10
11As SPDX license tags in each source file attest, dtc is licensed
12under the GNU GPL.  The full text of the GPL can be found in the file
13entitled 'GPL' which should be included in this package.  dtc code,
14therefore, may not be incorporated into works which do not have a GPL
15compatible license.
16
17libfdt, however, is GPL/BSD dual-licensed.  That is, it may be used
18either under the terms of the GPL, or under the terms of the 2-clause
19BSD license (aka the ISC license).  The full terms of that license can
20be found are in the file entitled 'BSD-2-Clause'. This is, in
21practice, equivalent to being BSD licensed, since the terms of the BSD
22license are strictly more permissive than the GPL.
23
24I made the decision to license libfdt in this way because I want to
25encourage widespread and correct usage of flattened device trees,
26including by proprietary or otherwise GPL-incompatible firmware or
27tools.  Allowing libfdt to be used under the terms of the BSD license
28makes that it easier for vendors or authors of such software to do so.
29
30This does mean that libfdt code could be "stolen" - say, included in a
31proprietary fimware and extended without contributing those extensions
32back to the libfdt mainline.  While I hope that doesn't happen, I
33believe the goal of allowing libfdt to be widely used is more
34important than avoiding that.  libfdt is quite small, and hardly
35rocket science; so the incentive for such impolite behaviour is small,
36and the inconvenience caused thereby is not dire.
37
38Licenses such as the LGPL which would allow code to be used in non-GPL
39software, but also require contributions to be returned were
40considered.  However, libfdt is designed to be used in firmwares and
41other environments with unusual technical constraints.  It's difficult
42to anticipate all possible changes which might be needed to meld
43libfdt into such environments and so difficult to suitably word a
44license that puts the boundary between what is and isn't permitted in
45the intended place.  Again, I judged encouraging widespread use of
46libfdt by keeping the license terms simple and familiar to be the more
47important goal.
48
49**IMPORTANT** It's intended that all of libfdt as released remain
50permissively licensed this way.  Therefore only contributions which
51are released under these terms can be merged into the libfdt mainline.
52
53
54David Gibson <[email protected]>
55(principal original author of dtc and libfdt)
562 November 2007
57

README.md

1# Device Tree Compiler and libfdt
2
3The source tree contains the Device Tree Compiler (dtc) toolchain for
4working with device tree source and binary files and also libfdt, a
5utility library for reading and manipulating the binary format.
6
7dtc and libfdt are maintained by:
8
9* [David Gibson `<[email protected]>`](mailto:[email protected])
10
11## Python library
12
13A Python library wrapping libfdt is also available. To build this you
14will need to install `swig` and Python development files. On Debian
15distributions:
16
17```
18$ sudo apt-get install swig python3-dev
19```
20
21The library provides an `Fdt` class which you can use like this:
22
23```
24$ PYTHONPATH=../pylibfdt python3
25>>> import libfdt
26>>> fdt = libfdt.Fdt(open('test_tree1.dtb', mode='rb').read())
27>>> node = fdt.path_offset('/subnode@1')
28>>> print(node)
29124
30>>> prop_offset = fdt.first_property_offset(node)
31>>> prop = fdt.get_property_by_offset(prop_offset)
32>>> print('%s=%s' % (prop.name, prop.as_str()))
33compatible=subnode1
34>>> node2 = fdt.path_offset('/')
35>>> print(fdt.getprop(node2, 'compatible').as_str())
36test_tree1
37```
38
39You will find tests in `tests/pylibfdt_tests.py` showing how to use each
40method. Help is available using the Python help command, e.g.:
41
42```
43$ cd pylibfdt
44$ python3 -c "import libfdt; help(libfdt)"
45```
46
47If you add new features, please check code coverage:
48
49```
50$ sudo apt-get install python3-coverage
51$ cd tests
52# It's just 'coverage' on most other distributions
53$ python3-coverage run pylibfdt_tests.py
54$ python3-coverage html
55# Open 'htmlcov/index.html' in your browser
56```
57
58The library can be installed with pip from a local source tree:
59
60```
61$ pip install . [--user|--prefix=/path/to/install_dir]
62```
63
64Or directly from a remote git repo:
65
66```
67$ pip install git+git://git.kernel.org/pub/scm/utils/dtc/dtc.git@main
68```
69
70The install depends on libfdt shared library being installed on the
71host system first. Generally, using `--user` or `--prefix` is not
72necessary and pip will use the default location for the Python
73installation which varies if the user is root or not.
74
75You can also install everything via make if you like, but pip is
76recommended.
77
78To install both libfdt and pylibfdt you can use:
79
80```
81$ make install [PREFIX=/path/to/install_dir]
82```
83
84To disable building the python library, even if swig and Python are available,
85use:
86
87```
88$ make NO_PYTHON=1
89```
90
91More work remains to support all of libfdt, including access to numeric
92values.
93
94## Mailing lists
95
96* The [devicetree-compiler](mailto:[email protected])
97  list is for discussion about dtc and libfdt implementation.
98* Core device tree bindings are discussed on the
99  [devicetree-spec](mailto:[email protected]) list.
100
101

README.version

1URL: https://git.kernel.org/cgit/utils/dtc/dtc.git/commit/?id=120775eb1cf39f8dcecd695c3ff1cfef8aeb669d
2Version: 1.4.2 plus bugfixes
3Owners: cphoenix
4