]> git.sur5r.net Git - u-boot/commitdiff
powerpc: Fix device tree padding associated with ramdisk
authorKumar Gala <galak@kernel.crashing.org>
Wed, 6 Jul 2011 15:16:28 +0000 (15:16 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Jul 2011 11:55:10 +0000 (13:55 +0200)
When booting with a ramdisk we bump the amount of memory reserved for
the device tree by FDT_RAMDISK_OVERHEAD.  However we did not increase
the actual size in the device tree blob to match.

Its possible on boundary cases that we dont have enough memory according
to the device tree blob and get errors like:

WARNING: could not set linux,initrd-end FDT_ERR_NOSPACE

We can easily fix this by setting the device tree size at the same time
we bump the amount of memory reserved for the device tree.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
arch/powerpc/lib/bootm.c

index e01787dcb77f6eac861295ac59aa34645020d830..4e0cb8f3bf5e20854d04786a4e18be4f94eb5ac1 100644 (file)
@@ -288,8 +288,10 @@ static int boot_body_linux(bootm_headers_t *images)
                        return ret;
                of_size = ret;
 
-               if (*initrd_start && *initrd_end)
+               if (*initrd_start && *initrd_end) {
                        of_size += FDT_RAMDISK_OVERHEAD;
+                       fdt_set_totalsize(*of_flat_tree, of_size);
+               }
                /* Create a new LMB reservation */
                lmb_reserve(lmb, (ulong)*of_flat_tree, of_size);