aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Cherechesu2022-07-27 13:08:27 -0700
committerStefano Stabellini2022-07-27 13:08:27 -0700
commitf6199342722c64a283d006b473b43918e93b4119 (patch)
tree7ac27a965168dcff817a8ab99439999a25074a30
parentc1f3a20e36dd7837e9e715b24ce7ee6ddb73fc12 (diff)
Added the parsing for APPEND_EXTRA_CMDS variable, which enables the
user to specify the path to a text file that contains, on each line, u-boot commands that will be added to the generated script as "fixups", before the boot command. The file specified by the APPEND_EXTRA_CMDS variable parameter will be copied as-is in the generated script. Signed-off-by: Andrei Cherechesu <andrei.cherechesu@nxp.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
-rw-r--r--README.md5
-rwxr-xr-xscripts/uboot-script-gen11
2 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index cb15ca5..3566a6d 100644
--- a/README.md
+++ b/README.md
@@ -64,6 +64,7 @@ BOOT_AUX_FILE[1]="uboot.cfg"
UBOOT_SOURCE="boot.source"
UBOOT_SCRIPT="boot.scr"
+APPEND_EXTRA_CMDS="extra.txt"
FDTEDIT="imagebuilder.dtb"
FIT="boot.fit"
FIT_ENC_KEY_DIR="dir/key"
@@ -197,6 +198,10 @@ Where:
as you can pass -o FILENAME to uboot-script-gen as a command line
parameter
+- APPEND_EXTRA_CMDS: is optional and specifies the path to a text file
+ containing extra u-boot commands to be added to the boot script before
+ the boot command. Useful for running custom fixup commands.
+
- FDTEDIT is an optional and is off by default. Specifies the output
modified dtb, used for reference and fdt_std.
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 19d7919..a4ddd1e 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -342,6 +342,9 @@ function check_file_type()
elif [ "$type" = "Device Tree Blob" ]
then
type="Device Tree Blob\|data"
+ elif [ "$type" = "text" ]
+ then
+ type="ASCII text"
fi
file -L $filename | grep "$type" &> /dev/null
@@ -1156,6 +1159,14 @@ device_tree_editing $device_tree_addr
# disable device tree reloation
echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE
+
+# append extra u-boot commands (fixups) to script before boot command
+if test "$APPEND_EXTRA_CMDS"
+then
+ check_file_type "$APPEND_EXTRA_CMDS" "text"
+ cat $APPEND_EXTRA_CMDS >> $UBOOT_SOURCE
+fi
+
echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE
if test "$FIT"