xref: /freebsd/usr.bin/dtc/dtc.1 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1af0dd31fSDavid Chisnall.\"-
2af0dd31fSDavid Chisnall.\" Copyright (c) 2013 David Chisnall
3af0dd31fSDavid Chisnall.\" All rights reserved.
4af0dd31fSDavid Chisnall.\"
5af0dd31fSDavid Chisnall.\" This software was developed by SRI International and the University of
6af0dd31fSDavid Chisnall.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
7af0dd31fSDavid Chisnall.\" ("CTSRD"), as part of the DARPA CRASH research programme.
8af0dd31fSDavid Chisnall.\"
9af0dd31fSDavid Chisnall.\" This software was developed by SRI International and the University of
10af0dd31fSDavid Chisnall.\" Redistribution and use in source and binary forms, with or without
11af0dd31fSDavid Chisnall.\" modification, are permitted provided that the following conditions
12af0dd31fSDavid Chisnall.\" are met:
13af0dd31fSDavid Chisnall.\" 1. Redistributions of source code must retain the above copyright
14af0dd31fSDavid Chisnall.\"    notice, this list of conditions and the following disclaimer.
15af0dd31fSDavid Chisnall.\" 2. Redistributions in binary form must reproduce the above copyright
16af0dd31fSDavid Chisnall.\"    notice, this list of conditions and the following disclaimer in the
17af0dd31fSDavid Chisnall.\"    documentation and/or other materials provided with the distribution.
18af0dd31fSDavid Chisnall.\"
19af0dd31fSDavid Chisnall.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20af0dd31fSDavid Chisnall.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21af0dd31fSDavid Chisnall.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22af0dd31fSDavid Chisnall.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23af0dd31fSDavid Chisnall.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24af0dd31fSDavid Chisnall.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25af0dd31fSDavid Chisnall.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26af0dd31fSDavid Chisnall.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27af0dd31fSDavid Chisnall.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28af0dd31fSDavid Chisnall.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29af0dd31fSDavid Chisnall.\" SUCH DAMAGE.
30af0dd31fSDavid Chisnall.\"/
31*2d5df840SJose Luis Duran.Dd February 26, 2022
32af0dd31fSDavid Chisnall.Dt DTC 1
33af0dd31fSDavid Chisnall.Os
34af0dd31fSDavid Chisnall.Sh NAME
35af0dd31fSDavid Chisnall.Nm dtc
36af0dd31fSDavid Chisnall.Nd device tree compiler
37af0dd31fSDavid Chisnall.Sh SYNOPSIS
38af0dd31fSDavid Chisnall.Nm
3921d5d37bSEd Maste.Op Fl @fhsv
40af0dd31fSDavid Chisnall.Op Fl b Ar boot_cpu_id
41af0dd31fSDavid Chisnall.Op Fl d Ar dependency_file
4262d16ad3SJose Luis Duran.Op Fl i Ar include_path
43af0dd31fSDavid Chisnall.Op Fl E Ar [no-]checker_name
44af0dd31fSDavid Chisnall.Op Fl H Ar phandle_format
45af0dd31fSDavid Chisnall.Op Fl I Ar input_format
46af0dd31fSDavid Chisnall.Op Fl O Ar output_format
47af0dd31fSDavid Chisnall.Op Fl o Ar output_file
48af0dd31fSDavid Chisnall.Op Fl R Ar entries
49af0dd31fSDavid Chisnall.Op Fl S Ar bytes
50af0dd31fSDavid Chisnall.Op Fl p Ar bytes
51af0dd31fSDavid Chisnall.Op Fl V Ar blob_version
52af0dd31fSDavid Chisnall.Op Fl W Ar [no-]checker_name
5388169e03SDavid Chisnall.Op Fl P Ar predefined_properties
54af0dd31fSDavid Chisnall.Ar input_file
55af0dd31fSDavid Chisnall.Sh DESCRIPTION
56af0dd31fSDavid ChisnallThe
57af0dd31fSDavid Chisnall.Nm
589d58ffcfSJohn-Mark Gurneyutility converts between flattened device tree (FDT) representations.
5903d37d34SDavid ChisnallIt is most commonly used to generate device tree blobs (DTB), the binary
6003d37d34SDavid Chisnallrepresentation of an FDT, from device tree sources (DTS), the ASCII text source
6103d37d34SDavid Chisnallrepresentation.
62af0dd31fSDavid Chisnall.Pp
6303d37d34SDavid ChisnallThe binary can be written in two formats, binary and assembly.
6403d37d34SDavid ChisnallThe binary is identical to the in-memory representation and can be used
6503d37d34SDavid Chisnalldirectly by firmware, loaders, and so on.
6603d37d34SDavid ChisnallThe assembly format, documented in
67af0dd31fSDavid Chisnall.Sx "ASM FORMAT" ,
68af0dd31fSDavid Chisnallwill produce the same binary format when assembled, but also includes some
6903d37d34SDavid Chisnallglobal variables that refer to parts of the table.
7003d37d34SDavid ChisnallThis format is most commonly used to produce a kernel specific to a device,
7103d37d34SDavid Chisnallwith the device tree blob compiled in.
72af0dd31fSDavid Chisnall.Pp
73af0dd31fSDavid ChisnallThe options are as follows:
74af0dd31fSDavid Chisnall.Bl -tag -width indent
75af0dd31fSDavid Chisnall.It Fl d Ar dependency_file
7603d37d34SDavid ChisnallWrites a dependency file understandable by make to the specified file.
7703d37d34SDavid ChisnallThis file can be included in a Makefile and will ensure that the output file
7803d37d34SDavid Chisnalldepends on the input file and any files that it includes.
7903d37d34SDavid ChisnallThis argument is only useful when the input is DTS, as only the source format
8003d37d34SDavid Chisnallhas a notion of inclusions.
8162d16ad3SJose Luis Duran.It Fl i Ar include_path
8262d16ad3SJose Luis DuranAdds a path to search for include files.
83af0dd31fSDavid Chisnall.It Fl E Ar [no-]checker_name
8403d37d34SDavid ChisnallEnable or disable a specified checker.
8503d37d34SDavid ChisnallThe argument is the name of the checker.
8603d37d34SDavid ChisnallThe full list of checkers is given in
87af0dd31fSDavid Chisnall.Sx CHECKERS .
8821d5d37bSEd Maste.It Fl @
8921d5d37bSEd MasteEmit a __symbols__ node to allow plugins to be loaded.
90af0dd31fSDavid Chisnall.It Fl f
91af0dd31fSDavid ChisnallForce the tool to attempt to generate the output, even if the input had errors.
92af0dd31fSDavid Chisnall.It Fl h
93af0dd31fSDavid ChisnallDisplay the help text and exit.
94af0dd31fSDavid Chisnall.It Fl H Ar phandle_format
9503d37d34SDavid ChisnallSpecifies the type of phandle nodes to generate in the output.
9603d37d34SDavid ChisnallValid values are:
97af0dd31fSDavid Chisnall.Pp
98af0dd31fSDavid Chisnall.Bl -tag -width indent -compact
99af0dd31fSDavid Chisnall.It Ar linux
100af0dd31fSDavid ChisnallGenerate the legacy linux,phandle nodes expected by older systems.
101af0dd31fSDavid Chisnall.It Ar epapr
10203d37d34SDavid ChisnallGenerate the phandle nodes, as described in the ePAPR specification.
10303d37d34SDavid ChisnallThis is the most sensible option for device trees being used with
104af0dd31fSDavid Chisnall.Fx .
105af0dd31fSDavid Chisnall.It Ar both
106af0dd31fSDavid ChisnallGenerate both, for maximum compatibility.
107af0dd31fSDavid Chisnall.El
108af0dd31fSDavid Chisnall.It Fl I Ar input_format
10903d37d34SDavid ChisnallSpecifies the input format.
11003d37d34SDavid ChisnallValid values are:
111af0dd31fSDavid Chisnall.Pp
112af0dd31fSDavid Chisnall.Bl -tag -width indent -compact
113af0dd31fSDavid Chisnall.It Ar dtb
11403d37d34SDavid ChisnallDevice tree blob.
11503d37d34SDavid ChisnallThe binary representation of the FDT.
116af0dd31fSDavid Chisnall.It Ar dts
11703d37d34SDavid ChisnallDevice tree source.
11803d37d34SDavid ChisnallThe ASCII representation of the FDT.
11903d37d34SDavid ChisnallThis is the default if the input format is not explicitly stated.
120af0dd31fSDavid Chisnall.El
121af0dd31fSDavid Chisnall.It Fl O Ar output_format
12203d37d34SDavid ChisnallSpecifies the output format.
12303d37d34SDavid ChisnallValid values are:
124af0dd31fSDavid Chisnall.Pp
125af0dd31fSDavid Chisnall.Bl -tag -width indent -compact
126af0dd31fSDavid Chisnall.It Ar asm
127af0dd31fSDavid ChisnallAssembler source for generating a device tree blob, as described in
128af0dd31fSDavid Chisnall.Sx "ASM FORMAT" .
129af0dd31fSDavid Chisnall.It Ar dtb
13003d37d34SDavid ChisnallDevice tree blob.
13103d37d34SDavid ChisnallThe binary representation of the FDT.
13203d37d34SDavid ChisnallThis is the default if the output format is not explicitly stated.
133af0dd31fSDavid Chisnall.It Ar dts
13403d37d34SDavid ChisnallDevice tree source.
13503d37d34SDavid ChisnallThe ASCII representation of the FDT.
136af0dd31fSDavid Chisnall.El
137af0dd31fSDavid Chisnall.It Fl o Ar output_file
138af0dd31fSDavid ChisnallThe file to which to write the output.
13988169e03SDavid Chisnall.It Fl P Ar predefined_macro
14088169e03SDavid ChisnallDefines a macro, in the form
14188169e03SDavid Chisnall.Ar name=value
14288169e03SDavid Chisnallor
14388169e03SDavid Chisnall.Ar name
14488169e03SDavid Chisnallto be used for device tree source files that contain conditional components.
14588169e03SDavid ChisnallThis tool supports two extensions to the standard to support conditional
14688169e03SDavid Chisnallcompilation of device trees.
14788169e03SDavid ChisnallThe first is an
14888169e03SDavid Chisnall.Ar /include/if [property]/ "file.dts"
14988169e03SDavid Chisnalldirective that is allowed at the start of a file and which will only include
15088169e03SDavid Chisnallthe specified file if it the specified property is passed with this flag.
15188169e03SDavid ChisnallThe second is the
15288169e03SDavid Chisnall.Ar $NAME
15388169e03SDavid Chisnallformat for property values.
15488169e03SDavid ChisnallThese allow property value to be specified on the command line.
155af0dd31fSDavid Chisnall.It Fl R Ar entries
15603d37d34SDavid ChisnallThe number of empty reservation table entries to pad the table with.
157ca84c67cSKyle EvansThis is useful if you are generating a device tree blob for bootloader or
158ca84c67cSKyle Evanssimilar that needs to reserve some memory before passing control to the
159ca84c67cSKyle Evansoperating system.
160af0dd31fSDavid Chisnall.It Fl S Ar bytes
16103d37d34SDavid ChisnallThe minimum size in bytes of the blob.
16203d37d34SDavid ChisnallThe blob will be padded after the strings table to ensure that it is the
16303d37d34SDavid Chisnallcorrect size.
16403d37d34SDavid ChisnallThis is useful for environments where the device tree blob must be modified in
16503d37d34SDavid Chisnallplace.
166af0dd31fSDavid Chisnall.It Fl p Ar bytes
16703d37d34SDavid ChisnallThe number of bytes of padding to add to the blob.
16803d37d34SDavid ChisnallThe blob will be padded after the strings table to ensure that it is the
16903d37d34SDavid Chisnallcorrect size.
17003d37d34SDavid ChisnallThis is useful for environments where the device tree blob must be modified in
17103d37d34SDavid Chisnallplace.
172af0dd31fSDavid Chisnall.It Fl W Ar [no-]checker_name
17303d37d34SDavid ChisnallEnable or disable a specified checker.
17403d37d34SDavid ChisnallThis is an alias for
175af0dd31fSDavid Chisnall.Fl E .
176af0dd31fSDavid Chisnall.It Fl s
17703d37d34SDavid ChisnallSorts the properties and nodes in the tree.
17803d37d34SDavid ChisnallThis is mainly useful when using tools like
179af0dd31fSDavid Chisnall.Xr diff 1
180af0dd31fSDavid Chisnallto compare two device tree sources.
181af0dd31fSDavid Chisnall.It Fl V Ar output_version
18203d37d34SDavid ChisnallThe version of the format to output.
18303d37d34SDavid ChisnallThis is only relevant for binary outputs, and only a value of 17 is currently
18403d37d34SDavid Chisnallsupported.
185af0dd31fSDavid Chisnall.It Fl v
186af0dd31fSDavid ChisnallDisplay the tool version and exit.
187af0dd31fSDavid Chisnall.It Ar input_file
188af0dd31fSDavid ChisnallThe source file.
189af0dd31fSDavid Chisnall.El
190af0dd31fSDavid Chisnall.Sh "ASM FORMAT"
191af0dd31fSDavid ChisnallThe assembly format defines several globals that can be referred to from other
19203d37d34SDavid Chisnallcompilation units, in addition to any labels specified in the source.
19303d37d34SDavid ChisnallThese are:
194af0dd31fSDavid Chisnall.Pp
195af0dd31fSDavid Chisnall.Bl -tag -width "dt_strings_start" -compact -offset indent
196af0dd31fSDavid Chisnall.It dt_blob_start
197af0dd31fSDavid Chisnallstart of the device tree blob.
198af0dd31fSDavid Chisnall.It dt_header
199af0dd31fSDavid Chisnallstart of the header, usually identical to the start of the blob.
200af0dd31fSDavid Chisnall.It dt_reserve_map
201af0dd31fSDavid Chisnallstart of the reservation map.
202af0dd31fSDavid Chisnall.It dt_struct_start
203af0dd31fSDavid Chisnallstart of the structure table.
204af0dd31fSDavid Chisnall.It dt_struct_end
205af0dd31fSDavid Chisnallend of the structure table.
206af0dd31fSDavid Chisnall.It dt_strings_start
207af0dd31fSDavid Chisnallstart of the strings table.
208af0dd31fSDavid Chisnall.It dt_strings_end
209af0dd31fSDavid Chisnallend of the strings table.
210af0dd31fSDavid Chisnall.It dt_blob_end
211af0dd31fSDavid Chisnallend of the device tree blob.
212af0dd31fSDavid Chisnall.El
213af0dd31fSDavid Chisnall.Sh CHECKERS
214af0dd31fSDavid ChisnallThe utility provides a number of semantic checks on the correctness of the
21503d37d34SDavid Chisnalltree.
21603d37d34SDavid ChisnallThese can be disabled with the
217af0dd31fSDavid Chisnall.Fl W
21803d37d34SDavid Chisnallflag.
21903d37d34SDavid ChisnallFor example,
220af0dd31fSDavid Chisnall.Fl W Ar no-type-phandle
22103d37d34SDavid Chisnallwill disable the phandle type check.
22203d37d34SDavid ChisnallThe supported checks are:
223af0dd31fSDavid Chisnall.Pp
224af0dd31fSDavid Chisnall.Bl -tag -width "no-type-phandle" -compact -offset indent
225af0dd31fSDavid Chisnall.It type-compatible
226af0dd31fSDavid ChisnallChecks the type of the
227af0dd31fSDavid Chisnall.Va compatible
228af0dd31fSDavid Chisnallproperty.
229af0dd31fSDavid Chisnall.It type-model
230af0dd31fSDavid ChisnallChecks the type of the
231af0dd31fSDavid Chisnall.Va model
232af0dd31fSDavid Chisnallproperty.
233af0dd31fSDavid Chisnall.It type-compatible
234af0dd31fSDavid ChisnallChecks the type of the
235af0dd31fSDavid Chisnall.Va compatible
236af0dd31fSDavid Chisnallproperty.
237e29c18dfSDavid Chisnall.It cells-attributes
238e29c18dfSDavid ChisnallChecks that all nodes with children have both
239e29c18dfSDavid Chisnall.Va #address-cells
240e29c18dfSDavid Chisnalland
241e29c18dfSDavid Chisnall.Va #size-cells
242e29c18dfSDavid Chisnallproperties.
243bbe31b70SEd Maste.It deleted-nodes
244bbe31b70SEd MasteChecks that all
245bbe31b70SEd Maste.Va /delete-node/
246bbe31b70SEd Mastestatements refer to nodes that are merged.
247af0dd31fSDavid Chisnall.El
248ca84c67cSKyle Evans.Sh OVERLAYS
249ca84c67cSKyle EvansThe utility provides support for generating overlays, also known as plugins.
250ca84c67cSKyle EvansOverlays are a method of patching a base device tree that has been compiled with
251ca84c67cSKyle Evansthe
252ca84c67cSKyle Evans.Fl @
253ca84c67cSKyle Evansflag, with some limited support for patching device trees that were not compiled
254ca84c67cSKyle Evanswith the
255ca84c67cSKyle Evans.Fl @
256ca84c67cSKyle Evansflag.
257ca84c67cSKyle Evans.Pp
258ca84c67cSKyle EvansTo denote that a DTS is intended to be used as an overlay,
259*2d5df840SJose Luis Duran.Va /plugin/\&;
260ca84c67cSKyle Evansshould be included in the header, following any applicable
261*2d5df840SJose Luis Duran.Va /dts-v1/\&;
262ca84c67cSKyle Evanstag.
263ca84c67cSKyle Evans.Pp
264ca84c67cSKyle EvansConventional overlays are crafted by creating
265ca84c67cSKyle Evans.Va fragment
266ca84c67cSKyle Evansnodes in a root.
267ca84c67cSKyle EvansEach fragment node must have either a
268ca84c67cSKyle Evans.Va target
269ca84c67cSKyle Evansproperty set to a label reference, or a
270ca84c67cSKyle Evans.Va target-path
271ca84c67cSKyle Evansstring property set to a path.
272ca84c67cSKyle EvansIt must then have an
273ca84c67cSKyle Evans.Va __overlay__
274ca84c67cSKyle Evanschild node, whose properties and child nodes are merged into the base device
275ca84c67cSKyle Evanstree when the overlay is applied.
276ca84c67cSKyle Evans.Pp
277ca84c67cSKyle EvansMuch simpler syntactic sugar was later invented to simplify generating overlays.
278*2d5df840SJose Luis DuranInstead of creating targeted fragments manually, one can instead create a root
279e69f3934SKyle Evansnode that targets a label in the base FDT using the
280ca84c67cSKyle Evans.Va &label
281ca84c67cSKyle Evanssyntax supported in conventional DTS.
282ca84c67cSKyle EvansThis will indicate that a fragment should be generated for the node, with the
283ca84c67cSKyle Evansgiven
284ca84c67cSKyle Evans.Va label
285ca84c67cSKyle Evansbeing the target, and the properties and child nodes will be used as the
286ca84c67cSKyle Evans__overlay__.
287ca84c67cSKyle Evans.Pp
288e69f3934SKyle EvansAdditionally, a path-based version of this syntactic sugar is supported.
289e69f3934SKyle EvansA root node may target a path in the base FDT using a name of the form
290e69f3934SKyle Evans.Va &{/path} .
291e69f3934SKyle EvansA fragment will be generated for the node as it is in the
292e69f3934SKyle Evans.Va &label
293e69f3934SKyle Evanscase, except the
294e69f3934SKyle Evans.Va target-path
295e69f3934SKyle Evansproperty will be set to
296e69f3934SKyle Evans.Va /path
297e69f3934SKyle Evansand no
298e69f3934SKyle Evans.Va target
299e69f3934SKyle Evanswill be set.
300e69f3934SKyle Evans.Pp
301ca84c67cSKyle EvansBoth conventional overlays and the later-added syntactic sugar are supported.
302ca84c67cSKyle Evans.Pp
303ca84c67cSKyle EvansOverlay blobs can be applied at boot time by setting
304ca84c67cSKyle Evans.Va fdt_overlays
305ca84c67cSKyle Evansin
306ca84c67cSKyle Evans.Xr loader.conf 5 .
307ca84c67cSKyle EvansMultiple overlays may be specified, and they will be applied in the order given.
308d37eb02eSKyle Evans.Sh NODE OMISSION
309d37eb02eSKyle EvansThis utility supports the
310d37eb02eSKyle Evans.Va /omit-if-no-ref/
311d37eb02eSKyle Evansstatement to mark nodes for omission if they are ultimately not referenced
312d37eb02eSKyle Evanselsewhere in the device tree.
313d37eb02eSKyle EvansThis may be used in more space-constrained environments to remove nodes that may
314d37eb02eSKyle Evansnot be applicable to the specific device the tree is being compiled for.
315d37eb02eSKyle Evans.Pp
316d37eb02eSKyle EvansWhen the
317d37eb02eSKyle Evans.Fl @
318d37eb02eSKyle Evansflag is used to write symbols, nodes with labels will be considered referenced
319d37eb02eSKyle Evansand will not be removed from the tree.
320af0dd31fSDavid Chisnall.Sh EXAMPLES
321af0dd31fSDavid ChisnallThe command:
322af0dd31fSDavid Chisnall.Pp
323af0dd31fSDavid Chisnall.Dl "dtc -o blob.S -O asm device.dts"
324af0dd31fSDavid Chisnall.Pp
325af0dd31fSDavid Chisnallwill generate a
326af0dd31fSDavid Chisnall.Pa blob.S
327af0dd31fSDavid Chisnallfile from the device tree source
328af0dd31fSDavid Chisnall.Pa device.dts
32903d37d34SDavid Chisnalland print errors if any occur during parsing or property checking.
330ca84c67cSKyle EvansThe resulting file can be assembled and linked into a binary.
331af0dd31fSDavid Chisnall.Pp
332af0dd31fSDavid ChisnallThe command:
333af0dd31fSDavid Chisnall.Pp
334af0dd31fSDavid Chisnall.Dl "dtc -o - -O dts -I dtb device.dtb"
335af0dd31fSDavid Chisnall.Pp
336af0dd31fSDavid Chisnallwill write the device tree source for the device tree blob
337af0dd31fSDavid Chisnall.Pa device.dtb
33803d37d34SDavid Chisnallto the standard output.
33903d37d34SDavid ChisnallThis is useful when debugging device trees.
340ca84c67cSKyle Evans.Pp
341ca84c67cSKyle EvansThe command:
342ca84c67cSKyle Evans.Pp
343ca84c67cSKyle Evans.Dl "dtc -@ -O dtb -I dts -o device.dtb device.dts"
344ca84c67cSKyle Evans.Pp
345ca84c67cSKyle Evanswill generate a
346ca84c67cSKyle Evans.Pa device.dtb
347ca84c67cSKyle Evansfile from the device tree source
348ca84c67cSKyle Evans.Pa device.dts
349ca84c67cSKyle Evanswith a __symbols__ node included so that overlays may be applied to it.
350ca84c67cSKyle Evans.Pp
351ca84c67cSKyle EvansThe command:
352ca84c67cSKyle Evans.Pp
353ca84c67cSKyle Evans.Dl "dtc -@ -O dtb -I dts -o device_overlay.dtbo device_overlay.dts"
354ca84c67cSKyle Evans.Pp
355ca84c67cSKyle Evanswill generate a
356ca84c67cSKyle Evans.Pa device_overlay.dtbo
357ca84c67cSKyle Evansfile, using the standard extension for a device tree overlay, from the device
358ca84c67cSKyle Evanstree source
359ca84c67cSKyle Evans.Pa device_overlay.dts .
360ca84c67cSKyle EvansA __symbols__ node will be included so that overlays may be applied to it.
361ca84c67cSKyle EvansThe presence of a
362*2d5df840SJose Luis Duran.Va /plugin/\&;
363ca84c67cSKyle Evansdirective in
364ca84c67cSKyle Evans.Pa device_overlay.dts
365ca84c67cSKyle Evanswill indicate to the utility that it should also generate the underlying
366ca84c67cSKyle Evansmetadata required in overlays.
367af0dd31fSDavid Chisnall.Sh COMPATIBILITY
368af0dd31fSDavid ChisnallThis utility is intended to be compatible with the device tree compiler
36903d37d34SDavid Chisnallprovided by elinux.org.
37003d37d34SDavid ChisnallCurrently, it implements the subset of features
3717ae5d1f0SJose Luis Duranrequired to build
3727ae5d1f0SJose Luis Duran.Fx
3737ae5d1f0SJose Luis Duranand others that have been requested by
3747ae5d1f0SJose Luis Duran.Fx
375af0dd31fSDavid Chisnalldevelopers.
376af0dd31fSDavid Chisnall.Pp
377af0dd31fSDavid ChisnallThe
378af0dd31fSDavid Chisnall.Ar fs
37903d37d34SDavid Chisnallinput format is not supported.
38003d37d34SDavid ChisnallThis builds a tree from a Linux
381af0dd31fSDavid Chisnall.Pa  /proc/device-tree ,
3827ae5d1f0SJose Luis Durana file system hierarchy not found in
3837ae5d1f0SJose Luis Duran.Fx ,
3847ae5d1f0SJose Luis Duranwhich instead exposes the DTB directly via a sysctl.
385af0dd31fSDavid Chisnall.Pp
386af0dd31fSDavid ChisnallThe warnings and errors supported by the elinux.org tool are not documented.
387af0dd31fSDavid ChisnallThis tool supports the warnings described in the
388af0dd31fSDavid Chisnall.Sx CHECKERS
389af0dd31fSDavid Chisnallsection.
3902d943d5bSJoel Dahl.Sh SEE ALSO
3912d943d5bSJoel Dahl.Xr fdt 4
392af0dd31fSDavid Chisnall.Sh STANDARDS
393af0dd31fSDavid ChisnallThe device tree formats understood by this tool conform to the Power.org
394af0dd31fSDavid ChisnallStandard for Embedded Power Architecture Platform Requirements
395af0dd31fSDavid Chisnall.Pq Vt ePAPR ,
396af0dd31fSDavid Chisnallexcept as noted in the
397af0dd31fSDavid Chisnall.Sx BUGS
398af0dd31fSDavid Chisnallsection and with the following exceptions for compatibility with the elinux.org
399af0dd31fSDavid Chisnalltool:
400af0dd31fSDavid Chisnall.Pp
401af0dd31fSDavid Chisnall.Bl -bullet -compact
402af0dd31fSDavid Chisnall.It
403af0dd31fSDavid ChisnallThe target of cross references is defined to be a node name in the
404af0dd31fSDavid Chisnallspecification, but is in fact a label.
405af0dd31fSDavid Chisnall.El
406af0dd31fSDavid Chisnall.Pp
407af0dd31fSDavid ChisnallThe /include/ directive is not part of the standard, however it is implemented
40803d37d34SDavid Chisnallwith the semantics compatible with the elinux.org tool.
40903d37d34SDavid ChisnallIt must appear in the top level of a file, and imports a new root definition.
41003d37d34SDavid ChisnallIf a file, plus all of its inclusions, contains multiple roots then they are
41103d37d34SDavid Chisnallmerged.
41203d37d34SDavid ChisnallAll nodes that are present in the second but not the first are imported.
41303d37d34SDavid ChisnallAny that appear in both are recursively merged, with properties from the second
41403d37d34SDavid Chisnallreplacing those from the first and properties child nodes being recursively
41503d37d34SDavid Chisnallmerged.
416af0dd31fSDavid Chisnall.Sh HISTORY
417af0dd31fSDavid ChisnallA dtc tool first appeared in
418af0dd31fSDavid Chisnall.Fx 9.0 .
419af0dd31fSDavid ChisnallThis version of the tool first appeared in
420af0dd31fSDavid Chisnall.Fx 10.0 .
421af0dd31fSDavid Chisnall.Sh AUTHORS
422d37eb02eSKyle Evans.Nm
423d37eb02eSKyle Evanswas written by
424d37eb02eSKyle Evans.An David T. Chisnall .
425d37eb02eSKyle EvansSome features were added later by
426d37eb02eSKyle Evans.An Kyle Evans .
427af0dd31fSDavid Chisnall.Pp
428af0dd31fSDavid ChisnallNote: The fact that the tool and the author share the same initials is entirely
429af0dd31fSDavid Chisnallcoincidental.
430af0dd31fSDavid Chisnall.Sh BUGS
431af0dd31fSDavid ChisnallThe device tree compiler does not yet support the following features:
432af0dd31fSDavid Chisnall.Pp
433af0dd31fSDavid Chisnall.Bl -bullet -compact
434af0dd31fSDavid Chisnall.It
43503d37d34SDavid ChisnallLabels in the middle of property values.
43603d37d34SDavid ChisnallThis is only useful in the assembly output, and only vaguely useful there, so
43703d37d34SDavid Chisnallis unlikely to be added soon.
438af0dd31fSDavid Chisnall.It
43903d37d34SDavid ChisnallFull paths, rather than labels, as the targets for phandles.
44003d37d34SDavid ChisnallThis is not very hard to add, but will probably not be added until something
44103d37d34SDavid Chisnallactually needs it.
442af0dd31fSDavid Chisnall.El
443af0dd31fSDavid Chisnall.Pp
444af0dd31fSDavid ChisnallThe current version performs a very limited set of semantic checks on the tree.
445af0dd31fSDavid ChisnallThis will be improved in future versions.
446