[U-Boot] [linux-sunxi] Re: [RFC PATCH 4/4] sunxi: low memory footprint for V3s

Icenowy Zheng icenowy at aosc.xyz
Thu Jan 5 23:57:27 CET 2017


2017年1月6日 06:39于 Maxime Ripard <maxime.ripard at free-electrons.com>写道:
>
> On Thu, Dec 29, 2016 at 03:01:01AM +0800, Icenowy Zheng wrote: 
> > V3s devices won't have enough memory to load U-Boot binary at 
> > 0x4a000000, and they do not have enough memory to reserve 64MiB for 
> > malloc() (it has only 64MiB at all!) 
> > Change the text base to 0x41000000, and cut down malloc() reserved area 
> > to 4MB, in order to fit into the small DRAM of V3s. 
> > 
> > Signed-off-by: Icenowy Zheng <icenowy at aosc.xyz> 
> > --- 
> >  include/configs/sunxi-common.h | 10 ++++++++++ 
> >  1 file changed, 10 insertions(+) 
> > 
> > diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h 
> > index b0bfc0dfd7..15c672813f 100644 
> > --- a/include/configs/sunxi-common.h 
> > +++ b/include/configs/sunxi-common.h 
> > @@ -76,7 +76,12 @@ 
> >  #define SDRAM_OFFSET(x) 0x4##x 
> >  #define CONFIG_SYS_SDRAM_BASE 0x40000000 
> >  #define CONFIG_SYS_LOAD_ADDR 0x42000000 /* default load address */ 
> > +/* V3s do not have enough memory to place code at 0x4a000000 */ 
> > +#ifndef CONFIG_MACH_SUN8I_V3S 
> >  #define CONFIG_SYS_TEXT_BASE 0x4a000000 
> > +#else 
> > +#define CONFIG_SYS_TEXT_BASE 0x41000000 
> > +#endif 
> >  /* Note SPL_STACK_R_ADDR is set through Kconfig, we include it here 
> >   * since it needs to fit in with the other values. By also #defining it 
> >   * we get warnings if the Kconfig value mismatches. */ 
> > @@ -148,8 +153,13 @@ 
> >  #define CONFIG_SYS_MMC_MAX_DEVICE 4 
> >  #endif 
>> > +#ifndef CONFIG_MACH_SUN8I_V3S 
> >  /* 64MB of malloc() pool */ 
> >  #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (64 << 20)) 
> > +#else 
> > +/* 4MB of malloc() pool */ 
> > +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (4 << 20)) 
> > +#endif 
>
> Can't this be used for all the SoCs? Allocating 64MB seems way to much 
> already :) 

This patch is obsolute now.

A newer version which enables booting a kernel is ready now, on my github.

And according to someone in linux-sunxi, some works, for example enable a UBIFS, eats a lot of heap.

>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 
>
> -- 
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group. 
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com. 
> For more options, visit https://groups.google.com/d/optout. 


More information about the U-Boot mailing list