Commit graph

133 commits

Author SHA1 Message Date
David Gibson
c96cb3c016 tests: Don't use -@ on plugin de/recompile tests
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>
2016-12-09 16:13:39 +11:00
David Gibson
66381538ce tests: Remove "suppression of fixups" tests
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>
2016-12-09 16:13:39 +11:00
David Gibson
ba765b273f tests: Clarify dtc overlay tests
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>
2016-12-09 16:13:37 +11:00
David Gibson
6ea8cd944f tests: More thorough tests of libfdt overlay application without dtc
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>
2016-12-09 16:13:35 +11:00
David Gibson
3ea879dc0c tests: Split overlay tests into those with do/don't exercise dtc plugin 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>
2016-12-09 16:13:18 +11:00
David Gibson
47b4d66a2f tests: Test auto-alias generation on base tree, not overlay
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>
2016-12-09 16:13:14 +11:00
David Gibson
72e1ad8115 tests: Make overlay/plugin tests unconditional
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>
2016-12-09 16:13:11 +11:00
Pantelis Antoniou
e7b3c3b595 tests: Add overlay tests
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>
2016-12-09 13:26:39 +11:00
Pantelis Antoniou
9637e3f772 tests: Add check_path test
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>
2016-12-09 13:26:39 +11:00
Maxime Ripard
ae97c77228 tests: overlay: Rename the device tree blobs to be more explicit
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>
2016-10-12 10:07:48 +11:00
Maxime Ripard
96162d2bd9 tests: overlay: Add test suffix to the compiled blobs
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>
2016-10-11 20:08:38 +11:00
Maxime Ripard
e8c3a1a493 tests: overlay: Move back the bad fixup tests
The bad fixups tests were meant to be usable even for a non-overlay-enabled
dtc.

Move them out of that check.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-07 12:28:58 +11:00
Maxime Ripard
aea8860d83 tests: Add tests cases for the overlay code
Add some test infrastructure to test that the overlay can be merged, but
also that poorly formatted fixups would fail as expected.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
[dwg: Don't execute bad overlay tests without overlay aware dtc]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-06 20:20:02 +11:00
David Gibson
a34bb721ca dtc: Fix assorted problems in the testcases for the -a option
We just added the -a option to allow padding of the output dtb's size to
a specified alignment.  Unfortunately the test cases for this had several
bugs:
    * Didn't actually test anything since "alignbase" instead of $alignbase
      was passed to the checker function
    * Introduced an unnecessary run_local_test wrapper
    * Didn't provide very helpful output on failure
    * Only attempted to check one alignment value

This patch fixes up these problems.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-09-22 14:42:42 +10:00
Tim Wang
874f40588d Implement the -a option to pad dtb aligned
There is one condition that need cat the dtb files
into one dtb.img which can support several boards
use same SoC platform.

And the original dtb file size is not aligned to any base.
This may cause "Synchronous Abort" when load from a unligned
address on some SoC machine, such as ARM.

So this patch implement the -a <aligned number> option to
pad zero at the end of dtb files and make the dtb size aligned
to <aligned number>.

Then, the aligned dtbs can cat together and load without "Synchronous
Abort".

Signed-off-by: Tim Wang <timwang@asrmicro.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-09-22 14:25:50 +10:00
Maxime Ripard
d29126c90a libfdt: Add iterator over properties
Implement a macro based on fdt_first_property_offset and
fdt_next_property_offset that provides a convenience to iterate over all
the properties of a given node.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Simon Glass <sjg@chromium.org>
[dwg: Removed a stray trailing blank line]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-07-28 15:29:13 +10:00
Stephen Warren
c9d9121683 Warn on node name unit-address presence/absence mismatch
ePAPR 1.1 section 2.2.1.1 "Node Name Requirements" specifies that any
node that has a reg property must include a unit address in its name
with value matching the first entry in its reg property. Conversely, if
a node does not have a reg property, the node name must not include a
unit address. Also allow ranges property as it is deemed valid, but ePAPR
is not clear about it.

Implement a check for this. The code doesn't validate the format of the
unit address; ePAPR implies this may vary from (containing bus) binding
to binding, so doing so would be much more complex.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
[robh: also allow non-empty ranges]
Signed-off-by: Rob Herring <robh@kernel.org>
[moved new test in check_table]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-02-19 16:00:05 +11:00
Anton Blanchard
2e53f9d2f0 Catch unsigned 32bit overflow when parsing flattened device tree offsets
We have a couple of checks of the form:

    if (offset+size > totalsize)
        die();

We need to check that offset+size doesn't overflow, otherwise the check
will pass, and we may access past totalsize.

Found with AFL.

Signed-off-by: Anton Blanchard <anton@samba.org>
[Added a testcase]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-02-19 01:08:46 +11:00
David Gibson
b43345039b Fix some bugs in processing of line directives
In order to work with preprocessed dts files more easily, dts will parse
line number information in the form emitted by cpp.

Anton Blanchard (using a fuzzer) reported that including a line number
directive with a nul character (a literal nul in the input file, not a \0
sequence) would cause dtc to SEGV.  I spotted several more problems on
examining the code:
    * It modified yytext in place which seems to work, but is ugly and I'm
      not sure if it's safe on all lex/flex versions
    * The regexp used in the lexer to recognize line number information
      accepts strings with escape characters, but it won't process these
      escapes.
        - GNU cpp at least, will generate \ escapes in line number
          information, at least with files containing " or \ in the name

This patch reworks the handling of line number information to address
these problems.  \ escapes should now be handled directly.  nuls in file
names (either with a literal nul in the input file, or with a \0 escape
sequence) are still not permitted, but will now result in a lexical error
rather than a SEGV.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-04 22:56:39 +11:00
David Gibson
d728ad59f5 Fix crash on nul character in string escape sequence
If a dts file contains a string with \ followed by a nul byte - an actual
nul in the input file, not the \\0 escape - then the assert() in
get_escape_char() will trip, crashing dtc.

As far as I can tell, there isn't any valid need for this assert(), so just
remove it.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-03 23:01:24 +11:00
David Gibson
1ab2205a6f Gracefully handle bad octal literals
The code handling integer literals in dtc-lexer.l assumes that the flex
regexp means that strtoull() can't fail to interpret the string as a valid
integer (either decimal, octal, or hexadecimal).  This is not true for
octals.  For example '09' is accepted as a literal by the regexp,
strtoull() attempts to handle it as octal, but it has a bad digit.

This changes the code to give a more useful error in this case.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-03 22:54:37 +11:00
David Gibson
1937095588 Prevent crash on division by zero
Currently, attempting to divide by zero in an integer expression in a dts
file will cause dtc to crash with a division by zero (SIGFPE).

This patch corrects this to properly detect this case and raise an error.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-03 22:27:32 +11:00
Thierry Reding
2218387a8c fdt: Add a function to count strings
Given a device tree node and a property name, the fdt_stringlist_count()
function counts the number of strings found in the property value.

This also adds a new error code, FDT_ERR_BADVALUE, that the function
returns when it encounters a non-NUL-terminated string list.

Signed-off-by: Thierry Reding <treding@nvidia.com>
[Changed testcase name --dwg]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-30 13:16:35 +10:00
David Gibson
067829ea5f Remove redundant fdtdump test code
The overall test runner script, for the fdtdump tests invokes the helper
script fdtdump-runtest.sh.  It then includes directly some code very
similar to fdtdump-runtest.sh, which is never reached due to a "return".

Remove the never-reached test code.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-07-09 13:41:21 +10:00
David Gibson
897a429199 Move fdt_path_offset alias tests to right tests section
The test script includes several specific tests for the handling of aliases
in fdt_path_offset().  These are primarily tests of the fdt_path_offset()
libfdt function itself, although dtc is used to generate a test file for
convenience.

Move these from the dtc tests section to the libfdt tests section
accordingly.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-07-09 13:29:42 +10:00
Mike Frysinger
8b927bf3b8 tests: convert echo -n to printf
The -n option is not standard in POSIX, so convert to printf which should
work the same in every shell.

Signed-off-by: Mike Frysinger <vapier@chromium.org>
2015-05-25 13:32:47 +10:00
Jack Miller
64c46b098b Fix crash with poorly defined #size-cells
If you have a parent block with #size-cells improperly set to 0, and
then subsequently try to include a regs property in the child, dtc will
crash with SIGFPE while validating it. This patch fixes that crash,
instead printing the same invalid length warning that was causing it.

Test included.

Signed-off-by: Jack Miller <jack@codezen.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-04-30 10:55:41 +10:00
Nikhil Devshatwar
3346e065aa dtc: parser: Add label while overriding nodes
This patch changes the dtc grammar to allow following syntax

i2cexp: &i2c2 {
    ...
};

Current device tree compiler allows to define multiple labels when defining
the device node the first time. Typically device nodes are defined in
DTSI files. Now these nodes can be overwritten for updating some of the
properties. Typically, device nodes are overridden in DTS files.

When working with adapter boards, most of the time adapter board can fit to
multiple base boards. But depending on which base board it is connected to,
the devices on the adapter board would be children of different devices.

e.g. On dra7-evm.dts, i2c2 is exported for expansion connector whereas
on dra72-evm.dts, i2c5 is exported for expansion connector.
This causes a problem when writing a generic device tree file for
the adapter board. Because, you cannot know whether all the devices on
adapter board are present on i2c or i2c5.

The problem can be solved by adding a common label (e.g. i2cexp) in both
of the DTS files when overriding the device nodes for i2c2 or i2c5.
This way, generic adapter board file would override the i2cexp. And
depending on which base board you use the adapter board, all the devices
are automatically added for correct device nodes.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-02-23 12:29:36 +11:00
Wang Long
aa719618a8 fdtput: add delete node and property function
add the delete node and property function for fdtput.

usage:
1) delete nodes
   fdtput -r <options> <dt file> [<node>...]
2) delete properties
   fdtput -d <options> <dt file> <node> [<property>...]

Signed-off-by: Wang Long <long.wanglong@huawei.com>
2015-01-27 19:30:19 +11:00
Jack Miller
5d4a8b9c4c Properly handle embedded nul delimited string lists
For example:

reserved-names="res1\0res2\0res3";

Where \0 is an actual embedded NUL in the source instead of a string
escape. To achieve this, use the len given by the lexer instead of
strlen.

Without this patch dtc will mangle the output and possibly hang on
realloc.
2014-08-08 19:17:31 +10:00
David Gibson
fa928fba7e Fix an off-by-2 error in the source output code
This has been there for ages, but the assertion makes no sense in the
context of the test immediately preceding it.  This caused an abort()
when in -I dts -O dts mode with the right sort of internal labels in a
string property value.

Add a testcase for this and another candidate edge case (though this one
we already get right).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-06-18 22:49:43 +10:00
Simon Glass
76a65b14d1 Add a basic test for fdtdump
We can test fdtdump by comparing its output with the source file that was
compiled by dtc. Add a simple test that should at least catch regressions
in basic functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-06-18 21:24:48 +10:00
David Gibson
40f7f576c8 libfdt: Add helpers to read #address-cells and #size-cells
This patch makes a small start on libfdt functions which actually help to
parse the contents of device trees, rather than purely manipulating the
tree's structure.

We add simple helpers to read and sanity check the #address-cells and
#size-cells values for a given node.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-05-12 16:01:09 +10:00
David Gibson
edb10bcf1c Add option to run_tests.sh to stop immediately on a failing test
This is a debugging convenience option, which makes it much easier to find
the failing tests and fix them one by one.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-12-30 22:42:41 +11:00
David Gibson
79eebb23db libfdt: Add function to resize the buffer for a sequential write tree
At present, when using sequential write mode, there's no straightforward
means of resizing the buffer the fdt is being built into.  This patch
adds an fdt_resize() function for this purpose.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-10-26 00:17:37 +11:00
Srinivas Kandagatla
d214655904 fdtput: expand fdt if value does not fit
If you try to insert a new node or extend a property with large value,
using fdtput you will notice that it always fails.

example:
fdtput -v -p -ts ./tst.dtb "/node-1" "property-1" "value-1
Error at 'node-1': FDT_ERR_NOSPACE

or

fdtput -v -c ./tst.dtb "/node-1"
Error at 'node-1': FDT_ERR_NOSPACE

or

fdtput -v  -ts ./tst.dtb "/node" "property" "very big value"
Decoding value:
	string: 'very big value'
Value size 15
Error at 'property': FDT_ERR_NOSPACE

All these error are returned from libfdt, as the size of the fdt passed
has no space to accomdate these new properties.
This patch adds realloc functions in fdtput to allocate new space in fdt
when it detects a shortage in space for new value or node. With this
patch, fdtput can insert a new node or property or extend a property
with new value greater than original size. Also it packs the final blob
to clean up any extra padding.

Without this patch fdtput tool complains with FDT_ERR_NOSPACE when we
try to add a node/property or extend the value of a property.

Testcases for the new behaviour added by David Gibson.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-29 12:48:16 +10:00
David Gibson
a58afe2eb2 Remove some tests for misfeatures
There are a couple of fdtput related tests which are rather pointless -
they explicitly test for the presence of an undesirable limitation in
fdtput, which will cause test failures when we fix it.  This patch removes
the tests.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-29 12:44:18 +10:00
David Gibson
1c76ec3c09 Use shorten_echo for wrap_tests
We have certain tests which generate extremely long command lines, which
are shortened in the testsuite output with the 'shorten_echo' function.
Currently that is used in run_fdtput_test and run_wrap_test, this patch
uses it for run_wrap_test as well, allowing more general tests with long
command lines.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-29 12:40:00 +10:00
Simon Glass
4e76ec796c libfdt: Add fdt_next_subnode() to permit easy subnode iteration
Iterating through subnodes with libfdt is a little painful to write as we
need something like this:

for (depth = 0, count = 0,
	offset = fdt_next_node(fdt, parent_offset, &depth);
     (offset >= 0) && (depth > 0);
     offset = fdt_next_node(fdt, offset, &depth)) {
	if (depth == 1) {
		/* code body */
	}
}

Using fdt_next_subnode() we can instead write this, which is shorter and
easier to get right:

for (offset = fdt_first_subnode(fdt, parent_offset);
     offset >= 0;
     offset = fdt_next_subnode(fdt, offset)) {
	/* code body */
}

Also, it doesn't require two levels of indentation for the loop body.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-04-28 07:30:49 -05:00
Simon Glass
8055d77a5b Adjust util_is_printable_string() comment and fix test
This commit which changed the behaviour of this function broke one
of the tests. Also the comment should be updated to reflect its new
behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-27 14:18:35 -06:00
Stephen Warren
1762ab42ef dtc: fix for_each_*() to skip first object if deleted
The previous definition of for_each_*() would always include the very
first object within the list, irrespective of whether it was marked
deleted, since the deleted flag was not checked on the first object,
but only on any "next" object.

Fix for_each_*() to check the deleted flag in the loop body every
iteration to correct this.

Incidentally, this change is why commit 45013d8 dtc: "Add ability to
delete nodes and properties" only caused two "make checkm" failures;
only two tests actually use multiple labels on the same property or
node. With this current change applied, but commit 317a5d9 "dtc: zero
out new label objects" reverted, "make checkm" fails 29 times; i.e.
for every test that uses any labels at all.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-10-08 09:12:24 -05:00
Stephen Warren
1b6d1941dc dtc: cpp co-existence: add support for #line directives
Line control directives of the following formats are supported:
    #line LINE "FILE"
    # LINE "FILE" [FLAGS]

This allows dtc to consume the output of pre-processors, and to provide
error messages that refer to the original filename, including taking
into account any #include directives that the pre-processor may have
performed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-09-28 09:24:39 -05:00
Stephen Warren
1ff3d3f8de dtc: cpp co-existence: allow names starting with # to be escaped
The device tree language as currently defined conflicts with the C pre-
processor in one aspect - when a property or node name begins with a #
character, a pre-processor would attempt to interpret it as a directive,
fail, and most likely error out.

This change allows a property/node name to be prefixed with \. This
prevents a pre-processor from seeing # as the first non-whitespace
character on the line, and hence prevents the conflict. \ was previously
an illegal character in property/node names, so this change is
backwards compatible. The \ is stripped from the name during parsing
by dtc.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-09-28 09:23:43 -05:00
Stephen Warren
45013d8619 dtc: Add ability to delete nodes and properties
dtc currently allows the contents of properties to be changed, and the
contents of nodes to be added to. There are situations where removing
properties or nodes may be useful. This change implements the following
syntax to do that:

    / {
        /delete-property/ propname;
        /delete-node/ nodename;
    };

or:

    /delete-node/ &noderef;

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-09-06 07:51:43 -05:00
Simon Glass
f807af1928 fdtput: Add -p option to create subnodes along entire path
This option mimics mkdir's -p option. It automatically creates nodes
as needed along the path provided. If the node already exists, no
error is given.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-07-12 12:00:25 -05:00
Simon Glass
d46c2de570 fdtput: Add -c option to create nodes
This option allows the creation of new nodes in a dtb file. The syntax
is:

   fdtput -c <dtb_file> <node_path>

The node_path contains the path of the node to be created. All path
components up to the final one must exist already. The final one must
not exist already.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-07-12 11:57:36 -05:00
David Gibson
d5399197e9 Allow toggling of semantic checks
This patch adds -W and -E options to dtc which allow toggling on and off
of the various built in semantic checks on the tree.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-07-08 13:45:21 -05:00
Stephen Warren
f67dfe8459 Add test for re-defining an identical label
When merging one device tree over the top of a previous tree, it is
possible to define a duplicate label that has the same name and points
to the same property or node. This is currently allowed by the duplicate
label checking code. However, alternative duplicate label checking
algorithms might not allow this. Add an explicit test to ensure this
capability is maintained.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-07-08 13:43:17 -05:00
David Gibson
4adbb5336b Remove test_tree1_dts0 testcases
The testcases based on test_tree1_dts0.dts were added purely to test dtc's
backwards compatibility handling of the old dts-v0 format.  Since that
support has been removed, the dts has been updated to use the current
dts-v1 syntax, which makes the testcases pass, but be completely useless.

This patch removes the now obsolete testcases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-06-03 09:13:59 -05:00
Stephen Warren
5f0c3b2d62 dtc: Basic integer expressions
Written by David Gibson <david@gibson.dropbear.id.au>. Additions by me:
* Ported to ToT dtc.
* Renamed cell to integer throughout.
* Implemented value range checks.
* Allow U/L/UL/LL/ULL suffix on literals.
* Enabled the commented test.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2012-04-09 08:42:05 -05:00