]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/lib/bootm.c
arm: fix bd pointer dereference prior initialization
[u-boot] / arch / arm / lib / bootm.c
index 2e7b2e1f33f27b472cbf30528301be67ff9733fb..802e833a2ed584fe1365dacd4a033665eeb2f5d7 100644 (file)
@@ -177,10 +177,7 @@ static int fixup_memory_node(void *blob)
 static int bootm_linux_fdt(int machid, bootm_headers_t *images)
 {
        ulong rd_len;
-       bd_t *bd = gd->bd;
-       char *s;
        void (*kernel_entry)(int zero, int dt_machid, void *dtblob);
-       ulong bootmap_base = getenv_bootm_low();
        ulong of_size = images->ft_len;
        char **of_flat_tree = &images->ft_addr;
        ulong *initrd_start = &images->initrd_start;
@@ -190,13 +187,15 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
 
        kernel_entry = (void (*)(int, int, void *))images->ep;
 
+       boot_fdt_add_mem_rsv_regions(lmb, *of_flat_tree);
+
        rd_len = images->rd_end - images->rd_start;
        ret = boot_ramdisk_high(lmb, images->rd_start, rd_len,
                                initrd_start, initrd_end);
        if (ret)
                return ret;
 
-       ret = boot_relocate_fdt(lmb, bootmap_base, of_flat_tree, &of_size);
+       ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
        if (ret)
                return ret;
 
@@ -329,12 +328,12 @@ void setup_revision_tag(struct tag **in_params)
 }
 #endif  /* CONFIG_REVISION_TAG */
 
-
 static void setup_end_tag (bd_t *bd)
 {
        params->hdr.tag = ATAG_NONE;
        params->hdr.size = 0;
 }
+#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
 
 static ulong get_sp(void)
 {
@@ -343,5 +342,3 @@ static ulong get_sp(void)
        asm("mov %0, sp" : "=r"(ret) : );
        return ret;
 }
-
-#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */