aboutsummaryrefslogtreecommitdiff
path: root/fdtdump.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-06Fix assorted sparse warningsDavid Gibson1-1/+1
This fixes a great many sparse warnings on the fdt and libfdt sources. These are mostly due to incorrect mixing of endian annotated and native integer types. This includes fixing a couple of quasi-bugs where we had endian conversions the wrong way around (this will have the right effect in practice, but is certainly conceptually incorrect). This doesn't make the whole tree sparse clean: there are many warnings in bison and lex generated code, and there are a handful of other remaining warnings that are (for now) more trouble than they're worth to fix (and are not genuine bugs). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-27dtc: fdtdump: check fdt if not in scanning modeHeinrich Schuchardt1-8/+19
Running fdtdump without scan mode for an invalid file often results in a segmentation fault because the fdt header is not checked. With the patch the header is checked both in scanning as well as in non-scanning mode. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [dwg: Removed unnecessary inline, changed type from int to bool] Reviewed-by: Simon Glass <sjg@chromium.org>
2016-07-24fdtdump.c: make sure size_t argument to memchr is always unsigned.Jean-Christophe Dubois1-4/+6
CID 132817 (#1 of 1): Integer overflowed argument (INTEGER_OVERFLOW) 15. overflow_sink: Overflowed or truncated value (or a value computed from an overflowed or truncated value) endp - p - 4L used as critical argument to function. Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-10-24Improve portabilityPhil Elwell1-1/+1
1) Remove the double parentheses around two comparisons in checks.c. The OSX LLVM-based C compiler warns about them. 2) Put an explicit "=" in the TN() macro, in accordance with c99. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2014-06-18Correct output from memreserve in fdtdumpSimon Glass1-1/+1
This currently displays a hex value without the 0x prefix. Add the prefix as dtc requires it. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-24fdtdump: add a debug modeMike Frysinger1-4/+37
When hacking raw fdt files, it's useful to know the actual offsets into the file each node appears. Add a --debug mode that includes this. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-24util: drop "long" from usage helpersMike Frysinger1-1/+1
Now that all utils have converted to the new usage framework, we can rename to just plain "usage()" and avoid naming conflicts. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-24fdtdump: add a --scan optionMike Frysinger1-2/+44
Often times, fdts get embedded in other larger files. Rather than force people to `dd` the blob out themselves, make the fdtdump file smarter. It can now scan the blob looking for the fdt magic. Once locate, it does a little validation on the main struct to make sure we didn't hit random binary data. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-05-24fdtdump: make usage a bit more friendlyMike Frysinger1-8/+23
This starts a new usage framework and then cuts fdtdump over to it. Now we can do `fdtdump -h` and get something useful back. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-27Move property-printing into utilSimon Glass1-36/+1
The function that prints a property can be useful to other programs, so move it into util. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-06dtc/fdtdump: include libfdt_env.h prior to fdt.hKim Phillips1-1/+1
in order to get the upcoming fdt type definitions. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-06fdtdump: properly handle multi-string propertiesPantelis Antoniou1-1/+11
Device tree can store multiple strings in a single property. We didn't handle that case properly. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2011-10-26fdtdump: rename from ftdumpMike Frysinger1-0/+162
The freetype package already installs a binary named "ftdump", so the dtc package conflicts with that. So rename the newer dtc tool to "fdtdump". This even makes a bit more sense: ftdump: [F]lat device [T]ree [dump] fdtdump: [F]lat [D]evice [T]ree [dump] Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>