[U-Boot] SUNXI: A64: Increase SPL size

André Przywara andre.przywara at arm.com
Wed Nov 8 22:06:42 UTC 2017


On 08/11/17 19:59, Jagan Teki wrote:
> Hi,
> 
> I'm trying to increase SPL size to 64K(with SRAM A2), so-that SPL can
> able to fit new features like falcon. I knew the limit about 32K but
> page[1] stating that we can use approximately 192 KiB of contiguous
> SRAM.

We are not really sure about this. The memory following SRAM A1 is
called SRAM C (not A2, that is secure memory at 0x44000). And this is
actually meant for use by the DisplayEngine, AFAIK. We found it unstable
to use from the ARM cores. With the default config is it not even
covering the whole region as described in the manual.

> eGON.BT0 has limit of reading 32KB, Can't we use > 32KB SPL here?

Well, how? As far as I know the *BROM* does not load more than 32KB, at
least not with the ("un-encrypted") eGON.BT0 format. Or could you
actually load more code?

I *think* we can load more with the "secure" payload, which requires the
"secure boot" fuse to be burned (with no return), which in turn will let
the BROM refuse to load a standard eGON.BT0 Boot0/SPL, but only the
secure packaged version (TOC0): http://linux-sunxi.org/TOC0

> because I've tried with 64K SPL size with existing SPL code and was
> able to boot, but with increasing SPL by enabling falcon seems like
> BROM unable read eGON.BT0 which eventually booting failed. Any inputs?

So why do you need falcon, desperately? You can put the kernel into the
SPL FIT image (u-boot.itb), then have the U-Boot proper just execute
booti (no further loading). That works from SPI flash, also. If you are
really want to, you can disable USB, Ethernet and the timeout and save
some time here. But those are .config options and shouldn't require code
changes.

Cheers,
Andre.

> diff:
> ----
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 0bd8370..b43c1ff 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -139,7 +139,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
>  config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
>         hex "Address on the MMC to load U-Boot from"
>         depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
> -       default 0x50 if ARCH_SUNXI
> +       default 0x90 if ARCH_SUNXI
>         default 0x75 if ARCH_DAVINCI
>         default 0x8a if ARCH_MX6
>         default 0x100 if ARCH_ROCKCHIP || ARCH_UNIPHIER
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index bc74dba..805489c 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -99,7 +99,7 @@
>   * the 1 actually activates the mapping of the first 32 KiB to 0x00000000.
>   */
>  #define CONFIG_SYS_INIT_RAM_ADDR       0x10000
> -#define CONFIG_SYS_INIT_RAM_SIZE       0x08000 /* FIXME: 40 KiB ? */
> +#define CONFIG_SYS_INIT_RAM_SIZE       0x10000 /* FIXME: 40 KiB ? */
>  #else
>  #define CONFIG_SYS_INIT_RAM_ADDR       0x0
>  #define CONFIG_SYS_INIT_RAM_SIZE       0x8000  /* 32 KiB */
> @@ -191,7 +191,7 @@
> 
>  #ifdef CONFIG_SUNXI_HIGH_SRAM
>  #define CONFIG_SPL_TEXT_BASE           0x10060         /* sram start+header */
> -#define CONFIG_SPL_MAX_SIZE            0x7fa0          /* 32 KiB */
> +#define CONFIG_SPL_MAX_SIZE            0xffa0          /* 192 KiB */
>  #ifdef CONFIG_ARM64
>  /* end of SRAM A2 for now, as SRAM A1 is pretty tight for an ARM64 build */
>  #define LOW_LEVEL_SRAM_STACK           0x00054000
> @@ -206,7 +206,7 @@
> 
>  #define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
> 
> -#define CONFIG_SPL_PAD_TO              32768           /* decimal for 'dd' */
> +#define CONFIG_SPL_PAD_TO              65536           /* decimal for 'dd' */
> diff --git a/tools/mksunxiboot.c b/tools/mksunxiboot.c
> index db0f10e..31df7e2 100644
> --- a/tools/mksunxiboot.c
> +++ b/tools/mksunxiboot.c
> @@ -48,7 +48,7 @@ int gen_check_sum(struct boot_file_head *head_p)
>  #define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a)-1)
>  #define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
> 
> -#define SUNXI_SRAM_SIZE 0x8000 /* SoC with smaller size are limited before */
> +#define SUNXI_SRAM_SIZE 0x10000        /* SoC with smaller size are
> limited before */
>  #define SRAM_LOAD_MAX_SIZE (SUNXI_SRAM_SIZE - sizeof(struct boot_file_head))
> 
> [1] http://linux-sunxi.org/BROM
> 
> thanks!
> 



More information about the U-Boot mailing list