summaryrefslogtreecommitdiffstats
path: root/commands/oftree.c
Commit message (Collapse)AuthorAgeFilesLines
* commands: oftree: kill oftree -fSascha Hauer2018-06-111-16/+1
| | | | | | | | | | Being able to free the live device tree seemed like a good idea in the early days of device tree support when the first boards were brought up. It turned out to be illusory that noone stores pointers to the live tree which become invalid when oftree -f is executed. Enough people stumbled upon crashed boards with this option, so remove it finally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/metadata'Sascha Hauer2014-08-071-0/+1
|\ | | | | | | | | | | | | Conflicts: arch/arm/dts/Makefile common/Makefile lib/Makefile
| * move file helper functions to separate fileSascha Hauer2014-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | oftree command: Use size_t for sizeSascha Hauer2014-07-111-1/+1
|/ | | | | | | read_file takes a size_t argument as size, so use this type for the size variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Clean up Kconfig and source for a couple device tree commands.Robert P. J. Day2014-07-071-1/+1
| | | | | | | Correct options listings for a couple device tree-related commands. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: make devicetree file optargs to -l/-sSascha Hauer2014-05-221-38/+16
| | | | | | | | | When loading or saving a devicetree it seems logical to add the filename to the option specifying the command. This is also slightly easier to parse. While at it add missing documentation for the -s option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Drop devicetree merge supportSascha Hauer2014-05-221-6/+3
| | | | | | | | | | | | I assume I am the only person knowing that barebox is able to merge devicetrees. This feature seems broken for a while now since trying to merge devicetress results in: unflatten: too many end nodes Remove this feature to save the complexity. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree: remove dump supportSascha Hauer2014-05-221-39/+3
| | | | | | This can now be done with the of_dump command. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: Add devicetree completionSascha Hauer2014-05-191-0/+2
| | | | | | | | The of_* commands take devicetree nodes as parameters. Add a devicetree completion function to ease passing nodes to these commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: Allow free stored dtb before loadJan Weitzel2014-01-061-1/+2
| | | | | | | | Don't return after freeing stored devicetree if also loading ist wanted. Allow "oftree -f -l my.dtb" Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: Allow to specify node by aliasSascha Hauer2013-08-141-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* OF: base: rename of_free to of_delete_nodeSebastian Hesselbarth2013-07-051-2/+2
| | | | | | | | | of_free is misleading about the actual purpose of the function. There is already a of_create_node counterpart, so rename of_free to of_create_node and update all users accordingly. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* OF: base: sync of_find_node_by_path with linux OF APISebastian Hesselbarth2013-06-201-10/+1
| | | | | | | | | | | | | Barebox of_find_node_by_path requires a node to be passed as start node to start searching. Linux OF API does not pass this node and no current user of it in barebox is passing anything else than the root node. Therefore, we rename current function to of_find_node_by_path_from and introduce a Linux OF API compatible of_find_node_by_path that always passes the current root_node. Also, all current users of that function are updated to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: remove unused libfdtSascha Hauer2013-03-061-2/+1
| | | | | | | Now that we are completely independent of libfdt remove the unused code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: retire CMD_OFTREE_PROBE Kconfig optionSascha Hauer2013-03-061-1/+1
| | | | | | | | Whether or not the user wishes devicetree probe support can now be decided indepentently of the oftree command, so retire the CMD_OFTREE_PROBE option and use OFDEVICE in the code instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: Use of_print_nodesSascha Hauer2013-03-061-3/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Add root node argument to of_find_node_by_pathSascha Hauer2013-03-061-1/+9
| | | | | | This makes of_find_node_by_path usable with multiple trees. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: let of_unflatten_dtb return the unflattened treeSascha Hauer2013-03-061-1/+13
| | | | | | | | | In order to be able to handle multiple devicetrees, do not assume the tree to be unflattened is the barebox internal one. Instead, just return a pointer to it and assign the barebox internal root_node external to the unflatten function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: Add -s option to save internal oftree to fileSascha Hauer2013-01-191-2/+28
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree command: refactorSascha Hauer2013-01-191-31/+68
| | | | | | | | | | | | | | | | | | | | | | | | | This has several improvements for the oftree command: - loading a devicetree (-l) and actually probing (-p) it now is separated - the command now can dump the internal devicetree or a dtb given on the command line. - The -f option now actually frees the internal devicetree With this the usage pattern for this command is: oftree -l /env/oftree oftree -d -n /sound oftree -d /env/oftree oftree -f oftree -p oftree -l -p /env/oftree Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: remove unused barebox_fdtSascha Hauer2013-01-191-8/+1
| | | | | | | | barebox_fdt should once become the pointer to the barebox internal devicetree. Since barebox has its own internal devicetree format this was never used. remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: rename of_parse_dtb to of_unflatten_dtbSascha Hauer2013-01-111-1/+1
| | | | | | | The process of unflatten the device tree is known from the kernel, so rename the function, because that's what it does. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-3/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | oftree command: Add devicetree probe supportSascha Hauer2012-09-141-13/+15
|/ | | | | | | | | | With this the -p option is no longer for parse, but for probe instead. Using this parses a devicetree given on the command line and probes the devices found in this tree. Devices which already exist are not probed again, but instead their device_node is attached to the existing device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-1/+1
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* initial oftree command supportSascha Hauer2011-10-191-0/+135
This adds basic device tree command support. So far we can parse a flat device tree (-p), which also stores the tree in memory, dump it (-d) and free (-f) the internally stored tree. The chosen node can be updated with barebox bootargs, no other device tree manipulation is implemented yet. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>