[PATCH 2/2] arm64: lmb: Reserve U-Boot separately if relocation is disabled

Tom Rini trini at konsulko.com
Mon Oct 11 16:00:43 CEST 2021


On Sun, Oct 10, 2021 at 11:52:09PM +0200, marek.vasut at gmail.com wrote:
> From: Marek Vasut <marek.vasut+renesas at gmail.com>
> 
> In case U-Boot starts with GD_FLG_SKIP_RELOC, the U-Boot code is
> not relocated, however the stack and heap is at the end of DRAM
> after relocation. Reserve a LMB area for the non-relocated U-Boot
> code so it won't be overwritten.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> ---
>  arch/arm/lib/stack.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/lib/stack.c b/arch/arm/lib/stack.c
> index 656084c7e5..d2e2715ecf 100644
> --- a/arch/arm/lib/stack.c
> +++ b/arch/arm/lib/stack.c
> @@ -14,6 +14,7 @@
>  #include <init.h>
>  #include <lmb.h>
>  #include <asm/global_data.h>
> +#include <asm/sections.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -46,4 +47,12 @@ static ulong get_sp(void)
>  void arch_lmb_reserve(struct lmb *lmb)
>  {
>  	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 16384);
> +
> +#ifdef CONFIG_ARM
> +		if (gd->flags & GD_FLG_SKIP_RELOC) {
> +			lmb_reserve(lmb, (phys_addr_t)__image_copy_start,
> +				    (phys_addr_t)__image_copy_end -
> +				    (phys_addr_t)__image_copy_start);
> +		}
> +#endif
>  }

Erm, this is in the arm code, the patch subject says arm64 and you're
testing for CONFIG_ARM (which will always be true here).  Can you please
respin?  Also, the whitespace of the new code is too indented.  Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20211011/9fb33ac9/attachment.sig>


More information about the U-Boot mailing list