From 9b54de80aceb7ad78c3d60fe21ef0584b34c4140 Mon Sep 17 00:00:00 2001 From: Raju Kumar Pothuraju Date: Wed, 28 Jun 2023 15:08:29 +0530 Subject: boot.cmd.generic: Update bootargs with launch_ramdisk_init Map uboot env variable launch_ramdisk_init with bootargs to stop at tiny rootfs. If user specified bootargs at uboot skip appending auto bootargs. Using fdtcontroladdr uboot variable instead of hardcoded value in boot.scr. If DTB loads from FAT to DDR from uboot fdtcontroladdr points to old dtb(loaded from boot.bin or uboot.elf) so updating it with the dtb load address. Signed-off-by: Raju Kumar Pothuraju Signed-off-by: Mark Hatle --- .../recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic index 2459d06b..d99932ed 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic @@ -9,10 +9,16 @@ ramdisk_name=@@RAMDISK_IMAGE1@@ rootfs_name=@@RAMDISK_IMAGE@@ @@PRE_BOOTENV@@ + +setenv get_bootargs 'fdt addr $fdtcontroladdr;fdt get value bootargs /chosen bootargs;' +setenv update_bootargs 'if test -n ${launch_ramdisk_init} && test ${bootargs} = "";then if run get_bootargs;then setenv bootargs "\$bootargs launch_ramdisk_init=${launch_ramdisk_init} $extrabootargs";fi;fi' + + for boot_target in ${boot_targets}; do echo "Trying to load boot images from ${boot_target}" if test "${boot_target}" = "jtag" ; then + run update_bootargs @@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 @@ -34,6 +40,7 @@ do fi if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; + setenv fdtcontroladdr @@DEVICETREE_ADDRESS@@ fi if test -e ${devtype} ${devnum}:${distro_bootpart} /devicetree/openamp.dtbo; then fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo; @@ -41,6 +48,7 @@ do fdt resize 8192 fdt apply @@DEVICETREE_OVERLAY_ADDRESS@@ fi + run update_bootargs if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ @@ -59,6 +67,7 @@ do sf read @@KERNEL_LOAD_ADDRESS@@ @@QSPI_KERNEL_OFFSET@@ @@QSPI_KERNEL_SIZE@@ sf read @@RAMDISK_IMAGE_ADDRESS@@ @@QSPI_RAMDISK_OFFSET@@ @@QSPI_RAMDISK_SIZE@@ + run update_bootargs @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; echo "Booting using Separate images failed" fi @@ -70,6 +79,7 @@ do nand read @@KERNEL_LOAD_ADDRESS@@ @@NAND_KERNEL_OFFSET@@ @@NAND_KERNEL_SIZE@@ nand read @@RAMDISK_IMAGE_ADDRESS@@ @@NAND_RAMDISK_OFFSET@@ @@NAND_RAMDISK_SIZE@@ + run update_bootargs @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; echo "Booting using Separate images failed" fi -- cgit v1.2.3-54-g00ecf