devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage
@ 2024-10-11 15:04 Laurentiu Mihalcea
  2024-10-11 15:04 ` [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count Laurentiu Mihalcea
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

Configure/add imx8 dsp DT node for rproc usage.
Additionally, fix number of power domains from the fsl,dsp.yaml binding.

---
Changes in v3:
- Moved handling of IRQSTR_DSP PD to fiwmare side. Now QXP has 2
mandatory PDs, while QM has 4.

- Dropped the optional PDs. All PDs are now mandatory.

- Dropped Linux implementation details from the binding's commit
message.

- Renamed reserved memory nodes to generic "memory".

- Split QXP board and soc DT changes into dif. patches.

- Dropped comments about SOF and rewrote the commit message of the
patch that modifies the 'dsp' node from 'imx8-ss-audio.dtsi'. Hopefully,
should be more clear why the change is done.

- Squashed arm,mhuv2 binding changes.

- Link to v2: https://lore.kernel.org/lkml/20240925232008.205802-1-laurentiumihalcea111@gmail.com/

Changes in v2:
- Modify subject of commit changing fsl,dsp.yaml to state that the change
  is for fsl,dsp.yaml

- Fix issue with arm,mhuv2 binding found by Rob's bot caused by the
  changes to fsl,dsp binding

- Improve formatting of commit messages

- Link to v1: https://lore.kernel.org/lkml/20240918182117.86221-1-laurentiumihalcea111@gmail.com
---

Laurentiu Mihalcea (6):
  dt-bindings: dsp: fsl,dsp: fix power domain count
  arm64: dts: imx8-ss-audio: configure dsp node for rproc usage
  arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions
  arm64: dts: imx8qm: drop dsp node from audio_subsys bus
  arm64: dts: imx8qm: add node for VPU dsp
  arm64: dts: imx8qm-mek: enable dsp node for rproc usage

 .../devicetree/bindings/dsp/fsl,dsp.yaml      | 31 +++++++++++++++----
 .../bindings/mailbox/arm,mhuv2.yaml           |  2 +-
 .../boot/dts/freescale/imx8-ss-audio.dtsi     | 19 +++++-------
 arch/arm64/boot/dts/freescale/imx8qm-mek.dts  | 27 ++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8qm.dtsi     | 28 +++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 21 ++++++++++++-
 6 files changed, 109 insertions(+), 19 deletions(-)

-- 
2.34.1


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

* [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count
  2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
@ 2024-10-11 15:04 ` Laurentiu Mihalcea
  2024-10-14  7:14   ` Krzysztof Kozlowski
  2024-10-11 15:04 ` [PATCH v3 2/6] arm64: dts: imx8-ss-audio: configure dsp node for rproc usage Laurentiu Mihalcea
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

Per the current binding, QM/QXP DSPs are supposed to have 4
power domains, while the rest just 1. For QM/QXP, the 4 power
domains are: DSP, DSP_RAM, MU13A, MU13B.

First off, drop MU13A from the count as its already attached
to lsio_mu13. This decreases the count to 3.

Secondly, drop DSP and DSP_RAM from the count for QXP. These
are already attached to the DSP's LPCGs.

Thirdly, a new power domain is required for DSP-SCU communication
(MU2A). With this in mind, the number of required power domains
for QXP is 2 (MU2A, MU13B), while for QM it's 4 (MU13B, DSP,
DSP_RAM, MU2A).

Update the fsl,dsp binding to reflect all of this information.
Since the arm,mhuv2 binding has an example node using the
fsl,imx8qxp-dsp compatible, remove two of the extra PDs to
align with the required power domain count.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 .../devicetree/bindings/dsp/fsl,dsp.yaml      | 31 +++++++++++++++----
 .../bindings/mailbox/arm,mhuv2.yaml           |  2 +-
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
index 9af40da5688e..ab93ffd3d2e5 100644
--- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
@@ -99,14 +99,35 @@ allOf:
           contains:
             enum:
               - fsl,imx8qxp-dsp
-              - fsl,imx8qm-dsp
               - fsl,imx8qxp-hifi4
+    then:
+      properties:
+        power-domains:
+          minItems: 2
+          maxItems: 2
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx8qm-dsp
               - fsl,imx8qm-hifi4
     then:
       properties:
         power-domains:
           minItems: 4
-    else:
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx8mp-dsp
+              - fsl,imx8mp-hifi4
+              - fsl,imx8ulp-dsp
+              - fsl,imx8ulp-hifi4
+    then:
       properties:
         power-domains:
           maxItems: 1
@@ -157,10 +178,8 @@ examples:
                  <&adma_lpcg IMX_ADMA_LPCG_OCRAM_IPG_CLK>,
                  <&adma_lpcg IMX_ADMA_LPCG_DSP_CORE_CLK>;
         clock-names = "ipg", "ocram", "core";
-        power-domains = <&pd IMX_SC_R_MU_13A>,
-                        <&pd IMX_SC_R_MU_13B>,
-                        <&pd IMX_SC_R_DSP>,
-                        <&pd IMX_SC_R_DSP_RAM>;
+        power-domains = <&pd IMX_SC_R_MU_13B>,
+                        <&pd IMX_SC_R_MU_2A>;
         mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
         mboxes = <&lsio_mu13 2 0>, <&lsio_mu13 2 1>, <&lsio_mu13 3 0>, <&lsio_mu13 3 1>;
         memory-region = <&dsp_reserved>;
diff --git a/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
index a4f1fe63659a..02f06314d85f 100644
--- a/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
+++ b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
@@ -197,7 +197,7 @@ examples:
             reg = <0 0x596e8000 0 0x88000>;
             clocks = <&adma_lpcg 0>, <&adma_lpcg 1>, <&adma_lpcg 2>;
             clock-names = "ipg", "ocram", "core";
-            power-domains = <&pd 0>, <&pd 1>, <&pd 2>, <&pd 3>;
+            power-domains = <&pd 0>, <&pd 1>;
             mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
             mboxes = <&mhu_tx 2 0>, //data-transfer protocol with 5 windows, mhu-tx
                      <&mhu_tx 3 0>, //data-transfer protocol with 7 windows, mhu-tx
-- 
2.34.1


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

* [PATCH v3 2/6] arm64: dts: imx8-ss-audio: configure dsp node for rproc usage
  2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
  2024-10-11 15:04 ` [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count Laurentiu Mihalcea
@ 2024-10-11 15:04 ` Laurentiu Mihalcea
  2024-10-11 15:50   ` Frank Li
  2024-10-11 15:04 ` [PATCH v3 3/6] arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions Laurentiu Mihalcea
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

The 'dsp' node is currently configured for running an
audio firmware. Since the firmware requires that some
audio-related IPs be disabled in Linux, this will clash
with the configurations from the imx8 board DTs
(i.e: imx8qm-mek, imx8qxp-mek, etc...), thus making the
dsp unusable (since the firmware won't function properly).

To avoid this issue, configure the 'dsp' node for rproc.
This way, users will be able to use the dsp alongside the
board-level audio configuration as long as the firmware
doesn't need the audio IPs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 .../boot/dts/freescale/imx8-ss-audio.dtsi     | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi b/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
index ff5df0fed9e9..a60ebb718789 100644
--- a/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
@@ -431,22 +431,19 @@ dsp_ram_lpcg: clock-controller@59590000 {
 	};
 
 	dsp: dsp@596e8000 {
-		compatible = "fsl,imx8qxp-dsp";
+		compatible = "fsl,imx8qxp-hifi4";
 		reg = <0x596e8000 0x88000>;
 		clocks = <&dsp_lpcg IMX_LPCG_CLK_5>,
 			 <&dsp_ram_lpcg IMX_LPCG_CLK_4>,
 			 <&dsp_lpcg IMX_LPCG_CLK_7>;
 		clock-names = "ipg", "ocram", "core";
-		power-domains = <&pd IMX_SC_R_MU_13A>,
-			<&pd IMX_SC_R_MU_13B>,
-			<&pd IMX_SC_R_DSP>,
-			<&pd IMX_SC_R_DSP_RAM>;
-		mbox-names = "txdb0", "txdb1",
-			"rxdb0", "rxdb1";
-		mboxes = <&lsio_mu13 2 0>,
-			<&lsio_mu13 2 1>,
-			<&lsio_mu13 3 0>,
-			<&lsio_mu13 3 1>;
+		power-domains = <&pd IMX_SC_R_MU_13B>,
+				<&pd IMX_SC_R_MU_2A>;
+		mbox-names = "tx", "rx", "rxdb";
+		mboxes = <&lsio_mu13 0 0>,
+			 <&lsio_mu13 1 0>,
+			 <&lsio_mu13 3 0>;
+		firmware-name = "imx/dsp/hifi4.bin";
 		status = "disabled";
 	};
 
-- 
2.34.1


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

* [PATCH v3 3/6] arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions
  2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
  2024-10-11 15:04 ` [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count Laurentiu Mihalcea
  2024-10-11 15:04 ` [PATCH v3 2/6] arm64: dts: imx8-ss-audio: configure dsp node for rproc usage Laurentiu Mihalcea
@ 2024-10-11 15:04 ` Laurentiu Mihalcea
  2024-10-11 15:51   ` Frank Li
  2024-10-11 15:04 ` [PATCH v3 4/6] arm64: dts: imx8qm: drop dsp node from audio_subsys bus Laurentiu Mihalcea
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

Add missing dsp rproc-related reserved memory regions and
assign them to the 'dsp' node.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
index 936ba5ecdcac..4c4e71d39bac 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
@@ -21,6 +21,24 @@ memory@80000000 {
 		reg = <0x00000000 0x80000000 0 0x40000000>;
 	};
 
+	reserved-memory {
+		dsp_vdev0vring0: memory@942f0000 {
+			reg = <0 0x942f0000 0 0x8000>;
+			no-map;
+		};
+
+		dsp_vdev0vring1: memory@942f8000 {
+			reg = <0 0x942f8000 0 0x8000>;
+			no-map;
+		};
+
+		dsp_vdev0buffer: memory@94300000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x94300000 0 0x100000>;
+			no-map;
+		};
+	};
+
 	reg_usdhc2_vmmc: usdhc2-vmmc {
 		compatible = "regulator-fixed";
 		regulator-name = "SD1_SPWR";
@@ -63,7 +81,8 @@ sound-wm8960 {
 };
 
 &dsp {
-	memory-region = <&dsp_reserved>;
+	memory-region = <&dsp_vdev0buffer>, <&dsp_vdev0vring0>,
+			<&dsp_vdev0vring1>, <&dsp_reserved>;
 	status = "okay";
 };
 
-- 
2.34.1


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

* [PATCH v3 4/6] arm64: dts: imx8qm: drop dsp node from audio_subsys bus
  2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
                   ` (2 preceding siblings ...)
  2024-10-11 15:04 ` [PATCH v3 3/6] arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions Laurentiu Mihalcea
@ 2024-10-11 15:04 ` Laurentiu Mihalcea
  2024-10-11 15:51   ` Frank Li
  2024-10-11 15:04 ` [PATCH v3 5/6] arm64: dts: imx8qm: add node for VPU dsp Laurentiu Mihalcea
  2024-10-11 15:04 ` [PATCH v3 6/6] arm64: dts: imx8qm-mek: enable dsp node for rproc usage Laurentiu Mihalcea
  5 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

On i.MX8QM, the DSP is in the VPU subsystem, which means that using the
'dsp' node from 'imx8-ss-audio.dtsi' is wrong as it's placed under the
wrong bus. As such, drop it.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qm.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8qm.dtsi b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
index 3ee6e2869e3c..f8b577ebdbef 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
@@ -603,3 +603,5 @@ mipi_pll_div2_clk: clock-controller-mipi-div2-pll {
 #include "imx8qm-ss-audio.dtsi"
 #include "imx8qm-ss-lvds.dtsi"
 #include "imx8qm-ss-mipi.dtsi"
+
+/delete-node/ &dsp;
-- 
2.34.1


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

* [PATCH v3 5/6] arm64: dts: imx8qm: add node for VPU dsp
  2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
                   ` (3 preceding siblings ...)
  2024-10-11 15:04 ` [PATCH v3 4/6] arm64: dts: imx8qm: drop dsp node from audio_subsys bus Laurentiu Mihalcea
@ 2024-10-11 15:04 ` Laurentiu Mihalcea
  2024-10-11 15:55   ` Frank Li
  2024-10-11 15:04 ` [PATCH v3 6/6] arm64: dts: imx8qm-mek: enable dsp node for rproc usage Laurentiu Mihalcea
  5 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

Add DT node for i.MX8QM's DSP, which is found in the VPU subsystem.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qm.dtsi | 26 +++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8qm.dtsi b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
index f8b577ebdbef..74857a94bcd3 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
@@ -581,6 +581,32 @@ mipi_pll_div2_clk: clock-controller-mipi-div2-pll {
 		clock-output-names = "mipi_pll_div2_clk";
 	};
 
+	vpu_subsys_dsp: bus@55000000 {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x55000000 0x0 0x55000000 0x1000000>;
+
+		vpu_dsp: dsp@556e8000 {
+			compatible = "fsl,imx8qm-hifi4";
+			reg = <0x556e8000 0x88000>;
+			clocks = <&clk_dummy>,
+				 <&clk_dummy>,
+				 <&clk_dummy>;
+			clock-names = "ipg", "ocram", "core";
+			power-domains = <&pd IMX_SC_R_MU_13B>,
+					<&pd IMX_SC_R_DSP>,
+					<&pd IMX_SC_R_DSP_RAM>,
+					<&pd IMX_SC_R_MU_2A>;
+			mbox-names = "tx", "rx", "rxdb";
+			mboxes = <&lsio_mu13 0 0>,
+				 <&lsio_mu13 1 0>,
+				 <&lsio_mu13 3 0>;
+			firmware-name = "imx/dsp/hifi4.bin";
+			status = "disabled";
+		};
+	};
+
 	/* sorted in register address */
 	#include "imx8-ss-cm41.dtsi"
 	#include "imx8-ss-audio.dtsi"
-- 
2.34.1


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

* [PATCH v3 6/6] arm64: dts: imx8qm-mek: enable dsp node for rproc usage
  2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
                   ` (4 preceding siblings ...)
  2024-10-11 15:04 ` [PATCH v3 5/6] arm64: dts: imx8qm: add node for VPU dsp Laurentiu Mihalcea
@ 2024-10-11 15:04 ` Laurentiu Mihalcea
  2024-10-11 15:56   ` Frank Li
  5 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2024-10-11 15:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li
  Cc: devicetree, linux-kernel, imx, linux-arm-kernel

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

Set the status of the dsp node to "okay" and assign and add
its reserved memory regions.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 27 ++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
index 62203eed6a6c..d51da3b6b3aa 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
@@ -92,6 +92,27 @@ vdevbuffer: memory@90400000 {
 			reg = <0 0x90400000 0 0x100000>;
 			no-map;
 		};
+
+		dsp_reserved: memory@92400000 {
+			reg = <0 0x92400000 0 0x1000000>;
+			no-map;
+		};
+
+		dsp_vdev0vring0: memory@942f0000 {
+			reg = <0 0x942f0000 0 0x8000>;
+			no-map;
+		};
+
+		dsp_vdev0vring1: memory@942f8000 {
+			reg = <0 0x942f8000 0 0x8000>;
+			no-map;
+		};
+
+		dsp_vdev0buffer: memory@94300000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x94300000 0 0x100000>;
+			no-map;
+		};
 	};
 
 	lvds_backlight0: backlight-lvds0 {
@@ -640,6 +661,12 @@ &sai7 {
 	status = "okay";
 };
 
+&vpu_dsp {
+	memory-region = <&dsp_vdev0buffer>, <&dsp_vdev0vring0>,
+			<&dsp_vdev0vring1>, <&dsp_reserved>;
+	status = "okay";
+};
+
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
-- 
2.34.1


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

* Re: [PATCH v3 2/6] arm64: dts: imx8-ss-audio: configure dsp node for rproc usage
  2024-10-11 15:04 ` [PATCH v3 2/6] arm64: dts: imx8-ss-audio: configure dsp node for rproc usage Laurentiu Mihalcea
@ 2024-10-11 15:50   ` Frank Li
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Li @ 2024-10-11 15:50 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, devicetree, linux-kernel, imx,
	linux-arm-kernel

On Fri, Oct 11, 2024 at 11:04:35AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> The 'dsp' node is currently configured for running an
> audio firmware. Since the firmware requires that some
> audio-related IPs be disabled in Linux, this will clash
> with the configurations from the imx8 board DTs
> (i.e: imx8qm-mek, imx8qxp-mek, etc...), thus making the
> dsp unusable (since the firmware won't function properly).
>
> To avoid this issue, configure the 'dsp' node for rproc.
> This way, users will be able to use the dsp alongside the
> board-level audio configuration as long as the firmware
> doesn't need the audio IPs.

Nit:
 wrap at 75 char

Frank

>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../boot/dts/freescale/imx8-ss-audio.dtsi     | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi b/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
> index ff5df0fed9e9..a60ebb718789 100644
> --- a/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
> @@ -431,22 +431,19 @@ dsp_ram_lpcg: clock-controller@59590000 {
>  	};
>
>  	dsp: dsp@596e8000 {
> -		compatible = "fsl,imx8qxp-dsp";
> +		compatible = "fsl,imx8qxp-hifi4";
>  		reg = <0x596e8000 0x88000>;
>  		clocks = <&dsp_lpcg IMX_LPCG_CLK_5>,
>  			 <&dsp_ram_lpcg IMX_LPCG_CLK_4>,
>  			 <&dsp_lpcg IMX_LPCG_CLK_7>;
>  		clock-names = "ipg", "ocram", "core";
> -		power-domains = <&pd IMX_SC_R_MU_13A>,
> -			<&pd IMX_SC_R_MU_13B>,
> -			<&pd IMX_SC_R_DSP>,
> -			<&pd IMX_SC_R_DSP_RAM>;
> -		mbox-names = "txdb0", "txdb1",
> -			"rxdb0", "rxdb1";
> -		mboxes = <&lsio_mu13 2 0>,
> -			<&lsio_mu13 2 1>,
> -			<&lsio_mu13 3 0>,
> -			<&lsio_mu13 3 1>;
> +		power-domains = <&pd IMX_SC_R_MU_13B>,
> +				<&pd IMX_SC_R_MU_2A>;
> +		mbox-names = "tx", "rx", "rxdb";
> +		mboxes = <&lsio_mu13 0 0>,
> +			 <&lsio_mu13 1 0>,
> +			 <&lsio_mu13 3 0>;
> +		firmware-name = "imx/dsp/hifi4.bin";
>  		status = "disabled";
>  	};
>
> --
> 2.34.1
>

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

* Re: [PATCH v3 3/6] arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions
  2024-10-11 15:04 ` [PATCH v3 3/6] arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions Laurentiu Mihalcea
@ 2024-10-11 15:51   ` Frank Li
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Li @ 2024-10-11 15:51 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, devicetree, linux-kernel, imx,
	linux-arm-kernel

On Fri, Oct 11, 2024 at 11:04:36AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Add missing dsp rproc-related reserved memory regions and
> assign them to the 'dsp' node.

Nit: wrap at 75 char

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 21 ++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> index 936ba5ecdcac..4c4e71d39bac 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> @@ -21,6 +21,24 @@ memory@80000000 {
>  		reg = <0x00000000 0x80000000 0 0x40000000>;
>  	};
>
> +	reserved-memory {
> +		dsp_vdev0vring0: memory@942f0000 {
> +			reg = <0 0x942f0000 0 0x8000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0vring1: memory@942f8000 {
> +			reg = <0 0x942f8000 0 0x8000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0buffer: memory@94300000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0 0x94300000 0 0x100000>;
> +			no-map;
> +		};
> +	};
> +
>  	reg_usdhc2_vmmc: usdhc2-vmmc {
>  		compatible = "regulator-fixed";
>  		regulator-name = "SD1_SPWR";
> @@ -63,7 +81,8 @@ sound-wm8960 {
>  };
>
>  &dsp {
> -	memory-region = <&dsp_reserved>;
> +	memory-region = <&dsp_vdev0buffer>, <&dsp_vdev0vring0>,
> +			<&dsp_vdev0vring1>, <&dsp_reserved>;
>  	status = "okay";
>  };
>
> --
> 2.34.1
>

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

* Re: [PATCH v3 4/6] arm64: dts: imx8qm: drop dsp node from audio_subsys bus
  2024-10-11 15:04 ` [PATCH v3 4/6] arm64: dts: imx8qm: drop dsp node from audio_subsys bus Laurentiu Mihalcea
@ 2024-10-11 15:51   ` Frank Li
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Li @ 2024-10-11 15:51 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, devicetree, linux-kernel, imx,
	linux-arm-kernel

On Fri, Oct 11, 2024 at 11:04:37AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> On i.MX8QM, the DSP is in the VPU subsystem, which means that using the
> 'dsp' node from 'imx8-ss-audio.dtsi' is wrong as it's placed under the
> wrong bus. As such, drop it.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8qm.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qm.dtsi b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> index 3ee6e2869e3c..f8b577ebdbef 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> @@ -603,3 +603,5 @@ mipi_pll_div2_clk: clock-controller-mipi-div2-pll {
>  #include "imx8qm-ss-audio.dtsi"
>  #include "imx8qm-ss-lvds.dtsi"
>  #include "imx8qm-ss-mipi.dtsi"
> +
> +/delete-node/ &dsp;
> --
> 2.34.1
>

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

* Re: [PATCH v3 5/6] arm64: dts: imx8qm: add node for VPU dsp
  2024-10-11 15:04 ` [PATCH v3 5/6] arm64: dts: imx8qm: add node for VPU dsp Laurentiu Mihalcea
@ 2024-10-11 15:55   ` Frank Li
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Li @ 2024-10-11 15:55 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, devicetree, linux-kernel, imx,
	linux-arm-kernel

On Fri, Oct 11, 2024 at 11:04:38AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Add DT node for i.MX8QM's DSP, which is found in the VPU subsystem.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---

with below nit.

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  arch/arm64/boot/dts/freescale/imx8qm.dtsi | 26 +++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qm.dtsi b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> index f8b577ebdbef..74857a94bcd3 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> @@ -581,6 +581,32 @@ mipi_pll_div2_clk: clock-controller-mipi-div2-pll {
>  		clock-output-names = "mipi_pll_div2_clk";
>  	};
>
> +	vpu_subsys_dsp: bus@55000000 {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges = <0x55000000 0x0 0x55000000 0x1000000>;
> +
> +		vpu_dsp: dsp@556e8000 {
> +			compatible = "fsl,imx8qm-hifi4";
> +			reg = <0x556e8000 0x88000>;
> +			clocks = <&clk_dummy>,
> +				 <&clk_dummy>,
> +				 <&clk_dummy>;
> +			clock-names = "ipg", "ocram", "core";
> +			power-domains = <&pd IMX_SC_R_MU_13B>,
> +					<&pd IMX_SC_R_DSP>,
> +					<&pd IMX_SC_R_DSP_RAM>,
> +					<&pd IMX_SC_R_MU_2A>;
> +			mbox-names = "tx", "rx", "rxdb";
> +			mboxes = <&lsio_mu13 0 0>,
> +				 <&lsio_mu13 1 0>,
> +				 <&lsio_mu13 3 0>;

Nit: keep consisent with clock-names and clocks,
mbox-names after mboxes

> +			firmware-name = "imx/dsp/hifi4.bin";
> +			status = "disabled";
> +		};
> +	};
> +
>  	/* sorted in register address */
>  	#include "imx8-ss-cm41.dtsi"
>  	#include "imx8-ss-audio.dtsi"
> --
> 2.34.1
>

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

* Re: [PATCH v3 6/6] arm64: dts: imx8qm-mek: enable dsp node for rproc usage
  2024-10-11 15:04 ` [PATCH v3 6/6] arm64: dts: imx8qm-mek: enable dsp node for rproc usage Laurentiu Mihalcea
@ 2024-10-11 15:56   ` Frank Li
  0 siblings, 0 replies; 13+ messages in thread
From: Frank Li @ 2024-10-11 15:56 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, devicetree, linux-kernel, imx,
	linux-arm-kernel

On Fri, Oct 11, 2024 at 11:04:39AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Set the status of the dsp node to "okay" and assign and add
> its reserved memory regions.

nit: wrap to 75 chars.

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 27 ++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> index 62203eed6a6c..d51da3b6b3aa 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
> @@ -92,6 +92,27 @@ vdevbuffer: memory@90400000 {
>  			reg = <0 0x90400000 0 0x100000>;
>  			no-map;
>  		};
> +
> +		dsp_reserved: memory@92400000 {
> +			reg = <0 0x92400000 0 0x1000000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0vring0: memory@942f0000 {
> +			reg = <0 0x942f0000 0 0x8000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0vring1: memory@942f8000 {
> +			reg = <0 0x942f8000 0 0x8000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0buffer: memory@94300000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0 0x94300000 0 0x100000>;
> +			no-map;
> +		};
>  	};
>
>  	lvds_backlight0: backlight-lvds0 {
> @@ -640,6 +661,12 @@ &sai7 {
>  	status = "okay";
>  };
>
> +&vpu_dsp {
> +	memory-region = <&dsp_vdev0buffer>, <&dsp_vdev0vring0>,
> +			<&dsp_vdev0vring1>, <&dsp_reserved>;
> +	status = "okay";
> +};
> +
>  &iomuxc {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_hog>;
> --
> 2.34.1
>

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

* Re: [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count
  2024-10-11 15:04 ` [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count Laurentiu Mihalcea
@ 2024-10-14  7:14   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-14  7:14 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Daniel Baluta, Shengjiu Wang, Iuliana Prodan,
	Tushar Khandelwal, Viresh Kumar, Frank Li, devicetree,
	linux-kernel, imx, linux-arm-kernel

On Fri, Oct 11, 2024 at 11:04:34AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Per the current binding, QM/QXP DSPs are supposed to have 4
> power domains, while the rest just 1. For QM/QXP, the 4 power
> domains are: DSP, DSP_RAM, MU13A, MU13B.
> 
> First off, drop MU13A from the count as its already attached
> to lsio_mu13. This decreases the count to 3.
> 
> Secondly, drop DSP and DSP_RAM from the count for QXP. These
> are already attached to the DSP's LPCGs.
> 
> Thirdly, a new power domain is required for DSP-SCU communication
> (MU2A). With this in mind, the number of required power domains
> for QXP is 2 (MU2A, MU13B), while for QM it's 4 (MU13B, DSP,
> DSP_RAM, MU2A).
> 
> Update the fsl,dsp binding to reflect all of this information.
> Since the arm,mhuv2 binding has an example node using the
> fsl,imx8qxp-dsp compatible, remove two of the extra PDs to
> align with the required power domain count.
> 
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

end of thread, other threads:[~2024-10-14  7:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 15:04 [PATCH v3 0/6] configure imx8 dsp DT node for rproc usage Laurentiu Mihalcea
2024-10-11 15:04 ` [PATCH v3 1/6] dt-bindings: dsp: fsl,dsp: fix power domain count Laurentiu Mihalcea
2024-10-14  7:14   ` Krzysztof Kozlowski
2024-10-11 15:04 ` [PATCH v3 2/6] arm64: dts: imx8-ss-audio: configure dsp node for rproc usage Laurentiu Mihalcea
2024-10-11 15:50   ` Frank Li
2024-10-11 15:04 ` [PATCH v3 3/6] arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions Laurentiu Mihalcea
2024-10-11 15:51   ` Frank Li
2024-10-11 15:04 ` [PATCH v3 4/6] arm64: dts: imx8qm: drop dsp node from audio_subsys bus Laurentiu Mihalcea
2024-10-11 15:51   ` Frank Li
2024-10-11 15:04 ` [PATCH v3 5/6] arm64: dts: imx8qm: add node for VPU dsp Laurentiu Mihalcea
2024-10-11 15:55   ` Frank Li
2024-10-11 15:04 ` [PATCH v3 6/6] arm64: dts: imx8qm-mek: enable dsp node for rproc usage Laurentiu Mihalcea
2024-10-11 15:56   ` Frank Li

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