public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matwey V. Kornilov <matwey.kornilov@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] Reserve ATF memory on Marvell Armdada 3700/7K/8K
Date: Tue, 3 Apr 2018 10:34:40 +0300	[thread overview]
Message-ID: <p9vamg$p4u$1@blaine.gmane.org> (raw)
In-Reply-To: <63321798f8798524@bloch.sibelius.xs4all.nl>


Hello,

I think I suffered from random kernel crashed due to this issue. Could
you please also submit this patch to downstream Marvell u-boot at github PR?

31.03.2018 17:13, Mark Kettenis пишет:
> Currently U-Boot doesn't make any effort to reserve the memory used by
> ARM Trusted Firmware on these platforms.  The result is that the
> memory is listed as available in the EFI memory map.  And as soon as a
> loaded kernel tries to use this memory things explode.  I've seen this
> with the OpenBSD kernel.  But I totally expect a Linux kernel to
> suffer the same fate.
> 
> I'm currently using the diff below, but it is not entirely clear to me
> if arch_early_init_r() is the appropriate place to do this.  I'm also
> wondering whether the block should also be marked as reserved in the
> FDT using fdt_add_mem_rsv().  If the latter is required this probably
> needs to be done by ft_board_setup() or ft_system_setup().
> 
> The address and size of the region have been taken from Marvell's ATF
> fork at
> 
>   https://github.com/MarvellEmbeddedProcessors/atf-marvell
> 
> The memory layout is defined in
> 
>   plat/marvell/a8k/common/include/platform_def.h
> 
> where there are lots of defines and a diagram that attempt to describe
> the memory.  It is not entirely obvious to me what part needs to be
> reserved.  But 0x0400000-0x04200000 works.
> 
> 
> 
> 
> diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c
> index 3c84043a2c..895cd2852f 100644
> --- a/arch/arm/mach-mvebu/arm64-common.c
> +++ b/arch/arm/mach-mvebu/arm64-common.c
> @@ -95,5 +95,11 @@ int arch_early_init_r(void)
>  	pci_init();
>  #endif
>  
> +#ifdef CONFIG_EFI_LOADER
> +	/* Reserve trusted SRAM section */
> +	efi_add_memory_map(0x04000000, 0x00200000 >> EFI_PAGE_SHIFT,
> +			   EFI_RESERVED_MEMORY_TYPE, false);
> +#endif
> +
>  	return 0;
>  }
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 

  reply	other threads:[~2018-04-03  7:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 14:13 [U-Boot] [RFC] Reserve ATF memory on Marvell Armdada 3700/7K/8K Mark Kettenis
2018-04-03  7:34 ` Matwey V. Kornilov [this message]
2018-04-06 10:04 ` Alexander Graf
2018-04-06 10:22 ` Alexander Graf
2019-02-04 16:51   ` Patrick Wildt
2019-02-12  9:38     ` Alexander Graf
2019-02-12 10:31       ` Marcin Wojtas
2019-06-11 11:00         ` [U-Boot] mvebu: reserve SRAM memory on Marvell Armada 3700/7K/8K Patrick Wildt
2019-06-13  5:48           ` Stefan Roese
2019-06-13  6:09             ` Heinrich Schuchardt
2019-06-13  8:23               ` Mark Kettenis
2019-06-13  9:11                 ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='p9vamg$p4u$1@blaine.gmane.org' \
    --to=matwey.kornilov@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox