summaryrefslogtreecommitdiff
path: root/fdtget.c
Commit message (Collapse)AuthorAgeFilesLines
* util: drop "long" from usage helpersMike Frysinger2013-05-241-3/+3
| | | | | | | | 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>
* dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpersMike Frysinger2013-05-241-33/+27
| | | | | | | | | | This helps standardize the flag processing and the usage screens. Only lightly tested; would be great if someone who uses these utils could double check. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Revert "utilfdt_read: pass back up the length of data read"Jon Loeliger2013-04-221-1/+1
| | | | | This reverts commit cc2c178727cdeca4eb9756637c2e09e50e0856e7. It was the wrong version of the patch.
* utilfdt_read: pass back up the length of data readMike Frysinger2013-04-211-1/+1
| | | | | | | | For a follow up commit, we want to be able to scan the buffer that was returned to us. In order to do that safely, we need to know how big the buffer actually is, so pass that back if requested. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fdtget: Add -d to provide a default valueSimon Glass2012-03-071-3/+17
| | | | | | | | | Sometimes the requested node or property is not present in the device tree. This option provides a way of reporting a default value in this case, rather than halting with an error. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
* fdtget: Add -l to list the subnodes of a nodeSimon Glass2012-03-071-12/+84
| | | | | | | | This option lists the subnodes of each node given as a parameter, one subnode per line. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
* fdtget: Add -p to list the properties of a nodeSimon Glass2012-03-071-6/+60
| | | | | | | | This option lists the properties of each node given as a parameter, one property per line. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
* fdtget: Fix multiple arg bug and add test for itSimon Glass2012-03-071-3/+3
| | | | | | | | | | | There is a rather unfortunate bug in fdtget in that if multiple argument sets are provided, it just repeats displaying the first set ones for each set. Fix this bug and add a test for it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
* Trivial style fixupDavid Gibson2012-02-031-2/+2
| | | | | | | Having braces on an if branch but not the else branch, or vice versa is ugly and can trick you when reading the code. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* Add fdtget utility to read property values from a device treeSimon Glass2012-01-211-0/+226
This simply utility makes it easy for scripts to read values from the device tree. It is written in C and uses the same libfdt as the rest of the dtc package. What is it for: - Reading fdt values from scripts - Extracting fdt information within build systems - Looking at particular values without having to dump the entire tree To use it, specify the fdt binary file on command line followed by a list of node, property pairs. The utility then looks up each node, finds the property and displays the value. Each value is printed on a new line. fdtget tries to guess the type of each property based on its contents. This is not always reliable, so you can use the -t option to force fdtget to decode the value as a string, or byte, etc. To read from stdin, use - as the file. Usage: fdtget <options> <dt file> [<node> <property>]... Options: -t <type> Type of data -h Print this help <type> s=string, i=int, u=unsigned, x=hex Optional modifier prefix: hh or b=byte, h=2 byte, l=4 byte (default) Signed-off-by: Simon Glass <sjg@chromium.org>