aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path.c
diff options
context:
space:
mode:
authorRui Miguel Silva <rui.silva@linaro.org>2022-05-11 10:55:40 +0100
committerTom Rini <trini@konsulko.com>2022-06-22 11:35:47 -0400
commitbfef72e4dd1c1d6dfc680867bf24a78597ab0438 (patch)
treed403ba89ce489bb4a0e56acd7342ecdff45a95de /lib/efi_loader/efi_device_path.c
parenta47ce34403f27178c1264bf60496bbb9a21e5842 (diff)
downloadu-boot-bfef72e4dd1c1d6dfc680867bf24a78597ab0438.zip
u-boot-bfef72e4dd1c1d6dfc680867bf24a78597ab0438.tar.gz
u-boot-bfef72e4dd1c1d6dfc680867bf24a78597ab0438.tar.bz2
cmd: load: add load command for memory mapped
cp.b is used a lot as a way to load binaries to memory and execute them, however we may need to integrate this with the efi subsystem to set it up as a bootdev. So, introduce a loadm command that will be consistent with the other loadX commands and will call the efi API's. ex: loadm $kernel_addr $kernel_addr_r $kernel_size with this a kernel with CONFIG_EFI_STUB enabled will be loaded and then subsequently booted with bootefi command. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r--lib/efi_loader/efi_device_path.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index 171661b..2493d74 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -1158,6 +1158,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
{
struct blk_desc *desc = NULL;
struct disk_partition fs_partition;
+ size_t image_size;
+ void *image_addr;
int part = 0;
char *filename;
char *s;
@@ -1173,6 +1175,13 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
} else if (!strcmp(dev, "Uart")) {
if (device)
*device = efi_dp_from_uart();
+ } else if (!strcmp(dev, "Mem")) {
+ efi_get_image_parameters(&image_addr, &image_size);
+
+ if (device)
+ *device = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
+ (uintptr_t)image_addr,
+ image_size);
} else {
part = blk_get_device_part_str(dev, devnr, &desc, &fs_partition,
1);