On Wed, Nov 08, 2023 at 03:43:03PM +0530, Nitin Yadav wrote:
> 
> 
> On 31/10/23 19:25, Tom Rini wrote:
> > On Tue, Oct 31, 2023 at 06:58:06PM +0530, Nitin Yadav wrote:
> >> AM62 SIP has 512MB RAM. But the top of the RAM is reserved for
> >> TF-A and OPTEE. U-Boot relocating there would cause overwriting
> >> of these reserved regions. Fix this by limit U-Boot to first
> >> 64MB of RAM for all boards with 512MB.
> >>
> >> Signed-off-by: Vignesh Raghavendra <[email protected]>
> >> Signed-off-by: Nitin Yadav <[email protected]>
> >> ---
> >>  board/ti/am62x/evm.c | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
> >> index ad93908840..ad3e415592 100644
> >> --- a/board/ti/am62x/evm.c
> >> +++ b/board/ti/am62x/evm.c
> >> @@ -18,6 +18,7 @@
> >>  #include <asm/io.h>
> >>  #include <asm/arch/hardware.h>
> >>  #include <dm/uclass.h>
> >> +#include <linux/sizes.h>
> >>  
> >>  DECLARE_GLOBAL_DATA_PTR;
> >>  
> >> @@ -59,6 +60,16 @@ int dram_init_banksize(void)
> >>    return fdtdec_setup_memory_banksize();
> >>  }
> >>  
> >> +phys_size_t get_effective_memsize(void)
> >> +{
> >> +  /*
> >> +  * Just below 512MB are TF-A and OPTEE reserve regions, thus
> >> +  * SPL/U-Boot RAM has to start below that. Leave 64MB space for
> >> +  * all reserved memories.
> >> +  */
> >> +  return gd->ram_size == SZ_512M ? SZ_512M - SZ_64M : gd->ram_size;
> >> +}
> > 
> > Where are TF-A and OPTEE in other cases? Are we not able to read the
> > reserved memory nodes and handle this through that?
>
> This is first Board where we have 512M of RAM, Others have 2GB of RAM.
> That's why we are reserving this space.

And how is this reservation being communicated / documented ? Why do we
need something different here, when we don't on 2GB of memory? The
normal case is U-Boot goes and plays around at the top of memory, so
there should be something happening in that previous case, where is it /
why isn't it something that works here?

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to