[U-Boot] [PATCH 7/6] sunxi: Reserve ATF memory space on A64

Andre Przywara andre.przywara at arm.com
Wed Apr 13 21:46:39 CEST 2016


Hi,

sorry for the late reply, just found your series here.

On 30/03/16 16:53, Alexander Graf wrote:
> On the A64 we usually boot with ATF running in EL3. ATF as it is available
> today resides in the first 16MB of RAM.

So this is actually a mistake Allwinner made and which we haven't fixed yet.
ATF (at least BL3-1, which is the runtime service part we use for the
A64) should at least run in secure memory, actually in secure SRAM.
Having it in DRAM is a kludge, unnecessary (it's small enough to reside
in some SRAM), a waste of memory (it should get along with something
like 32KB) and also insecure, as long as we don't use the TrustZone
controller to mark this part of DRAM as secure.

> So we should make sure we reserve
> that space in our memory maps.

I will try to load ATF into one of the SRAM regions the A64 has, and tag
that as secure. U-Boot shouldn't care about ATF then, we don't need to
reserve any memory for it - after all those SRAM regions look like some
kind of MMIO device which we wouldn't touch anyway.

Cheers,
Andre.

> Signed-off-by: Alexander Graf <agraf at suse.de>
> ---
>  board/sunxi/board.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index 74510c5..331cb0a 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -136,6 +136,15 @@ int dram_init(void)
>       return 0;
>  }
>
> +#ifdef CONFIG_MACH_SUN50I
> +void dram_init_banksize(void)
> +{
> +     /* We need to reserve the first 16MB of RAM for ATF */
> +     gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE + (16 * 1024 * 1024);
> +     gd->bd->bi_dram[0].size = get_effective_memsize() - (16 * 1024 * 1024);
> +}
> +#endif
> +
>  #if defined(CONFIG_NAND_SUNXI) && defined(CONFIG_SPL_BUILD)
>  static void nand_pinmux_setup(void)
>  {
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.



More information about the U-Boot mailing list