configure imx8 dsp DT node for rproc usage
v4 cover configure imx8 dsp DT node for rproc usage
From: Laurentiu Mihalcea <[email protected]>
Configure/add imx8 dsp DT node for rproc usage. Additionally, fix number of power domains from the fsl,dsp.yaml binding.
---
Changes in v4:
- Added Krzysztof's and Frank's R-b's.
- Wrapped DT commit messages to 75 chars.
- Placed 'mbox-names' after 'mboxes' property in 'vpu_dsp' DT node.
- Link to v3: https://lore.kernel.org/lkml/[email protected]/
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/[email protected]/
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/[email protected]
---
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(-)
Signature · 1 line
2.34.1
PATCH v4 1/6 dt-bindings: dsp: fsl,dsp: fix power domain count
From: Laurentiu Mihalcea <[email protected]>
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.
--- .../devicetree/bindings/dsp/fsl,dsp.yaml | 31 +++++++++++++++---- .../bindings/mailbox/arm,mhuv2.yaml | 2 +- 2 files changed, 26 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/dsp/fsl,dsp.yaml +25 -6
@@ -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>;
Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml +1 -1
@@ -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
Signature · 1 line
2.34.1
PATCH v4 2/6 arm64: dts: imx8-ss-audio: configure dsp node for rproc usage
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
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.
--- .../boot/dts/freescale/imx8-ss-audio.dtsi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
arch/arm64/boot/dts/freescale/imx8-ss-audio.dtsi +8 -11
@@ -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"; };
Signature · 1 line
2.34.1
PATCH v4 3/6 arm64: dts: imx8qxp-mek: add dsp rproc-related mem regions
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
Add missing dsp rproc-related reserved memory regions and assign them to the 'dsp' node.
--- arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8qxp-mek.dts +20 -1
@@ -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"; };
Signature · 1 line
2.34.1
PATCH v4 4/6 arm64: dts: imx8qm: drop dsp node from audio_subsys bus
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
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.
--- arch/arm64/boot/dts/freescale/imx8qm.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/freescale/imx8qm.dtsi +2 -0
@@ -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;
Signature · 1 line
2.34.1
PATCH v4 5/6 arm64: dts: imx8qm: add node for VPU dsp
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
Add DT node for i.MX8QM's DSP, which is found in the VPU subsystem.
--- arch/arm64/boot/dts/freescale/imx8qm.dtsi | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/freescale/imx8qm.dtsi +26 -0
@@ -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>; + mboxes = <&lsio_mu13 0 0>, + <&lsio_mu13 1 0>, + <&lsio_mu13 3 0>; + mbox-names = "tx", "rx", "rxdb"; + firmware-name = "imx/dsp/hifi4.bin"; + status = "disabled"; + }; + }; + /* sorted in register address */ #include "imx8-ss-cm41.dtsi" #include "imx8-ss-audio.dtsi"
Signature · 1 line
2.34.1
PATCH v4 6/6 arm64: dts: imx8qm-mek: enable dsp node for rproc usage
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
Set the status of the dsp node to "okay" and assign and add its reserved memory regions.
--- arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/freescale/imx8qm-mek.dts +27 -0
@@ -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>;
Signature · 1 line
2.34.1
Quoted 4 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
Configure/add imx8 dsp DT node for rproc usage. Additionally, fix number of power domains from the fsl,dsp.yaml binding.
For the series:
Thanks,
Iulia
Quoted 59 lines
---
Changes in v4:
- Added Krzysztof's and Frank's R-b's.- Wrapped DT commit messages to 75 chars.
- Placed 'mbox-names' after 'mboxes' property in '
vpu_dsp' DT node.- Link to v3: https://lore.kernel.org/lkml/[email protected]/
Changes in v3:
- Moved handling ofIRQSTR_DSPPD 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/[email protected]/
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/[email protected]
---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 fromaudio_subsysbus
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(-)
Shawn Guo
AppliedQuoted 7 lines · Laurentiu Mihalcea
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 fromaudio_subsysbus
arm64: dts: imx8qm: add node for VPU dsp
arm64: dts: imx8qm-mek: enable dsp node for rproc usage
Applied all, thanks!