diff mbox series

[v4,1/3] ASoC: dt-bindings: support imx95's CM7 core

Message ID 20250211225808.3050-2-laurentiumihalcea111@gmail.com (mailing list archive)
State New
Headers show
Series add sof support on imx95 | expand

Commit Message

Laurentiu Mihalcea Feb. 11, 2025, 10:58 p.m. UTC
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Add binding for imx95's CM7 core, used for audio processing.
Additionally, introduce a common binding for NXP audio processors with
Sound Open Firmware (SOF) support.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 .../bindings/sound/fsl,imx95-cm7-sof.yaml     | 64 +++++++++++++++++++
 .../bindings/sound/fsl,sof-cpu.yaml           | 27 ++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml

Comments

Krzysztof Kozlowski Feb. 12, 2025, 7:09 a.m. UTC | #1
On Tue, Feb 11, 2025 at 05:58:06PM -0500, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Add binding for imx95's CM7 core, used for audio processing.
> Additionally, introduce a common binding for NXP audio processors with
> Sound Open Firmware (SOF) support.
> 
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../bindings/sound/fsl,imx95-cm7-sof.yaml     | 64 +++++++++++++++++++
>  .../bindings/sound/fsl,sof-cpu.yaml           | 27 ++++++++
>  2 files changed, 91 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml

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

Best regards,
Krzysztof
Marco Felsch Feb. 12, 2025, 9:36 a.m. UTC | #2
On 25-02-11, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Add binding for imx95's CM7 core, used for audio processing.
> Additionally, introduce a common binding for NXP audio processors with
> Sound Open Firmware (SOF) support.
> 
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../bindings/sound/fsl,imx95-cm7-sof.yaml     | 64 +++++++++++++++++++
>  .../bindings/sound/fsl,sof-cpu.yaml           | 27 ++++++++
>  2 files changed, 91 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
> new file mode 100644
> index 000000000000..f00ae3219e15
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
> @@ -0,0 +1,64 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/fsl,imx95-cm7-sof.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP imx95 CM7 core
> +
> +maintainers:
> +  - Daniel Baluta <daniel.baluta@nxp.com>
> +
> +description: NXP imx95 CM7 core used for audio processing
> +
> +properties:
> +  compatible:
> +    const: fsl,imx95-cm7-sof

Albeit Krzysztof already add his Reviewed-by, can I ask why we need to
add the -sof suffix instead of -audio or so? SOF is a software project
but you can clearly run different software on the audio-copro as well.

Regards,
  Marco

> +
> +  reg:
> +    maxItems: 1
> +
> +  reg-names:
> +    const: sram
> +
> +  memory-region:
> +    maxItems: 1
> +
> +  memory-region-names:
> +    const: dma
> +
> +  port:
> +    description: SAI3 port
> +    $ref: audio-graph-port.yaml#
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - memory-region
> +  - memory-region-names
> +  - port
> +
> +allOf:
> +  - $ref: fsl,sof-cpu.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    cm7-cpu@80000000 {
> +        compatible = "fsl,imx95-cm7-sof";
> +        reg = <0x80000000 0x6100000>;
> +        reg-names = "sram";
> +        mboxes = <&mu7 2 0>, <&mu7 2 1>, <&mu7 3 0>, <&mu7 3 1>;
> +        mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
> +        memory-region = <&adma_res>;
> +        memory-region-names = "dma";
> +        port {
> +            /* SAI3-WM8962 link */
> +            endpoint {
> +                remote-endpoint = <&wm8962_ep>;
> +            };
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml b/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml
> new file mode 100644
> index 000000000000..31863932dbc3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml
> @@ -0,0 +1,27 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/fsl,sof-cpu.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP audio processor common properties
> +
> +maintainers:
> +  - Daniel Baluta <daniel.baluta@nxp.com>
> +
> +properties:
> +  mboxes:
> +    maxItems: 4
> +
> +  mbox-names:
> +    items:
> +      - const: txdb0
> +      - const: txdb1
> +      - const: rxdb0
> +      - const: rxdb1
> +
> +required:
> +  - mboxes
> +  - mbox-names
> +
> +additionalProperties: true
> -- 
> 2.34.1
> 
> 
>
Daniel Baluta Feb. 12, 2025, 10:11 a.m. UTC | #3
On Wed, Feb 12, 2025 at 11:38 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
>
> On 25-02-11, Laurentiu Mihalcea wrote:
> > From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >
> > Add binding for imx95's CM7 core, used for audio processing.
> > Additionally, introduce a common binding for NXP audio processors with
> > Sound Open Firmware (SOF) support.
> >
> > Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > ---
> >  .../bindings/sound/fsl,imx95-cm7-sof.yaml     | 64 +++++++++++++++++++
> >  .../bindings/sound/fsl,sof-cpu.yaml           | 27 ++++++++
> >  2 files changed, 91 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
> >  create mode 100644 Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
> > new file mode 100644
> > index 000000000000..f00ae3219e15
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
> > @@ -0,0 +1,64 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/fsl,imx95-cm7-sof.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: NXP imx95 CM7 core
> > +
> > +maintainers:
> > +  - Daniel Baluta <daniel.baluta@nxp.com>
> > +
> > +description: NXP imx95 CM7 core used for audio processing
> > +
> > +properties:
> > +  compatible:
> > +    const: fsl,imx95-cm7-sof
>
> Albeit Krzysztof already add his Reviewed-by, can I ask why we need to
> add the -sof suffix instead of -audio or so? SOF is a software project
> but you can clearly run different software on the audio-copro as well.

Sure you can run a different software project on the audio DSP but
you will need a way to distinguish between the different projects.

There might be different mailbox, memory configurations. So you will  need
to invent another suffix specific to the new project.

We can make  const: fsl,imx95-cm7-audio as the one used with SOF
and think about a different name later for when another project will
want to use the DSP.
Mark Brown Feb. 12, 2025, 12:38 p.m. UTC | #4
On Wed, Feb 12, 2025 at 12:11:49PM +0200, Daniel Baluta wrote:
> On Wed, Feb 12, 2025 at 11:38 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
> > On 25-02-11, Laurentiu Mihalcea wrote:

> > > +    const: fsl,imx95-cm7-sof

> > Albeit Krzysztof already add his Reviewed-by, can I ask why we need to
> > add the -sof suffix instead of -audio or so? SOF is a software project
> > but you can clearly run different software on the audio-copro as well.

> Sure you can run a different software project on the audio DSP but
> you will need a way to distinguish between the different projects.

> There might be different mailbox, memory configurations. So you will  need
> to invent another suffix specific to the new project.

> We can make  const: fsl,imx95-cm7-audio as the one used with SOF
> and think about a different name later for when another project will
> want to use the DSP.

I think the point here was that the DT should stay the same even if the
DSP firwmare changes, just as how changing the main OS shouldn't affect
the DT.
Laurentiu Mihalcea Feb. 12, 2025, 7:36 p.m. UTC | #5
On 2/12/2025 2:38 PM, Mark Brown wrote:
> On Wed, Feb 12, 2025 at 12:11:49PM +0200, Daniel Baluta wrote:
>> On Wed, Feb 12, 2025 at 11:38 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
>>> On 25-02-11, Laurentiu Mihalcea wrote:
>>>> +    const: fsl,imx95-cm7-sof
>>> Albeit Krzysztof already add his Reviewed-by, can I ask why we need to
>>> add the -sof suffix instead of -audio or so? SOF is a software project
>>> but you can clearly run different software on the audio-copro as well.
>> Sure you can run a different software project on the audio DSP but
>> you will need a way to distinguish between the different projects.
>> There might be different mailbox, memory configurations. So you will  need
>> to invent another suffix specific to the new project.
>> We can make  const: fsl,imx95-cm7-audio as the one used with SOF
>> and think about a different name later for when another project will
>> want to use the DSP.
> I think the point here was that the DT should stay the same even if the
> DSP firwmare changes, just as how changing the main OS shouldn't affect
> the DT.

It's rather unfortunate but based on the experience from the 8 series
(imx8qm, imx8qxp, imx8mp), the programming model can differ quite
a bit (e.g: remoteproc vs SOF) even if the core is the same (i.e: DSP core).

The different programming models also required different DT configurations
(e.g: dif. mboxes as Daniel mentioned, some extra properties (i.e: reg-names), etc...)

The "-sof" suffix was chosen here instead of the more generic "-audio" (or whatever else
alternative) because the DT configuration is specific to SOF's programming model. Other
audio applications running on the same core may have dif. configurations (e.g: use
DTCM/ITCM for memory instead of DDR, dif. mbox count, etc...). I suppose this kind of thing
is bound to happen to some degree since the DT node doesn't just describe the CM7 core
(but, rather, it also encompasses information on the memory, mboxes, etc. used)
but perhaps I'm wrong?
Marco Felsch Feb. 13, 2025, 6:47 a.m. UTC | #6
Hi Laurentiu, Daniel,

On 25-02-12, Laurentiu Mihalcea wrote:
> 
> On 2/12/2025 2:38 PM, Mark Brown wrote:
> > On Wed, Feb 12, 2025 at 12:11:49PM +0200, Daniel Baluta wrote:
> >> On Wed, Feb 12, 2025 at 11:38 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
> >>> On 25-02-11, Laurentiu Mihalcea wrote:
> >>>> +    const: fsl,imx95-cm7-sof
> >>> Albeit Krzysztof already add his Reviewed-by, can I ask why we need to
> >>> add the -sof suffix instead of -audio or so? SOF is a software project
> >>> but you can clearly run different software on the audio-copro as well.
> >> Sure you can run a different software project on the audio DSP but
> >> you will need a way to distinguish between the different projects.
> >> There might be different mailbox, memory configurations. So you will  need
> >> to invent another suffix specific to the new project.
> >> We can make  const: fsl,imx95-cm7-audio as the one used with SOF
> >> and think about a different name later for when another project will
> >> want to use the DSP.
> > I think the point here was that the DT should stay the same even if the
> > DSP firwmare changes, just as how changing the main OS shouldn't affect
> > the DT.
> 
> It's rather unfortunate but based on the experience from the 8 series
> (imx8qm, imx8qxp, imx8mp), the programming model can differ quite
> a bit (e.g: remoteproc vs SOF) even if the core is the same (i.e: DSP core).
> 
> The different programming models also required different DT configurations
> (e.g: dif. mboxes as Daniel mentioned, some extra properties (i.e: reg-names), etc...)
> 
> The "-sof" suffix was chosen here instead of the more generic "-audio" (or whatever else
> alternative) because the DT configuration is specific to SOF's programming model. Other
> audio applications running on the same core may have dif. configurations (e.g: use
> DTCM/ITCM for memory instead of DDR, dif. mbox count, etc...). I suppose this kind of thing
> is bound to happen to some degree since the DT node doesn't just describe the CM7 core
> (but, rather, it also encompasses information on the memory, mboxes, etc. used)
> but perhaps I'm wrong?

Time will tell if there will be any other user except for SOF for the
DSP but and this is what I wanted to point out: the DTS should abstract
the HW. IMHO The CM7-Audio node should contain all properties required
to turn power and reset the core (e.g. clocks, reset, pm-domains). I get
your point regarding different configs but please have a look at
mt8183-kukui.dtsi. Here the rpmsg config is a subnode of the actual
system-control-proc. This makes much more sense to me since the HW part
is part of the generic core-node and all the software config goes into a
separate subnode.

Regards,
  Marco
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
new file mode 100644
index 000000000000..f00ae3219e15
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml
@@ -0,0 +1,64 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/fsl,imx95-cm7-sof.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP imx95 CM7 core
+
+maintainers:
+  - Daniel Baluta <daniel.baluta@nxp.com>
+
+description: NXP imx95 CM7 core used for audio processing
+
+properties:
+  compatible:
+    const: fsl,imx95-cm7-sof
+
+  reg:
+    maxItems: 1
+
+  reg-names:
+    const: sram
+
+  memory-region:
+    maxItems: 1
+
+  memory-region-names:
+    const: dma
+
+  port:
+    description: SAI3 port
+    $ref: audio-graph-port.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - memory-region
+  - memory-region-names
+  - port
+
+allOf:
+  - $ref: fsl,sof-cpu.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    cm7-cpu@80000000 {
+        compatible = "fsl,imx95-cm7-sof";
+        reg = <0x80000000 0x6100000>;
+        reg-names = "sram";
+        mboxes = <&mu7 2 0>, <&mu7 2 1>, <&mu7 3 0>, <&mu7 3 1>;
+        mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
+        memory-region = <&adma_res>;
+        memory-region-names = "dma";
+        port {
+            /* SAI3-WM8962 link */
+            endpoint {
+                remote-endpoint = <&wm8962_ep>;
+            };
+        };
+    };
diff --git a/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml b/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml
new file mode 100644
index 000000000000..31863932dbc3
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml
@@ -0,0 +1,27 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/fsl,sof-cpu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP audio processor common properties
+
+maintainers:
+  - Daniel Baluta <daniel.baluta@nxp.com>
+
+properties:
+  mboxes:
+    maxItems: 4
+
+  mbox-names:
+    items:
+      - const: txdb0
+      - const: txdb1
+      - const: rxdb0
+      - const: rxdb1
+
+required:
+  - mboxes
+  - mbox-names
+
+additionalProperties: true