public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rogan Dawes <rogan@dawes.za.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] Debugging why my kernel won't start
Date: Wed, 18 Aug 2010 18:32:51 +0200	[thread overview]
Message-ID: <4C6C0B33.8090703@dawes.za.net> (raw)
In-Reply-To: <20100818153347.C886E157D71@gemini.denx.de>

On 2010/08/18 5:33 PM, Wolfgang Denk wrote:
> Dear Rogan Dawes,
> 
> Your kernel may not be able to pick up a ramdisk image in flash.
> 
> Mainline ARM cannot do that, for example.
> 
> [Patches to support that have been submitted, but rejected.]
> 
>> Surely that should be Ok? Besides, U-boot is supposed to copy the data
>> in the image to the specified destination address, isn't it?
>
> No, why should it copy the image? It just verifies that the checksum
> is OK, and then passes the address to the kernel. The kernel will have
> to copy it anyway when uncompressing it, so ther ei no use in U-Boot
> adding another copy operation.

Well, I thought that was the point of the "mkimage" header, with the
Load Address and Entry Point fields. Although, of course, you'll never
actually "enter" a ramdisk image. I had still thought that they would be
copied, regardless. Otherwise, what is the point in specifying those
fields? They might just as well be zero.

But yes, what you say makes sense.

This appears to be the answer, from Marvell's u-boot sources, in
lib_arm/armlinux.c, inside the #ifdef RAMDISK block:

#ifdef  DEBUG
        if (!data) {
                printf ("No initrd\n");
        }
#endif

        if (data) {
                #ifdef RAMDISK
                initrd_start = ntohl(hdr->ih_load);
                initrd_end = initrd_start + len;
                memmove ((void *)initrd_start, (void *)data, len);
                #else
                initrd_start = data;
                initrd_end = initrd_start + len;
                #endif
        } else {
                initrd_start = 0;
                initrd_end = 0;
        }

and then later:

#ifdef CONFIG_INITRD_TAG
        if (initrd_start && initrd_end)
                setup_initrd_tag (bd, initrd_start, initrd_end);
#endif

So, clearly, the address that the kernel is expecting MUST be within
RAM, and MUST exclude the header.

So, the question then is, what is current u-boot doing? And why does it
not work when the ramdisk is copied over to memory?

It looks like U-Boot for ARM doesn't handle ramdisks at all? From
common/cmd_bootm.c:

#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
                case BOOTM_STATE_RAMDISK:
                {
                        ulong rd_len = images.rd_end - images.rd_start;
                        char str[17];

                        ret = boot_ramdisk_high(&images.lmb,
images.rd_start,
                                rd_len, &images.initrd_start,
&images.initrd_end);
                        if (ret)
                                return ret;

                        sprintf(str, "%lx", images.initrd_start);
                        setenv("initrd_start", str);
                        sprintf(str, "%lx", images.initrd_end);
                        setenv("initrd_end", str);
                }
                        break;
#endif

But this is only enabled for PPC, M68K and SPARC.

Is this the missing functionality that I am looking for?

Rogan

  reply	other threads:[~2010-08-18 16:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16  7:24 [U-Boot] Debugging why my kernel won't start Rogan Dawes
2010-08-16  8:34 ` Gérald Kerma
2010-08-16  8:38   ` Rogan Dawes
2010-08-16 20:15 ` Rogan Dawes
2010-08-16 20:29   ` Wolfgang Denk
2010-08-16 21:08     ` Rogan Dawes
2010-08-16 21:11       ` [U-Boot] [PATCH] non-working dns323 config Rogan Dawes
2010-08-18 22:23         ` Wolfgang Denk
2010-08-19  5:25           ` Rogan Dawes
2010-08-19  5:35             ` Wolfgang Denk
2010-08-19  6:37               ` Rogan Dawes
2010-08-19  6:49                 ` Wolfgang Denk
2010-08-16 22:03       ` [U-Boot] Debugging why my kernel won't start Wolfgang Denk
2010-08-17  4:30         ` Rogan Dawes
2010-08-17 10:10   ` Albert ARIBAUD
2010-08-17 10:21     ` Rogan Dawes
2010-08-17 10:41       ` Albert ARIBAUD
2010-08-17 11:19         ` Rogan Dawes
2010-08-17 11:42           ` Rogan Dawes
2010-08-17 15:38             ` Albert ARIBAUD
2010-08-17 19:56               ` Rogan Dawes
2010-08-17 20:09                 ` Rogan Dawes
2010-08-17 21:20                   ` Wolfgang Denk
2010-08-17 21:54                     ` Rogan Dawes
2010-08-17 22:04                       ` Wolfgang Denk
2010-08-17 22:10                         ` Rogan Dawes
2010-08-18  5:51                           ` Wolfgang Denk
2010-08-18  9:48                             ` Rogan Dawes
2010-08-18 10:54                               ` Wolfgang Denk
2010-08-18 14:42                                 ` Rogan Dawes
2010-08-18 15:33                                   ` Wolfgang Denk
2010-08-18 16:32                                     ` Rogan Dawes [this message]
2010-08-18 17:00                                       ` Wolfgang Denk
2010-08-17 21:18                 ` Wolfgang Denk

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=4C6C0B33.8090703@dawes.za.net \
    --to=rogan@dawes.za.net \
    --cc=u-boot@lists.denx.de \
    /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