Add debug DBG_FDT_PRINT_CHOSEN config file option which adds
print of DT "chosen" node at the end of generated U-boot script.

This is useful for debug and development purposes.

Example:
  ...
  setenv fdt_high 0xffffffffffffffff
  fdt print /chosen
  booti 0x43000000 - 0x43200000

Signed-off-by: Grygorii Strashko <[email protected]>
---
 README.md                | 8 ++++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/README.md b/README.md
index 4ba430ce74c5..5b75018ea956 100644
--- a/README.md
+++ b/README.md
@@ -396,3 +396,11 @@ disk\_image supports these additional parameters on the 
config file:
 disk_image also generates on the fly a xl config file for each domU and
 adds them to the dom0 rootfs partition under /etc/xen. It makes it
 easier to start those domUs from dom0.
+
+
+## Debug
+
+This section defines config file debug options
+
+- DBG_FDT_PRINT_CHOSEN specifies that U-Boot script command to print DT 
"chosen"
+  node will be added to the boot script.
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 0607542b1872..74e3b076910c 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -1357,6 +1357,11 @@ device_tree_editing $device_tree_addr
 # disable device tree reloation
 echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE
+if test "$DBG_FDT_PRINT_CHOSEN"
+then
+    echo "fdt print /chosen" >> $UBOOT_SOURCE
+fi
+
 # append extra u-boot commands (fixups) to script before boot command
 if test "$APPEND_EXTRA_CMDS"
 then
--
2.34.1


Reply via email to