LinuxCommandLibrary

dtc

Compile device tree source files

TLDR

Decompile a .dtb file into a readable .dts file

$ dtc -I dtb -O dts -o [path/to/output_file.dts] [path/to/input_file.dtb]
copy

SYNOPSIS

dtc [options] -o

PARAMETERS

-h
    Display the help message and exit.

-v
    Display the version information and exit.

-I
    Specify the input file format (dts, dtb, asm, fdtdump).

-O
    Specify the output file format (dts, dtb, asm).

-o
    Specify the output file name.

-V
    Specify the device tree blob version (deprecated).

-d
    Write dependencies to .

-@
    Add the symbols table to the device tree blob.

-p
    Set the phandle mask to (deprecated).

-i
    Add to the include file search path.

-H
    Specify the phandle format (legacy, epapr).

-f
    Force overwrite of output file.

-s
    Sort entries in the device tree blob.

-q
    Quiet, suppress warnings.

DESCRIPTION

The dtc command is the device tree compiler. It takes as input a device tree source (.dts) file, which is a human-readable text file describing the hardware components of a system, and compiles it into a device tree blob (.dtb) file. The .dtb file is a binary format suitable for use by the kernel during boot to understand the system's hardware configuration.
The dtc command allows customization of the compilation process, including specifying include paths for header files, controlling the output format, and specifying warnings and error handling options.
Essentially, dtc bridges the gap between human-readable hardware descriptions and the machine-readable format required by the operating system to properly initialize and manage hardware resources. Correct compilation and deployment of a proper device tree blob is critical for the correct operation of embedded Linux systems and similar architectures. It is essential for bootstrapping the Linux kernel on architectures like ARM and PowerPC.

DEVICE TREE OVERLAYS

dtc is also used to compile device tree overlays, which are used to dynamically modify the device tree at runtime. These are usually applied via configfs.

SEE ALSO

fdtdump(1)

Copied to clipboard