mbox series

[0/5] configure imx8 dsp DT node for rproc usage

Message ID 20240918182117.86221-1-laurentiumihalcea111@gmail.com
Headers show
Series configure imx8 dsp DT node for rproc usage | expand

Message

Laurentiu Mihalcea Sept. 18, 2024, 6:21 p.m. UTC
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.

Laurentiu Mihalcea (5):
  dt-bindings: dsp: fix power domain count
  arm64: dts: imx8qxp: configure dsp node for rproc usage
  arm64: dts: imx8qm: drop dsp node from audio_subsys bus
  arm64: dts: imx8qm: add node for VPU dsp
  arm64: dts: imx8qm: enable dsp node for rproc usage

 .../devicetree/bindings/dsp/fsl,dsp.yaml      | 62 +++++++++++++++----
 .../boot/dts/freescale/imx8-ss-audio.dtsi     | 20 +++---
 arch/arm64/boot/dts/freescale/imx8qm-mek.dts  | 27 ++++++++
 arch/arm64/boot/dts/freescale/imx8qm.dtsi     | 29 +++++++++
 arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 15 ++++-
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi    | 19 ++++++
 6 files changed, 147 insertions(+), 25 deletions(-)

Comments

Frank Li Sept. 18, 2024, 6:54 p.m. UTC | #1
On Wed, Sep 18, 2024 at 02:21:15PM -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. Luckily,
> there's no users for the dsp node so drop it.
>

Fix tag, and wrap at 75 chars.

the 'dsp' node from 'imx8-ss-audio.dtsi' is wrong in i.MX8QM because it is
in the VPU subsystem. So delete it.

Frank

> 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
>
Frank Li Sept. 18, 2024, 6:57 p.m. UTC | #2
On Wed, Sep 18, 2024 at 02:21:16PM -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>
> ---
>  arch/arm64/boot/dts/freescale/imx8qm.dtsi | 27 +++++++++++++++++++++++

why not add a file imx8qm-ss-vpu.dtsi to keep consistent with others.

Frank

>  1 file changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qm.dtsi b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> index f8b577ebdbef..ae0165a44dcd 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
> @@ -581,6 +581,33 @@ 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_IRQSTR_DSP>,
> +					<&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
>
Frank Li Sept. 18, 2024, 7 p.m. UTC | #3
On Wed, Sep 18, 2024 at 02:21:17PM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Set the status of the dsp node to "okay" and assign
> its reserved memory regions.

wrap at 75 chars.

Add dsp node and related reserved memory regions.

Frank

>
> 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..7ee69ce7b193 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: dsp@92400000 {
> +			reg = <0 0x92400000 0 0x1000000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0vring0: vdev0vring0@942f0000 {

'vdev0vring0' should be genernal name, such as 'memory'

> +			reg = <0 0x942f0000 0 0x8000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0vring1: vdev0vring1@942f8000 {
> +			reg = <0 0x942f8000 0 0x8000>;
> +			no-map;
> +		};
> +
> +		dsp_vdev0buffer: vdev0buffer@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
>
Frank Li Sept. 18, 2024, 7:02 p.m. UTC | #4
On Wed, Sep 18, 2024 at 02:21:14PM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Currently, the dsp node is configured for SOF usage, which
> is not the "default" case and should be done in a separate
> SOF DTS. As such, configure the dsp node for rproc usage,
> which is the "default" case.

why do you think SOF is not "default" case? where sof dts?

Frank

>
> This also includes the addition of the 2 optional
> power domains which may be required by some applications.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../boot/dts/freescale/imx8-ss-audio.dtsi     | 20 +++++++++----------
>  arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 15 +++++++++++++-
>  arch/arm64/boot/dts/freescale/imx8qxp.dtsi    | 19 ++++++++++++++++++
>  3 files changed, 42 insertions(+), 12 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..28970211dd67 100644
> --- a/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi
> @@ -431,22 +431,20 @@ 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_IRQSTR_DSP>,
> +				<&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";
>  	};
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> index 936ba5ecdcac..527933a3eb5c 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
> @@ -63,7 +63,8 @@ sound-wm8960 {
>  };
>
>  &dsp {
> -	memory-region = <&dsp_reserved>;
> +	memory-region = <&dsp_vdev0buffer>, <&dsp_vdev0vring0>,
> +			<&dsp_vdev0vring1>, <&dsp_reserved>;
>  	status = "okay";
>  };
>
> @@ -71,6 +72,18 @@ &dsp_reserved {
>  	status = "okay";
>  };
>
> +&dsp_vdev0buffer {
> +	status = "okay";
> +};
> +
> +&dsp_vdev0vring0 {
> +	status = "okay";
> +};
> +
> +&dsp_vdev0vring1 {
> +	status = "okay";
> +};
> +
>  &fec1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_fec1>;
> diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
> index 0313f295de2e..9522a65b3e22 100644
> --- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
> @@ -186,6 +186,25 @@ dsp_reserved: dsp@92400000 {
>  			status = "disabled";
>  		};
>
> +		dsp_vdev0vring0: vdev0vring0@942f0000 {
> +			reg = <0 0x942f0000 0 0x8000>;
> +			no-map;
> +			status = "disabled";
> +		};
> +
> +		dsp_vdev0vring1: vdev0vring1@942f8000 {
> +			reg = <0 0x942f8000 0 0x8000>;
> +			no-map;
> +			status = "disabled";
> +		};
> +
> +		dsp_vdev0buffer: vdev0buffer@94300000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0 0x94300000 0 0x100000>;
> +			no-map;
> +			status = "disabled";
> +		};
> +
>  		encoder_rpc: encoder-rpc@94400000 {
>  			reg = <0 0x94400000 0 0x700000>;
>  			no-map;
> --
> 2.34.1
>