History log of /external/dtc/dtc.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a058df1cffd5fb5d24cad1555841ec1e6fbd3104 09-Nov-2017 SzuWei Lin <szuweilin@google.com> Update dtc to the version of 20170713 of upstream

For pylibfdt, merge dtc to upstream 0016f8c2aa32423f680ec6e94a00f1095b81b5fc
and merge history

Bug: 64424046
Test: Build dtc, use output dtc to build dts, can output correct dtb.
Change-Id: I4304259e1245bc4a45d0b8f8e3ae8119e509042c
13ce6e1c2fc4549fbb53a9ca5f577166c6e315ac 08-Jun-2017 David Gibson <david@gibson.dropbear.id.au> dtc: fix sprintf() format string error, again

2a42b14 "dtc: check.c fix compile error" changed a format string using
%lx which wasn't correct for all platforms. Unfortunately it changed it to
%zx, which is wrong for a different set of platforms (and only right on
the others by accident). The parameter we're formatting here is uint64_t,
not size_t, so we need to use the PRIx64 macro from <inttypes.h> to get
this right.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
41c88b14dc8685502ffb40ed85629c759357c136 25-Apr-2017 SzuWei Lin <szuweilin@google.com> Update to dtc-1.4.4

Merge dtc to upstream 558cd81bdd432769b59bff01240c44f82cfb1a9d
and merge history

Bug: 37655045
Test: Build dtc, use output dtc to build dts, can output correct dtb.
Change-Id: Ibd9a82768e999bc46e6de349ca97ba6447e85455
33c3985226d344662511f999aa1920c112a549da 20-Mar-2017 Rob Herring <robh@kernel.org> checks: Add bus checks for PCI buses

Add PCI bridge and device node checks. We identify PCI bridges with
'device_type = "pci"' as only PCI bridges should set that property. For
bridges, check that node name is pci or pcie, ranges and bus-range are
present, and #address-cells and #size-cells are correct.

For devices, check the reg property fields are correct for the first
element (the config address). Check that the unit address is formatted
corectly based on the reg property. Device unit addresses are in the
form DD or DD,F where DD is the device 0-0x1f and F is the function 0-7.
Also, check that the bus number is within the expected range defined by
bridge's bus-ranges.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Rob Herring <robh@kernel.org>
[dwg: Added a missing check dependency]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
672ac09ea04d998dfddfdef3070a8af8d480182b 05-Mar-2017 David Gibson <david@gibson.dropbear.id.au> Clean up gcc attributes

We have a number of explicit __GNUC__ conditionals to tell if we want to
use some gcc extensions for extra warnings. This cleans this up to use
a single conditional, defining convenience macros for those attributes.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
49300f2ade6a6ad9b19957b1fce41fccfe1246a3 05-Mar-2017 David Gibson <david@gibson.dropbear.id.au> dtc: Don't abuse struct fdt_reserve_entry

struct fdt_reserve_entry is defined in fdt.h to exactly mirror the
in-memory layout of a reserve entry in the flattened tree. Since that is
always big-endian, it uses fdt64_t elements, which have sparse annotations
marking them as not native endian.

However, in dtc, we also use struct fdt_reserve_entry inside struct
reserve_info, and use it with native endian values. This will cause sparse
errors.

This stops this abuse, making struct reserve_info have its own native
endian fields for the same information.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
acd1b534a5924e1fa2b8c941d1931d78ca327e18 03-Feb-2017 Ian Campbell <ijc@hellion.org.uk> Print output filename as part of warning messages

For example:
src/arm/at91-ariag25.dtb: Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name

If output is to stdout then the prefix is "<stdout>: ".

This helps to direct the developer to where to look when multiple files are
being compiled in parallel.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
ec2917363c948b0a7b0a5a831c4b6902ce897c8f 06-Dec-2016 Pantelis Antoniou <pantelis.antoniou@konsulko.com> overlay: Add syntactic sugar version of overlays

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
/external/dtc/dtc.h
00fbb8696b665ab138406cc9522793f2096031a0 31-May-2016 David Gibson <david@gibson.dropbear.id.au> Rename boot_info

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>
/external/dtc/dtc.h
20f29d8d41f6d1bd2fbe466aa5676026eb012832 07-Dec-2016 Pantelis Antoniou <pantelis.antoniou@konsulko.com> dtc: Plugin and fixup support

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>
/external/dtc/dtc.h
874f40588d3eb7e406521117c6e24d5a3376a77e 18-Jul-2016 Tim Wang <timwang@asrmicro.com> 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>
/external/dtc/dtc.h
f9e91a48ba509e77aadcb5349885e1777ef17372 19-Jun-2014 Andrei Errapart <andrei@errapartengineering.com> Work around MSVC limitations

1) No variadic macros in the form "args..."; this is a GCC extension.
2) No empty struct initializers. In any case, there is very little to win:
{ } vs. { 0 }.

Signed-off-by: Andrei Errapart <andrei@errapartengineering.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
24cb3d0681d9196d57176a0a94bfc6e610ef7b45 01-Feb-2014 Florian Fainelli <f.fainelli@gmail.com> dtc: fix some more -Wshadow warnings

Building on a RHEL6 system produced the following -Wshadow warnings in
fstree.c, util.c and checks.c:

cc1: warnings being treated as errors
checks.c: In function 'parse_checks_option':
checks.c:709: error: declaration of 'optarg' shadows a global
declaration
/usr/include/getopt.h:59: error: shadowed declaration is here
make[1]: *** [checks.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** Waiting for unfinished jobs....
cc1: warnings being treated as errors
fstree.c: In function 'read_fstree':
fstree.c:40: error: declaration of 'tmpnam' shadows a global
declaration
/usr/include/stdio.h:208: error: shadowed declaration is here
make[1]: *** [fstree.o] Error 1
cc1: warnings being treated as errors
util.c: In function 'xstrdup':
util.c:42: error: declaration of 'dup' shadows a global declaration
/usr/include/unistd.h:528: error: shadowed declaration is here

Fix all of these -Wshadow warnings by using slightly different variable
names which won't collide with anything else.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
/external/dtc/dtc.h
17625371eeea2fa7257361163c52d336a1a98ebc 28-Oct-2013 David Gibson <david@gibson.dropbear.id.au> Use stdbool more widely

We already use the C99 bool type from stdbool.h in a few places. However
there are many other places we represent boolean values as plain ints.
This patch changes that.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
4ad49c3a9cdaccac02cd448c2704ea52ad85d1dc 16-Apr-2013 Mike Frysinger <vapier@gentoo.org> util: add common ARRAY_SIZE define

I want to use this in more places, so put it in util.h rather than
copying & pasting it into another file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
1762ab42ef77db7ab2776d0d6cba3515150f518a 05-Oct-2012 Stephen Warren <swarren@nvidia.com> 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>
/external/dtc/dtc.h
45013d86197fea96810a7ae1b920d22b4c887688 08-Aug-2012 Stephen Warren <swarren@nvidia.com> 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>
/external/dtc/dtc.h
d5399197e9e0d8bad13de5c41df3b93804c0558a 08-Jul-2012 David Gibson <david@gibson.dropbear.id.au> 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>
/external/dtc/dtc.h
511dedd40f0372cd7c85e3d4c66553f5829142b7 08-Jul-2012 David Gibson <david@gibson.dropbear.id.au> Re-work level setting on checks code

Currently each of the semantic checks in checks.c has a "level" between
IGNORE and ERROR. This single level makes it awkward to implement the
semantics we want for toggling the checks on the command line.

This patch reworks the code to instead have separate boolean flags for
warning and error. At present having both flags set will have the same
effect as having just the error flag set, but this can change in the
future.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
a4b515c03804dbc0eff5bbf281bd22438717e773 11-Oct-2011 Anton Staaf <robotboy@chromium.org> dtc: Add data_append_integer function

This function deals with appending integers of various sizes (8, 16
32, and 64 bit currently). It handles endianess conversions. If the
integer will not fit in the requested number of bits of storage it
will have it's high bits ignored.

This patch also rewrites data_append_cell and data_append_addr to use
data_append_integer.

Signed-off-by: Anton Staaf <robotboy@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
37c0b6a0916c31a5eae0a9ddfcc5d0b8fb4569c6 09-Nov-2010 David Gibson <david@gibson.dropbear.id.au> dtc: Add code to make diffing trees easier

This patch adds a "dtdiff" script to do a useful form diff of two
device trees. This automatically converts the tree to dts form (if
it's not already) and uses a new "-s" option in dtc to "sort" the
tree. That is, it sorts the reserve entries, it sorts the properties
within each node by name, and it sorts nodes by name within their
parent.

This gives a pretty sensible diff between the trees, which will ignore
semantically null internal rearrangements (directly diffing the dts
files can give a lot of noise due to the order changes).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
83da1b2a4ee272ac97647a82fc652d9b4b1505ee 25-Feb-2010 Grant Likely <grant.likely@secretlab.ca> Allow device tree to be modified by additonal device tree sections

This patch allows the following construct:

/ {
property-a = "old";
property-b = "does not change";
};

/ {
property-a = "changed";
property-c = "new";
node-a {
};
};

Where the later device tree overrides the properties found in the
earlier tree. This is useful for laying down a template device tree
in an include file and modifying it for a specific board without having
to clone the entire tree.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
/external/dtc/dtc.h
05898c67c15d73fe50bd87fc939bd9ee6a4275ce 24-Feb-2010 David Gibson <david@gibson.dropbear.id.au> dtc: Allow multiple labels on nodes and properties

At present, both the grammar and our internal data structures mean
that there can be only one label on a node or property. This is a
fairly arbitrary constraint, given that any number of value labels can
appear at the same point, and that in C you can have any number of
labels on the same statement.

This is pretty much a non-issue now, but it may become important with
some of the extensions that Grant and I have in mind. It's not that
hard to change, so this patch does so, allowing an arbitrary number of
labels on any given node or property. As usual a testcase is added
too.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
/external/dtc/dtc.h
329055dbbc3c09e21386ceae788256991f4c8aec 23-Feb-2010 David Gibson <david@gibson.dropbear.id.au> Disallow re-use of the same label within a dts file

Currently, nothing will stop you from re-using the same label string
multiple times in a dts, e.g.:
/ {
samelabel: prop1 = "foo";
samelabel: prop2 = "bar";
};

or
/ {
samelabel: prop1 = "foo";
samelabel: subnode {
};
};

When using node references by label, this could lead to confusing
results (with no warning), and in -Oasm mode will result in output
which the assembler will complain about (since it too will have
duplicate labels).

This patch, therefore, adds code to checks.c to give errors if you
attempt to re-use the same label. It treats all labels (node,
property, and value) as residing in the same namespace, since the
assembler will treat them so for -Oasm mode.

Testcases for the new code are also added.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
15ad6d862ec7f66dc00783798705a8db1c5d9aca 19-Feb-2010 David Gibson <david@gibson.dropbear.id.au> dtc: Automatically pick a sensible boot_cpuid_phys

Currently, when in -Idts -Odtb or -Ifs -Odtb modes, dtc always
defaults to using 0 as the value for the boot_cpuid_phys header field.
That's correct quite often, but there are some systems where there is
no CPU with hardware ID of 0, or where we don't want to use the CPU
with hardware ID 0 at all (e.g. for AMP-style partitioning). The only
way to override this default currently, is with the -b command line
option.

This patch improves dtc to instead base the default boot_cpuid_phys
value on the reg property of the first listed subnode of /cpus. This
means that dtc will get boot_cpuid_phys correct by default in a
greater proportion of cases (since the boot cpu is usually listed
first, and this way at least the boot_cpuid_phys default will match
some existing cpu node). If the node doesn't exist or has an invalid
'reg' property (missing or not 4 bytes in length), then
boot_cpuid_phys is set to 0.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
d68cb36b0bebc7711ada9b750f3c19398c44efb7 08-Dec-2009 David Gibson <david@gibson.dropbear.id.au> dtc: Simpler interface to source file management

This patch cleans up our handling of input files, particularly dts
source files, but also (to an extent) other input files such as those
used by /incbin/ and those used in -I dtb and -I fs modes.

We eliminate the current clunky mechanism which combines search paths
(which we don't actually use at present) with the open relative to
current source file behaviour, which we do.

Instead there's a single srcfile_relative_open() entry point for
callers which opens a new input file relative to the current source
file (which the srcpos code tracks internally). It doesn't currently
do search paths, but we can add that later without messing with the
callers, by drawing the search path from a global (which makes sense
anyway, rather than shuffling it around the rest of the processing
code).

That suffices for non-dts input files. For the actual dts files,
srcfile_push() and srcfile_pop() wrappers open the file while also
keeping track of it as the current source file for future opens.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
d75b33af676d0beac8398651a7f09037555a550b 26-Nov-2009 David Gibson <david@gibson.dropbear.id.au> Support ePAPR compliant phandle properties

Currently, the Linux kernel, libfdt and dtc, when using flattened
device trees encode a node's phandle into a property named
"linux,phandle". The ePAPR specification, however - aiming as it is
to not be a Linux specific spec - requires that phandles be encoded in
a property named simply "phandle".

This patch adds support for this newer approach to dtc and libfdt.
Specifically:

- fdt_get_phandle() will now return the correct phandle if it
is supplied in either of these properties

- fdt_node_offset_by_phandle() will correctly find a node with
the given phandle encoded in either property.

- By default, when auto-generating phandles, dtc will encode
it into both properties for maximum compatibility. A new -H
option allows either only old-style or only new-style
properties to be generated.

- If phandle properties are explicitly supplied in the dts
file, dtc will not auto-generate ones in the alternate format.

- If both properties are supplied, dtc will check that they
have the same value.

- Some existing testcases are updated to use a mix of old and
new-style phandles, partially testing the changes.

- A new phandle_format test further tests the libfdt support,
and the -H option.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
b2b4990bbf03a1b9def187cbc37488eed66a182c 04-Jan-2009 David Gibson <david@gibson.dropbear.id.au> dtc: Move some functions to util.[ch]

Now that we have a util.[ch] file shared between dtc and
convert-dtsv0, move some functions which are currently duplicated in
the two to util files. Specifically we move the die(), xmalloc() and
xrealloc() functions.

While we're at it, add standard double-include protection to util.h

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
2ebe88df6932a3d685e43d921c9beb526129d2be 05-Sep-2008 Jon Loeliger <jdl@freescale.com> Add conditionalized debug() print macro.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
/external/dtc/dtc.h
879e4d2590b50d63f82c3c3652bc3c7900591f1c 03-Oct-2008 Jon Loeliger <jdl@jdl.com> 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>
/external/dtc/dtc.h
c8c374b8565081da08e3d1d73df8ddb0d6a66ae3 25-Jun-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Use the same endian-conversion functions as libfdt

Currently both libfdt and dtc define a set of endian conversion macros
for accessing the device tree blob which is always big-endian. libfdt
uses names like cpu_to_fdt32() and dtc uses names like cpu_to_be32 (as
the Linux kernel). This patch switches dtc over to using the libfdt
macros (including libfdt_env.h to supply them). This has a couple of
small advantages:
- Removes some code duplication
- Will make conversion a bit easier if we ever need to produce
little-endian device tree blobs.
- dtc no longer needs to pull in netinet/in.h simply for the
ntohs() and ntohl() functions

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
53359016caf6db9ab2347517a323d6ba8eb6671e 25-Jun-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Use stdint.h types throughout dtc

Currently, dtc defines Linux-like names for various fixed-size integer
types. There's no good reason to do this; even Linux itself doesn't
use these names for externally visible things any more. This patch
replaces these with the C99 standardized type names from stdint.h.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
548767f42eb00a2bac6f2a1361b7fd49f7b76908 16-May-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Rework handling of boot_cpuid_phys

Currently, dtc will put the nonsense value 0xfeedbeef into the
boot_cpuid_phys field of an output blob, unless explicitly given
another value with the -b command line option. As well as being a
totally unuseful default value, this also means that dtc won't
properly preserve the boot_cpuid_phys field in -I dtb -O dtb mode.

This patch reworks things to improve the boot_cpuid handling. The new
semantics are that the output's boot_cpuid_phys value is:
the value given on the command line if -b is used
otherwise
the value from the input, if in -I dtb mode
otherwise
0

Implementation-wise we do the following:
- boot_cpuid_phys is added to struct boot_info, so that
structure now contains all of the blob's semantic information.
- dt_to_blob() and dt_to_asm() output the cpuid given in
boot_info
- dt_from_blob() fills in boot_info based on the input blob
- The other dt_from_*() functions just record 0, but we can
change this easily if e.g. we invent a way of specifying the boot cpu
in the source format.
- main() overrides the cpuid in the boot_info between input
and output if -b is given

We add some testcases to check this new behaviour.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
a742aade6a28fbebf7a66448b40b983549897253 16-May-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Make dt_from_blob() open its own input file, like the other input formats

Currently, main() has a variable for the input file. It used to be
that main() would open the input based on command line arguments
before passing it to the dt_from_*() function. However, only
dt_from_blob() uses this. dt_from_source() opens its own file, and
dt_from_fs() interprets the argument as as a directory and does its
own opendir() call.

Furthermore, main() opened the file with dtc_open_file() but closed it
with a direct call to fclose().

Therefore, to improve the interface consistency between the
dt_from_*() functions, make dt_from_blob() open and close its own
files like the other dt_from_*() functions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
35aa1a273bc407271f8a1e7b91989b9e6787879c 16-May-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Simplify error handling for unparseable input

Currently, main() tests if it got a valid input tree from whichever
dt_from_*() function it invoked and if not, die()s. For one thing,
this test has, for no good reason, three different ways for those
functions to communicate a failure to provide input (bi NULL, bi->dt
NULL, or bi->error non-zero). For another, in every case save one, if
the dt_from_*() functions are unable to provide input they will
immediately die() (with a more specific error message) rather than
proceeding to the test in main().

Therefore, this patch removes this test, making the one case that
could have triggered it (in dt_from_source()) call die() directly
instead. With this change, the error field in struct boot_info is now
unused, so remove it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
1a9468c9a0c0bd6e3ff1b9bff7547dd7e7aa9bb7 06-Mar-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Abolish asize field of struct data

The asize field in struct data is a hangover from the early days when
a struct data was sometimes allowed to refer to a static chunk of
memory rather than a malloc()ed block.

That's long gone, since the lifetime issues were far more trouble than
it was worth, so get rid of the asize field.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
b2de518b80eb01b1004e137ff2435b03dc40018d 29-Feb-2008 David Gibson <david@gibson.dropbear.id.au> dtc: Make -I dtb mode use fill_fullpaths()

At present -I dts and -I fs modes both use the fill_fullpaths() helper
function to fill in the fullpath and basenamelen fields of struct
node, which are useful in later parts of the code. -I dtb mode,
however, fills these in itself.

This patch simplifies flattree.c by making -I dtb mode use
fill_fullpaths() like the others.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
ad4f54ae2b67ddcd4d128fd4b5c21c66a640d237 04-Jan-2008 Scott Wood <scottwood@freescale.com> Return a non-zero exit code if an error occurs during dts parsing.

Previously, only failure to parse caused the reading of the tree to fail;
semantic errors that called yyerror() but not YYERROR only emitted a message,
without signalling make to stop the build.

Signed-off-by: Scott Wood <scottwood@freescale.com>
/external/dtc/dtc.h
376ab6f2ed5aac107ef197ff2ec401bf2a8239bd 18-Dec-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Remove remaining old-style checks

The remaining old-style tree checking code: check_root(), check_cpus()
and check_memory() really aren't that useful. They mostly check for
the presence of particular nodes and properties. That's inherently
prone to false-positives, because we could be dealing with an
artificial tree (like many of the testcases) or it could be expected
that the missing properties are filled in by a bootloader or other
agent.

If any of these checks really turns out to be useful, we can
reimplement them later in a better conceived way on top of the new
checking infrastructure. For now, just get rid of them, removing the
last vestiges of the old-style checking code (hoorah).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
efbbef8e4f86f8043760f1e48b25ab2795ba3524 05-Dec-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Implement path references

This patch extends dtc syntax to allow references (&label, or
&{/full/path}) directly within property definitions, rather than
inside a cell list. Such references are expanded to the full path of
the referenced node, as a string, instead of to a phandle as
references within cell lists are evaluated.

A testcase is also included.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
92cb9a25b1a9117f4dacb0bce8c16b90b73b8698 04-Dec-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Add many const qualifications

This adds 'const' qualifiers to many variables and functions. In
particular it's now used for passing names to the tree accesor
functions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
2d72816ccfdcfd8039ab0b8883f9eeac895984bb 04-Dec-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Fix uninitialized use of structure_ok

My rework of the tree checking code introduced a potentially nasty bug
- it uses the structure_ok variable uninitialized. This patch fixes
the problem. It's a fairly ugly bandaid approach, but the ugly will
disappear once future patches have folded the semantic checks into the
new framework.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
2b7dc8dce549ad72ad437b254bf756d7ba4c2a5a 28-Nov-2007 Kumar Gala <galak@kernel.crashing.org> Add an option to pad the blob that is generated

There are times when we need extra space in the blob and just want
to have it added on w/o know the exact size to make it.

The padding and min size options are mutually exclusive.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
/external/dtc/dtc.h
dc941774e228779562379a221ddc489d289e8513 22-Nov-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Merge refs and labels into single "markers" list (v2)

Currently, every 'data' object, used to represent property values, has
two lists of fixup structures - one for labels and one for references.
Sometimes we want to look at them separately, but other times we need
to consider both types of fixup.

I'm planning to implement string references, where a full path rather
than a phandle is substituted into a property value. Adding yet
another list of fixups for that would start to get silly. So, this
patch merges the "refs" and "labels" lists into a single list of
"markers", each of which has a type field indicating if it represents
a label or a phandle reference. String references or any other new
type of in-data marker will then just need a new type value - merging
data blocks and other common manipulations will just work.

While I was at it I made some cleanups to the handling of fixups which
simplify things further.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
b16a2bd89dbf109b9c8d1c9e047b9afa72af6d2f 22-Nov-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Flexible tree checking infrastructure (v2)

dtc: Flexible tree checking infrastructure

Here, at last, is a substantial start on revising dtc's infrastructure
for checking the tree; this is the rework I've been saying was
necessary practically since dtc was first release.

In the new model, we have a table of "check" structures, each with a
name, references to checking functions, and status variables. Each
check can (in principle) be individually switched off or on (as either
a warning or error). Checks have a list of prerequisites, so if
checks need to rely on results from earlier checks to make sense (or
even to avoid crashing) they just need to list the relevant other
checks there.

For now, only the "structural" checks and the fixups for phandle
references are converted to the new mechanism. The rather more
involved semantic checks (which is where this new mechanism will
really be useful) will have to be converted in future patches.

At present, there's no user interface for turning on/off the checks -
the -f option now forces output even if "error" level checks fail.
Again, future patches will be needed to add the fine-grained control,
but that should be quite straightforward with the infrastructure
implemented here.

Also adds a testcase for the handling of bad references, which catches
a bug encountered while developing this patch.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
2f1ccc36f478d0cdb55666eb62ae6a338751be9c 01-Nov-2007 David Gibson <david@gibson.dropbear.id.au> 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>
/external/dtc/dtc.h
7b3fb789d2cd5fed818f439d0c7aed44b9860fab 22-Oct-2007 Jon Loeliger <jdl@freescale.com> DTC: Remove the need for the GLR Parser.

Previously, there were a few shift/reduce and reduce/reduce
errors in the grammar that were being handled by the not-so-popular
GLR Parser technique.

Flip a right-recursive stack-abusing rule into a left-recursive
stack-friendly rule and clear up three messes in one shot: No more
conflicts, no need for the GLR parser, and friendlier stackness.
Compensate by reversing the property list on the node.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
/external/dtc/dtc.h
169f0b183d45b87ba6dfc194792aee6170ffb54d 18-Oct-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Disable semantic checks by default

At present, dtc makes a lot of semantic checks on the device tree by
default, and will refuse to produce output if they fail. This means
people tend to need -f to force output despite failing semantic checks
rather a lot.

This patch splits the device tree checks into structural checks (no
bad or duplicate names or phandles) and semantic checks (everything
else). By default, only the structural checks are performed, and are
fatal. -f will force output even with structural errors (using this
in -Idts mode would essentially always be a bad idea, but it might be
useful in -Idtb mode for examining a malformed dtb).

Semantic checks are only performed if the new -c command line option
is supplied, and are always warnings only. Semantic checks will never
be performed on a tree with structural errors.

This patch is only a stopgap before implementing proper fine-grained
error/warning handling, but it should at least get rid of the
far-too-frequent need for -f for the time being.

This patch removes the -f from the dtc testcases now that it's no
longer necessary.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
fb7c7acf5a4187ea810043ae17854625a313b725 26-Sep-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Use libfdt/fdt.h instead of flat_dt.h

In the dtc tree, both flat_dt.h and libfdt/fdt.h have structures and
constants relating to the flattened device tree format derived from
asm-powerpc/prom.h in the kernel. The former is used in dtc, the
latter in libfdt.

libfdt/fdt.h is the more recent, revised version, so use that
throughout, removing flat_dt.h.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
/external/dtc/dtc.h
63dc9c7113cd0fff60d04b05cd8053e70279f9d4 18-Sep-2007 David Gibson <david@gibson.dropbear.id.au> 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>
/external/dtc/dtc.h
bf944970317820867895680cf0e2c4e72eefa8b1 31-Aug-2007 David Gibson <david@gibson.dropbear.id.au> dtc: Optimise by default, fix warnings thus uncovered

This patch turns on optimisation in the Makefile by default. With the
optimizer on, some uninitialized variable warnings (one real, two
bogus) are now generated. This patch also squashes those again.
/external/dtc/dtc.h
6a99b1313208d05ba6d9c5d3858230d9ee785f8c 07-Jul-2007 Milton Miller <miltonm@bga.com> dtc: implement labels on property data

Extend the parser grammer to allow labels before or after any
property data (string, cell list, or byte list), and any
byte or cell within the property data.

Store the labels using the same linked list structure as node
references, but using a parallel list.

When writing assembly output emit global labels as offsets from
the start of the definition of the data.

Note that the alignment for a cell list is done as part of the
opening < delimiter, not the = or , before it. To label a cell
after a string or byte list put the label inside the cell list.

For example,
prop = zero: [ aa bb ], two: < four: 1234 > eight: ;
will produce labels with offsets 0, 2, 4, and 8 bytes from
the beginning of the data for property prop.

Signed-off-by: Milton Miller <miltonm@bga.com>
/external/dtc/dtc.h
4384b23454a939852d679aee93ee624cf210287f 05-Apr-2007 Jerry Van Baren <gvb.uboot@gmail.com> Implement the -R option and add a -S option.

Implement the -R <number> option to add memory reserve slots.
Add a -S <size> option makes the blob at least this number of bytes.

Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
/external/dtc/dtc.h
e45e6fd274826991c2b7e01fde4d73110487e0e0 23-Mar-2007 Jon Loeliger <jdl@freescale.com> DTC: Add support for a C-like #include "file" mechanism.

Keeps track of open files in a stack, and assigns
a filenum to source positions for each lexical token.
Modified error reporting to show source file as well.
No policy on file directory basis has been decided.
Still handles stdin.

Tested on all arch/powerpc/boot/dts DTS files

Signed-off-by: Jon Loeliger <jdl@freescale.com>
/external/dtc/dtc.h
cd1da8711641a4c7722742ce8b692b2b7cdadfc7 18-Mar-2007 Jerry Van Baren <gerald.vanbaren@comcast.net> Improve options, #define default version.

Add -h option for help
Add -q quiet option to reduce or suppress the whining
Create #define for the default version value.

Signed-off-by: vanbaren@cideas.com <vanbaren@cideas.com>
/external/dtc/dtc.h
3948849fd0cdcaf0b91c7cc4774e86c05ba097ef 16-Feb-2007 Jon Loeliger <jdl@freescale.com> Moved data_convert_cell() out of data.c to the parser.
It constructs a cell_t, not data objects.
Renamed it to cell_from_string() as well.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
/external/dtc/dtc.h
af0278a3a04fabe8349cae89613274da196509ca 15-Feb-2007 Jon Loeliger <jdl@freescale.com> Add support for decimal, octal and binary based cell values.

New syntax d#, b#, o# and h# allow for an explicit prefix
on cell values to specify their base. Eg: <d# 123>

Signed-off-by: Jon Loeliger <jdl@freescale.com>
/external/dtc/dtc.h
32da475af165a0e1e274aa9a8bbdfb873831efa7 07-Feb-2007 David Gibson <david@gibson.dropbear.id.au> Allow multipart property values

At present each property definition in a dts file must give as the
value either a string ("abc..."), a bytestring ([12abcd...]) or a cell
list (<1 2 3 ...>). This patch allows a property value to be given as
several of these, comma-separated. The final property value is just
the components appended together. So a property could have a list of
cells followed by a string, or a bytestring followed by some cells.
Cells are always aligned, so if cells are given following a string or
bytestring which is not a multiple of 4 bytes long, zero bytes are
inserted to align the following cells.

The primary motivation for this feature, however, is to allow defining
a property as a list of several strings. This is what's needed for
defining OF 'compatible' properties, and is less ugly and fiddly than
using embedded \0s in the strings.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
/external/dtc/dtc.h
38e8f8fd88dae07ef8ada9d6baa41b06a4d9ac9f 31-May-2006 Michael Neuling <mikey@neuling.org> dtc: add setting of physical boot cpu

dtc always sets the physical boot CPU to 0xfeedbeef. Add a -b option to
set this. Also add warnings when using the wrong property with the
wrong blob version.

Signed-off-by: Michael Neuling <mikey@neuling.org>
/external/dtc/dtc.h
1ae70562f04c3b60644a52d005d8551484852b5f 26-Oct-2005 David Gibson <dgibson@sneetch.(none)> Remove no longer used (and already commented) reserve_data field from boot_info.
/external/dtc/dtc.h
712e52e4386295c6ae9570721c4c91965d747b08 26-Oct-2005 David Gibson <dgibson@sneetch.(none)> Use names for output functions in the form dt_to_*() instead of
write_dt_*() for consistency with the dt_from_*() input functions.
/external/dtc/dtc.h
f040d95b847c4f7d1fa4c3c6309127b8c1ffd8b3 24-Oct-2005 David Gibson <dgibson@sneetch.(none)> Rework tracking of reserve entries during processing. This is initial work
to allow more powerful handling of reserve entries.
/external/dtc/dtc.h
7f6d12b3a1b632f7854bdfe7a25a825ab28bcf07 15-Jul-2005 David Gibson <dgibson@sneetch.(none)> Remove unused enum from dtc.h.
/external/dtc/dtc.h
f0517db25008374955e1b09a140413d7e0f499c3 15-Jul-2005 David Gibson <dgibson@sneetch.(none)> Support for specifying memreserve ranges in the source format, based on
a patch by Jon Loeliger <jdl AT freescale.com>, although tweaked
substantially.
/external/dtc/dtc.h
03a9b9dcdc29df37e40d08aaa80f3274ffd56354 11-Jul-2005 David Gibson <dgibson@sneetch.(none)> Use u8 instead of uint8_t, as we do with the other size types.
/external/dtc/dtc.h
9ad4587c904ce0eb58e5e747b3f3d99f03e8d21f 17-Jun-2005 David Gibson <dgibson@sneetch.(none)> Remove build_empty_property(). It wasn't useful.
/external/dtc/dtc.h
81f2e89c7551ef44a6203ab1cbb8228d09202572 16-Jun-2005 David Gibson <dgibson@sneetch.(none)> Rudimentary phandle reference support.
/external/dtc/dtc.h
4102d840d993e7cce7d5c5aea8ef696dc81236fc 16-Jun-2005 David Gibson <dgibson@sneetch.(none)> Initial label support. Also switch to glr-parser mode and get rid of
hacks that were necessary without it.
/external/dtc/dtc.h
fc14dad7692d84d5f0f547fd0456b3f98526b6cc 08-Jun-2005 David Gibson <dgibson@sneetch.(none)> Initial commit
/external/dtc/dtc.h