linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Switch to using AIPSTZ5 on i.MX8MP
@ 2025-08-21 10:56 Laurentiu Mihalcea
  2025-08-21 10:56 ` [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-21 10:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, 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/

Laurentiu Mihalcea (4):
  arm64: defconfig: enable i.MX AIPSTZ driver
  arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
  arm64: dts: imx8mp: add aipstz-related definitions
  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.34.1


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

* [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver
  2025-08-21 10:56 [PATCH 0/4] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
@ 2025-08-21 10:56 ` Laurentiu Mihalcea
  2025-08-24 11:27   ` Krzysztof Kozlowski
  2025-08-21 10:56 ` [PATCH 2/4] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-21 10:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

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

Enable the config (CONFIG_IMX_AIPSTZ) for the i.MX AIPSTZ driver, which
is required for platforms using the AIPSTZ bridge (e.g. i.MX8MP).

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 667c4859ecc3..23ba01d37263 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -264,6 +264,7 @@ CONFIG_GOOGLE_FIRMWARE=y
 CONFIG_GOOGLE_CBMEM=m
 CONFIG_GOOGLE_COREBOOT_TABLE=m
 CONFIG_EFI_CAPSULE_LOADER=y
+CONFIG_IMX_AIPSTZ=y
 CONFIG_IMX_SCU=y
 CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE=y
 CONFIG_QCOM_QSEECOM=y
-- 
2.34.1


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

* [PATCH 2/4] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
  2025-08-21 10:56 [PATCH 0/4] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
  2025-08-21 10:56 ` [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
@ 2025-08-21 10:56 ` Laurentiu Mihalcea
  2025-08-24 11:29   ` Krzysztof Kozlowski
  2025-08-21 10:56 ` [PATCH 3/4] arm64: dts: imx8mp: add aipstz-related definitions Laurentiu Mihalcea
  2025-08-21 10:56 ` [PATCH 4/4] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
  3 siblings, 1 reply; 8+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-21 10:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

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

AIPS5 is actually AIPSTZ5 as it offers some security-related
configurations. Since these configurations need to be applied before
accessing any of the peripherals on the bus, it's better to make AIPSTZ5
be their parent instead of keeping AIPS5 and adding a child node for
AIPSTZ5. Also, because of the security configurations, the address space
of the bus has to be changed to that of the configuration registers.

Finally, since AIPSTZ5 belongs to the AUDIOMIX power domain, add the
missing 'power-domains' property. The domain needs to be powered on before
attempting to configure the security-related registers.

The DT node name is not changed to avoid potential issues with DTs in
which this node is referenced.

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>
Reviewed-by: Frank Li <Frank.Li@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 bb24dba7338e..b62bb821cf61 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1396,12 +1396,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.34.1


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

* [PATCH 3/4] arm64: dts: imx8mp: add aipstz-related definitions
  2025-08-21 10:56 [PATCH 0/4] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
  2025-08-21 10:56 ` [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
  2025-08-21 10:56 ` [PATCH 2/4] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
@ 2025-08-21 10:56 ` Laurentiu Mihalcea
  2025-08-24 11:29   ` Krzysztof Kozlowski
  2025-08-21 10:56 ` [PATCH 4/4] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
  3 siblings, 1 reply; 8+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-21 10:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

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

Add header file with AIPSTZ-related definitions: consumer types,
master/peripheral configuration bits, and master ID definitions.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 33 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     |  1 +
 2 files changed, 34 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 b62bb821cf61..afcd8c785cfd 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"
 
 / {
-- 
2.34.1


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

* [PATCH 4/4] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'
  2025-08-21 10:56 [PATCH 0/4] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
                   ` (2 preceding siblings ...)
  2025-08-21 10:56 ` [PATCH 3/4] arm64: dts: imx8mp: add aipstz-related definitions Laurentiu Mihalcea
@ 2025-08-21 10:56 ` Laurentiu Mihalcea
  3 siblings, 0 replies; 8+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-21 10:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Fabio Estevam, Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, 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.

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

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index afcd8c785cfd..841d155685ee 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -2437,6 +2437,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.34.1


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

* Re: [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver
  2025-08-21 10:56 ` [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
@ 2025-08-24 11:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-24 11:27 UTC (permalink / raw)
  To: Laurentiu Mihalcea, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

On 21/08/2025 12:56, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Enable the config (CONFIG_IMX_AIPSTZ) for the i.MX AIPSTZ driver, which
> is required for platforms using the AIPSTZ bridge (e.g. i.MX8MP).

Qualcomm i.MX8MP? You are changing wide defconfig.

Which boards use it?


Best regards,
Krzysztof

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

* Re: [PATCH 2/4] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
  2025-08-21 10:56 ` [PATCH 2/4] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
@ 2025-08-24 11:29   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-24 11:29 UTC (permalink / raw)
  To: Laurentiu Mihalcea, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

On 21/08/2025 12:56, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> AIPS5 is actually AIPSTZ5 as it offers some security-related
> configurations. Since these configurations need to be applied before
> accessing any of the peripherals on the bus, it's better to make AIPSTZ5
> be their parent instead of keeping AIPS5 and adding a child node for
> AIPSTZ5. Also, because of the security configurations, the address space
> of the bus has to be changed to that of the configuration registers.
> 
> Finally, since AIPSTZ5 belongs to the AUDIOMIX power domain, add the
> missing 'power-domains' property. The domain needs to be powered on before
> attempting to configure the security-related registers.
> 
> The DT node name is not changed to avoid potential issues with DTs in
> which this node is referenced.
> 
> 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>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>

Where did it happen?

> ---
>  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 bb24dba7338e..b62bb821cf61 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -1396,12 +1396,14 @@ eqos: ethernet@30bf0000 {
>  			};
>  		};
>  
> -		aips5: bus@30c00000 {
> -			compatible = "fsl,aips-bus", "simple-bus";


This breaks all the users. I understood explanation as "it is better",
no real reasons.

No, you cannot do that.

Best regards,
Krzysztof

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

* Re: [PATCH 3/4] arm64: dts: imx8mp: add aipstz-related definitions
  2025-08-21 10:56 ` [PATCH 3/4] arm64: dts: imx8mp: add aipstz-related definitions Laurentiu Mihalcea
@ 2025-08-24 11:29   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-24 11:29 UTC (permalink / raw)
  To: Laurentiu Mihalcea, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

On 21/08/2025 12:56, Laurentiu Mihalcea wrote:
> +#endif /* __IMX8MP_AIPSTZ_H */
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index b62bb821cf61..afcd8c785cfd 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"

Completely unused define. Your patchset is not organized in logical chunks.

>  #include "imx8mp-pinfunc.h"
>  
>  / {


Best regards,
Krzysztof

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

end of thread, other threads:[~2025-08-24 11:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 10:56 [PATCH 0/4] Switch to using AIPSTZ5 on i.MX8MP Laurentiu Mihalcea
2025-08-21 10:56 ` [PATCH 1/4] arm64: defconfig: enable i.MX AIPSTZ driver Laurentiu Mihalcea
2025-08-24 11:27   ` Krzysztof Kozlowski
2025-08-21 10:56 ` [PATCH 2/4] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
2025-08-24 11:29   ` Krzysztof Kozlowski
2025-08-21 10:56 ` [PATCH 3/4] arm64: dts: imx8mp: add aipstz-related definitions Laurentiu Mihalcea
2025-08-24 11:29   ` Krzysztof Kozlowski
2025-08-21 10:56 ` [PATCH 4/4] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea

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).