diff mbox series

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

Message ID 0c399cdc-7a89-4482-a7fe-780da9ad6ca2@epam.com (mailing list archive)
State New
Headers show
Series [ImageBuilder] uboot-script-gen: add debug option to print final dt "chosen" node | expand

Commit Message

Grygorii Strashko March 17, 2025, 11:16 a.m. UTC
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 <grygorii_strashko@epam.com>
---
  README.md                | 8 ++++++++
  scripts/uboot-script-gen | 5 +++++
  2 files changed, 13 insertions(+)

Comments

Stefano Stabellini March 18, 2025, 12:13 a.m. UTC | #1
On Mon, 17 Mar 2025, Grygorii Strashko wrote:
> 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 <grygorii_strashko@epam.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  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
>
diff mbox series

Patch

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