linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP
@ 2025-11-11 12:00 Laurentiu Mihalcea
  2025-11-11 12:00 ` [PATCH v3 1/3] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Laurentiu Mihalcea @ 2025-11-11 12:00 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Daniel Baluta
  Cc: Pengutronix Kernel Team, devicetree, linux-arm-kernel,
	linux-kernel

From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

This series is a combination of the previously dropped patches from [1]
and the config-related patch from [2]. This enables the usage of AIPSTZ5
on i.MX8MP-based platforms.

[1]: https://lore.kernel.org/lkml/20250610160152.1113930-1-laurentiumihalcea111@gmail.com/
[2]: https://lore.kernel.org/lkml/20250707234628.164151-1-laurentiumihalcea111@gmail.com/

---
Changes in v3:

* enable CONFIG_IMX_AIPSTZ as module instead of built-in.
* link to v2: https://lore.kernel.org/lkml/20251104150612.1874-1-laurentiumihalcea111@gmail.com/

Changes in v2:

* squash patch 3 into patch 4.
* rewrite commit message of patch 1 to state that this driver is used
  for the IMX8MP-EVK board.
* rewrite commit message of patch 2 to (hopefully) better describe
  why we need this change.
* link to v1: https://lore.kernel.org/lkml/20250821105634.1893-1-laurentiumihalcea111@gmail.com/
---

Laurentiu Mihalcea (3):
  arm64: defconfig: enable i.MX AIPSTZ driver
  arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
  arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'

 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 33 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     | 16 ++++++---
 arch/arm64/configs/defconfig                  |  1 +
 3 files changed, 46 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h

-- 
2.43.0



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

* [PATCH v3 1/3] arm64: defconfig: enable i.MX AIPSTZ driver
  2025-11-11 12:00 [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
@ 2025-11-11 12:00 ` Laurentiu Mihalcea
  2025-11-11 12:00 ` [PATCH v3 2/3] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Laurentiu Mihalcea @ 2025-11-11 12:00 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Daniel Baluta
  Cc: Pengutronix Kernel Team, devicetree, linux-arm-kernel,
	linux-kernel

From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Enable the i.MX AIPSTZ driver, which is used for i.MX8MP-based boards such
as NXP's IMX8MP-EVK.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 8d6a1bb1e03e..2db7d000aca7 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -271,6 +271,7 @@ CONFIG_GOOGLE_FIRMWARE=y
 CONFIG_GOOGLE_CBMEM=m
 CONFIG_GOOGLE_COREBOOT_TABLE=m
 CONFIG_EFI_CAPSULE_LOADER=y
+CONFIG_IMX_AIPSTZ=m
 CONFIG_IMX_SCU=y
 CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE=y
 CONFIG_QCOM_QSEECOM=y
-- 
2.43.0



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

* [PATCH v3 2/3] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
  2025-11-11 12:00 [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
  2025-11-11 12:00 ` [PATCH v3 1/3] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
@ 2025-11-11 12:00 ` Laurentiu Mihalcea
  2025-11-11 12:00 ` [PATCH v3 3/3] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
  2025-11-16 12:57 ` [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Laurentiu Mihalcea @ 2025-11-11 12:00 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Daniel Baluta
  Cc: Pengutronix Kernel Team, devicetree, linux-arm-kernel,
	linux-kernel

From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Change the programming model of the "aips5" node to allow configuring
the security-related registers exposed by the AIPSTZ5 bridge. Without
this, masters such as the HIFI4 DSP will have their access to the
peripherals connected to the bridge denied after power cycling the
AUDIOMIX domain.

Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 7ab321af9e15..426c11853d84 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1428,12 +1428,14 @@ eqos: ethernet@30bf0000 {
 			};
 		};
 
-		aips5: bus@30c00000 {
-			compatible = "fsl,aips-bus", "simple-bus";
-			reg = <0x30c00000 0x400000>;
+		aips5: bus@30df0000 {
+			compatible = "fsl,imx8mp-aipstz";
+			reg = <0x30df0000 0x10000>;
+			power-domains = <&pgc_audio>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges;
+			#access-controller-cells = <3>;
+			ranges = <0x30c00000 0x30c00000 0x400000>;
 
 			spba-bus@30c00000 {
 				compatible = "fsl,spba-bus", "simple-bus";
-- 
2.43.0



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

* [PATCH v3 3/3] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'
  2025-11-11 12:00 [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
  2025-11-11 12:00 ` [PATCH v3 1/3] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
  2025-11-11 12:00 ` [PATCH v3 2/3] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
@ 2025-11-11 12:00 ` Laurentiu Mihalcea
  2025-11-16 12:57 ` [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Laurentiu Mihalcea @ 2025-11-11 12:00 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Daniel Baluta
  Cc: Pengutronix Kernel Team, devicetree, linux-arm-kernel,
	linux-kernel

From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

The DSP needs to access peripherals on AIPSTZ5 (to communicate with
the AP using AUDIOMIX MU, for instance). To do so, the security-related
registers of the bridge have to be configured before the DSP is started.
Enforce a dependency on AIPSTZ5 by adding the 'access-controllers'
property to the 'dsp' node.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 33 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     |  6 ++++
 2 files changed, 39 insertions(+)
 create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h b/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h
new file mode 100644
index 000000000000..6481c484ca37
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright 2025 NXP
+ */
+
+#ifndef __IMX8MP_AIPSTZ_H
+#define __IMX8MP_AIPSTZ_H
+
+/* consumer type - master or peripheral */
+#define IMX8MP_AIPSTZ_MASTER		0x0
+#define IMX8MP_AIPSTZ_PERIPH		0x1
+
+/* master configuration options */
+#define IMX8MP_AIPSTZ_MPL		(1 << 0)
+#define IMX8MP_AIPSTZ_MTW		(1 << 1)
+#define IMX8MP_AIPSTZ_MTR		(1 << 2)
+#define IMX8MP_AIPSTZ_MBW		(1 << 3)
+
+/* peripheral configuration options */
+#define IMX8MP_AIPSTZ_TP		(1 << 0)
+#define IMX8MP_AIPSTZ_WP		(1 << 1)
+#define IMX8MP_AIPSTZ_SP		(1 << 2)
+#define IMX8MP_AIPSTZ_BW		(1 << 3)
+
+/* master ID definitions */
+#define IMX8MP_AIPSTZ_EDMA		0 /* AUDIOMIX EDMA */
+#define IMX8MP_AIPSTZ_CA53		1 /* Cortex-A53 cluster */
+#define IMX8MP_AIPSTZ_SDMA2		3 /* AUDIOMIX SDMA2 */
+#define IMX8MP_AIPSTZ_SDMA3		3 /* AUDIOMIX SDMA3 */
+#define IMX8MP_AIPSTZ_HIFI4		5 /* HIFI4 DSP */
+#define IMX8MP_AIPSTZ_CM7		6 /* Cortex-M7 */
+
+#endif /* __IMX8MP_AIPSTZ_H */
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 426c11853d84..2173b539dfb5 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -13,6 +13,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/thermal/thermal.h>
 
+#include "imx8mp-aipstz.h"
 #include "imx8mp-pinfunc.h"
 
 / {
@@ -2479,6 +2480,11 @@ dsp: dsp@3b6e8000 {
 			firmware-name = "imx/dsp/hifi4.bin";
 			resets = <&audio_blk_ctrl IMX8MP_AUDIOMIX_DSP_RUNSTALL>;
 			reset-names = "runstall";
+			access-controllers = <&aips5
+				IMX8MP_AIPSTZ_HIFI4
+				IMX8MP_AIPSTZ_MASTER
+				(IMX8MP_AIPSTZ_MPL | IMX8MP_AIPSTZ_MTW | IMX8MP_AIPSTZ_MTR)
+			>;
 			status = "disabled";
 		};
 	};
-- 
2.43.0



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

* Re: [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP
  2025-11-11 12:00 [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
                   ` (2 preceding siblings ...)
  2025-11-11 12:00 ` [PATCH v3 3/3] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
@ 2025-11-16 12:57 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2025-11-16 12:57 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Daniel Baluta,
	Pengutronix Kernel Team, devicetree, linux-arm-kernel,
	linux-kernel

On Tue, Nov 11, 2025 at 04:00:19AM -0800, Laurentiu Mihalcea wrote:
> Laurentiu Mihalcea (3):
>   arm64: defconfig: enable i.MX AIPSTZ driver
>   arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
>   arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'

Applied all, thanks!



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

end of thread, other threads:[~2025-11-16 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 12:00 [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
2025-11-11 12:00 ` [PATCH v3 1/3] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
2025-11-11 12:00 ` [PATCH v3 2/3] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
2025-11-11 12:00 ` [PATCH v3 3/3] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
2025-11-16 12:57 ` [PATCH v3 0/3] Switch to using AIPSTZ5 on i.MX8MP Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).