[U-Boot-Users] [PATCH] Fix initrd booting

Andy Fleming afleming at gmail.com
Tue Aug 7 21:12:28 CEST 2007


On 8/7/07, Jerry Van Baren <gvb.uboot at gmail.com> wrote:
> Hi Andy,
>
> I'm not sure if you are aiming this at u-boot-fdt, which would be
> logical, or if you are aiming this at u-boot-testing (or other).  Care
> to clarify?

To be honest, I don't care where it goes, but without this patch,
anyone booting on e500 with a Ramdisk will run into problems unless
they are lucky.


> >  #else
> >               if (*(ulong *)of_flat_tree == OF_DT_HEADER) {
> >  #endif
> > -#ifndef CFG_NO_FLASH
> > -                     if (addr2info((ulong)of_flat_tree) != NULL)
> > -                             of_data = (ulong)of_flat_tree;
> > -#endif
> > +                     of_data = (ulong)of_flat_tree;
>
> Is this right?  The logic in bootm *in general* and specifically here is
> hard to figure out, but the way I'm puzzling it out...
> 1) If of_data is *not* NULL, it is used as the indicator that the blob
>       must be relocated.
> 2) The above is saying that, if there is flash (not defined CFG_NO_FLASH
>       gaak) and if of_flat_tree points into flash (addr2info returns a
>       pointer), then of_data is set which makes #1 true.
>
> As I read it, this causes the blob to be copied to RAM if it is in
> flash, which is necessary since we cannot add/rewrite nodes and
> properties in a flash copy.
>
> Your change causes the blob to _always_ be relocated.  Not necessarily
> bad, but is it always good?  I'm not a bootm expert by any means, and I
> suspect the complexity grew substantially over time, but in the mucking
> about I did, I did not dare to change the logic.  :-/


On e500, the blob *must* be in the low 16M of memory.  MUST.  The low
16M is all that is mapped, and the kernel will not map more than that
until it reads the blob.  Certainly, it doesn't *always* need to be
relocated.  It's been a while since I created this patch, but I
suppose it's possible to modify the logic to properly only relocate it
if it's in Flash OR if it's not in the low 16M.  I think that, at the
time, I determined that this was the least intrusive change which
would result in everything working.

I probably need to respin it, though.  I haven't updated it since I
first created it, and you may have changed the fdt code, since.

Andy




More information about the U-Boot mailing list