Skip to contentSkip to conversation

dt-bindings: dsp: mediatek: add mt8186 dsp document

PATCH In review Tinghan Shen 4 participants 12 messages Apr 22, 2022 – Jun 6, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: dsp: mediatek: add mt8186 dsp document

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---

This patch depends on MT8186 clock bindings.
https://lore.kernel.org/all/[email protected]/

---
 .../bindings/dsp/mediatek,mt8186-dsp.yaml     | 93 +++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +93 -0
new file mode 100644
index 000000000000..00a79e880895
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dsp/mediatek,mt8186-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek mt8186 DSP core
+
+maintainers:
+  - Tinghan Shen <[email protected]>
+
+description: |
+  MediaTek mt8186 SoC contains a DSP core used for
+  advanced pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8186-dsp
+
+  reg:
+    items:
+      - description: Address and size of the DSP config 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 audio dsp clock
+      - description: mux for audio dsp local bus
+
+  clock-names:
+    items:
+      - const: audiodsp_sel
+      - const: adsp_bus_sel
+
+  power-domains:
+    maxItems: 1
+
+  mboxes:
+    items:
+      - description: ipc reply between host and audio DSP.
+      - description: ipc request between host and audio DSP.
+
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1
+
+  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/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/mt8186-clk.h>
+    dsp@10680000 {
+        compatible = "mediatek,mt8186-dsp";
+        reg = <0x10680000 0x2000>,
+              <0x10800000 0x100000>,
+              <0x1068b000 0x100>,
+              <0x1068f000 0x1000>;
+        reg-names = "cfg", "sram", "sec", "bus";
+        clocks = <&topckgen CLK_TOP_AUDIODSP>,
+                 <&topckgen CLK_TOP_ADSP_BUS>;
+        clock-names = "audiodsp_sel",
+                      "adsp_bus_sel";
+        power-domains = <&spm 6>;
+        mbox-names = "mbox0", "mbox1";
+        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
+    };
Signature · 1 line
2.18.0
#1 lore raw
Quoted 9 lines · Tinghan Shen

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---

This patch depends on MT8186 clock bindings.

https://lore.kernel.org/all/[email protected]/

Quoted 16 lines
---
 .../bindings/dsp/mediatek,mt8186-dsp.yaml     | 93
+++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml

(quoted diff) +0 -0

dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8186- dsp.yaml
new file mode 100644
index 000000000000..00a79e880895

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +7 -0
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dsp/mediatek,mt8186-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek mt8186 DSP core

Hello Tinghan,

Please use MediaTek.
Thanks.

BRs,
Rex

Quoted 86 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +86 -0
+
+maintainers:
+  - Tinghan Shen <[email protected]>
+
+description: |
+  MediaTek mt8186 SoC contains a DSP core used for
+  advanced pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8186-dsp
+
+  reg:
+    items:
+      - description: Address and size of the DSP config 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 audio dsp clock
+      - description: mux for audio dsp local bus
+
+  clock-names:
+    items:
+      - const: audiodsp_sel
+      - const: adsp_bus_sel
+
+  power-domains:
+    maxItems: 1
+
+  mboxes:
+    items:
+      - description: ipc reply between host and audio DSP.
+      - description: ipc request between host and audio DSP.
+
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1
+
+  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/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/mt8186-clk.h>
+    dsp@10680000 {
+        compatible = "mediatek,mt8186-dsp";
+        reg = <0x10680000 0x2000>,
+              <0x10800000 0x100000>,
+              <0x1068b000 0x100>,
+              <0x1068f000 0x1000>;
+        reg-names = "cfg", "sram", "sec", "bus";
+        clocks = <&topckgen CLK_TOP_AUDIODSP>,
+                 <&topckgen CLK_TOP_ADSP_BUS>;
+        clock-names = "audiodsp_sel",
+                      "adsp_bus_sel";
+        power-domains = <&spm 6>;
+        mbox-names = "mbox0", "mbox1";
+        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
+    };
#2 lore raw

Hi Rex,

Quoted 38 lines · Rex-BC Chen
Quoted 9 lines · Tinghan Shen

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---

This patch depends on MT8186 clock bindings.

https://lore.kernel.org/all/[email protected]/

Quoted 16 lines
---
 .../bindings/dsp/mediatek,mt8186-dsp.yaml     | 93
+++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml

(quoted diff) +0 -0

dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8186- dsp.yaml
new file mode 100644
index 000000000000..00a79e880895

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +7 -0
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dsp/mediatek,mt8186-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek mt8186 DSP core

Hello Tinghan,

Quoted 1 line

Please use MediaTek.

Ok. I'll update it at next version.

Thanks,
TingHan

Quoted 93 lines

Thanks.

BRs,
Rex

Quoted 86 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +86 -0
+
+maintainers:
+  - Tinghan Shen <[email protected]>
+
+description: |
+  MediaTek mt8186 SoC contains a DSP core used for
+  advanced pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8186-dsp
+
+  reg:
+    items:
+      - description: Address and size of the DSP config 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 audio dsp clock
+      - description: mux for audio dsp local bus
+
+  clock-names:
+    items:
+      - const: audiodsp_sel
+      - const: adsp_bus_sel
+
+  power-domains:
+    maxItems: 1
+
+  mboxes:
+    items:
+      - description: ipc reply between host and audio DSP.
+      - description: ipc request between host and audio DSP.
+
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1
+
+  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/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/mt8186-clk.h>
+    dsp@10680000 {
+        compatible = "mediatek,mt8186-dsp";
+        reg = <0x10680000 0x2000>,
+              <0x10800000 0x100000>,
+              <0x1068b000 0x100>,
+              <0x1068f000 0x1000>;
+        reg-names = "cfg", "sram", "sec", "bus";
+        clocks = <&topckgen CLK_TOP_AUDIODSP>,
+                 <&topckgen CLK_TOP_ADSP_BUS>;
+        clock-names = "audiodsp_sel",
+                      "adsp_bus_sel";
+        power-domains = <&spm 6>;
+        mbox-names = "mbox0", "mbox1";
+        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
+    };
#3 lore raw
In reply to Tinghan Shen
Quoted 53 lines · Tinghan Shen

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---

This patch depends on MT8186 clock bindings.
https://lore.kernel.org/all/[email protected]/

---
 .../bindings/dsp/mediatek,mt8186-dsp.yaml     | 93 +++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +32 -0
new file mode 100644
index 000000000000..00a79e880895
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dsp/mediatek,mt8186-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek mt8186 DSP core
+
+maintainers:
+  - Tinghan Shen <[email protected]>
+
+description: |
+  MediaTek mt8186 SoC contains a DSP core used for
+  advanced pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8186-dsp
+
+  reg:
+    items:
+      - description: Address and size of the DSP config 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

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +10 -0
+
+  clocks:
+    items:
+      - description: mux for audio dsp clock
+      - description: mux for audio dsp local bus
+
+  clock-names:
+    items:
+      - const: audiodsp_sel
+      - const: adsp_bus_sel

What does the "sel" stands for? Maybe just skip the "_sel" suffixes?

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 55

Quoted 13 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +13 -0
+
+  power-domains:
+    maxItems: 1
+
+  mboxes:
+    items:
+      - description: ipc reply between host and audio DSP.
+      - description: ipc request between host and audio DSP.
+
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1

These should be rather some meaningful names, e.g. "rx" and "tx".

Quoted 12 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +12 -0
+
+  memory-region:
+    items:
+      - description: dma buffer between host and DSP.
+      - description: DSP system memory.
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - clocks
+  - clock-names

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 77

Quoted 10 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +10 -0
+  - power-domains
+  - mbox-names
+  - mboxes
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>

You do not use these headers.

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 79

Quoted 2 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +2 -0
+    #include <dt-bindings/clock/mt8186-clk.h>
+    dsp@10680000 {

Best regards,
Krzysztof

#4 lore raw

Hi Krzysztof,

Thanks for your review and sorry for late response.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · Tinghan Shen

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---

This patch depends on MT8186 clock bindings.

https://urldefense.com/v3/__https://lore.kernel.org/all/[email protected]/__;!!CTRNKA9wMg0ARbw!xNJkwM9Z-raJLjgIoriOnjolphzSHqpnATbd3XC7wU7iaUns8gqGB2omSOkliuoDf3g$

Quoted 26 lines
Quoted 26 lines
 

---
 .../bindings/dsp/mediatek,mt8186-dsp.yaml     | 93 +++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +4 -0
new file mode 100644
index 000000000000..00a79e880895
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: 

https://urldefense.com/v3/__http://devicetree.org/schemas/dsp/mediatek,mt8186-dsp.yaml*__;Iw!!CTRNKA9wMg0ARbw!xNJkwM9Z-raJLjgIoriOnjolphzSHqpnATbd3XC7wU7iaUns8gqGB2omSOklA_t3nMM$

+$schema:
https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!xNJkwM9Z-raJLjgIoriOnjolphzSHqpnATbd3XC7wU7iaUns8gqGB2omSOkl3OXmT2U$

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +3 -0
+
+title: Mediatek mt8186 DSP core
+

(...snip...)

Quoted 7 lines

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 42

Quoted 5 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +5 -0
+
+  clock-names:
+    items:
+      - const: audiodsp_sel
+      - const: adsp_bus_sel

What does the "sel" stands for? Maybe just skip the "_sel" suffixes?

No problem. I'll remove '_sel' in next version.

Quoted 16 lines
Quoted 4 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +3 -0
+
+  power-domains:
+    maxItems: 1

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 55

Quoted 10 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +10 -0
+
+  mboxes:
+    items:
+      - description: ipc reply between host and audio DSP.
+      - description: ipc request between host and audio DSP.
+
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1

These should be rather some meaningful names, e.g. "rx" and "tx".

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c

	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +16 -0
+
+  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
+
Quoted 8 lines

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 77

Quoted 6 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +6 -0
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>

You do not use these headers.

Ok. I'll remove them at next version.

Thanks,
TingHan

Quoted 8 lines

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 79

Quoted 3 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +2 -0
+    #include <dt-bindings/clock/mt8186-clk.h>
+    dsp@10680000 {

Best regards,
Krzysztof

#5 lore raw
Quoted 13 lines · Tinghan Shen
Quoted 6 lines

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 55

Quoted 4 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +4 -0
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1

These should be rather some meaningful names, e.g. "rx" and "tx".

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c

Quoted 7 lines
	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

It is a bit confusing... how did that driver got merged recently without bindings? Why bindings are separate?

The bindings always come together in one patchset with the driver implementing them. Bindings are though a separate patch, yet still followed by the driver which uses them.

I do not see any compatibles in that driver, which suggests there is no other binding using it. If that's correct, then you need to change the driver.

Best regards,
Krzysztof

#6 lore raw

Hi Krzysztof,

Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Tinghan Shen
Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +4 -0
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

These should be rather some meaningful names, e.g. "rx" and "tx".

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c__;!!CTRNKA9wMg0ARbw!1TmempNkQhC5QuLBhyfWo_AC97MoLuWipsGV-LPaW9RKNPheU7Bgc-eboNi1JA1nC5I$

Quoted 13 lines
Quoted 9 lines
 

	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

It is a bit confusing... how did that driver got merged recently without bindings? Why bindings are separate?

Quoted 8 lines

The bindings always come together in one patchset with the driver implementing them. Bindings are though a separate patch, yet still followed by the driver which uses them.

I do not see any compatibles in that driver, which suggests there is no other binding using it. If that's correct, then you need to change the driver.

The mtk-adsp-ipc driver's sole function is to encapsulate the operations of mailbox framework from adsp ipc users. The mtk-adsp-ipc is not defined in the dts file and we don't need it to be defined. The creation of mtk-adsp-ipc device is requested by adsp ipc users via the use of 'platform_device_register_data'[1].

the driver implemented the mailbox framework is 'mtk-adsp-mailbox'[2]. it has corresponding hardwares and a yaml file[3] to describe it.

I'll send a patch to change the mbox name at next version. It's better to have some meaningful names as you said.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=e0100bfd383c7d994d2e957e85ca56a5fe5a3f43
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=af2dfa96c52d042df5deb29fb6e32d3ff4d76a61
[3]
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=afa092e1e8824363d3174fef329c034445c111d5

Thanks,
TingHan

#7 lore raw
Quoted 39 lines · Tinghan Shen

Hi Krzysztof,

Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Tinghan Shen
Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +4 -0
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

These should be rather some meaningful names, e.g. "rx" and "tx".

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c__;!!CTRNKA9wMg0ARbw!1TmempNkQhC5QuLBhyfWo_AC97MoLuWipsGV-LPaW9RKNPheU7Bgc-eboNi1JA1nC5I$

Quoted 13 lines
Quoted 9 lines
 

	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

It is a bit confusing... how did that driver got merged recently without bindings? Why bindings are separate?

Quoted 8 lines

The bindings always come together in one patchset with the driver implementing them. Bindings are though a separate patch, yet still followed by the driver which uses them.

I do not see any compatibles in that driver, which suggests there is no other binding using it. If that's correct, then you need to change the driver.

Quoted 7 lines

The mtk-adsp-ipc driver's sole function is to encapsulate the operations of mailbox framework from adsp ipc users. The mtk-adsp-ipc is not defined in the dts file and we don't need it to be defined. The creation of mtk-adsp-ipc device is requested by adsp ipc users via the use of 'platform_device_register_data'[1].

the driver implemented the mailbox framework is 'mtk-adsp-mailbox'[2]. it has corresponding hardwares and a yaml file[3] to describe it.

I don't understand how is this related. We talk here about the mbox-names for this bindings file. You replied, that these bindings are already used by something, but now you say that they are not? So why do you need to change anything in any driver?

Simple question - do the bindings here "add mt8186 dsp document" are used by any specific Linux driver already?

Best regards,
Krzysztof

#8 lore raw

Hi Krzysztof,

Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Tinghan Shen

Hi Krzysztof,

Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Tinghan Shen
Quoted 6 lines

Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml line 55

Quoted 4 lines
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml new file +4 -0
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1

These should be rather some meaningful names, e.g. "rx" and "tx".

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c__;!!CTRNKA9wMg0ARbw!1TmempNkQhC5QuLBhyfWo_AC97MoLuWipsGV-LPaW9RKNPheU7Bgc-eboNi1JA1nC5I$

Quoted 30 lines
Quoted 22 lines
Quoted 13 lines
Quoted 9 lines
 

	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

It is a bit confusing... how did that driver got merged recently without bindings? Why bindings are separate?

Quoted 8 lines

The bindings always come together in one patchset with the driver implementing them. Bindings are though a separate patch, yet still followed by the driver which uses them.

I do not see any compatibles in that driver, which suggests there is no other binding using it. If that's correct, then you need to change the driver.

Quoted 7 lines

The mtk-adsp-ipc driver's sole function is to encapsulate the operations of mailbox framework from adsp ipc users. The mtk-adsp-ipc is not defined in the dts file and we don't need it to be defined. The creation of mtk-adsp-ipc device is requested by adsp ipc users via the use of 'platform_device_register_data'[1].

the driver implemented the mailbox framework is 'mtk-adsp-mailbox'[2]. it has corresponding hardwares and a yaml file[3] to describe it.

Quoted 7 lines

I don't understand how is this related. We talk here about the mbox-names for this bindings file. You replied, that these bindings are already used by something, but now you say that they are not? So why do you need to change anything in any driver?

Simple question - do the bindings here "add mt8186 dsp document" are used by any specific Linux driver already?

This bindings, 'add mt8186 dsp document', are used by the SOF sound driver of MT8186[1].

I'm sorry for miss leading you in previous reply. I was thought that you're asking why the mtk-adsp-ipc driver got merged without bindings. So, I tried to explain why mtk-adsp-ipc doesn't have bindings.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=1f0214a86de87011ecb96f22545dd6e5c7324cd7

Thanks,
TingHan

#9 lore raw
Quoted 58 lines · Tinghan Shen

Hi Krzysztof,

Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Tinghan Shen

Hi Krzysztof,

Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Tinghan Shen
Quoted 6 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1

These should be rather some meaningful names, e.g. "rx" and "tx".

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c__;!!CTRNKA9wMg0ARbw!1TmempNkQhC5QuLBhyfWo_AC97MoLuWipsGV-LPaW9RKNPheU7Bgc-eboNi1JA1nC5I$

Quoted 35 lines
Quoted 22 lines
Quoted 13 lines
Quoted 9 lines
 

	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

It is a bit confusing... how did that driver got merged recently without bindings? Why bindings are separate?

Quoted 8 lines

The bindings always come together in one patchset with the driver implementing them. Bindings are though a separate patch, yet still followed by the driver which uses them.

I do not see any compatibles in that driver, which suggests there is no other binding using it. If that's correct, then you need to change the driver.

Quoted 7 lines

The mtk-adsp-ipc driver's sole function is to encapsulate the operations of mailbox framework from adsp ipc users. The mtk-adsp-ipc is not defined in the dts file and we don't need it to be defined. The creation of mtk-adsp-ipc device is requested by adsp ipc users via the use of 'platform_device_register_data'[1].

the driver implemented the mailbox framework is 'mtk-adsp-mailbox'[2]. it has corresponding hardwares and a yaml file[3] to describe it.

I don't understand how is this related. We talk here about the mbox-names for this bindings file. You replied, that these bindings are already used by something, but now you say that they are not? So why do you need to change anything in any driver?

Quoted 8 lines
Quoted 2 lines

Simple question - do the bindings here "add mt8186 dsp document" are used by any specific Linux driver already?

This bindings, 'add mt8186 dsp document', are used by the SOF sound driver of MT8186[1].

I'm sorry for miss leading you in previous reply. I was thought that you're asking why the mtk-adsp-ipc driver got merged without bindings. So, I tried to explain why mtk-adsp-ipc doesn't have bindings.

Then my question is kind of still valid:
How did "mt8186 SOF" driver got merged recently without bindings? Why bindings are separate?

You cannot just sneak in usage of bindings in a driver, then submit bindings and say "we already have an user!". No, the bindings come with the driver. Always.

Linked patch [1] brings undocumented compatible mediatek,mt8186-dsp, so you should see big fat warning when running checkpatch. So this points that you did not run checkpatch which is another not acceptable submission. :(

[1]
https://lore.kernel.org/all/[email protected]/

Best regards,
Krzysztof

#10 lore raw

Hi Krzysztof,

Quoted 16 lines · Krzysztof Kozlowski
Quoted 15 lines · Tinghan Shen

Hi Krzysztof,

Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Tinghan Shen

Hi Krzysztof,

Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Tinghan Shen
Quoted 6 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+  mbox-names:
+    items:
+      - const: mbox0
+      - const: mbox1

These should be rather some meaningful names, e.g. "rx" and "tx".

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

The mbox name has to align with the adsp ipc driver. The adsp ipc driver is using 'mbox%d' for mailbox channels.

https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c__;!!CTRNKA9wMg0ARbw!1TmempNkQhC5QuLBhyfWo_AC97MoLuWipsGV-LPaW9RKNPheU7Bgc-eboNi1JA1nC5I$

Quoted 52 lines
Quoted 35 lines
Quoted 35 lines
Quoted 22 lines
Quoted 13 lines
Quoted 9 lines
 

	chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);

	/* ...snip... */

	adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);

Is it ok to continue using these names?

It is a bit confusing... how did that driver got merged recently without bindings? Why bindings are separate?

Quoted 8 lines

The bindings always come together in one patchset with the driver implementing them. Bindings are though a separate patch, yet still followed by the driver which uses them.

I do not see any compatibles in that driver, which suggests there is no other binding using it. If that's correct, then you need to change the driver.

Quoted 7 lines

The mtk-adsp-ipc driver's sole function is to encapsulate the operations of mailbox framework from adsp ipc users. The mtk-adsp-ipc is not defined in the dts file and we don't need it to be defined. The creation of mtk-adsp-ipc device is requested by adsp ipc users via the use of 'platform_device_register_data'[1].

the driver implemented the mailbox framework is 'mtk-adsp-mailbox'[2]. it has corresponding hardwares and a yaml file[3] to describe it.

I don't understand how is this related. We talk here about the mbox-names for this bindings file. You replied, that these bindings are already used by something, but now you say that they are not? So why do you need to change anything in any driver?

Quoted 8 lines
Quoted 2 lines

Simple question - do the bindings here "add mt8186 dsp document" are used by any specific Linux driver already?

This bindings, 'add mt8186 dsp document', are used by the SOF sound driver of MT8186[1].

I'm sorry for miss leading you in previous reply. I was thought that you're asking why the mtk-adsp-ipc driver got merged without bindings. So, I tried to explain why mtk-adsp-ipc doesn't have bindings.

Then my question is kind of still valid:
How did "mt8186 SOF" driver got merged recently without bindings? Why bindings are separate?

You cannot just sneak in usage of bindings in a driver, then submit bindings and say "we already have an user!". No, the bindings come with the driver. Always.

Quoted 8 lines

Linked patch [1] brings undocumented compatible mediatek,mt8186-dsp, so you should see big fat warning when running checkpatch. So this points that you did not run checkpatch which is another not acceptable submission. :(

[1]
https://lore.kernel.org/all/[email protected]/

I apologize for breaking the rules and sending inappropriate patches.

I was thought that it was acceptable to send community reviewed patches in a series, then followed the bindings at another patch. I was believed that separating un-reviewed binding patch from reviewed driver patches would aid in patch acceptance. Now, I see I make a big mistake. I'm sorry.

Best regards,
TingHan

maintainer
#11 lore raw
In reply to Tinghan Shen
Quoted 7 lines · Tinghan Shen

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---

Quoted 8 lines

This patch depends on MT8186 clock bindings.
https://lore.kernel.org/all/[email protected]/

---
 .../bindings/dsp/mediatek,mt8186-dsp.yaml     | 93 +++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.example.dts:22:18: fatal error: dt-bindings/clock/mt8186-clk.h: No such file or directory
22 | #include <dt-bindings/clock/mt8186-clk.h>

      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.
make[1]: *** [scripts/Makefile.lib:364: Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.example.dtb] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1401: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

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.

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek