]> git.baikalelectronics.ru Git - uboot.git/commit
cmd: fdt: allow standalone "fdt move"
authorAndre Przywara <andre.przywara@arm.com>
Fri, 10 Feb 2023 11:02:12 +0000 (11:02 +0000)
committerSimon Glass <sjg@chromium.org>
Mon, 13 Feb 2023 00:33:51 +0000 (17:33 -0700)
commitc90adc8ed69122e51f79e93a214c43bf7455130f
treeab74007aff1364475e2701426596c919c6ccac1c
parentb900df9c627f5fc6bfd3498ac225582b7b1504fd
cmd: fdt: allow standalone "fdt move"

At the moment every subcommand of "fdt", except "addr" itself, requires
the DT address to be set first. We explicitly check for that before even
comparing against the subcommands' string.
This early bailout also affects the "move" subcommand, even though that
does not require or rely on a previous call to "fdt addr". In fact it
even sets the FDT address to the target of the move command, so is a
perfect beginning for a sequence of fdt commands.

Move the check for a previously set FDT address to after we handle the
"move" command also, so we don't need a dummy call to "fdt addr" first,
before being able to move the devicetree.

This skips one pointless "fdt addr" call in scripts which aim to alter
the control DT, but need to copy it to a safe location first (for
instance to $fdt_addr_r).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/fdt.c