* [U-Boot-Users] [PATCH v3] Fix initrd/dtb interaction
@ 2007-08-14 15:32 Andy Fleming
2007-08-14 15:39 ` Wolfgang Denk
2007-08-15 7:43 ` Stefan Roese
0 siblings, 2 replies; 3+ messages in thread
From: Andy Fleming @ 2007-08-14 15:32 UTC (permalink / raw)
To: u-boot
The original code would wrongly relocate the blob to be right before
the initrd if it existed. The blob *must* be within CFG_BOOTMAPSZ,
if it is defined. So we make two changes:
1) flag the blob for relocation whenever its address is above BOOTMAPSZ
2) If the blob is being relocated, relocate it before kbd, not initrd
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
Fixed the merge problem. I thought I had based off of the fdt tree, but
it was a patch from gvb which was in the mainline and not my tree, so
I'm confused. Either way, it's fixed now.
common/cmd_bootm.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index e19f83e..8249dce 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -924,6 +924,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
initrd_end = 0;
}
+#ifdef CFG_BOOTMAPSZ
+ /*
+ * The blob must be within CFG_BOOTMAPSZ,
+ * so we flag it to be copied if it is
+ */
+ if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
+ of_data = of_flat_tree;
+#endif
+
#if defined(CONFIG_OF_LIBFDT)
/* move of_flat_tree if needed */
if (of_data) {
@@ -931,11 +940,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
ulong of_start, of_len;
of_len = be32_to_cpu(fdt_totalsize(of_data));
- /* position on a 4K boundary before the initrd/kbd */
- if (initrd_start)
- of_start = initrd_start - of_len;
- else
- of_start = (ulong)kbd - of_len;
+
+ /* position on a 4K boundary before the kbd */
+ of_start = (ulong)kbd - of_len;
of_start &= ~(4096 - 1); /* align on page */
debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
of_data, of_data + of_len - 1, of_len, of_len);
@@ -983,11 +990,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
if (of_data) {
ulong of_start, of_len;
of_len = ((struct boot_param_header *)of_data)->totalsize;
+
/* provide extra 8k pad */
- if (initrd_start)
- of_start = initrd_start - of_len - 8192;
- else
- of_start = (ulong)kbd - of_len - 8192;
+ of_start = (ulong)kbd - of_len - 8192;
of_start &= ~(4096 - 1); /* align on page */
debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
of_data, of_data + of_len - 1, of_len, of_len);
--
1.5.0.2.230.gfbe3d-dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot-Users] [PATCH v3] Fix initrd/dtb interaction
2007-08-14 15:32 [U-Boot-Users] [PATCH v3] Fix initrd/dtb interaction Andy Fleming
@ 2007-08-14 15:39 ` Wolfgang Denk
2007-08-15 7:43 ` Stefan Roese
1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2007-08-14 15:39 UTC (permalink / raw)
To: u-boot
In message <118710557976-git-send-email-afleming@freescale.com> you wrote:
> The original code would wrongly relocate the blob to be right before
> the initrd if it existed. The blob *must* be within CFG_BOOTMAPSZ,
> if it is defined. So we make two changes:
>
> 1) flag the blob for relocation whenever its address is above BOOTMAPSZ
>
> 2) If the blob is being relocated, relocate it before kbd, not initrd
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
Applied, thanks. [May take a while until it's visible on the public
server, though; got some more stuff in the queue here.]
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
Status quo. Latin for "the mess we're in."
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] [PATCH v3] Fix initrd/dtb interaction
2007-08-14 15:32 [U-Boot-Users] [PATCH v3] Fix initrd/dtb interaction Andy Fleming
2007-08-14 15:39 ` Wolfgang Denk
@ 2007-08-15 7:43 ` Stefan Roese
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2007-08-15 7:43 UTC (permalink / raw)
To: u-boot
Hi Andy,
On Tuesday 14 August 2007, Andy Fleming wrote:
> The original code would wrongly relocate the blob to be right before
> the initrd if it existed. The blob *must* be within CFG_BOOTMAPSZ,
> if it is defined. So we make two changes:
>
> 1) flag the blob for relocation whenever its address is above BOOTMAPSZ
>
> 2) If the blob is being relocated, relocate it before kbd, not initrd
I get the following error with your patch on platforms not using device tree
at all (like 4xx sequoia...):
cmd_bootm.c: In function 'do_bootm_linux':
cmd_bootm.c:932: error: 'of_flat_tree' undeclared (first use in this function)
cmd_bootm.c:932: error: (Each undeclared identifier is reported only once
cmd_bootm.c:932: error: for each function it appears in.)
cmd_bootm.c:933: error: 'of_data' undeclared (first use in this function)
make[1]: *** [cmd_bootm.o] Error 1
Would be great if you could generate a quick patch for that.
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-15 7:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14 15:32 [U-Boot-Users] [PATCH v3] Fix initrd/dtb interaction Andy Fleming
2007-08-14 15:39 ` Wolfgang Denk
2007-08-15 7:43 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox