From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Thu, 14 Jul 2011 10:47:42 -0400 Subject: [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk In-Reply-To: <1310001388-4084-1-git-send-email-galak@kernel.crashing.org> References: <1310001388-4084-1-git-send-email-galak@kernel.crashing.org> Message-ID: <4E1F018E.2080703@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Kumar, Wolfgang On 07/06/2011 09:16 PM, Kumar Gala wrote: > 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 > --- > arch/powerpc/lib/bootm.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c > index e01787d..4e0cb8f 100644 > --- a/arch/powerpc/lib/bootm.c > +++ b/arch/powerpc/lib/bootm.c > @@ -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); This looks good to me. Since it is in bootm.c and not in libfdt, I'll let Wolfgang pick it up unless I hear otherwise. Acked-by: Gerald Van Baren Thanks, gvb