All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ira W. Snyder <iws@ovro.caltech.edu>
To: u-boot@lists.denx.de
Subject: [U-Boot] 83xx fails to boot with moderately sized kernels
Date: Fri, 10 Sep 2010 11:10:23 -0700	[thread overview]
Message-ID: <20100910181022.GA18510@ovro.caltech.edu> (raw)
In-Reply-To: <201009101329.48145.sr@denx.de>

On Fri, Sep 10, 2010 at 01:29:48PM +0200, Stefan Roese wrote:
> Hi Ira & Wolfgang,
> 
> On Friday 10 September 2010 13:18:55 Wolfgang Denk wrote:
> > > Does anyone know the true maximum value for CONFIG_SYS_BOOTMAPSZ on Linux
> > > (if one even exists)?
> > 
> > The CONFIG_SYS_BOOTMAPSZ thing is as old as U-Boot and PPCBoot
> > exists, i. e. well over a decade. IIRC there was such a limitation on
> > the then current 2.2.13 Linux kernels, at least on MPC8xx and PPC40x
> > systems, which is where all started from.
> > 
> > 
> > I am pretty sure that as long as nobody ran into any problems, nobody
> > looked into that code, so it was copied from architecture to
> > architecture without much thinking, if any.
> 
> I looked at it a bit over a year ago and commited this change for the AMCC/APM 
> eval boards:
> 
> commit 6942efc2be1b90054fa4afa5cda7023469fe08b9
> Author: Stefan Roese <sr@denx.de>
> Date:   Tue Jul 28 10:50:32 2009 +0200
> 
>     ppc4xx: amcc: Set CONFIG_SYS_BOOTMAPSZ to 16MB for big kernels
>     
>     This patch changes CONFIG_SYS_BOOTMAPSZ from 8MB to 16MB which is the
>     initial TLB on 40x PPC's in the Linux kernel. With this change even bigger
>     Linux kernels (> 8MB) can be booted.
>     
>     This patch also sets CONFIG_SYS_BOOTM_LEN to 16MB (default 8MB) to enable
>     decompression of bigger images.
>     
>     Signed-off-by: Stefan Roese <sr@denx.de>
> 
> 
> So we have this 16MiB initial TLB restriction at least for PPC405 (not 
> PPC440). I'm pretty sure that 83xx has no such tight restrictions.
> 

I've just gone through both the 40x code (as a source for comparison)
and the 6xx code (generic 32-bit powerpc: 83xx, 85xx, others?).

arch/powerpc/kernel/setup_32.c's machine_init() function is the first
thing to access the device tree. The full MMU setup has not been done at
this point; the initial MMU configuration is used at this point. The
initial MMU configuration is done in arch/powerpc/kernel/head_32.S's
initial_bats() function. On 6xx, it creates a 256MB mapping:

/*
 * On 601, we use 3 BATs to map up to 24M of RAM at _PAGE_OFFSET
 * (we keep one for debugging) and on others, we use one 256M BAT.
 */

Inside U-Boot, common/image.c's boot_relocate_fdt() function uses
lmb_alloc_base() to allocate memory to hold the FDT for Linux. That
shouldn't return an invalid memory location. (It doesn't return a
pointer to unpopulated memory on a board.)

Based on that, I think it should be fine to increase
CONFIG_SYS_BOOTMAPSZ to 256MB on all 32-bit 6xx processors. This
includes 83xx and 85xx. Is 86xx included too (IIRC, it has 64bit modes)?

A boot test on my MPC8349EMDS confirms that it works:

   Booting using the fdt blob at 0x2242d6c
   Uncompressing Kernel Image ... OK
   Loading Ramdisk to 0fe9f000, end 0ff75699 ... OK
   Loading Device Tree to 0fe97000, end 0fe9e84f ... OK
[    0.000000] Using MPC834x MDS machine description
[    0.000000] Linux version 2.6.31.12-00018-g306aebe [output trimmed]

Would you prefer a patch only for the MPC8349EMDS, or should I try and
convert the other boards too? How should I know which boards are safe?
Grep for CONFIG_E300?

Thanks,
Ira

  reply	other threads:[~2010-09-10 18:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 22:52 [U-Boot] 83xx fails to boot with moderately sized kernels Ira W. Snyder
2010-09-10 11:18 ` Wolfgang Denk
2010-09-10 11:29   ` Stefan Roese
2010-09-10 18:10     ` Ira W. Snyder [this message]
2010-09-10 18:26       ` Kim Phillips
2010-09-10 18:53         ` Wolfgang Denk
2010-09-10 19:11           ` Kim Phillips
2010-09-10 18:51       ` Wolfgang Denk
2010-09-11  7:19         ` Joakim Tjernlund
2010-09-13 19:21           ` Scott Wood
2010-09-13 21:52             ` Joakim Tjernlund
2010-09-13 22:00               ` Scott Wood

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=20100910181022.GA18510@ovro.caltech.edu \
    --to=iws@ovro.caltech.edu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.