mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2] arch: arm: imx: esdctl: limit ram to 1GB on imx93 in case OPTEE is enabled
Date: Thu, 01 May 2025 09:20:08 +0200	[thread overview]
Message-ID: <20250430-imx9optee-v2-1-30b1739e887b@pengutronix.de> (raw)

In MX93 the ELE (Edge Lock Enclave) is limited to communicate with
messages addressed under 1.5GB. The ELE can not reach the memory between
(0xE0000000-0xFFFFFFFF).

So we limit the usable memory in case OPTEE is used.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
v1 -> v2: moved the limitation to be active in imx93_barebox_entry only
---
 arch/arm/mach-imx/esdctl.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index 701ca0ac1f3..264ba1177ec 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -1047,9 +1047,20 @@ void __noreturn imx7d_barebox_entry(void *boarddata)
 
 void __noreturn imx93_barebox_entry(void *boarddata)
 {
+	resource_size_t mem = 0;
+
 	imx93_init_scratch_space(false);
 	optee_set_membase(imx_scratch_get_optee_hdr());
 
-	barebox_arm_entry(MX9_DDR_CSD1_BASE_ADDR,
-			  imx9_ddrc_sdram_size(), boarddata);
+	mem = imx9_ddrc_sdram_size();
+	/* In MX93 the ELE is limited to comunicate with messages
+	 * under 1.5GB address space. This limits the overal memory
+	 * to be 1GB in case OPTEE is used.
+	 */
+	if (IS_ENABLED(CONFIG_PBL_OPTEE)) {
+	        if (mem > 0x40000000)
+	                mem = 0x40000000;
+	}
+
+	barebox_arm_entry(MX9_DDR_CSD1_BASE_ADDR, mem, boarddata);
 }

---
base-commit: 873b572763d38ab4100d218d0a3614f79b596077
change-id: 20250430-imx9optee-31d2dfc926bf

Best regards,
-- 
Michael Grzeschik <m.grzeschik@pengutronix.de>




                 reply	other threads:[~2025-05-01  7:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250430-imx9optee-v2-1-30b1739e887b@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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