Age | Commit message (Collapse) | Author |
|
This enables the dtc binary to be used without dependencies
on shared libraries, for instance, when the binary is copied
to be used in the Android kernel build process.
Bug: 38007786
Test: mmm -j8 external/dtc , ldd out/host/linux-x86/bin/dtc
Change-Id: Ic566104dc8064bdea12a9d3e0c442b518dc5d2ec
Merged-In: Ic566104dc8064bdea12a9d3e0c442b518dc5d2ec
(cherry picked from commit 9dfa11ddc415aec92f9ffed55d86cb3ba77c9a29)
|
|
am: d55eeac324
Change-Id: Ic6c3f477acadff3927958f5e08f1972bbf57ecc0
|
|
am: 76f53c87df
Change-Id: I6762418a2a5300bce2a19f72f2c95220328923fd
|
|
am: 2a1020b73b
Change-Id: Idfd1f593b302343d9eca0951358690f924eb8cf0
|
|
The new kernel headers do:
#define __bitwise __bitwise__
However, the code redefines __bitwise without undef'ing it first.
This is a temporary fix, b/35721782 filed to fix this.
Change-Id: Ic16796a599dc577b4fef7f8e2a586162160955fb
Test: Builds without warningers/errors.
|
|
am: d5cbea133f
Change-Id: Id4b7246d8f686e1ef2afa0e4d8dd3b7b2fac00ce
|
|
784eabe1a6
am: 3d18b62367
Change-Id: I1625b4ee834629d4aa2183983c982d1dd162db26
|
|
am: 34e67011b4
Change-Id: Ia4507b10f8c8fe633eede7a5b387888cf41c0cd8
|
|
am: c15ed6d6ca
Change-Id: I5ae016a4b67b955ed3f65d8c61b40daf6b7931db
|
|
am: 784eabe1a6
Change-Id: I7997d426221643fa7907c0919c2a75e86ee2692f
|
|
am: 4305ca9fb6
Change-Id: I30f79810815230d4734ac5cad0c7de260c1fcbef
|
|
am: ec2917363c
Change-Id: I04d6c96d87c8ed847e3fc2d60ab0a0102fa70399
|
|
am: 8876e278cf
Change-Id: Ib49faed8ef307bb2b6db54e36e6547f48c9e3098
|
|
am: 507cd9883a
Change-Id: I3fd4b4c61f5c668fb75f74417163738b904f6e0d
|
|
For simple overlays that use a single target there exists a
simpler syntax version.
&foo { }; generates an overlay with a single target at foo.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Downloaded from https://marc.info/?l=devicetree&m=148111493325866&w=4
Change-Id: I7bf2ff20133ee37888e8dc6031b5539b0d6168e7
|
|
There exists a syntactic sugar version of overlays which
make them simpler to write for the trivial case of a single target.
Document it in the device tree object internals.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Downloaded from https://marc.info/?l=devicetree&m=148111492925863&w=4
Change-Id: Iac4cb844f655516022926e7c18e7de3ae384e5e8
|
|
Reset master to upstream 120775eb1cf39f8dcecd695c3ff1cfef8aeb669d
and merge history.
Bug: 35151782
Test: Build dtc, use output dtc to build dts, can output correct dtb.
Change-Id: I4d3ef31a8597f7b214fea2d70ceb99a08d57d925
|
|
dtc defines a streq() (string equality) macro to avoid the easy confusion
of the sense of strcmp() comparison for equality. A few places where we
don't use it have slipped in, so remove them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
While '#', '?', '.', '+', '*', and '_' are considered valid characters,
their use is discouraged in recommended practices.
Testing this found a few cases of '.'. The majority of the warnings were
all from underscores.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
While '?', '.', '+', '*', and '_' are considered valid characters their
use is discouraged in recommended practices. '#' is also only
recommended to be used at the beginning of property names.
Testing this found one typo error with '.' used instead of ','. The
rest of the warnings were all from underscores.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
None of the callers ever pass a NULL to srcpos_string(), so the check
for it is not necessary. Furthermore, checking it make Coverity complain
about the raw dereferences which follow later in the function.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
When running coverity on dtc source code the following error is reported.
==========================================================================
*** CID 1370967: Resource leaks (RESOURCE_LEAK)
/tools/dtc/livetree.c: 850 in add_fixup_entry()
844 if (strchr(node->fullpath, ':') || strchr(prop->name, ':'))
845 die("arguments should not contain ':'\n");
846
847 xasprintf(&entry, "%s:%s:%u",
848 node->fullpath, prop->name, m->offset);
849 append_to_property(fn, m->ref, entry, strlen(entry) + 1);
>>> CID 1370967: Resource leaks (RESOURCE_LEAK)
>>> Variable "entry" going out of scope leaks the storage it points to.
850 }
==========================================================================
Fix the leak.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
If we have a construct like this:
label: &handle {
...
};
Running dtc on it will cause a segfault, because we use 'target'
when it could be NULL. Move the add_label() call into the if
statement to fix this potentially bad use of a NULL pointer.
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Two its in a row can't be right.
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
It's useful to have some tags to jump around sources. We don't
include test sources in the toplevel Makefile because they
probably aren't useful to main program development.
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Running fdtdump without scan mode for an invalid file often
results in a segmentation fault because the fdt header is
not checked.
With the patch the header is checked both in scanning as
well as in non-scanning mode.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[dwg: Removed unnecessary inline, changed type from int to bool]
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
The data struct used for parsing character literals was never freed
resulting in a few bytes leaked for every character.
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
struct boot_info is named that for historical reasons, and isn't
particularly meaningful. Essentially it contains all the information -
in "live" form from a single dts or dtb file. As we move towards support
for dynamic dt overlays, that name will become increasingly bad.
So, in preparation, rename it to dt_info. At the same time rename the
'the_boot_info' global to 'parser_output' since that's its actual purpose.
Unfortunately we do need the global unless we switch to bison's re-entrant
parser extensions, which would introduce its own complications.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
First remove the non-terminal name 'versioninfo' - /plugin/ doesn't really
indicate a "version" per se, and version could be confused with the dtb
output version.
Second allow the /dts-v1/; /plugin/; sequence to be repeated, for easier
use of include files - but ensure that all copies match, so you can't
include a file declaring /plugin/ in one that doesn't, or vice versa.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
At the moment we generate a __symbols__ node if -@ is specified OR if the
dts has the /plugin/ tag. That difference in behaviour from handling base
trees is unnecessary and slightly confusing. It also means it's impossible
to create a plugin without symbols. Since symbols in a plugin are only
useful in the case of stacked plugins - and libfdt doesn't even support
merging plugin symbols as part of overlay application yet - that's a thing
that might be useful.
So make __symbols__ generation depend only on -@. We also remove remove
the testcases that checked explicitly for this not very useful behaviour.
Instead we don't use -@ for our basic overlay testcase, and check that
symbols are not generated.
At some point in the future we should add support for symbol merging to
libfdt and add testcases for stacked overlay application.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Using -@ again here obscures what's going on, because at the end we can't
know which run actually generated the symbols node. We should just
generate the symbols on the first run and leave it at that.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
I think these were for an additional command line option which got dropped
during development. At this point all they're testing is that fixups don't
get generated for a non /plugin/ tree, which is already tested with one of
the simpler cases previously.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
This changes the names of the testfiles for a number of the testcases of
the dtc overlay generation functionality to make them shorter and a bit
cleaerer what's going on. In addition we move some of the check_path
sanity checks closer to the dtc commands they verify.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
At the moment we have some rudimentary tests of the fdt_overlay_apply()
function which don't rely on overlay generation support in dtc. This is
done by avoiding any external references in the sample overlay, in
particularly using the 'target-path' syntax instead of 'target' to avoid
needing external references in the fragment targets. Thus this test case
doesn't exercise libfdt's processing of the __fixups__ node at all.
We do test that somewhat in combination with dtc's overlay support.
However, in the interests of being able to quickly determine which side a
bug is on, it would be nice to exercise this without requiring the dtc
support.
This adds testcases to do so, by making some examples with manually
constructed __symbols__ and __fixups__ nodes. In addition we rename some
of the test data files and add some extra check_path tests to make it a bit
clearer what's going on here.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
without symbols
The fdt_overlay_apply() function purports to support the edge cases where
an overlay has no fixups to be applied, or a base tree which has no
symbols (the latter can only work if the former is also true). However it
gets it wrong in a couple of small ways:
* In the no fixups case, it doesn't fail immediately, but will attempt
fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
offset, which will fail. Instead it should succeed immediately, since
there's nothing to do.
* In the case of no symbols, it again doesn't fail immediately. However
if there is an actual fixup it will fail with an unexpected error,
because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
look up the symbols. We should instead return -FDT_ERR_NOTFOUND
directly.
Both of these errors lead to the code returning misleading error codes in
failing cases.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Two test programs - check_path and overlay - define a CHECK() helper macro
in such a way that in the case of an error it will re-execute the checked
code fragment, instead of using the return value from the initial call.
This can lead to misreporting errors, because the code may fail in a
different way the second time around due to changes made during the first
failing call.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
generation
The various tests for overlay/plugin support are currently lumped together
in the overlay_tests shell function, which is executed by libfdt_tests.
However, this includes both tests designed primarily to exercise libfdt's
overlay application, and tests designed to exercise dtc's overlay
generation. Split these up for improved clarity.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
The current testcases for the -A "auto alias generation" option operate on
a "plugin" tree. Although not technically wrong, this is an odd approach,
since a plugin will almost certainly need the __symbols__ and/or __fixups__
syntax instead of aliases. On the other hand -A may be useful simply for
generating aliases on a tree which is not using the overlay / plugin
mechanism at all.
Therefore change the tests to operate on a base tree example instead of a
plugin.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
When overlay apply supprt was added to libfdt the testcases included some
which could only be executed with the (then) out of tree dtc with overlay
output support. So, the test script automatically skipped those tests if
it wasn't available.
Now that the overlay support is merged into dtc mainline there's no reason
to keep this logic. Instead run all the overlay tests unconditionally.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Add a number of tests for dynamic objects/overlays.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Add a test that checks for existence or not of a node.
It is useful for testing the various cases when generating
symbols and fixups for dynamic device tree objects.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
This patch enable the generation of symbols & local fixup information
for trees compiled with the -@ (--symbols) option.
Using this patch labels in the tree and their users emit information
in __symbols__ and __local_fixups__ nodes.
The __fixups__ node make possible the dynamic resolution of phandle
references which are present in the plugin tree but lie in the
tree that are applying the overlay against.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Provides the document explaining the internal mechanics of
plugins and options.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
As preparation for overlay support we need to pass the boot info
parameter instead of the root node to each check method.
The root node can be retrieved by accessing boot info's dt member.
No other functional changes are made.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Some error values were missing from the table which meant that they could
not be translated by fdt_strerror().
Signed-off-by: Benjamin Fair <b-fair@ti.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
If fdt_getprop() fails, negative error code should be returned.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
If fdt_getprop() fails, negative error code should be returned.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
Rename the blobs to have a more explicit output that will give us a clearer
idea about whether a DT (and the test) has been compiled using a dtc with
our without overlays support.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
The compiled blobs in the overlay tests do not have the test suffix which
is usually used to clean up and ignore the test artifacts.
Let's add that suffix.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
|
fdt_overlay_apply was not usable in the shared library. Export it to allow
its use.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|