public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 8/9] sunxi: non-FEL SPL boot support for sun7i
Date: Mon, 17 Mar 2014 11:20:55 -0400	[thread overview]
Message-ID: <20140317152055.GY16360@bill-the-cat> (raw)
In-Reply-To: <1394988357.2234.26.camel@hastur.hellion.org.uk>

On Sun, Mar 16, 2014 at 04:45:57PM +0000, Ian Campbell wrote:
> On Sun, 2014-03-16 at 15:19 +0000, Ian Campbell wrote:
> > On Fri, 2014-03-14 at 15:03 -0400, Tom Rini wrote:
> > > On 03/14/2014 02:50 PM, Hans de Goede wrote:
> > > > Hi,
> > > > 
> > > > On 03/14/2014 03:17 PM, Tom Rini wrote:
> > > >> On Fri, Mar 14, 2014 at 10:33:50AM +0000, Ian Campbell wrote:
> > > >>
> > > >>> Based linux-sunxi#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in
> > > >>> ldscripts" vs v2014.01.
> > > >> [snip]
> > > >>> +/* Flat Device Tree (FDT/DT) support */
> > > >>> +#define CONFIG_OF_LIBFDT
> > > >>> +#define CONFIG_SYS_BOOTMAPSZ		(16 << 20)
> > > >>
> > > >> This seems pretty small.  This is to keep things from being relocated
> > > >> into highmem right?
> > > > 
> > > > Hmm, this reminds me that we currently need to do a "env set fdt_high ffffffff"
> > > > in our boot scripts to get ftd to work at all. Would be nice to fix this for
> > > > upstream. I'm afraid I'm clueless as to why we (sunxi) need it, but we do.
> > > 
> > > You want to be setting bootm_low (even for bootz, it's about the
> > > underlying boot mechanics that bootz and bootelf and ... hook into) to
> > > the amount of lowmem the kernel will have.  We do this because we do
> > > want to make sure that the device tree isn't overwritten by the kernel
> > > BSS or similar.  Everyone with more DDR than kernel lowmem needs to be
> > > doing something along these lines.
> > 
> > So, I'm confused about what to do here ;-)
> > 
> > AFAICS none of the existing platforms in u-boot.git are setting
> > bootm_low in their default environment.

Yes.  http://patchwork.ozlabs.org/patch/329210/ gets things right for
some subset of TI platforms and I'll be picking that up soon.  Or maybe
a v2.

> > README suggests that bootm_low is the lowest address allowed for use by
> > bootm/z rather than the limit, from the docs it seems that
> > CONFIG_SYS_BOOTMAPSZ (overridden by env bootm_mapsize) is the limit
> > 
> > bootm_low defaults to CONFIG_SYS_SDRAM_BASE, which sunxi sets, and this
> > seems logical to me since kernel's lowmem mapping starts at offset 0
> > into RAM.
> > 
> > I think we probably do want to set BOOTMAPSZ to something like 256MB,
> > which seems to be the highest in tree (although the vast majority use
> > 8MB...). But I'm not sure that explains why fdt_high is needed today.
> > I'll have a play.
> 
> So setting BOOTMAPSZ to e.g. 256MB limits the fdt load address as you
> would expect.
> 
> But it seems to not make any difference for the initramfs which still
> gets loaded to the top of RAM. This is consistent with README which says
> that unless initrd_high is set the ramdisk will be loaded as high as
> possible, without reference to BOOTMAPSZ. Supposedly setting initrd_high
> to "no", "off" or "0" should cause initrd relocation to obey BOOTMAPSZ
> -- but at least in my experiments it does not seem to do so.
> 
> boot_ramdisk_high() doesn't seem to make any reference to
> bootm_{low,size,etc} like I would expect and with initrd_high==0 it
> calls lmb_alloc which allocates anywhere. This is in contrast with
> boot_relocate_fdt which uses getenv_bootm_mapsize() and
> getenv_bootm_low().
> 
> It looks to me like the initrd reloc logic is wrong -- but it's been
> that way for such a long time I think I must be mistaken.

I think after reading what you're saying, things are very unclear,
unfortunately.  What you can do, but is very odd after thinking about it
is if you set bootm_low only and not any of the size things, it works as
a constraint on the upper bounds so initrd nor fdt are put above that.
But that's really seeming like a side effect rather than an intent.  I'm
going to whack at this more..

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140317/4386b7e9/attachment.pgp>

  reply	other threads:[~2014-03-17 15:20 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 10:33 [U-Boot] [PATCH v1 0/9] sunxi: initial upstreamining effort Ian Campbell
2014-03-14 10:33 ` [U-Boot] [PATCH v1 1/9] sunxi: initial sun7i clocks and timer support Ian Campbell
2014-03-14 14:16   ` Tom Rini
2014-03-14 10:33 ` [U-Boot] [PATCH v1 2/9] sunxi: initial sun7i pinmux and gpio support Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-14 10:33 ` [U-Boot] [PATCH v1 3/9] sunxi: initial sun7i dram setup support Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-14 16:28     ` [U-Boot] [linux-sunxi] " Henrik Nordström
2014-03-14 17:24       ` Luke Kenneth Casson Leighton
2014-03-17 13:16       ` [U-Boot] " Stefan
2014-03-17 14:56         ` [U-Boot] [linux-sunxi] " Ian Campbell
2014-03-14 17:23     ` [U-Boot] " Alex G.
2014-03-14 18:59       ` Tom Rini
2014-03-14 10:33 ` [U-Boot] [PATCH v1 4/9] sunxi: initial generic sun7i cpu, board and start of day support Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-15 15:57     ` Alex G.
2014-03-14 10:33 ` [U-Boot] [PATCH v1 5/9] sunxi: generic sun7i build infrastructure Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-16 13:25     ` Ian Campbell
2014-03-17 15:04       ` Tom Rini
2014-03-17 15:24         ` Ian Campbell
2014-03-14 10:33 ` [U-Boot] [PATCH v1 6/9] sunxi: add support for Cubietruck booting in FEL mode Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-14 10:33 ` [U-Boot] [PATCH v1 7/9] sunxi: mmc support Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-14 15:36   ` Pantelis Antoniou
2014-03-16 20:38     ` Ian Campbell
2014-03-17  2:13       ` [U-Boot] [linux-sunxi] " Chen-Yu Tsai
2014-03-14 10:33 ` [U-Boot] [PATCH v1 8/9] sunxi: non-FEL SPL boot support for sun7i Ian Campbell
2014-03-14 14:17   ` Tom Rini
2014-03-14 18:50     ` Hans de Goede
2014-03-14 19:03       ` Tom Rini
2014-03-16 15:19         ` Ian Campbell
2014-03-16 16:45           ` Ian Campbell
2014-03-17 15:20             ` Tom Rini [this message]
2014-03-17 15:29               ` Ian Campbell
2014-03-17 15:36                 ` Tom Rini
2014-03-17 19:33           ` Tom Rini
2014-03-18  8:22             ` [U-Boot] [linux-sunxi] " Maxime Ripard
2014-03-21 14:58               ` Tom Rini
2014-03-20 19:57             ` [U-Boot] " Ian Campbell
2014-03-14 10:33 ` [U-Boot] [PATCH v1 9/9] sunxi: add gmac Ethernet support Ian Campbell
2014-03-14 11:11   ` [U-Boot] [linux-sunxi] " Chen-Yu Tsai
2014-03-14 11:28     ` Ian Campbell
2014-03-14 14:22       ` Tom Rini
2014-03-16 15:09         ` Ian Campbell
2014-03-17 15:06           ` Tom Rini
2014-03-14 14:17   ` [U-Boot] " Tom Rini
2014-03-14 12:55 ` [U-Boot] [PATCH v1 0/9] sunxi: initial upstreamining effort Tom Rini
2014-03-14 13:59   ` Ian Campbell
2014-03-14 14:19     ` Tom Rini
2014-03-14 15:01       ` Albert ARIBAUD
2014-03-14 19:07         ` Hans de Goede
2014-03-14 19:11           ` Hans de Goede
2014-03-14 13:02 ` Albert ARIBAUD
2014-03-14 13:13   ` Maxime Ripard
2014-03-14 14:03   ` Ian Campbell
2014-03-14 14:16 ` Tom Rini
2014-03-14 15:04   ` Ian Campbell
2014-03-14 15:13     ` Tom Rini
2014-03-14 20:17   ` Dennis Gilmore
2014-03-15 16:02     ` Hans de Goede
2014-03-16  7:49     ` Ian Campbell
2014-03-14 14:31 ` Marek Vasut
2014-03-14 15:21 ` Henrik Nordström

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=20140317152055.GY16360@bill-the-cat \
    --to=trini@ti.com \
    --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