public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: "Suzuki K. Poulose" <suzuki@in.ibm.com>
To: McClintock Matthew-B29882 <B29882@freescale.com>
Cc: "lethal@linux-sh.org" <lethal@linux-sh.org>,
	"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
	"horms@verge.net.au" <horms@verge.net.au>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"mat@brain-dump.org" <mat@brain-dump.org>
Subject: Re: [PATCH 3/3] ppc/uImage: Add support for RAM Disks
Date: Mon, 14 Jan 2013 10:44:53 +0530	[thread overview]
Message-ID: <50F3944D.7080506@in.ibm.com> (raw)
In-Reply-To: <70CC66F5C30A414DADDA6973E4CA391A820296@039-SN1MPN1-002.039d.mgd.msft.net>

On 01/11/2013 12:41 PM, McClintock Matthew-B29882 wrote:
> On Fri, Jan 11, 2013 at 12:42 AM, Suzuki K. Poulose <suzuki@in.ibm.com> wrote:
>> From: Suzuki K. Poulose <suzuki@in.ibm.com>
>>
>> Handle the RAM Disks in uImage format
>
> As opposed to simple ext2.gz ramdisk?

Yep. Any supported ramdisk format can be wrapped up in a uImage file.

Thanks
Suzuki

>
> -M
>
>>
>> Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
>> ---
>>   kexec/arch/ppc/kexec-uImage-ppc.c |   22 +++++++++++++++++++++-
>>   1 file changed, 21 insertions(+), 1 deletion(-)
>>
>> diff --git a/kexec/arch/ppc/kexec-uImage-ppc.c b/kexec/arch/ppc/kexec-uImage-ppc.c
>> index eaea3c1..58935c0 100644
>> --- a/kexec/arch/ppc/kexec-uImage-ppc.c
>> +++ b/kexec/arch/ppc/kexec-uImage-ppc.c
>> @@ -46,6 +46,26 @@ void uImage_ppc_usage(void)
>>          );
>>   }
>>
>> +char* slurp_ramdisk_ppc(const char *filename, off_t *r_size)
>> +{
>> +       struct Image_info img;
>> +       off_t size;
>> +       const unsigned char *buf =
>> +                       (const unsigned char *)slurp_file(filename, &size);
>> +
>> +       /* Check if this is a uImage RAMDisk */
>> +       if (buf != (void*)0 &&
>> +               uImage_probe(buf, size, IH_ARCH_PPC) == IH_TYPE_RAMDISK) {
>> +               if (uImage_load(buf, size, &img) != 0)
>> +                       die ("uImage: Reading %ld bytes from %s failed\n", size, filename);
>> +               buf = img.buf;
>> +               size = img.len;
>> +       }
>> +
>> +       *r_size = size;
>> +       return buf;
>> +}
>> +
>>   int uImage_ppc_probe(const char *buf, off_t len)
>>   {
>>          int type;
>> @@ -196,7 +216,7 @@ static int ppc_load_bare_bits(int argc, char **argv, const char *buf,
>>          blob_buf = fixup_dtb_init(info, blob_buf, &blob_size, load_addr, &dtb_addr);
>>
>>          if (ramdisk) {
>> -               seg_buf = slurp_file(ramdisk, &seg_size);
>> +               seg_buf = slurp_ramdisk_ppc(ramdisk, &seg_size);
>>                  /* Load ramdisk at top of memory */
>>                  hole_addr = add_buffer(info, seg_buf, seg_size, seg_size,
>>                                  0, dtb_addr + blob_size, max_addr, -1);
>>
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-01-14  5:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11  6:41 [PATCH 0/3] kexec: Support for uImage RAMDisks Suzuki K. Poulose
2013-01-11  6:41 ` [PATCH 1/3] kexec/uImage: Return the image type for uImage_probe Suzuki K. Poulose
2013-01-16 17:20   ` Sebastian Andrzej Siewior
2013-01-17  3:10     ` Suzuki K. Poulose
2013-01-11  6:41 ` [PATCH 2/3] kexec/uImage: Recognize uImage RAM Disks Suzuki K. Poulose
2013-01-11  6:42 ` [PATCH 3/3] ppc/uImage: Add support for " Suzuki K. Poulose
2013-01-11  7:11   ` McClintock Matthew-B29882
2013-01-14  5:14     ` Suzuki K. Poulose [this message]
2013-01-14 15:14       ` McClintock Matthew-B29882
2013-01-16 17:30         ` Sebastian Andrzej Siewior
2013-01-16 17:37           ` McClintock Matthew-B29882
2013-01-16 17:26   ` Sebastian Andrzej Siewior
2013-01-17  9:47     ` Suzuki K. Poulose
2013-01-27 16:39       ` Sebastian Andrzej Siewior

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=50F3944D.7080506@in.ibm.com \
    --to=suzuki@in.ibm.com \
    --cc=B29882@freescale.com \
    --cc=bigeasy@linutronix.de \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=lethal@linux-sh.org \
    --cc=mat@brain-dump.org \
    /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