Hello.

We like to sometimes manipulate bootargs from the U-Boot prompt to
control the boot process for development or debugging purposes (such as
to control the target runlevel, to specify initramfs script breakpoints,
or to experiment with kernel options, etc.).  After upgrading to
rel-v2022.2 we noticed that our bootargs were no longer making it into
the kernel command line.

We're using the attached patch to restore this functionality.  Please
feel welcome to incorporate this into future Xilinx releases if you are
happy with it.

Thanks,
Corey
From bf602424b803734f39ad4b8793bb66d70302f57f Mon Sep 17 00:00:00 2001
From: Corey Thompson <[email protected]>
Date: Thu, 9 Feb 2023 15:59:23 -0500
Subject: [PATCH] u-boot-zynq-scr: Don't clobber bootargs in
 boot.cmd.generic.root

---
 .../u-boot-zynq-scr/boot.cmd.generic.root     | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git 
a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root 
b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root
index ca90cbe1..9d35145d 100644
--- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root
+++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root
@@ -14,8 +14,8 @@ do
        echo "Trying to load boot images from ${boot_target}"
        if test "${boot_target}" = "jtag" ; then
                fdt addr @@DEVICETREE_ADDRESS@@
-               fdt get value bootargs /chosen bootargs
-               setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
+               fdt get value fdt_bootargs /chosen bootargs
+               setenv bootargs $fdt_bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
                @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ 
@@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@
        fi
        if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" || 
test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then
@@ -49,20 +49,20 @@ do
                if test -e ${devtype} ${devnum}:${distro_bootpart} 
/${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then
                        fatload ${devtype} ${devnum}:${distro_bootpart} 
@@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name};
                        fdt addr @@DEVICETREE_ADDRESS@@
-                       fdt get value bootargs /chosen bootargs
-                       setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
+                       fdt get value fdt_bootargs /chosen bootargs
+                       setenv bootargs $fdt_bootargs $bootargs 
@@KERNEL_ROOT_RAMDISK@@
                        @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ 
@@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@
                fi
                if test -e ${devtype} ${devnum}:${distro_bootpart} 
/${rootfs_name} && test "${skip_ramdisk}" != "yes"; then
                        fatload ${devtype} ${devnum}:${distro_bootpart} 
@@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name};
                        fdt addr @@DEVICETREE_ADDRESS@@
-                       fdt get value bootargs /chosen bootargs
-                       setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
+                       fdt get value fdt_bootargs /chosen bootargs
+                       setenv bootargs $fdt_bootargs $bootargs 
@@KERNEL_ROOT_RAMDISK@@
                        @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ 
@@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@
                fi
                fdt addr @@DEVICETREE_ADDRESS@@
-               fdt get value bootargs /chosen bootargs
-               setenv bootargs $bootargs @@KERNEL_ROOT_SD@@
+               fdt get value fdt_bootargs /chosen bootargs
+               setenv bootargs $fdt_bootargs $bootargs @@KERNEL_ROOT_SD@@
                @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - 
@@DEVICETREE_ADDRESS@@
        fi
        if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || 
test "${boot_target}" = "qspi0"; then
@@ -75,8 +75,8 @@ do
                sf read @@KERNEL_LOAD_ADDRESS@@ @@QSPI_KERNEL_OFFSET@@ 
@@QSPI_KERNEL_SIZE@@
                sf read @@RAMDISK_IMAGE_ADDRESS@@ @@QSPI_RAMDISK_OFFSET@@ 
@@QSPI_RAMDISK_SIZE@@
                fdt addr @@DEVICETREE_ADDRESS@@
-               fdt get value bootargs /chosen bootargs
-               setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
+               fdt get value fdt_bootargs /chosen bootargs
+               setenv bootargs $fdt_bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
                @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ 
@@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@;
                echo "Booting using Separate images failed"
        fi
@@ -90,8 +90,8 @@ do
                nand read @@KERNEL_LOAD_ADDRESS@@ @@NAND_KERNEL_OFFSET@@ 
@@NAND_KERNEL_SIZE@@
                nand read @@RAMDISK_IMAGE_ADDRESS@@ @@NAND_RAMDISK_OFFSET@@ 
@@NAND_RAMDISK_SIZE@@
                fdt addr @@DEVICETREE_ADDRESS@@
-               fdt get value bootargs /chosen bootargs
-               setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
+               fdt get value fdt_bootargs /chosen bootargs
+               setenv bootargs $fdt_bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
                @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ 
@@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@;
                echo "Booting using Separate images failed"
        fi
-- 
2.35.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5147): 
https://lists.yoctoproject.org/g/meta-xilinx/message/5147
Mute This Topic: https://lists.yoctoproject.org/mt/96862890/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

  • [meta-xilinx] [PATCH] u-... Thompson, Corey via lists.yoctoproject.org

Reply via email to