]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - cmd/bootefi.c
configs: Migrate RBTREE, LZO, CMD_MTDPARTS, CMD_UBI and CMD_UBIFS
[people/ms/u-boot.git] / cmd / bootefi.c
index 3b777058f4a2432db90cc353e66b48f35820e9e9..771300ee94b739e36f16f2c6eed98e539e9b23c0 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <dm/device.h>
+#include <dm.h>
 #include <efi_loader.h>
 #include <errno.h>
 #include <libfdt.h>
@@ -133,7 +133,13 @@ static void *copy_fdt(void *fdt)
                               &new_fdt_addr) != EFI_SUCCESS) {
                /* If we can't put it there, put it somewhere */
                new_fdt_addr = (ulong)memalign(4096, fdt_size);
+               if (efi_allocate_pages(1, EFI_BOOT_SERVICES_DATA, fdt_pages,
+                                      &new_fdt_addr) != EFI_SUCCESS) {
+                       printf("ERROR: Failed to reserve space for FDT\n");
+                       return NULL;
+               }
        }
+
        new_fdt = (void*)(ulong)new_fdt_addr;
        memcpy(new_fdt, fdt, fdt_totalsize(fdt));
        fdt_set_totalsize(new_fdt, fdt_size);