]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/image-fdt.c
Merge branch 'master' of git://www.denx.de/git/u-boot-arc
[karo-tx-uboot.git] / common / image-fdt.c
index 8c3f3e63740c08db668bcd6a6d9f96c68bdf2696..d6ee225d409e4446ab8e9eb008e8f79c33769f11 100644 (file)
@@ -458,11 +458,6 @@ __weak int ft_verify_fdt(void *fdt)
        return 1;
 }
 
-__weak int arch_fixup_fdt(void *blob)
-{
-       return 0;
-}
-
 int image_setup_libfdt(bootm_headers_t *images, void *blob,
                       int of_size, struct lmb *lmb)
 {
@@ -479,10 +474,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
                printf("ERROR: /chosen node create failed\n");
                goto err;
        }
+#ifdef CONFIG_ARCH_FIXUP_FDT
        if (arch_fixup_fdt(blob) < 0) {
                printf("ERROR: arch-specific fdt fixup failed\n");
                goto err;
        }
+#endif
        if (IMAGE_OF_BOARD_SETUP) {
                fdt_ret = ft_board_setup(blob, gd->bd);
                if (fdt_ret) {
@@ -502,8 +499,9 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
        fdt_fixup_ethernet(blob);
 
        /* Delete the old LMB reservation */
-       lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
-                (phys_size_t)fdt_totalsize(blob));
+       if (lmb)
+               lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
+                        (phys_size_t)fdt_totalsize(blob));
 
        ret = fdt_shrink_to_minimum(blob);
        if (ret < 0)
@@ -515,7 +513,8 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
                fdt_set_totalsize(blob, of_size);
        }
        /* Create a new LMB reservation */
-       lmb_reserve(lmb, (ulong)blob, of_size);
+       if (lmb)
+               lmb_reserve(lmb, (ulong)blob, of_size);
 
        fdt_initrd(blob, *initrd_start, *initrd_end);
        if (!ft_verify_fdt(blob))