efi_loader: correct includes in efi_variable.c
[oweals/u-boot.git] / net / tftp.c
index 8fab6d2650f77c49b788c41f67d1b754b479c1df..5a69bca6413c14326c385134c3b92f9f1a6705fe 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <efi_loader.h>
+#include <env.h>
 #include <mapmem.h>
 #include <net.h>
 #include <net/tftp.h>
@@ -606,10 +607,9 @@ static int tftp_init_load_addr(void)
        struct lmb lmb;
        phys_size_t max_size;
 
-       lmb_init_and_reserve(&lmb, gd->bd->bi_dram[0].start,
-                            gd->bd->bi_dram[0].size, (void *)gd->fdt_blob);
+       lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
 
-       max_size = lmb_get_unreserved_size(&lmb, load_addr);
+       max_size = lmb_get_free_size(&lmb, load_addr);
        if (!max_size)
                return -1;