Commit graph

249 commits

Author SHA1 Message Date
David Gibson
b6d80a20fc libfdt: Increase namespace-pollution paranoia
libfdt is supposed to easy to embed in projects all and sundry.
Often, it won't be practical to separate the embedded libfdt's
namespace from that of the surrounding project.  Which means there can
be namespace conflicts between even libfdt's internal/static functions
and functions or macros coming from the surrounding project's headers
via libfdt_env.h.

This patch, therefore, renames a bunch of libfdt internal functions
and macros and makes a few other chances to reduce the chances of
namespace collisions with embedding projects.  Specifically:
	- Internal functions (even static ones) are now named _fdt_*()

	- The type and (static) global for the error table in
          fdt_strerror() gain an fdt_ prefix

	- The unused macro PALIGN is removed

	- The memeq and streq macros are removed and open-coded in the
          users (they were only used once each)

	- Other macros gain an FDT_ prefix

	- To save some of the bulk from the previous change, an
          FDT_TAGALIGN() macro is introduced, where FDT_TAGALIGN(x) ==
          FDT_ALIGN(x, FDT_TAGSIZE)

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14 12:36:27 -05:00
David Gibson
1409097db8 dtc: Enable and fix -Wcast-qual warnings
Enabling -Wcast-qual warnings in dtc shows up a number of places where
we are incorrectly discarding a const qualification.  There are also
some places where we are intentionally discarding the 'const', and we
need an ugly cast through uintptr_t to suppress the warning.  However,
most of these are pretty well isolated with the *_w() functions.  So
in the interests of maximum safety with const qualifications, this
patch enables the warnings and fixes the existing complaints.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14 12:36:08 -05:00
David Gibson
36786db615 dtc: Enable and fix -Wpointer-arith warnings
This patch turns on the -Wpointer-arith option in the dtc Makefile,
and fixes the resulting warnings due to using (void *) in pointer
arithmetic.  While convenient, pointer arithmetic on void * is not
portable, so it's better that we avoid it, particularly in libfdt.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14 12:36:08 -05:00
David Gibson
cdcb415851 dtc: Address an assortment of portability problems
I've recently worked with a FreeBSD developer, getting dtc and libfdt
working on FreeBSD.  This showed up a number of portability problems
in the dtc package which this patch addresses.  Changes are as
follows:

	- the parent_offset and supernode_atdepth_offset testcases
used the glibc extension functions strchrnul() and strndupa().  Those
are removed, using slightly longer coding with standard C functions
instead.

	- some other testcases had a #define _GNU_SOURCE for no
particular reason.  This is removed.

	- run_tests.sh has bash specific constructs removed, and the
interpreter changed to /bin/sh.  This apparently now runs fine on
FreeBSD's /bin/sh, and I've also tested it with both ash and dash.

	- convert-dtsv0-lexer.l has some extra #includes added.  These
must have been included indirectly with Linux and glibc, but aren't on
FreeBSD.

	- the endian handling functions in libfdt_env.h, based on
endian.h and byteswap.h are replaced with some portable open-coded
versions.  Unfortunately, these result in fairly crappy code when
compiled, but as far as I can determine there doesn't seem to be any
POSIX, SUS or de facto standard way of determining endianness at
compile time, nor standard names for byteswapping functions.

	- some more endian handling, from testdata.h using the
problematic endian.h is simply removed, since it wasn't actually being
used anyway.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14 12:21:18 -05:00
David Gibson
aa1baab3cc libfdt: Several cleanups to parameter checking
This patch makes a couple of small cleanups to parameter checking of
libfdt functions.

	- In several functions which take a node offset, we use an
idiom involving fdt_next_tag() first to check that we have indeed been
given a node offset.  This patch adds a helper function
_fdt_check_node_offset() to encapsulate this usage of fdt_next_tag().

	- In fdt_rw.c in several places we have the expanded version
of the RW_CHECK_HEADER() macro for no particular reason.  This patch
replaces those instances with an invocation of the macro; that's what
it's for.

	- In fdt_sw.c we rename the check_header_sw() function to
sw_check_header() to match the analgous function in fdt_rw.c, and we
provide an SW_CHECK_HEADER() wrapper macro as RW_CHECK_HEADER()
functions in fdt_rw.c

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-05-29 08:15:53 -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
2512a7eb5c libfdt: Remove no longer used code from fdt_node_offset_by_compatible()
Since fdt_node_offset_by_compatible() was converted to the new
fdt_next_node() iterator, a chunk of initialization code became
redundant, but was not removed by oversight.  This patch cleans it up.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-02-18 08:29:01 -06:00
David Gibson
8a4e75049d libfdt: Trivial cleanup for CHECK_HEADER)
Currently the CHECK_HEADER() macro is defined local to fdt_ro.c.
However, there are a handful of functions (fdt_move, rw_check_header,
fdt_open_into) from other files which could also use it (currently
they open-code something more-or-less identical).  Therefore, this
patch moves CHECK_HEADER() to libfdt_internal.h and uses it in those
places.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-02-18 08:27:13 -06:00
David Gibson
089adb9964 libfdt: Fix NOP handling bug in fdt_add_subnode_namelen()
fdt_add_subnode_namelen() has a bug if asked to add a subnode to a
node which has NOP tags interspersed with its properties.  In this
case fdt_add_subnode_namelen() will put the new subnode before the
first NOP tag, even if there are properties after it, which will
result in an invalid blob.

This patch fixes the bug, and adds a testcase for it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-02-14 08:02:41 -06:00
David Gibson
fc9769ac2b libfdt: Add and use a node iteration helper function.
This patch adds an fdt_next_node() function which can be used to
iterate through nodes of the tree while keeping track of depth.  This
function is used to simplify the iteration code in a lot of other
functions, and is also exported for use by library users.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-02-12 09:11:40 -06:00
David Gibson
82b327d380 libfdt: Add fdt_set_name() function
This patch adds an fdt_set_name() function to libfdt, mirroring
fdt_get_name().  This is a r/w function which alters the name of a
given device tree node.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-01-11 07:40:40 -06:00
David Gibson
3e516d961a dtc: Update TODO files
This patch makes a bunch of updates to the TODO files for dtc and
libfdt, some of them rather overdue.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-12-19 08:20:26 -06:00
David Gibson
30f7fbfbe9 libfdt: Add more documentation (patch the seventh)
This patch adds more documenting comments to libfdt.h.  Specifically,
these document the read/write functions (not including fdt_open_into()
and fdt_pack(), for now).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-12-17 07:39:33 -06:00
David Gibson
f819a4e21d libfdt: Add more documentation (patch the sixth)
This patch adds some more documenting comments to libfdt.h.
Specifically this documents all the write-in-place functions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-12-17 07:38:42 -06:00
Kumar Gala
f29454eb7e Fix whitespace in libfdt/fdt.h
Take from u-boot whitespace fixup of the file

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-11-28 09:44:27 -06:00
David Gibson
67b6b33b9b dtc: Add valgrind support to testsuite
This patch adds some options to the run_tests.sh script allowing it to
run all the testcases under valgrind to check for pointer corruption
bugs and memory leaks.  Invoking "make checkm" will run the testsuite
with valgrind.

It include a mechanism for specifying valgrind errors to be suppressed
on a per-testcase basis, and adds a couple of such suppression files
for the mangle-layout and open_pack testcases which dump for use by
other testcases a buffer which may contain uninitialized sections.  We
use suppressions rather than initializing the buffer so that valgrind
will catch any internal access s to the uninitialized data, which
would be a bug.

The patch also fixes one genuine bug caught by valgrind -
_packblocks() in fdt_rw.c was using memcpy() where it should have been
using memmove().

At present the valgrinding won't do anything useful for testcases
invoked via a shell script - which includes all the dtc testcases.  I
plan to fix that later.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-26 15:57:58 -06:00
David Gibson
2cf86939af libfdt: Abolish fdt_offset_ptr_typed()
The fdt_offset_ptr_typed() macro seemed like a good idea at the time.
However, it's not actually used all that often, it can silently throw
away const qualifications and it uses a gcc extension (typeof) which
I'd prefer to avoid for portability.

Therefore, this patch gets rid of it (and the fdt_offset_ptr_typed_w()
variant which was never used at all).  It also makes a few variables
const in testcases, which always should have been const, but weren't
caught before because of the aforementioned silent discards.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-20 09:01:29 -06:00
David Gibson
9521dc5ecc libfdt: Abolish _typed() variants, add _cell() variants
In a number of places through libfdt and its tests, we have *_typed()
macro variants on functions which use gcc's typeof and statement
expression extensions to allow passing literals where the underlying
function takes a buffer and size.

These seemed like a good idea at the time, but in fact they have some
problems.  They use typeof and statement expressions, extensions I'd
prefer to avoid for portability.  Plus, they have potential gotchas -
although they'll deal with the size of the thing passed, they won't
deal with other representation issues (like endianness) and results
could be very strange if the type of the expression passed isn't what
you think it is.

In fact, the only users of these _typed() macros were when the value
passed is a single cell (32-bit integer).  Therefore, this patch
removes all these _typed() macros and replaces them with explicit
_cell() variants which handle a single 32-bit integer, and which also
perform endian convesions as appropriate.

With this in place, it now becomes easy to use standardized big-endian
representation for integer valued properties in the testcases,
regardless of the platform we're running on.  We therefore do that,
which has the additional advantage that all the example trees created
during a test run are now byte-for-byte identical regardless of
platform.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-20 09:00:37 -06:00
David Gibson
7346858f81 libfdt: Add phandle related functions
This patch adds fdt_get_phandle() and fdt_node_offset_by_phandle()
functions to libfdt.  fdt_get_phandle() will retreive the phandle
value of a given node, and fdt_node_offset_by_phandle() will locate a
node given a phandle.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-13 07:40:06 -06:00
David Gibson
53acf491e9 libfdt: Add more documentation (path the fifth)
This patch documents a few more functions in libfdt.h.  All the
read-only functions are now documented.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-08 11:13:04 -06:00
David Gibson
9d3af7ab62 libfdt: Add more documentation (patch the fourth)
This patch documents a few more functions in libfdt.h.  It also makes
a slight update to the description of the FDT_ERR_INTERNAL error code.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-05 08:49:28 -06:00
David Gibson
2ec634d24b libfdt: Add more documentation (patch the third)
libfdt: Add more documentation (patch the third)

This patch adds documentation in libfdt.h for a few more libfdt
functions.  It also makes a slight update to the documentation of
fdt_get_name().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-05 08:48:57 -06:00
David Gibson
a041dcdc48 libfdt: Handle v16 and re-ordered trees for r/w
Currently all the read/write functions in libfdt require that the
given tree be v17, and further, that the tree has the memory
reservation block, structure block and strings block stored in that
physical order.

This patch eases these constraints, by making fdt_open_int() reorder
the blocks, and/or convert the tree to v17, so that it will then be
ready for the other read-write functions.

It also extends fdt_pack() to actually remove any gaps between blocks
that might be present.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-01 08:03:31 -05:00
David Gibson
4a5df5c026 libfdt: Correctly handle versions > 17
If future dtb version > 17 are defined, that are still backwards
compatible with v16, libfdt will of course be able to read and
understand them.  However, when modifying such a tree, it can't
guarantee that it won't clobber additional structure from the new
version which it doesn't know about.  Therefore, before making
modifications to a tree of version >17, we must change it's version to
be exactly 17.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-30 07:48:35 -05:00
David Gibson
9b91134ba3 libfdt: Remove un-const-safe fdt_set_header macro
The fdt_set_header() macro casts an arbitrary pointer into (struct
fdt_header *) to set fdt header fields.  While we need to change the
type, so that we can use this macro on the usual (void *) used to
represent a device tree blob, the current macro also casts away any
const on the input pointer, which loses an important check.

This patch replaces the fdt_set_header() macro with a set of inline
functions, one for each header field which do a similar thing, but
which won't silently remove const from a given pointer.  This approach
is also more in keeping with the individual accessor macros we use for
reading fdt header fields.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-25 09:49:18 -05:00
David Gibson
57f99b7b3f libfdt: Documentation (patch the second)
Add documentation for another handful of libfdt functions to libfdt.h

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-25 09:37:53 -05:00
David Gibson
cec0c384ef libfdt: Add some documenting comments in libfdt.h
This patch adds some internal documentation in libfdt.h, in the form
of comments on the error codes and some functions.  Only a couple of
functions are covered so far, leaving the documentation still woefully
inadequate, but hey, it's a start.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-24 09:57:26 -05:00
David Gibson
3c44c87bde libfdt: Rename and publish _fdt_next_tag()
Although it's a low-level function that shouldn't normally be needed,
there are circumstances where it's useful for users of libfdt to use
the _fdt_next_tag() function.  Therefore, this patch renames it to
fdt_next_tag() and publishes it in libfdt.h.

In addition, this patch adds a new testcase using fdt_next_tag(),
dtbs_equal_ordered.  This testcase tests for structural equality of
two dtbs, including the order of properties and subnodes, but ignoring
NOP tags, the order of the dtb sections and the layout of strings in
the strings block.  This will be useful for testing other dtc
functionality in the future.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-24 09:56:27 -05:00
David Gibson
96b5fad3a1 libfdt: Rename and publish _fdt_check_header()
It's potentially useful for users of libfdt to sanity check a device
tree (or, rather, a blob of data which may or may not be a device
tree) before processing it in more detail with libfdt.

This patch renames the libfdt internal function _fdt_check_header() to
fdt_check_header() and makes it a published function, so it can now be
used for this purpose.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-24 07:58:13 -05:00
David Gibson
394e47208d libfdt: Add missing RW_CHECK_HEADER to fdt_del_node()
fdt_del_node(), unlike most of the rw functions does not check the
fdt's header with RW_CHECK_HEADER.  However, it could make a mess of
things if the conditions in RW_CHECK_HEADER aren't met.  So, this
patch adds the omitted check.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-22 09:52:18 -05:00
David Gibson
11d5302021 libfdt: Make fdt_string() return a const pointer
Currently, fdt_string() returns a (non-const) char *, despite taking a
const void *fdt.  This is inconsistent with all the other read-only
functions which all return const pointers into the blob.

This patch fixes that.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-22 09:51:55 -05:00
David Gibson
333542fabf libfdt: Add functions for handling the "compatible" property
This patch adds functions for dealing with the compatible property.
fdt_node_check_compatible() can be used to determine whether a node is
compatible with a given string and fdt_node_offset_by_compatible()
locates nodes with a given compatible string.

Testcases for these functions are also included.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-16 07:41:37 -05:00
David Gibson
6f8b7710c9 libfdt: libfdt_env.h must be included first
libfdt.h currently includes fdt.h, then libfdt_env.h.  This is
incorrect, because depending on the environment into which libfdt is
embedded, libfdt_env.h may be needed to define datatypes used in
fdt.h.  This patch corrects the problem.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-16 07:22:50 -05:00
David Gibson
fd1bf3a5ae libfdt: Add functions to get/add/delete memory reservemap entries
This patch adds functions to libfdt for accessing the memory
reservation map section of a device tree blob.  fdt_num_mem_rsv()
retreives the number of reservation entries in a dtb, and
fdt_get_mem_rsv() retreives a specific reservation entry.
fdt_add_mem_rsv() adds a new entry, and fdt_del_mem_rsv() removes a
specific numbered entry.

Testcases for these new functions are also included.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-15 08:31:52 -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
David Gibson
d2a9da0458 libfdt: Make unit address optional for finding nodes
At present, the fdt_subnode_offset() and fdt_path_offset() functions
in libfdt require the exact name of the nodes in question be passed,
including unit address.

This is contrary to traditional OF-like finddevice() behaviour, which
allows the unit address to be omitted (which is useful when the device
name is unambiguous without the address).

This patch introduces similar behaviour to
fdt_subnode_offset_namelen(), and hence to fdt_subnode_offset() and
fdt_path_offset() which are implemented in terms of the former.  The
unit address can be omitted from the given node name.  If this is
ambiguous, the first such node in the flattened tree will be selected
(this behaviour is consistent with IEEE1275 which specifies only that
an arbitrary node matching the given information be selected).

This very small change is then followed by many more diffs which
change the test examples and testcases to exercise this behaviour.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-15 08:27:24 -05:00
David Gibson
63dc9c7113 dtc: Whitespace cleanup
This large patch removes all trailing whitespace from dtc (including
libfdt, the testsuite and documentation).  It also removes a handful
of redundant blank lines (at the end of functions, or when there are
two blank lines together for no particular reason).

As well as anything else, this means that quilt won't whinge when I go
to convert the whole of libfdt into a patch to apply to the kernel.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-09-18 09:43:26 -05:00
David Gibson
ae1454b311 libfdt: Add fdt_node_offset_by_prop_value()
This patch adds a function to libfdt to locate nodes containing a
property with a specific value.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-09-17 13:18:09 -05:00
David Gibson
592ea5888c dtc: Assume properties preced subnodes in the flattened tree
With kernel commit eff2ebd207af9f501af0ef667a7d14befcb36c1b, we
clarified that in the flattened tree format, a particular nodes
properties are required to precede its subdnodes.

At present however, both dtc and libfdt will process trees which don't
meet this condition.  This patch simplifies the code for
fdt_get_property() based on assuming that constraint.  dtc continues
to be able to handle such an invalid tree - on the grounds that it's
useful for dtc to be able to correct such a broken tree - but this
patch adds a warning when this condition is not met while reading a
flattened tree.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-09-05 13:17:14 -05:00
David Gibson
e2b3bb3227 libfdt: Fix use of uninitialized variable in fdt_get_path()
My recent implemenetation of fdt_get_path() had a bug - the while loop
tested offset which was unitialized on the first iteration.  Depending
on code surrounding the call, this could cause fdt_get_path() to
return incorrect results.

This patch corrects the problem by applying some more correct thinking
to the loop condition.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-08-31 08:34:09 -05:00
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
David Gibson
4f61ae1627 dtc: Improve the make install target
This patch makes various improvements to dtc's make install target:
	- libfdt is also installed.  Specifically, libfdt.a and the
two export relevant header files, fdt.h and libfdt.h are installed.
	- ftdump is no longer installed.  It was only ever a
development debugging tool and may well go away at some point.
	- In keeping with normal conventions, there is now a PREFIX
variable, allowing control of where things are installed (in /usr,
/usr/local, /opt, etc.).
	- By default, installed into the user's home directory,
instead of /usr.  This is friendlier for self-installers, package
builders can easily override PREFIX to restore the old behaviour.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-07-25 10:26:36 -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
6c65eab11e dtc: Remove redundant copy of the GPL
The dtc tree currently includes two copies of the GPL - one which was
there originally, and one imported from the libfdt tree.  This patch
gets rid of the extra copy in the libfdt tree.

In addition it renames the file containing the remaining copy from
COPYING to GPL.  Since libfdt is dual-licensed, this seems clearer.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-06-25 21:43:11 -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
David Gibson
23cdf2379f Move everything into a subdirectory in preparation for merge into dtc. 2007-06-14 11:58:35 +10:00