Commit graph

6 commits

Author SHA1 Message Date
Rob Herring
acfe84f2c4 dtc: Replace GPLv2 boilerplate/reference with SPDX tags
Replace instances of GPLv2 or later boilerplate with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-2-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
Grant Likely
c86da84d30 Add support for YAML encoded output
YAML encoded DT is useful for validation of DTs using binding schemas.

The YAML encoding is an intermediate format used for validation and
is therefore subject to change as needed. The YAML output is dependent
on DTS input with type information preserved.

Signed-off-by: Grant Likely <grant.likely@arm.com>
[robh: make YAML support optional, build fixes, Travis CI test,
 preserve type information in paths and phandles]
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-09-13 11:39:03 +10:00
Jon Loeliger
879e4d2590 Implement and use an xstrdup() function
Many places in dtc use strdup(), but none of them actually check the
return value to see if the implied allocation succeeded.  This is a
potential bug, which we fix in the patch below by replacing strdup()
with an xstrdup() which in analogy to xmalloc() will quit with a fatal
error if the allocation fails.

I felt the introduciton of util.[ch] was a better choice
for utility oriented code than directly using srcpos.c
for the new string function.

This patch is a re-factoring of Dave Gibson's similar patch.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
2008-10-03 11:12:33 -05:00
David Gibson
6a6c972cdf dtc: Clean up included Makefile fragments
Currently the Makefile.dtc and Makefile.libfdt fragments include a
number of things that seemed like they might be useful for other
projects embedding the pieces, or for a make dist target.

Well, we have no make dist target, it's become fairly unclear that
these things would actually be useful to embedders (the kernel
certainly doesn't use them), and it's a bunch of stuff with no current
users.

This patch, therefore, removes a bunch of unused definitions from the
Makefile fragments.  It also removes a dependency declared in
Makefile.libfdt (of libfdt.a on the constituent .o files) which was
incorrect (wrong path), and if corrected would be redundant with the
similar dependency in the top-level makefile.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-05-19 14:07:53 -05:00
David Gibson
2f1ccc36f4 dtc: Move tree checking code to checks.c
This patch moves the dtc code for checking the device tree its
processing into a new checks.c.  The tree accessor functions from
livetree.c which the checks use are exported and added to dtc.h.

Another small step towards a flexible checking architecture.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-01 08:03:37 -05:00
David Gibson
ad9593f229 dtc: Refactor Makefiles
This patch makes a number of Makefile cleanups and improvements:
	- We use more generic rules to invoke flex and bison, which is
useful for some of the other changes.
	- We use the name dtc-lexer.lex.c for the flex output, instead
of the default lex.yy.c.  That means less potential for confusion if
dtc is embedded into other projects (e.g. the kernel).
	- We separate out a Makefile.dtc designed for embedding into
other projects, analagous to Makefile.libfdt.
	- Makefile.libfdt is cleaned up to be more useful based on
some actual trial runs of embedding libfdt in the kernel bootwrapper.
	- Versioning related rules and variables are collected into
one place in the Makefile.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-15 08:28:07 -05:00