[U-Boot] [PATCH v1 8/9] sunxi: non-FEL SPL boot support for sun7i

Ian Campbell
2014-03-16T15:19:40Z

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.

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.

Ian.