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

Maxime Ripard maxime.ripard at free-electrons.com
Tue Mar 18 09:22:50 CET 2014


On Mon, Mar 17, 2014 at 03:33:19PM -0400, Tom Rini wrote:
> On Sun, Mar 16, 2014 at 03:19:40PM +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 ;-)
> 
> And I've not made things clearer with a mis-recollection of things.  I
> don't know why I keep saying "bootm_low" when I mean "bootm_size" like
> I've done in later patches (and thankfully, when poking people on G+).
> 
> There's three ways to say "Please ensure that the FDT and if passed initrd
> do not relocate above a certain location".
> 1) In the environment, set bootm_size to kernel lowmem.  This means that
> boot_start_lmb restricts the pool used by both fdt and initrd to that
> value at the top.
> 2) In the environment, set fdt_high (and if using initrd, initrd_high)
> to the top of lowmem.  This means that we'll make sure they don't get
> relocated above that value.
> 3) In the environment set initrd_high to top of lowmem and set
> bootm_mapsize to lowmem.
> 
> In all of the above, lowmem can be replaced with any valid size that's
> also smaller than lowmem, such as 256MB.  Another option, in the
> environment, is to set initrd_high and fdt_high to 0xffffffff and then
> relocation is disabled.  I would _not_ recommend this in the general
> case as one of the points of relocation is to ensure we don't get
> overwritten by the kernel BSS.

IIRC, we added it not to make sure that it was in lowmem, but because
we had issues with large enough kernels (multi_v7_defconfig + embedded
initramfs) that would overwrite the relocated DTB whenever it was
decompressing itself.

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- 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/20140318/bfc1e468/attachment.pgp>


More information about the U-Boot mailing list