Commit graph

361 commits

Author SHA1 Message Date
David Gibson
1248237c7e libfdt: Add fdt_parent_offset() and supporting functions
This patch adds an fdt_parent_offset() function which returns an
offset to the parent node of a given node.  It also adds two helper
functions which are used to implement fdt_parent_offset() but are also
exported: fdt_supernode_atdepth_offset() which returns the ancestor of
a given node at a specified depth from the root of the tree, and
fdt_node_depth() which returns the depth of a given node.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-08-30 08:43:12 -05:00
David Gibson
037db263e0 libfdt: Add fdt_get_path() function
This patch adds an fdt_get_path() function to libfdt, which returns
the full path of a given node in a caller supplied buffer.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-08-30 08:43:06 -05:00
David Gibson
9d26eabdc6 libfdt: Add fdt_get_name() to retrieve a node's name
This patch adds a new fdt_get_name() function to libfdt which will
return a node's name string (including unit address, if any).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-08-30 08:42:59 -05:00
David Gibson
bd2ae2f41c libfdt: Fix handling of trailing / in fdt_path_offset()
Currently, fdt_path_offset() returns FDL_ERR_BADOFFSET if given a path
with a trailing '/'.  In particular this means that
fdt_path_offset("/") returns FDT_ERR_BADOFFSET rather than 0 as one
would expect.

This patch fixes the function to accept and ignore trailing '/'
characters.  As well as allowing fdt_path_offset("/") this means that
fdt_path_offset("/foo/") will return the same as
fdt_path_offset("/foo") which seems in keeping with the principle of
least surprise.

This also adds a testcase to ensure that fdt_path_offset("/") returns
0 as it should.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-08-30 08:42:45 -05:00
Milton Miller
9670eed1bc dtc: add a testcase with labels
Create a source file with labels for use as a testcase
to check parsing dts files.

Signed-off-by: Milton Miller <miltonm@bga.com>
2007-07-07 10:14:15 -05:00
David Gibson
d9d679fb96 dtc: Improve and better integrate dtc and libfdt Makefiles
This patch substantially revamps the dtc Makefiles, in particular
better integrating the Makefile for dtc proper with the Makefiles
imported from libfdt for libfdt and the shared testsuite.  Notable
changes:
	- No recursive make calls.  Instead subsidiary Makefiles are
included into the top-level Makefile so we get a complete dependency
information.
	- Common pattern rules, CFLAGS etc. shared between dtc, libfdt
and testsuite, rather than separate copies.
	- Vaguely Kbuild-like non-verbose mode used by default, which
makes warnings more prominent.
	- libfdt Makefile consists only of variable definitions and
helper rules, to make it more easily embeddable into other Makefile
systems.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-06-25 21:50:14 -05:00
David Gibson
0c7cd1a087 dtc: Count testcases and results in the dtc/libfdt testsuite
There are quite a lot of testcases in the dtc testsuite (recently
imported from libfdt).  It can be easy to miss a stray FAIL result in
the midst of all the rest.  To improve this, this patch adds a summary
to the end of the testsuite results giving the total number of tests
along with the number of PASSes FAILs and other results.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-06-25 21:43:03 -05:00
David Gibson
12578976fe Merge libfdt into dtc.
Having pulled the libfdt repository into dtc, merge the makefiles and
testsuites so that they build together usefully.
2007-06-14 15:05:55 +10:00
Jon Loeliger
fd84d97dee Add some initial test cases.
Add the original simple test case and a case with
different based cell values.  Correct output asm
files as well as stderr is captured.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-02-15 11:02:44 -06:00
David Gibson
363f1ea846 Add missing file. 2005-07-04 13:51:09 +10:00
David Gibson
fc14dad769 Initial commit 2005-06-08 17:18:34 +10:00