mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX6: configure AIPS registers only if trusted
@ 2025-09-25 12:26 Philipp Zabel
  2025-09-26 11:39 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Zabel @ 2025-09-25 12:26 UTC (permalink / raw)
  To: barebox

Bail out of AIPS configuration if OP-TEE has cleared the MTW
("master trusted for write access") bit for the ARM core master
to lock down AIPS configuration.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 arch/arm/mach-imx/imx6.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
index ed6cde801ec7..0cf2c17d6b90 100644
--- a/arch/arm/mach-imx/imx6.c
+++ b/arch/arm/mach-imx/imx6.c
@@ -31,8 +31,16 @@
 #define MX6_OCOTP_CFG0			0x410
 #define MX6_OCOTP_CFG1			0x420
 
+#define BM_MPR_MPROT1_MTW		(0x1 << 25)
+
 static void imx6_configure_aips(void __iomem *aips)
 {
+	u32 mpr = readl(aips);
+
+	/* Bail if CPU ist not trusted for write accesses. */
+	if (!(mpr & BM_MPR_MPROT1_MTW))
+		return;
+
 	/*
 	 * Set all MPROTx to be non-bufferable, trusted for R/W,
 	 * not forced to user-mode.
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: i.MX6: configure AIPS registers only if trusted
  2025-09-25 12:26 [PATCH] ARM: i.MX6: configure AIPS registers only if trusted Philipp Zabel
@ 2025-09-26 11:39 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-09-26 11:39 UTC (permalink / raw)
  To: barebox, Philipp Zabel


On Thu, 25 Sep 2025 14:26:03 +0200, Philipp Zabel wrote:
> Bail out of AIPS configuration if OP-TEE has cleared the MTW
> ("master trusted for write access") bit for the ARM core master
> to lock down AIPS configuration.
> 
> 

Applied, thanks!

[1/1] ARM: i.MX6: configure AIPS registers only if trusted
      https://git.pengutronix.de/cgit/barebox/commit/?id=525b55afedca (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-26 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-25 12:26 [PATCH] ARM: i.MX6: configure AIPS registers only if trusted Philipp Zabel
2025-09-26 11:39 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox