Skip to contentSkip to conversation

ASoC: mediatek: Add support of SOF on Mediatek mt8196 SoC.

PATCH Superseded hailong.fan 4 participants 16 messages Jul 3, 2025 – Aug 26, 2025

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: mediatek: Add support of SOF on Mediatek mt8196 SoC.

From: Hailong Fan <[email protected]>

Sorry for late reply.

Add support of MediaTek mt8196 SoC DSP to SOF. This series is based on linux-next, tag: next-20250702.

---
Changes in v2:
- Rebase onto https://lore.kernel.org/all/[email protected]/
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

This series patches dependent on:
[1]
https://lore.kernel.org/all/[email protected]/
[2]
https://lore.kernel.org/all/[email protected]/

Hailong Fan (2):
dt-bindings: dsp: mediatek: add mt8196 dsp document
ASoC: SOF: MediaTek: Add mt8196 hardware support

 .../bindings/sound/mediatek,mt8196-dsp.yaml   |  95 +++
 sound/soc/sof/mediatek/Kconfig                |   9 +
 sound/soc/sof/mediatek/Makefile               |   1 +
 sound/soc/sof/mediatek/mt8196/Makefile        |   3 +
 sound/soc/sof/mediatek/mt8196/mt8196-clk.c    |  98 +++
 sound/soc/sof/mediatek/mt8196/mt8196-clk.h    |  23 +
 sound/soc/sof/mediatek/mt8196/mt8196-loader.c |  60 ++
 sound/soc/sof/mediatek/mt8196/mt8196.c        | 556 ++++++++++++++++++
 sound/soc/sof/mediatek/mt8196/mt8196.h        | 124 ++++
 9 files changed, 969 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml
 create mode 100644 sound/soc/sof/mediatek/mt8196/Makefile
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196-clk.c
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196-clk.h
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196-loader.c
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196.c
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196.h
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/2 dt-bindings: dsp: mediatek: add mt8196 dsp document

From: Hailong Fan <[email protected]>

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.

---
 .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +95 -0
new file mode 100644
index 000000000000..68f594f476e8
@@ -0,0 +1,95 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/mediatek,mt8196-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek mt8196 DSP core
+
+maintainers:
+  - Hailong Fan <[email protected]>
+
+description: The MediaTek mt8196 SoC mt8196 contain a DSP core used for advanced
+  pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8196-dsp
+
+  reg:
+    items:
+      - description: DSP configuration registers
+      - description: DSP SRAM
+      - description: DSP secure registers
+      - description: 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
+  - mboxes
+  - mbox-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt8196-clk.h>
+    #include <dt-bindings/power/mt8196-power.h>
+    adsp@1a000000 {
+        compatible = "mediatek,mt8196-dsp";
+        reg = <0x1a000000 0x5000>,
+              <0x1a210000 0x80000>,
+              <0x1a345000 0x300>,
+              <0x1a00f000 0x1000>;
+        reg-names = "cfg", "sram", "sec", "bus";
+        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";
+        power-domains = <&scpsys MT8196_POWER_DOMAIN_ADSP_TOP_DORMANT>;
+        mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
+        mbox-names = "rx", "tx";
+    };
Signature · 1 line
2.45.2
#2 lore raw

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

Quoted 3 lines · hailong.fan

From: Hailong Fan <[email protected]>

This patch adds mt8196 dsp document. The dsp is used for Sound Open

Please do not use "This commit/patch/change", but imperative mood. See longer explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 17 lines

Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---
 .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +2 -0
new file mode 100644
index 000000000000..68f594f476e8
@@ -0,0 +1,95 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +10 -0
+---
+$id: http://devicetree.org/schemas/sound/mediatek,mt8196-dsp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek mt8196 DSP core
+
+maintainers:
+  - Hailong Fan <[email protected]>
+
+description: The MediaTek mt8196 SoC mt8196 contain a DSP core used for advanced

Missing blank line. Look at other bindings. Also does not look wrapped at 80 (see Linux coding style doc).

Quoted 19 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +19 -0
+  pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8196-dsp
+
+  reg:
+    items:
+      - description: DSP configuration registers
+      - description: DSP SRAM
+      - description: DSP secure registers
+      - description: DSP bus registers
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: sram
+      - const: sec
+      - const: bus

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +10 -0
+
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel

Isn't this called audiodsp in other bindings?

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

Quoted 1 line
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +1 -0
+      - const: clk26m

Don't use frequencies. How is the pin or input called in datasheet? How other devices call it?

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 47

Quoted 5 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +5 -0
+      - const: adsppll
+
+  power-domains:
+    maxItems: 1
+

Best regards,
Krzysztof

#3 lore raw

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

Il 03/07/25 10:08, Krzysztof Kozlowski ha scritto:

Quoted 18 lines · hailong.fan
Quoted 3 lines

From: Hailong Fan <[email protected]>

This patch adds mt8196 dsp document. The dsp is used for Sound Open

Please do not use "This commit/patch/change", but imperative mood. See longer explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 9 lines

Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

---
  .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95 +++++++++++++++++++
  1 file changed, 95 insertions(+)

create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml

Quoted 5 lines

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml

Quoted 5 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +0 -0
new file mode 100644
index 000000000000..68f594f476e8

Wrong folder; this should go to dsp/mediatek,mt8196-dsp.yaml ....

...but then I don't get why MT8196 wasn't simply added to mediatek,mt8186-dsp.yaml.

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

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +5 -0
+
+maintainers:
+  - Hailong Fan <[email protected]>
+
+description: The MediaTek mt8196 SoC mt8196 contain a DSP core used for advanced

Missing blank line. Look at other bindings. Also does not look wrapped at 80 (see Linux coding style doc).

There's also a typo, "mt8196 SoC mt8196"

Quoted 33 lines
Quoted 20 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +19 -0
+  pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8196-dsp
+
+  reg:
+    items:
+      - description: DSP configuration registers
+      - description: DSP SRAM
+      - description: DSP secure registers
+      - description: DSP bus registers
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: sram
+      - const: sec
+      - const: bus

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +10 -0
+
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel

Isn't this called audiodsp in other bindings?

Quoted 4 lines

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

Quoted 1 line
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +1 -0
+      - const: clk26m

Don't use frequencies. How is the pin or input called in datasheet? How other devices call it?

In the datasheet, this is called.... CLK26M (really).

Cheers,
Angelo

Quoted 8 lines

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +5 -0
+      - const: adsppll
+
+  power-domains:
+    maxItems: 1
+

Best regards,
Krzysztof

#4 lore raw

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

Quoted 13 lines · AngeloGioacchino Del Regno
Quoted 13 lines

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +10 -0
+
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel

Isn't this called audiodsp in other bindings?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

+ - const: clk26m

Don't use frequencies. How is the pin or input called in datasheet? How other devices call it?

In the datasheet, this is called.... CLK26M (really).

OK, this is a valid argument, however we still try to unify the inputs so bindings can share such pieces. It is discouraged to have similar devices with different bindings in only one place: clk26m -> clk27m or whatever other number.

Common is also to name the clock input based on the purpose (like bus, ref).

Best regards,
Krzysztof

#5 lore raw

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

Quoted 34 lines · Krzysztof Kozlowski

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 13 lines · AngeloGioacchino Del Regno
Quoted 13 lines

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +10 -0
+
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel

Isn't this called audiodsp in other bindings?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

+ - const: clk26m

Don't use frequencies. How is the pin or input called in datasheet? How
other devices call it?

In the datasheet, this is called.... CLK26M (really).

OK, this is a valid argument, however we still try to unify the inputs
so bindings can share such pieces. It is discouraged to have similar devices with different bindings in only one place: clk26m -> clk27m or
whatever other number.

Quoted 6 lines

Common is also to name the clock input based on the purpose (like bus, ref).

Best regards,
Krzysztof

On the MediaTek platform, the main SoC clock sources are typically 32K, 13M, and 26M. This is why the terms clk32k, clk13m, and clk26m are used.
Specifically, clk26m refers to the system’s 26 MHz clock source. The clkxxx naming convention is intended to indicate that these are SoC clock sources, while also distinguishing between different clock frequencies.

Therefore, using other terms could potentially cause confusion.

For example, the ADSP clock sources are ADSPPLL(800MHz) and clk26m(26MHz).
On other platforms, the definition of clk26m in the Device Tree Source (DTS) is as follows:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/mediatek/mt8188.dtsi#n328
The mt8196 platform uses the same design.

Best Regards,
Hailong.Fan

#6 lore raw

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

Quoted 12 lines · Hailong Fan (范海龙)
Quoted 12 lines

OK, this is a valid argument, however we still try to unify the inputs
so bindings can share such pieces. It is discouraged to have similar devices with different bindings in only one place: clk26m -> clk27m or
whatever other number.

Common is also to name the clock input based on the purpose (like bus, ref).

Quoted 8 lines
Quoted 2 lines

Best regards,
Krzysztof

On the MediaTek platform, the main SoC clock sources are typically 32K, 13M, and 26M. This is why the terms clk32k, clk13m, and clk26m are used.
Specifically, clk26m refers to the system’s 26 MHz clock source. The clkxxx naming convention is intended to indicate that these are SoC

But it should nnot.

Quoted 4 lines

clock sources, while also distinguishing between different clock frequencies.

Therefore, using other terms could potentially cause confusion.

No, you don't understand. This device receives some main PLL or ref clock. That's the only important information in the name, not its frequency..

Quoted 8 lines

For example, the ADSP clock sources are ADSPPLL(800MHz) and clk26m(26MHz).
On other platforms, the definition of clk26m in the Device Tree Source (DTS) is as follows:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/mediatek/mt8188.dtsi#n328
The mt8196 platform uses the same design.

So you add poor code, because previously Mediatek added more poor code? What sort of argument is that?

Best regards,
Krzysztof

#7 lore raw

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

Quoted 32 lines · Krzysztof Kozlowski

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 17 lines · Hailong Fan (范海龙)
Quoted 10 lines

OK, this is a valid argument, however we still try to unify the inputs
so bindings can share such pieces. It is discouraged to have similar
devices with different bindings in only one place: clk26m -> clk27m
or
whatever other number.

Quoted 6 lines

Common is also to name the clock input based on the purpose (like bus, ref).

Best regards,
Krzysztof

Quoted 7 lines

On the MediaTek platform, the main SoC clock sources are typically 32K,
13M, and 26M. This is why the terms clk32k, clk13m, and clk26m are used.
Specifically, clk26m refers to the system’s 26 MHz clock source. The clkxxx naming convention is intended to indicate that these are SoC

But it should nnot.

Quoted 17 lines
Quoted 4 lines

clock sources, while also distinguishing between different clock frequencies.

Therefore, using other terms could potentially cause confusion.

No, you don't understand. This device receives some main PLL or ref clock. That's the only important information in the name, not its frequency..

Quoted 8 lines

For example, the ADSP clock sources are ADSPPLL(800MHz) and clk26m(26MHz).
On other platforms, the definition of clk26m in the Device Tree Source
(DTS) is as follows:

https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/mediatek/mt8188.dtsi*n328__;Iw!!CTRNKA9wMg0ARbw!ibScPB89tyVolnUhBscm6gkEwMebDiD8FozTY1H_-cMZ5_klBxmJxgWlOTOhboITEls4ef4w-Tce2qs$

Quoted 5 lines
Quoted 1 line

The mt8196 platform uses the same design.

So you add poor code, because previously Mediatek added more poor code?
What sort of argument is that?

Thank you for your suggestion. We are planning to update it to sys_clk in the next version. What do you think?

Quoted 4 lines

Best regards,
Krzysztof

#8 lore raw

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

In reply to AngeloGioacchino Del Regno
Quoted 4 lines · AngeloGioacchino Del Regno

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 11 lines

Il 03/07/25 10:08, Krzysztof Kozlowski ha scritto:

Quoted 10 lines · hailong.fan
Quoted 4 lines

From: Hailong Fan <[email protected]>

This patch adds mt8196 dsp document. The dsp is used for Sound Open

Please do not use "This commit/patch/change", but imperative mood. See
longer explanation here:

https://urldefense.com/v3/__https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst*L95__;Iw!!CTRNKA9wMg0ARbw!g39q48fUCsDJ5PETUtQ0PK0Bkwf0Ce1F_ZzJiEiWMzuybWQ0dSPzblvLlJ-4saWTSoJWuS5imsXbpdgLBvUy4wxw9C5w7B4m$

Quoted 26 lines
Quoted 13 lines
Quoted 13 lines

Firmware driver node. It includes registers, clocks, memory regions,
and mailbox for dsp.

---
  .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95
+++++++++++++++++++
  1 file changed, 95 insertions(+)

create mode 100644
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml

Quoted 10 lines
Quoted 10 lines

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml
new file mode 100644
index 000000000000..68f594f476e8

Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +0 -0

dsp.yaml

Wrong folder; this should go to dsp/mediatek,mt8196-dsp.yaml ....

Quoted 3 lines

...but then I don't get why MT8196 wasn't simply added to mediatek,mt8186-dsp.yaml.

Yes, the first version was written this way, but the maintainer suggested the following, so I'm not sure which approach is more appropriate. Could you please provide a final recommendation?

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

comment:

Quoted 7 lines
Quoted 4 lines
---
 .../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?

Quoted 22 lines
Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +4 -0
@@ -0,0 +1,95 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: 

https://urldefense.com/v3/__http://devicetree.org/schemas/sound/mediatek,mt8196-dsp.yaml*__;Iw!!CTRNKA9wMg0ARbw!g39q48fUCsDJ5PETUtQ0PK0Bkwf0Ce1F_ZzJiEiWMzuybWQ0dSPzblvLlJ-4saWTSoJWuS5imsXbpdgLBvUy4wxw9GN4ryBQ$
+$schema:
https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!g39q48fUCsDJ5PETUtQ0PK0Bkwf0Ce1F_ZzJiEiWMzuybWQ0dSPzblvLlJ-4saWTSoJWuS5imsXbpdgLBvUy4wxw9NKbMuhN$

Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +4 -0
+
+title: MediaTek mt8196 DSP core
+
+maintainers:
Quoted 9 lines
Quoted 4 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +3 -0
+  - Hailong Fan <[email protected]>
+
+description: The MediaTek mt8196 SoC mt8196 contain a DSP core

used for advanced

Missing blank line. Look at other bindings. Also does not look wrapped
at 80 (see Linux coding style doc).

Quoted 2 lines

There's also a typo, "mt8196 SoC mt8196"

Will update in next version, thanks.

Quoted 55 lines
Quoted 33 lines
Quoted 20 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +19 -0
+  pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8196-dsp
+
+  reg:
+    items:
+      - description: DSP configuration registers
+      - description: DSP SRAM
+      - description: DSP secure registers
+      - description: DSP bus registers
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: sram
+      - const: sec
+      - const: bus

Documentation/devicetree/bindings/sound/mediatek,mt8196-

Quoted 10 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +10 -0
+
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel

Isn't this called audiodsp in other bindings?

Quoted 5 lines
Quoted 1 line

+ - const: clk26m

Don't use frequencies. How is the pin or input called in datasheet? How
other devices call it?

In the datasheet, this is called.... CLK26M (really).

Cheers,
Angelo

Quoted 9 lines

Documentation/devicetree/bindings/sound/mediatek,mt8196-

Quoted 6 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +5 -0
+      - const: adsppll
+
+  power-domains:
+    maxItems: 1
+

Best regards,
Krzysztof

#9 lore raw

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

Quoted 9 lines · Hailong Fan (范海龙)
Quoted 8 lines · AngeloGioacchino Del Regno

External email : Please do not click links or open attachments until you have verified the sender or the content.

Il 03/07/25 10:08, Krzysztof Kozlowski ha scritto:

Quoted 3 lines · hailong.fan
Quoted 2 lines

From: Hailong Fan <[email protected]>

Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

This patch adds mt8196 dsp document. The dsp is used for Sound Open

Please do not use "This commit/patch/change", but imperative mood. See
longer explanation here:

https://urldefense.com/v3/__https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst*L95__;Iw!!CTRNKA9wMg0ARbw!g39q48fUCsDJ5PETUtQ0PK0Bkwf0Ce1F_ZzJiEiWMzuybWQ0dSPzblvLlJ-4saWTSoJWuS5imsXbpdgLBvUy4wxw9C5w7B4m$

Quoted 1 line
Quoted 1 line

Fix your email client not to produce such junk like above ^.

Quoted 28 lines
Quoted 25 lines
Quoted 12 lines
Quoted 12 lines

Firmware driver node. It includes registers, clocks, memory regions,
and mailbox for dsp.

---
  .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95
+++++++++++++++++++
  1 file changed, 95 insertions(+)

create mode 100644
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml

Quoted 10 lines
Quoted 10 lines

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml
new file mode 100644
index 000000000000..68f594f476e8

Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +0 -0

dsp.yaml

Wrong folder; this should go to dsp/mediatek,mt8196-dsp.yaml ....

Quoted 3 lines

...but then I don't get why MT8196 wasn't simply added to mediatek,mt8186-dsp.yaml.

Quoted 6 lines

Yes, the first version was written this way, but the maintainer suggested the following, so I'm not sure which approach is more appropriate. Could you please provide a final recommendation?

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

You linked to your reply. What does it prove? You are the maintainer and you gave this recommendation for your own patch?

Quoted 9 lines

comment:

Quoted 7 lines
Quoted 4 lines
---
 .../bindings/dsp/mediatek,mt8196-dsp.yaml     | 96

+++++++++++++++++++

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

Quoted 7 lines

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?

No.

Best regards,
Krzysztof

#10 lore raw

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

Quoted 4 lines · Krzysztof Kozlowski

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 23 lines
Quoted 22 lines · Hailong Fan (范海龙)
Quoted 18 lines · AngeloGioacchino Del Regno

External email : Please do not click links or open attachments until
you have verified the sender or the content.

Il 03/07/25 10:08, Krzysztof Kozlowski ha scritto:

Quoted 12 lines · hailong.fan
Quoted 5 lines

From: Hailong Fan <[email protected]>

This patch adds mt8196 dsp document. The dsp is used for Sound
Open

Please do not use "This commit/patch/change", but imperative mood.
See
longer explanation here:

https://urldefense.com/v3/__https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst*L95__;Iw!!CTRNKA9wMg0ARbw!g39q48fUCsDJ5PETUtQ0PK0Bkwf0Ce1F_ZzJiEiWMzuybWQ0dSPzblvLlJ-4saWTSoJWuS5imsXbpdgLBvUy4wxw9C5w7B4m$

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

Fix your email client not to produce such junk like above ^.

OK,thx.

Quoted 32 lines
Quoted 32 lines
Quoted 31 lines
Quoted 14 lines
Quoted 14 lines

Firmware driver node. It includes registers, clocks, memory regions,
and mailbox for dsp.

---
  .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95
+++++++++++++++++++
  1 file changed, 95 insertions(+)

create mode 100644
Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml

Quoted 11 lines
Quoted 11 lines

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml
new file mode 100644
index 000000000000..68f594f476e8
--- /dev/null
+++
b/Documentation/devicetree/bindings/sound/mediatek,mt8196- dsp.yaml

Wrong folder; this should go to dsp/mediatek,mt8196-dsp.yaml ....

...but then I don't get why MT8196 wasn't simply added to mediatek,mt8186-dsp.yaml.

Quoted 6 lines
Quoted 6 lines

Yes, the first version was written this way, but the maintainer suggested the following, so I'm not sure which approach is more appropriate. Could you please provide a final recommendation?

v1 link:

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

Quoted 20 lines

You linked to your reply. What does it prove? You are the maintainer and
you gave this recommendation for your own patch?

Quoted 15 lines

comment:

Quoted 7 lines
Quoted 4 lines
---
 .../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://urldefense.com/v3/__https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/dsp__;!!CTRNKA9wMg0ARbw!nYISmR0CRlwCkvCsX__KkrKPFCiGy1jjwq_rZjMMXmQ6RhzlUeLgBmUpxvAslqJZTvM7J-QDvq_hpD4$

Quoted 5 lines
Quoted 3 lines

Do we need to move all the files under the DSP directory to the sound
directory?

No.

Got it, we will place mediatek,mt8196-dsp.yaml in the Documentation/devicetree/bindings/dsp directory. Thx.

Quoted 4 lines

Best regards,
Krzysztof

#11 lore raw

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

In reply to Krzysztof Kozlowski
Quoted 4 lines · Krzysztof Kozlowski

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 9 lines
Quoted 3 lines · hailong.fan

From: Hailong Fan <[email protected]>

This patch adds mt8196 dsp document. The dsp is used for Sound Open

Please do not use "This commit/patch/change", but imperative mood. See
longer explanation here:

https://urldefense.com/v3/__https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst*L95__;Iw!!CTRNKA9wMg0ARbw!mhCB8cQ9NY4AztdErJWay3VtFNHSe89i00TgGeTd62W6m-Ios46XeDaYqM0QQ7m4SHjlNw69PvU7T9M$

Quoted 1 line

Okay, will be updated to:
Add device tree binding documentation for the
MediaTek MT8196 DSP. The DSP is used by the Sound Open Firmware driver node and includes registers, clocks, memory regions, and a mailbox for DSP communication.

Thanks.

Quoted 32 lines
Quoted 32 lines

Firmware driver node. It includes registers, clocks, memory regions,
and mailbox for dsp.

---
 .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95
+++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file mode 100644
index 000000000000..68f594f476e8

Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +0 -0

dsp.yaml

Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +4 -0
@@ -0,0 +1,95 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: 

https://urldefense.com/v3/__http://devicetree.org/schemas/sound/mediatek,mt8196-dsp.yaml*__;Iw!!CTRNKA9wMg0ARbw!mhCB8cQ9NY4AztdErJWay3VtFNHSe89i00TgGeTd62W6m-Ios46XeDaYqM0QQ7m4SHjlNw697qH1t6A$
+$schema:
https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!mhCB8cQ9NY4AztdErJWay3VtFNHSe89i00TgGeTd62W6m-Ios46XeDaYqM0QQ7m4SHjlNw69EdDHgNY$

Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +4 -0
+
+title: MediaTek mt8196 DSP core
+
+maintainers:
Quoted 10 lines
Quoted 4 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +3 -0
+  - Hailong Fan <[email protected]>
+
+description: The MediaTek mt8196 SoC mt8196 contain a DSP core

used for advanced

Missing blank line. Look at other bindings. Also does not look wrapped
at 80 (see Linux coding style doc).

Okay, will be update to:
description: |
The MediaTek mt8196 SoC contains
a DSP core used for advanced pre- and
post-audio processing. This DSP
is typically used by the Sound Open Firmware
(SOF) driver and requires
registers, clocks, memory regions, and a mailbox
for communication.

Th
anks.

Quoted 23 lines
Quoted 23 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +23 -0
+  pre- and post- audio processing.
+
+properties:
+  compatible:
+    const: mediatek,mt8196-dsp
+
+  reg:
+    items:
+      - description: DSP configuration registers
+      - description: DSP SRAM
+      - description: DSP secure registers
+      - description: DSP bus registers
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: sram
+      - const: sec
+      - const: bus
+
+  clocks:
+    items:
+      - description: mux for dsp clock
Quoted 9 lines

Documentation/devicetree/bindings/sound/mediatek,mt8196-

Quoted 6 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +6 -0
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel

Isn't this called audiodsp in other bindings?

Yes, but essentially it is the mux selection of the ADSP clock. So, would using "adsp_sel" make it clearer?

Quoted 14 lines
Quoted 1 line

+ - const: clk26m

Don't use frequencies. How is the pin or input called in datasheet? How
other devices call it?

Documentation/devicetree/bindings/sound/mediatek,mt8196-

Quoted 5 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196- new file +5 -0
+      - const: adsppll
+
+  power-domains:
+    maxItems: 1
+

Best regards,
Krzysztof

#12 lore raw

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

Quoted 10 lines · Hailong Fan (范海龙)
Quoted 10 lines
Quoted 9 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +9 -0
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel
Quoted 5 lines
Quoted 2 lines

Isn't this called audiodsp in other bindings?

Yes, but essentially it is the mux selection of the ADSP clock. So, would using "adsp_sel" make it clearer?

So every new binding will come with new name? Stick to the same name if this is the same clock.

Best regards,
Krzysztof

#13 lore raw

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

Quoted 22 lines · Krzysztof Kozlowski

External email : Please do not click links or open attachments until you have verified the sender or the content.

Quoted 10 lines · Hailong Fan (范海龙)
Quoted 10 lines
Quoted 9 lines
Documentation/devicetree/bindings/sound/mediatek,mt8196-dsp.yaml new file +9 -0
+  clocks:
+    items:
+      - description: mux for dsp clock
+      - description: 26M clock
+      - description: ADSP PLL clock
+
+  clock-names:
+    items:
+      - const: adsp_sel
Quoted 6 lines
Quoted 2 lines

Isn't this called audiodsp in other bindings?

Yes, but essentially it is the mux selection of the ADSP clock. So, would using "adsp_sel" make it clearer?

Quoted 6 lines

So every new binding will come with new name? Stick to the same name if
this is the same clock.

Best regards,
Krzysztof

Got it, we will keep the name consistent, thanks a lot.

#14 lore raw

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

In reply to hailong.fan
Quoted 6 lines · hailong.fan

From: Hailong Fan <[email protected]>

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.

Quoted 6 lines
---
 .../bindings/sound/mediatek,mt8196-dsp.yaml   | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/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/sound/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/sound/mediatek,mt8196-dsp.example.dtb] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1525: 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/[email protected]

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.

#15 lore raw

PATCH v2 2/2 ASoC: SOF: MediaTek: Add mt8196 hardware support

In reply to hailong.fan

From: Hailong Fan <[email protected]>

Add support of SOF on MediaTek mt8196 SoC.
MT8196 has a Cadence HiFi-5 DSP core that is responsible for running the operating system and application programs. The IPC communication between the AP and DSP is based on shared DRAM and mailbox interrupt.

---
 sound/soc/sof/mediatek/Kconfig                |   9 +
 sound/soc/sof/mediatek/Makefile               |   1 +
 sound/soc/sof/mediatek/mt8196/Makefile        |   3 +
 sound/soc/sof/mediatek/mt8196/mt8196-clk.c    |  98 +++
 sound/soc/sof/mediatek/mt8196/mt8196-clk.h    |  23 +
 sound/soc/sof/mediatek/mt8196/mt8196-loader.c |  60 ++
 sound/soc/sof/mediatek/mt8196/mt8196.c        | 556 ++++++++++++++++++
 sound/soc/sof/mediatek/mt8196/mt8196.h        | 124 ++++
 8 files changed, 874 insertions(+)
 create mode 100644 sound/soc/sof/mediatek/mt8196/Makefile
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196-clk.c
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196-clk.h
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196-loader.c
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196.c
 create mode 100644 sound/soc/sof/mediatek/mt8196/mt8196.h
sound/soc/sof/mediatek/Kconfig +9 -0
index 4a2eddf6009a..36eb6f5c080b 100644
@@ -42,4 +42,13 @@ config SND_SOC_SOF_MT8195
 	  Say Y if you have such a device.
 	  If unsure select "N".
 
+config SND_SOC_SOF_MT8196
+	tristate "SOF support for MT8196 audio DSP"
+	select SND_SOC_SOF_MTK_COMMON
+	depends on MTK_ADSP_IPC
+	help
+	  This adds support for Sound Open Firmware for MediaTek platforms
+	  using the mt8196 processors.
+	  Say Y if you have such a device.
+	  If unsure select "N".
 endif ## SND_SOC_SOF_MTK_TOPLEVEL
sound/soc/sof/mediatek/Makefile +1 -0
index 29c5afb2f3d6..3e36d538679e 100644
@@ -2,3 +2,4 @@
 obj-$(CONFIG_SND_SOC_SOF_MTK_COMMON) += mtk-adsp-common.o
 obj-$(CONFIG_SND_SOC_SOF_MT8195) += mt8195/
 obj-$(CONFIG_SND_SOC_SOF_MT8186) += mt8186/
+obj-$(CONFIG_SND_SOC_SOF_MT8196) += mt8196/
sound/soc/sof/mediatek/mt8196/Makefile new file +3 -0
new file mode 100644
index 000000000000..245ff4cb387c
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+snd-sof-mt8196-objs := mt8196.o mt8196-clk.o mt8196-loader.o
+obj-$(CONFIG_SND_SOC_SOF_MT8196) += snd-sof-mt8196.o
sound/soc/sof/mediatek/mt8196/mt8196-clk.c new file +98 -0

98 lines not on this page · raw message

sound/soc/sof/mediatek/mt8196/mt8196-clk.h new file +23 -0
new file mode 100644
index 000000000000..e9f050b74a42
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
+/*
+ * Copyright(c) 2025 MediaTek Inc. All rights reserved.
+ * Author: Hailong Fan <[email protected]>
+ */
+
+#ifndef __MT8196_CLK_H
+#define __MT8196_CLK_H
+
+struct snd_sof_dev;
+
+/* DSP clock */
+enum adsp_clk_id {
+	CLK_TOP_ADSP_SEL,
+	CLK_TOP_CLK26M,
+	CLK_TOP_ADSPPLL,
+	ADSP_CLK_MAX
+};
+
+int mt8196_adsp_init_clock(struct snd_sof_dev *sdev);
+int mt8196_adsp_clock_on(struct snd_sof_dev *sdev);
+void mt8196_adsp_clock_off(struct snd_sof_dev *sdev);
+#endif
sound/soc/sof/mediatek/mt8196/mt8196-loader.c new file +60 -0

60 lines not on this page · raw message

sound/soc/sof/mediatek/mt8196/mt8196.c new file +556 -0

556 lines not on this page · raw message

sound/soc/sof/mediatek/mt8196/mt8196.h new file +124 -0

124 lines not on this page · raw message

Signature · 1 line
2.45.2