Skip to contentSkip to conversation

uboot-script-gen: add debug option to print final dt "chosen" node

PATCH In review Grygorii Strashko 2 participants 2 messages Mar 17, 2025 – Mar 18, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uboot-script-gen: add debug option to print final dt "chosen" node

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

---
 README.md                | 8 ++++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 13 insertions(+)
README.md +8 -0
index 4ba430ce74c5..5b75018ea956 100644
@@ -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.
scripts/uboot-script-gen +5 -0
index 0607542b1872..74e3b076910c 100755
@@ -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
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Grygorii Strashko

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.

Quoted 7 lines

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

Quoted 41 lines
---
 README.md                | 8 ++++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 13 insertions(+)
README.md +0 -0
index 4ba430ce74c5..5b75018ea956 100644
@@ -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.

README.md +7 -0
+
+
+## Debug
+
+This section defines config file debug options
+
+- DBG_FDT_PRINT_CHOSEN specifies that U-Boot script command to print DT

"chosen"

README.md +1 -0
+  node will be added to the boot script.
scripts/uboot-script-gen +4 -0
index 0607542b1872..74e3b076910c 100755
@@ -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
Signature · 1 line
2.34.1