summaryrefslogtreecommitdiff
path: root/common/cmd_fdt.c
Commit message (Collapse)AuthorAgeLines
* Fix printf errors.Andrew Klossner2008-07-09-4/+4
| | | | | | | | | | | | The compiler will help find mismatches between printf formats and arguments if you let it. This patch adds the necessary attributes to declarations in include/common.h, then begins to correct the resulting compiler warnings. Some of these were bugs, e.g., "$d" instead of "%d" and incorrect arguments. Others were just annoying, like int-long mismatches on a system where both are 32 bits. It's worth fixing the annoying errors to catch the real ones. Signed-off-by: Andrew Klossner <andrew@cesa.opbu.xerox.com>
* libfdt: Move the working_fdt pointer to cmd_fdt.cGerald Van Baren2008-06-10-0/+5
| | | | | | | | The working_fdt pointer was declared in common/fdt_support.c but was not used there. Move it to common/cmd_fdt.c where it is used (it is also used in lib_ppc/bootm.c). Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* fdt: unshadow global working fdt variableKim Phillips2008-06-10-53/+61
| | | | | | | differentiate with local variables of the same name by renaming the global 'fdt' variable 'working_fdt'. Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
* Use strncmp() for the fdt commandGerald Van Baren2008-06-09-9/+7
| | | | | | Cleaner than doing multiple conditionals on characters. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* The fdt boardsetup command criteria was not uniqueGerald Van Baren2008-06-09-1/+2
| | | | | | | It was checking just for "b", which is not unique with respect to the "boot" command. Change to check for "boa"[rdsetup]. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Big white-space cleanup.Wolfgang Denk2008-05-21-2/+2
| | | | | | | | | | | This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Fix fdt set command to conform to dts specAndy Fleming2008-04-02-70/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fdt set command was treating properties specified as <00> and <0011> as byte streams, rather than as an array of cells. As we already have syntax for expressing the desire for a stream of bytes ([ xx xx ...]), we should use the <> syntax to describe arrays of cells, which are always 32-bits per element. If we imagine this likely (IMHO) scenario: > fdt set /ethernet-phy@1 reg <1> With the old code, this would create a bad fdt, since the reg cell would be made to be one byte in length. But the cell must be 4 bytes, so this would break mysteriously. Also, the dts spec calls for constants inside the angle brackets (<>) to conform to C constant standards as they pertain to base. Take this scenario: > fdt set /ethernet@f00 reg <0xe250000\ 0x1000> The old fdt command would complain that it couldn't parse that. Or, if you wanted to specify that a certain clock ran at 33 MHz, you'd be required to do this: > fdt set /mydev clock <1f78a40> Whereas the new code will accept decimal numbers. While I was in there, I extended the fdt command parser to handle property strings which are split across multiple arguments: > fdt set /ethernet@f00 interrupts < 33 2 34 2 36 2 > > fdt p /ethernet@f00 ethernet@f00 { interrupts = <0x21 0x2 0x22 0x2 0x24 0x2>; }; Lastly, the fdt print code was rearranged slightly to print arrays of cells if the length of the property is a multiple of 4 bytes, and to not print leading zeros. Signed-off-by: Andy Fleming <afleming@freescale.com>
* Remove deprecated CONFIG_OF_HAS_UBOOT_ENV and CONFIG_OF_HAS_BD_TJerry Van Baren2008-03-26-17/+0
| | | | | | | | | | | | | | These defines embedded the u-boot env variables and/or the bd_t structure in the fdt blob. The conclusion of discussion on the u-boot email list was that embedding these in the fdt blob is not useful: there are better ways of passing the data (in fact, the fdt blob itself replaces the bd_t struct). The only board that enables these is the stxxtc and they don't appear to be used by linux. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com> Acked-by: Kim Phillips <kim.phillips@freescale.com>
* Fix fdt boardsetup command parsingKumar Gala2008-03-18-1/+2
| | | | | | The introduciton of the 'fdt bootcpu' broke parsing for 'fdt boardsetup'. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* Add sub-commands to fdtKumar Gala2008-03-18-1/+111
| | | | | | | | | | | fdt header - Display header info fdt bootcpu <id> - Set boot cpuid fdt memory <addr> <size> - Add/Update memory node fdt rsvmem print - Show current mem reserves fdt rsvmem add <addr> <size> - Add a mem reserve fdt rsvmem delete <index> - Delete a mem reserves Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* Improve the FDT help message.Gerald Van Baren2008-01-08-7/+3
| | | | | | | Add a note that "fdt copy" makes the new address active. Remove most of the extra hints at the end of the fdt help. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Support setting FDT properties with optional values.Gerald Van Baren2008-01-08-7/+9
| | | | | | | | | | | | | | | | | Fix a bug found and documented by Bartlomiej Sieka where the optional value on "fdt set <path> <prop> [<val>]" wasn't optional. => fdt mknode / testnode => fdt print /testnode testnode { }; => fdt set /testnode testprop => fdt print /testnode testnode { testprop; }; Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Add spaces around the = in the fdt print format.Gerald Van Baren2007-12-07-2/+2
| | | | Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Fix fdt printing for updated libfdtGerald Van Baren2007-11-22-23/+27
| | | | | | Also improve printing (adopt dtc v1 "c style" hex format), whitespace cleanup. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Fix warnings from import of libfdtKumar Gala2007-11-21-3/+3
| | | | | | | | | | cmd_fdt.c: In function fdt_print: cmd_fdt.c:586: warning: assignment discards qualifiers from pointer target type cmd_fdt.c:613: warning: assignment discards qualifiers from pointer target type cmd_fdt.c:635: warning: assignment discards qualifiers from pointer target type cmd_fdt.c:636: warning: assignment discards qualifiers from pointer target type Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* Update libfdt from device tree compiler (dtc)Kumar Gala2007-11-21-9/+13
| | | | | | | Update libfdt to commit 8eaf5e358366017aa2e846c5038d1aa19958314e from the device tree compiler (dtc) project. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* Make no options to fdt print default to '/'Kumar Gala2007-11-21-1/+5
| | | | Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* [BUILD] conditionally compile common/cmd_*.c in common/MakefileGrant Likely2007-11-20-5/+0
| | | | | | | Modify common/Makefile to conditionally compile the cmd_*.c files based on the board config. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* fdt: allow for builds that don't want env and bd_t nodesKim Phillips2007-08-10-23/+15
| | | | | | | protect fdt_env and fdt_bd_t invocations, fix codingstyle while in the area. Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
* Call ft_board_setup() from the bootm command.Gerald Van Baren2007-08-10-7/+0
| | | | | | | | | | In the patch titled "Create new fdt boardsetup command..." I removed the call to ft_board_setup() from the routine fdt_chosen(), but I forgot to add a direct call back into cmd_bootm.c This fixes the oversight by adding the direct call to the bootm command. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Create new fdt boardsetup command, fix bug parsing [] form of set values.Gerald Van Baren2007-08-10-10/+21
| | | | | | | | | | | | Previously ft_board_setup() was called by fdt_chosen() which was not really correctly structured. This splits ft_board_setup() out by creating a new fdt boardsetup command. Fix a bug when parsing fdt set command values which have the square bracket form [00 11 22 33] - the length was updated incorrectly in when parsing that form. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* For fdt_find_node_by_path(), handle the root path properly.Gerald Van Baren2007-08-10-23/+12
| | | | | | | Also removes the special case root path detection in cmd_fdt.c since it is no longer necessary. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Replace fdt_node_offset() with fdt_find_node_by_path().Gerald Van Baren2007-08-10-1/+1
| | | | | | | | The new name matches more closely the kernel's name, which is also a much better description. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* Fix cmd_fdt line lengths, refactor code.Gerald Van Baren2007-08-10-187/+239
| | | | | | | | Break lines that were greater than 80 characters in length. Move the fdt print and property parsing code to separate static functions to reduce coding clutter in the fdt_cmd handling body. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* FDT command improvements.Gerald Van Baren2007-08-10-128/+143
| | | | | | | Fix "fdt set" so that it will create a non-existing property. Add "fdt mknode" to create nodes. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Improve fdt move length handling.Gerald Van Baren2007-08-10-6/+15
| | | | | | | Make the length parameter optional: if not specified, do the move using the current size unchanged. Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
* Moved fdt command support code to fdt_support.cGerald Van Baren2007-04-06-270/+31
| | | | | ...in preparation for improving the bootm command's handling of fdt blobs. Also cleaned up some coding sloppiness.
* Add a flattened device tree (fdt) command (1 of 2)Gerald Van Baren2007-03-31-0/+874
The fdt command uses David Gibson's libfdt library to manipulate as well as print the flattened device tree. This patch is the new command, the second part is the modifications to the existing code.