[PATCH 2/2] dt-bindings: dsp: mediatek: add mt8196 dsp document

hailong.fan posted 2 patches 9 months ago
There is a newer version of this series
[PATCH 2/2] dt-bindings: dsp: mediatek: add mt8196 dsp document
Posted by hailong.fan 9 months ago
This patch adds mt8196 dsp document. The dsp is used for Sound Open
Firmware driver node. It includes registers,  clocks, memory regions,
and mailbox for dsp.

Signed-off-by: hailong.fan <hailong.fan@mediatek.com>
---
 .../bindings/dsp/mediatek,mt8196-dsp.yaml     | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml

diff --git a/Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
new file mode 100644
index 000000000000..62bcd97bd0f4
--- /dev/null
+++ b/Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dsp/mediatek,mt8196-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek mt8196 DSP core
+
+maintainers:
+  - Hailong Fan <hailong.fan@mediatek.com>
+
+description: |
+  Some boards from mt8196 contain a DSP core used for
+  advanced pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8196-dsp
+
+  reg:
+    items:
+      - description: Address and size of the DSP Cfg registers
+      - description: Address and size of the DSP SRAM
+      - description: Address and size of the DSP secure registers
+      - description: Address and size of the DSP bus registers
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: sram
+      - const: sec
+      - const: bus
+
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel
+      - const: clk26m
+      - const: adsppll
+
+  power-domains:
+    maxItems: 1
+
+  mboxes:
+    items:
+      - description: mailbox for receiving audio DSP requests.
+      - description: mailbox for transmitting requests to audio DSP.
+
+  mbox-names:
+    items:
+      - const: rx
+      - const: tx
+
+  memory-region:
+    items:
+      - description: dma buffer between host and DSP.
+      - description: DSP system memory.
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - clocks
+  - clock-names
+  - power-domains
+  - mbox-names
+  - mboxes
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt8196-clk.h>
+    #include <dt-bindings/power/mt8196-power.h>
+    adsp: adsp@1a000000 {
+        compatible = "mediatek,mt8196-dsp";
+        reg = <0x1a000000 0x5000>,
+              <0x1a210000 0x80000>,
+              <0x1a345000 0x300>,
+              <0x1a00f000 0x1000>;
+        reg-names = "cfg", "sram", "sec", "bus";
+        power-domains = <&scpsys MT8196_POWER_DOMAIN_ADSP_TOP_DORMANT>;
+        clocks = <&cksys_clk CLK_CK_ADSP_SEL>,
+                 <&cksys_clk CLK_CK_TCK_26M_MX9>,
+                 <&cksys_clk CLK_CK_ADSPPLL>;
+        clock-names = "adsp_sel",
+                      "clk26m",
+                      "adsppll";
+        mbox-names = "rx", "tx";
+        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
+    };
-- 
2.45.2
Re: [PATCH 2/2] dt-bindings: dsp: mediatek: add mt8196 dsp document
Posted by Krzysztof Kozlowski 9 months ago
On Thu, Mar 20, 2025 at 11:17:25AM +0800, hailong.fan wrote:
> This patch adds mt8196 dsp document. The dsp is used for Sound Open
> Firmware driver node. It includes registers,  clocks, memory regions,
> and mailbox for dsp.
> 
> Signed-off-by: hailong.fan <hailong.fan@mediatek.com>

Don't use login as full name, but proper Latin-alphabet transcription or
original name in UTF.

This cannot be tested due to dependency, so limited review.

> ---
>  .../bindings/dsp/mediatek,mt8196-dsp.yaml     | 96 +++++++++++++++++++

Don't grow dsp directory. Either this is remoteproc or some sound
component, so place it accordingly.

>  1 file changed, 96 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
> 
> diff --git a/Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
> new file mode 100644
> index 000000000000..62bcd97bd0f4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
> @@ -0,0 +1,96 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/dsp/mediatek,mt8196-dsp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Mediatek mt8196 DSP core
> +
> +maintainers:
> +  - Hailong Fan <hailong.fan@mediatek.com>
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  Some boards from mt8196 contain a DSP core used for

Boards or MT8196? If boards, how is this related to SoC in the first
place? Thus wrong compatible.

> +  advanced pre- and post- audio processing.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt8196-dsp

If this is part of the SoC, then wrong description.

> +
> +  reg:
> +    items:
> +      - description: Address and size of the DSP Cfg registers

s/Address and size of the//

Write concise and accurate description. This cannot be anything else, so
no need to state obvious.

> +      - description: Address and size of the DSP SRAM
> +      - description: Address and size of the DSP secure registers
> +      - description: Address and size of the DSP bus registers
> +
> +  reg-names:
> +    items:
> +      - const: cfg
> +      - const: sram
> +      - const: sec
> +      - const: bus
> +
> +  clocks:
> +    items:
> +      - description: mux for dsp clock
> +      - description: 26M clock
> +      - description: ADSP PLL clock
> +
> +  clock-names:
> +    items:
> +      - const: adsp_sel
> +      - const: clk26m
> +      - const: adsppll
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  mboxes:
> +    items:
> +      - description: mailbox for receiving audio DSP requests.
> +      - description: mailbox for transmitting requests to audio DSP.
> +
> +  mbox-names:
> +    items:
> +      - const: rx
> +      - const: tx
> +
> +  memory-region:
> +    items:
> +      - description: dma buffer between host and DSP.
> +      - description: DSP system memory.
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - clocks
> +  - clock-names
> +  - power-domains
> +  - mbox-names
> +  - mboxes
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/mt8196-clk.h>
> +    #include <dt-bindings/power/mt8196-power.h>
> +    adsp: adsp@1a000000 {

Drop unused label

> +        compatible = "mediatek,mt8196-dsp";
> +        reg = <0x1a000000 0x5000>,
> +              <0x1a210000 0x80000>,
> +              <0x1a345000 0x300>,
> +              <0x1a00f000 0x1000>;
> +        reg-names = "cfg", "sram", "sec", "bus";
> +        power-domains = <&scpsys MT8196_POWER_DOMAIN_ADSP_TOP_DORMANT>;
> +        clocks = <&cksys_clk CLK_CK_ADSP_SEL>,
> +                 <&cksys_clk CLK_CK_TCK_26M_MX9>,
> +                 <&cksys_clk CLK_CK_ADSPPLL>;
> +        clock-names = "adsp_sel",
> +                      "clk26m",
> +                      "adsppll";
> +        mbox-names = "rx", "tx";
> +        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;

Reverse order of mboxes and mbox-names properties. xxx-names follows the
xxx.

Best regards,
Krzysztof
Re: [PATCH 2/2] dt-bindings: dsp: mediatek: add mt8196 dsp document
Posted by Hailong Fan (范海龙) 9 months ago
On Thu, 2025-03-20 at 08:49 +0100, Krzysztof Kozlowski wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Thu, Mar 20, 2025 at 11:17:25AM +0800, hailong.fan wrote:
> > This patch adds mt8196 dsp document. The dsp is used for Sound Open
> > Firmware driver node. It includes registers,  clocks, memory
> > regions,
> > and mailbox for dsp.
> > 
> > Signed-off-by: hailong.fan <hailong.fan@mediatek.com>
> 
> Don't use login as full name, but proper Latin-alphabet transcription
> or
> original name in UTF.
> 
> This cannot be tested due to dependency, so limited review.
Will fix in v2, thx.
> 
> > ---
> >  .../bindings/dsp/mediatek,mt8196-dsp.yaml     | 96
> > +++++++++++++++++++
> 
> Don't grow dsp directory. Either this is remoteproc or some sound
> component, so place it accordingly.
This is a reference to the approach used in a previous MediaTek
project:

https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/dsp
Do we need to move all the files under the DSP directory to the sound
directory?
> 
> >  1 file changed, 96 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/dsp/mediatek,mt8196-
> > dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8196-
> > dsp.yaml
> > new file mode 100644
> > index 000000000000..62bcd97bd0f4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/dsp/mediatek,mt8196-
> > dsp.yaml
> > @@ -0,0 +1,96 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: 
> > https://urldefense.com/v3/__http://devicetree.org/schemas/dsp/mediatek,mt8196-dsp.yaml*__;Iw!!CTRNKA9wMg0ARbw!j4BSCn2ciKI2gdoQgLFTB0YUey5u6HieRa6NvWQvaF7X_mEEyHhCIslrFYGBOYEbWLaE2J5kDORlxRI$
> > +$schema: 
> > https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!j4BSCn2ciKI2gdoQgLFTB0YUey5u6HieRa6NvWQvaF7X_mEEyHhCIslrFYGBOYEbWLaE2J5k8T-XN8U$
> > +
> > +title: Mediatek mt8196 DSP core
> > +
> > +maintainers:
> > +  - Hailong Fan <hailong.fan@mediatek.com>
> > +
> > +description: |
> 
> Do not need '|' unless you need to preserve formatting.
Will update in v2, thx.
> 
> > +  Some boards from mt8196 contain a DSP core used for
> 
> Boards or MT8196? If boards, how is this related to SoC in the first
> place? Thus wrong compatible.
> 
> > +  advanced pre- and post- audio processing.
> > +
> > +properties:
> > +  compatible:
> > +    const: mediatek,mt8196-dsp
> 
> If this is part of the SoC, then wrong description.
Sure, it will be updated in V2 as follows: 
MediaTek mt8196 SoC contains a DSP core used for
advanced pre- and post- audio processing.
> 
> > +
> > +  reg:
> > +    items:
> > +      - description: Address and size of the DSP Cfg registers
> 
> s/Address and size of the//
> 
> Write concise and accurate description. This cannot be anything else,
> so
> no need to state obvious.
Will update in v2, thx.
> 
> > +      - description: Address and size of the DSP SRAM
> > +      - description: Address and size of the DSP secure registers
> > +      - description: Address and size of the DSP bus registers
> > +
> > +  reg-names:
> > +    items:
> > +      - const: cfg
> > +      - const: sram
> > +      - const: sec
> > +      - const: bus
> > +
> > +  clocks:
> > +    items:
> > +      - description: mux for dsp clock
> > +      - description: 26M clock
> > +      - description: ADSP PLL clock
> > +
> > +  clock-names:
> > +    items:
> > +      - const: adsp_sel
> > +      - const: clk26m
> > +      - const: adsppll
> > +
> > +  power-domains:
> > +    maxItems: 1
> > +
> > +  mboxes:
> > +    items:
> > +      - description: mailbox for receiving audio DSP requests.
> > +      - description: mailbox for transmitting requests to audio
> > DSP.
> > +
> > +  mbox-names:
> > +    items:
> > +      - const: rx
> > +      - const: tx
> > +
> > +  memory-region:
> > +    items:
> > +      - description: dma buffer between host and DSP.
> > +      - description: DSP system memory.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - reg-names
> > +  - clocks
> > +  - clock-names
> > +  - power-domains
> > +  - mbox-names
> > +  - mboxes
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/mt8196-clk.h>
> > +    #include <dt-bindings/power/mt8196-power.h>
> > +    adsp: adsp@1a000000 {
> 
> Drop unused label
Will update in v2, thx.
> 
> > +        compatible = "mediatek,mt8196-dsp";
> > +        reg = <0x1a000000 0x5000>,
> > +              <0x1a210000 0x80000>,
> > +              <0x1a345000 0x300>,
> > +              <0x1a00f000 0x1000>;
> > +        reg-names = "cfg", "sram", "sec", "bus";
> > +        power-domains = <&scpsys
> > MT8196_POWER_DOMAIN_ADSP_TOP_DORMANT>;
> > +        clocks = <&cksys_clk CLK_CK_ADSP_SEL>,
> > +                 <&cksys_clk CLK_CK_TCK_26M_MX9>,
> > +                 <&cksys_clk CLK_CK_ADSPPLL>;
> > +        clock-names = "adsp_sel",
> > +                      "clk26m",
> > +                      "adsppll";
> > +        mbox-names = "rx", "tx";
> > +        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
> 
> Reverse order of mboxes and mbox-names properties. xxx-names follows
> the
> xxx.
Will update in v2, thx.
> 
> Best regards,
> Krzysztof
> M
Re: [PATCH 2/2] dt-bindings: dsp: mediatek: add mt8196 dsp document
Posted by Rob Herring (Arm) 9 months ago
On Thu, 20 Mar 2025 11:17:25 +0800, hailong.fan wrote:
> This patch adds mt8196 dsp document. The dsp is used for Sound Open
> Firmware driver node. It includes registers,  clocks, memory regions,
> and mailbox for dsp.
> 
> Signed-off-by: hailong.fan <hailong.fan@mediatek.com>
> ---
>  .../bindings/dsp/mediatek,mt8196-dsp.yaml     | 96 +++++++++++++++++++
>  1 file changed, 96 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.example.dts:18:18: fatal error: dt-bindings/clock/mt8196-clk.h: No such file or directory
   18 |         #include <dt-bindings/clock/mt8196-clk.h>
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.dtbs:131: Documentation/devicetree/bindings/dsp/mediatek,mt8196-dsp.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1522: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250320031753.13669-3-hailong.fan@mediatek.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.