LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: "Mark A. Greer" <mgreer@mvista.com>
Cc: linuxppc-dev <Linuxppc-dev@ozlabs.org>
Subject: Re: [RFC] bootwrapper: prevent fdt from being overwritten by kernel
Date: Mon, 30 Oct 2006 15:16:57 +1100	[thread overview]
Message-ID: <17733.31929.136137.129244@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <20061026225045.GA19839@mag.az.mvista.com>

Mark A. Greer writes:

> If the fdt that's wrapped in a zImage isn't edited, it will still be
> sitting in the zImage when the kernel boots
> (i.e., at 0x400000 + <some offset into the zImage>).
> 
> That's okay until you get a large enough kernel (e.g., initramfs)
> which will overwrite the fdt when the kernel is relocated to 0.

Oops :)

> To handle that, I changed the sandpoint.c:platform_init() to base the
> simple_alloc heap at the greater of either the end of the zImage or the end
> of the kernel once its decompressed & relocated to 0.  It then copies
> the dtb to an area allocated by simple_alloc so I know its safe from
> being overwritten.

That sounds reasonable.

> In addition, I moved the vmlinux elf header decompress code from
> prep_kernel() to its own routine and called it before platform_init.
> I then pass the elf header ptr into platform_init.  That way,
> platform_init can figure out where the end of the kernel will
> be and put the dtb beyond it.  The OF code can now change
> claim_base in platform_init instead of needing the platform_ops.image_hdr
> hook.

Hmmm.  What if platform_init needs to e.g. turn on caches or do other
things that need to be done before decompressing?  I think it's
important to provide some way for the platform code to do things
really early on.

Paul.

  parent reply	other threads:[~2006-10-30  4:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26 22:50 [RFC] bootwrapper: prevent fdt from being overwritten by kernel Mark A. Greer
2006-10-26 22:56 ` Mark A. Greer
2006-10-30  4:16 ` Paul Mackerras [this message]
2006-10-31 23:02   ` Mark A. Greer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17733.31929.136137.129244@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=mgreer@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox