Commit 0738774fcc introduced some
incorrect indentation / bracketing in unflatten_tree(). By luck, the
extra break statement intended to be within an if block, but actually
afterwards has no semantic effect. Still, this patch gets rid of it
for cleanliness.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Since Milton's patch, dtc will accept (and, correctly, ignore) NOP
tags when given dtb input v16 or later. However, although NOPs
weren't defined in earlier versions, they're not ambiguous, so should
be accepted there as well. This patch does so, printing a mere
warning when finding NOPs in a too-early dtb version.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Version 16 and later of the flat device tree format allow NOPs
to be placed in the tree. When processing dtb input, dtc must
recognise them.
Previously it would produce the error message
FATAL ERROR: Invalid opcode word 00000004 in device tree blob
Signed-off-by: Milton Miller <miltonm@bga.com>
With the last improvement to pad out the blob, I broke the blob
header totalsize adjustment. The adjustment was moved up in the
code before the memory image of the blob is created.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
This makes padding out the blob if the user requested extra size much
easer. The assembly and writing to the file is more straight forward too.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
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>
libfdt defined a new version of the flattened device tree format,
version 17. It is backwards compatible with version 16, just adding
an extra header field giving the size of the blob's structure blob.
This patch adds support to dtc allowing it to read and write version
17 blobs. It also makes version 17 the default output version for
blobs.
At the same time we change the code to consistently using decimal
numbers for versions. Previously we sometimes used 16 and sometimes
0x10 to refer to version 16.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
The reserve mem regions are screwy if you read a blob on x86. I'm
guessing there may be a few more of these lurking in the code.
Signed-off-by: Michael Neuling <mikey@neuling.org>
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>
even for ASM output. It was inconsistent with the binary
output form, and kernel folks decided to have the early
kernel perform the reservation itself.
it shouldn't be (because the assembler will do the necessary swapping).
The cell values (asm_emit_cell()) are different from the data values
(asm_emit_data()) because the cell values are generated within the
program and don't get swapped like the data values read from the dts file.
They should be left as they are so that the assembler will swap them,
if necessary. For example, when the property length field was 4,
the asm output contained ".long 0x4000000" and sent the kernel prom.c
dt parsing code into the weeds.
Pointed out by Mark Greer.