]> git.sur5r.net Git - u-boot/blobdiff - cmd/bootefi.c
fit: Verify all configuration signatures
[u-boot] / cmd / bootefi.c
index 806339823ffaa73d6cb7f995fb995868fc6f0029..cd755b6bf44441a9d25ff0356a9d10066f9e4c56 100644 (file)
@@ -61,6 +61,11 @@ efi_status_t efi_init_obj_list(void)
        if (ret != EFI_SUCCESS)
                goto out;
 #endif
+#ifdef CONFIG_GENERATE_ACPI_TABLE
+       ret = efi_acpi_register();
+       if (ret != EFI_SUCCESS)
+               goto out;
+#endif
 #ifdef CONFIG_GENERATE_SMBIOS_TABLE
        ret = efi_smbios_register();
        if (ret != EFI_SUCCESS)
@@ -143,11 +148,13 @@ static void *copy_fdt(void *fdt)
 
        /* Safe fdt location is at 128MB */
        new_fdt_addr = fdt_ram_start + (128 * 1024 * 1024) + fdt_size;
-       if (efi_allocate_pages(1, EFI_RUNTIME_SERVICES_DATA, fdt_pages,
+       if (efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
+                              EFI_RUNTIME_SERVICES_DATA, fdt_pages,
                               &new_fdt_addr) != EFI_SUCCESS) {
                /* If we can't put it there, put it somewhere */
                new_fdt_addr = (ulong)memalign(EFI_PAGE_SIZE, fdt_size);
-               if (efi_allocate_pages(1, EFI_RUNTIME_SERVICES_DATA, fdt_pages,
+               if (efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
+                                      EFI_RUNTIME_SERVICES_DATA, fdt_pages,
                                       &new_fdt_addr) != EFI_SUCCESS) {
                        printf("ERROR: Failed to reserve space for FDT\n");
                        return NULL;
@@ -261,6 +268,7 @@ static efi_status_t do_bootefi_exec(void *efi,
 {
        struct efi_loaded_image loaded_image_info = {};
        struct efi_object loaded_image_info_obj = {};
+       struct efi_object mem_obj = {};
        struct efi_device_path *memdp = NULL;
        efi_status_t ret;
 
@@ -277,6 +285,12 @@ static efi_status_t do_bootefi_exec(void *efi,
                /* actual addresses filled in after efi_load_pe() */
                memdp = efi_dp_from_mem(0, 0, 0);
                device_path = image_path = memdp;
+               efi_add_handle(&mem_obj);
+
+               ret = efi_add_protocol(mem_obj.handle, &efi_guid_device_path,
+                                      device_path);
+               if (ret != EFI_SUCCESS)
+                       goto exit;
        } else {
                assert(device_path && image_path);
        }
@@ -341,6 +355,8 @@ static efi_status_t do_bootefi_exec(void *efi,
 exit:
        /* image has returned, loaded-image obj goes *poof*: */
        list_del(&loaded_image_info_obj.link);
+       if (mem_obj.handle)
+               list_del(&mem_obj.link);
 
        return ret;
 }