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

Maxime Ripard maxime.ripard at free-electrons.com
Thu Jan 5 23:39:30 CET 2017


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 :)

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170105/23ca5f24/attachment.sig>


More information about the U-Boot mailing list