All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk
@ 2011-07-07  1:16 Kumar Gala
  2011-07-14 13:30 ` Kumar Gala
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kumar Gala @ 2011-07-07  1:16 UTC (permalink / raw)
  To: u-boot

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>
---
 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);
 
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk
  2011-07-07  1:16 [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk Kumar Gala
@ 2011-07-14 13:30 ` Kumar Gala
  2011-07-14 14:47 ` Jerry Van Baren
  2011-07-26 11:55 ` Wolfgang Denk
  2 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2011-07-14 13:30 UTC (permalink / raw)
  To: u-boot


On Jul 6, 2011, at 8: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 <galak@kernel.crashing.org>
> ---
> arch/powerpc/lib/bootm.c |    4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)

Jerry,

Any comments on this.

- k

> 
> 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);
> 
> -- 
> 1.7.3.4
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk
  2011-07-07  1:16 [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk Kumar Gala
  2011-07-14 13:30 ` Kumar Gala
@ 2011-07-14 14:47 ` Jerry Van Baren
  2011-07-26 11:55 ` Wolfgang Denk
  2 siblings, 0 replies; 4+ messages in thread
From: Jerry Van Baren @ 2011-07-14 14:47 UTC (permalink / raw)
  To: u-boot

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<galak@kernel.crashing.org>
> ---
>   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 <vanbaren@cideas.com>

Thanks,
gvb

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk
  2011-07-07  1:16 [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk Kumar Gala
  2011-07-14 13:30 ` Kumar Gala
  2011-07-14 14:47 ` Jerry Van Baren
@ 2011-07-26 11:55 ` Wolfgang Denk
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2011-07-26 11:55 UTC (permalink / raw)
  To: u-boot

Dear Kumar Gala,

In message <1310001388-4084-1-git-send-email-galak@kernel.crashing.org> you 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 <galak@kernel.crashing.org>
> ---
>  arch/powerpc/lib/bootm.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A great many people think they are thinking when they are merely re-
arranging their prejudices."                          - William James

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-26 11:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07  1:16 [U-Boot] [PATCH] powerpc: Fix device tree padding associated with ramdisk Kumar Gala
2011-07-14 13:30 ` Kumar Gala
2011-07-14 14:47 ` Jerry Van Baren
2011-07-26 11:55 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.