aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2022-10-10 18:01:20 +0100
committerTom Rini <trini@konsulko.com>2022-10-21 16:06:13 -0400
commit163fb376695661620f13839ec35d860e7e7ff504 (patch)
treed3acc96c99ece4b69f0206ec3d9edfb942010e6d /cmd
parent71858454fedd1e9d975d43e82f2fbaf2640460b0 (diff)
downloadu-boot-163fb376695661620f13839ec35d860e7e7ff504.zip
u-boot-163fb376695661620f13839ec35d860e7e7ff504.tar.gz
u-boot-163fb376695661620f13839ec35d860e7e7ff504.tar.bz2
qfw: store loaded file size in environment variable
At the moment the QEMU firmware command just prints the size of the loaded binaries on the console. To go with all the other load methods, and many boot scripts' expectations, also store the size of the file loaded last in the environment variable "filesize". We first put the kernel size in there, but overwrite this with the initrd size, should we have one, because this is probably the more prominent user of $filesize (in the booti or bootz command). Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/qfw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/qfw.c b/cmd/qfw.c
index ccbc967..c61001b 100644
--- a/cmd/qfw.c
+++ b/cmd/qfw.c
@@ -40,6 +40,7 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr)
qfw_read_entry(qfw_dev, FW_CFG_KERNEL_DATA,
le32_to_cpu(kernel_size), data_addr);
data_addr += le32_to_cpu(kernel_size);
+ env_set_hex("filesize", le32_to_cpu(kernel_size));
data_addr = initrd_addr;
qfw_read_entry(qfw_dev, FW_CFG_INITRD_SIZE, 4, &initrd_size);
@@ -49,6 +50,7 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr)
qfw_read_entry(qfw_dev, FW_CFG_INITRD_DATA,
le32_to_cpu(initrd_size), data_addr);
data_addr += le32_to_cpu(initrd_size);
+ env_set_hex("filesize", le32_to_cpu(initrd_size));
}
qfw_read_entry(qfw_dev, FW_CFG_CMDLINE_SIZE, 4, &cmdline_size);