From: Max Krummenacher Date: Tue, 3 Sep 2019 12:58:14 +0000 Subject: [U-Boot] [PATCH] apalis_imx6: allocate specific region of memory to OP-TEE In-Reply-To: <20190902212135.8031-1-ricardo@foundries.io> References: <20190902212135.8031-1-ricardo@foundries.io> Message-ID: <467bdc74c4d6ca555fe193ecbeadb8ff27c07a5f.camel@toradex.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 2019-09-02 at 18:21 -0300, Ricardo Salveti wrote: > OP-TEE uses the memory region defined by the maximum DRAM address minus > CONFIG_OPTEE_TZDRAM_SIZE, so subtract CONFIG_OPTEE_TZDRAM_SIZE from the > available DRAM size to avoid conflicts. > > Signed-off-by: Ricardo Salveti > --- > board/toradex/apalis_imx6/apalis_imx6.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c > index 6421a22c25..fa7fcc8d46 100644 > --- a/board/toradex/apalis_imx6/apalis_imx6.c > +++ b/board/toradex/apalis_imx6/apalis_imx6.c > @@ -75,6 +75,11 @@ int dram_init(void) > gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, > (ulong)imx_ddr_size()); > > + /* Subtract the defined OPTEE runtime firmware length */ > +#ifdef CONFIG_OPTEE_TZDRAM_SIZE > + gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE; > +#endif > + > return 0; > } > > Acked-by: Max Krummenacher