All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF
@ 2022-12-22  7:21 ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Add support of MediaTek mt8188 SoC DSP to SOF.
The sof driver patches in this series are taken from
thesofproject/linux/tree/topic/sof-dev-rebase.

Tinghan Shen (3):
  dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
  ASoC: SOF: mediatek: Support mt8188 platform
  ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core

 .../bindings/dsp/mediatek,mt8186-dsp.yaml     |  4 +++-
 sound/soc/sof/mediatek/mt8186/mt8186.c        | 20 +++++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h        |  3 ++-
 sound/soc/sof/mediatek/mt8195/mt8195.c        |  1 +
 4 files changed, 26 insertions(+), 2 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF
@ 2022-12-22  7:21 ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Add support of MediaTek mt8188 SoC DSP to SOF.
The sof driver patches in this series are taken from
thesofproject/linux/tree/topic/sof-dev-rebase.

Tinghan Shen (3):
  dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
  ASoC: SOF: mediatek: Support mt8188 platform
  ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core

 .../bindings/dsp/mediatek,mt8186-dsp.yaml     |  4 +++-
 sound/soc/sof/mediatek/mt8186/mt8186.c        | 20 +++++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h        |  3 ++-
 sound/soc/sof/mediatek/mt8195/mt8195.c        |  1 +
 4 files changed, 26 insertions(+), 2 deletions(-)

-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF
@ 2022-12-22  7:21 ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Add support of MediaTek mt8188 SoC DSP to SOF.
The sof driver patches in this series are taken from
thesofproject/linux/tree/topic/sof-dev-rebase.

Tinghan Shen (3):
  dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
  ASoC: SOF: mediatek: Support mt8188 platform
  ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core

 .../bindings/dsp/mediatek,mt8186-dsp.yaml     |  4 +++-
 sound/soc/sof/mediatek/mt8186/mt8186.c        | 20 +++++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h        |  3 ++-
 sound/soc/sof/mediatek/mt8195/mt8195.c        |  1 +
 4 files changed, 26 insertions(+), 2 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
  2022-12-22  7:21 ` Tinghan Shen
  (?)
@ 2022-12-22  7:21   ` Tinghan Shen
  -1 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
for pre- and post- audio processing.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
---
 .../devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml          | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
index 3e63f79890b4..88575da1e6d5 100644
--- a/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
@@ -15,7 +15,9 @@ description: |
 
 properties:
   compatible:
-    const: mediatek,mt8186-dsp
+    enum:
+      - mediatek,mt8186-dsp
+      - mediatek,mt8188-dsp
 
   reg:
     items:
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
@ 2022-12-22  7:21   ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
for pre- and post- audio processing.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
---
 .../devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml          | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
index 3e63f79890b4..88575da1e6d5 100644
--- a/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
@@ -15,7 +15,9 @@ description: |
 
 properties:
   compatible:
-    const: mediatek,mt8186-dsp
+    enum:
+      - mediatek,mt8186-dsp
+      - mediatek,mt8188-dsp
 
   reg:
     items:
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
@ 2022-12-22  7:21   ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
for pre- and post- audio processing.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
---
 .../devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml          | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml b/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
index 3e63f79890b4..88575da1e6d5 100644
--- a/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
@@ -15,7 +15,9 @@ description: |
 
 properties:
   compatible:
-    const: mediatek,mt8186-dsp
+    enum:
+      - mediatek,mt8186-dsp
+      - mediatek,mt8188-dsp
 
   reg:
     items:
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
  2022-12-22  7:21 ` Tinghan Shen
  (?)
@ 2022-12-22  7:21   ` Tinghan Shen
  -1 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Add support of SOF on MediaTek MT8188 SoC.
MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
The IPC communication between AP and DSP is based on shared DRAM and
mailbox interrupt.

The change in the mt8186.h is compatible on both mt8186 and
mt8188. The register controls booting the DSP core with the
default address or the user specified address. Both mt8186
and mt8188 should boot with the user specified boot in the driver.
The usage of the register is the same on both SoC, but the
control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
and bit 0 on mt8188. Configure the redundant bit has noside effect
on both SoCs.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index 79da25725987..af0dfc2fc4cc 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
 	.ops = &sof_mt8186_ops,
 };
 
+static const struct sof_dev_desc sof_of_mt8188_desc = {
+	.ipc_supported_mask	= BIT(SOF_IPC),
+	.ipc_default		= SOF_IPC,
+	.default_fw_path = {
+		[SOF_IPC] = "mediatek/sof",
+	},
+	.default_tplg_path = {
+		[SOF_IPC] = "mediatek/sof-tplg",
+	},
+	.default_fw_filename = {
+		[SOF_IPC] = "sof-mt8188.ri",
+	},
+	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
+	.ops = &sof_mt8186_ops,
+};
+
 static const struct of_device_id sof_of_mt8186_ids[] = {
 	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
+	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
index 98b2965e5ba6..886d687449e3 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.h
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
@@ -52,7 +52,8 @@ struct snd_sof_dev;
 #define ADSP_PRID			0x0
 #define ADSP_ALTVEC_C0			0x04
 #define ADSP_ALTVECSEL			0x0C
-#define ADSP_ALTVECSEL_C0		BIT(1)
+/* BIT(1) for mt8186. BIT(0) for mt8188 */
+#define ADSP_ALTVECSEL_C0		(BIT(0) | BIT(1))
 
 /* dsp bus */
 #define ADSP_SRAM_POOL_CON		0x190
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
@ 2022-12-22  7:21   ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Add support of SOF on MediaTek MT8188 SoC.
MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
The IPC communication between AP and DSP is based on shared DRAM and
mailbox interrupt.

The change in the mt8186.h is compatible on both mt8186 and
mt8188. The register controls booting the DSP core with the
default address or the user specified address. Both mt8186
and mt8188 should boot with the user specified boot in the driver.
The usage of the register is the same on both SoC, but the
control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
and bit 0 on mt8188. Configure the redundant bit has noside effect
on both SoCs.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index 79da25725987..af0dfc2fc4cc 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
 	.ops = &sof_mt8186_ops,
 };
 
+static const struct sof_dev_desc sof_of_mt8188_desc = {
+	.ipc_supported_mask	= BIT(SOF_IPC),
+	.ipc_default		= SOF_IPC,
+	.default_fw_path = {
+		[SOF_IPC] = "mediatek/sof",
+	},
+	.default_tplg_path = {
+		[SOF_IPC] = "mediatek/sof-tplg",
+	},
+	.default_fw_filename = {
+		[SOF_IPC] = "sof-mt8188.ri",
+	},
+	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
+	.ops = &sof_mt8186_ops,
+};
+
 static const struct of_device_id sof_of_mt8186_ids[] = {
 	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
+	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
index 98b2965e5ba6..886d687449e3 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.h
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
@@ -52,7 +52,8 @@ struct snd_sof_dev;
 #define ADSP_PRID			0x0
 #define ADSP_ALTVEC_C0			0x04
 #define ADSP_ALTVECSEL			0x0C
-#define ADSP_ALTVECSEL_C0		BIT(1)
+/* BIT(1) for mt8186. BIT(0) for mt8188 */
+#define ADSP_ALTVECSEL_C0		(BIT(0) | BIT(1))
 
 /* dsp bus */
 #define ADSP_SRAM_POOL_CON		0x190
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
@ 2022-12-22  7:21   ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Add support of SOF on MediaTek MT8188 SoC.
MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
The IPC communication between AP and DSP is based on shared DRAM and
mailbox interrupt.

The change in the mt8186.h is compatible on both mt8186 and
mt8188. The register controls booting the DSP core with the
default address or the user specified address. Both mt8186
and mt8188 should boot with the user specified boot in the driver.
The usage of the register is the same on both SoC, but the
control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
and bit 0 on mt8188. Configure the redundant bit has noside effect
on both SoCs.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
 sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index 79da25725987..af0dfc2fc4cc 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
 	.ops = &sof_mt8186_ops,
 };
 
+static const struct sof_dev_desc sof_of_mt8188_desc = {
+	.ipc_supported_mask	= BIT(SOF_IPC),
+	.ipc_default		= SOF_IPC,
+	.default_fw_path = {
+		[SOF_IPC] = "mediatek/sof",
+	},
+	.default_tplg_path = {
+		[SOF_IPC] = "mediatek/sof-tplg",
+	},
+	.default_fw_filename = {
+		[SOF_IPC] = "sof-mt8188.ri",
+	},
+	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
+	.ops = &sof_mt8186_ops,
+};
+
 static const struct of_device_id sof_of_mt8186_ids[] = {
 	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
+	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
index 98b2965e5ba6..886d687449e3 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.h
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
@@ -52,7 +52,8 @@ struct snd_sof_dev;
 #define ADSP_PRID			0x0
 #define ADSP_ALTVEC_C0			0x04
 #define ADSP_ALTVECSEL			0x0C
-#define ADSP_ALTVECSEL_C0		BIT(1)
+/* BIT(1) for mt8186. BIT(0) for mt8188 */
+#define ADSP_ALTVECSEL_C0		(BIT(0) | BIT(1))
 
 /* dsp bus */
 #define ADSP_SRAM_POOL_CON		0x190
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
  2022-12-22  7:21 ` Tinghan Shen
  (?)
@ 2022-12-22  7:21   ` Tinghan Shen
  -1 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Set the generic iomem callback for debugfs_add_region_item to support
sof-logger.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 3 +++
 sound/soc/sof/mediatek/mt8195/mt8195.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index af0dfc2fc4cc..dbea604ebc04 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -588,6 +588,9 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
 	.drv		= mt8186_dai,
 	.num_drv	= ARRAY_SIZE(mt8186_dai),
 
+	/* Debug information */
+	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
+
 	/* PM */
 	.suspend	= mt8186_dsp_suspend,
 	.resume		= mt8186_dsp_resume,
diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 3c81e84fcecf..11ceff3acc54 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -642,6 +642,7 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
 
 	/* Debug information */
 	.dbg_dump = mt8195_adsp_dump,
+	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
 	/* DAI drivers */
 	.drv = mt8195_dai,
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
@ 2022-12-22  7:21   ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Set the generic iomem callback for debugfs_add_region_item to support
sof-logger.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 3 +++
 sound/soc/sof/mediatek/mt8195/mt8195.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index af0dfc2fc4cc..dbea604ebc04 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -588,6 +588,9 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
 	.drv		= mt8186_dai,
 	.num_drv	= ARRAY_SIZE(mt8186_dai),
 
+	/* Debug information */
+	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
+
 	/* PM */
 	.suspend	= mt8186_dsp_suspend,
 	.resume		= mt8186_dsp_resume,
diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 3c81e84fcecf..11ceff3acc54 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -642,6 +642,7 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
 
 	/* Debug information */
 	.dbg_dump = mt8195_adsp_dump,
+	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
 	/* DAI drivers */
 	.drv = mt8195_dai,
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
@ 2022-12-22  7:21   ` Tinghan Shen
  0 siblings, 0 replies; 30+ messages in thread
From: Tinghan Shen @ 2022-12-22  7:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Tinghan Shen, Chunxu Li,
	Dan Carpenter, YC Hung, AngeloGioacchino Del Regno,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Set the generic iomem callback for debugfs_add_region_item to support
sof-logger.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 3 +++
 sound/soc/sof/mediatek/mt8195/mt8195.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index af0dfc2fc4cc..dbea604ebc04 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -588,6 +588,9 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
 	.drv		= mt8186_dai,
 	.num_drv	= ARRAY_SIZE(mt8186_dai),
 
+	/* Debug information */
+	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
+
 	/* PM */
 	.suspend	= mt8186_dsp_suspend,
 	.resume		= mt8186_dsp_resume,
diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 3c81e84fcecf..11ceff3acc54 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -642,6 +642,7 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = {
 
 	/* Debug information */
 	.dbg_dump = mt8195_adsp_dump,
+	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
 
 	/* DAI drivers */
 	.drv = mt8195_dai,
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
  2022-12-22  7:21   ` Tinghan Shen
  (?)
@ 2022-12-22 11:09     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:09 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Add support of SOF on MediaTek MT8188 SoC.
> MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
> The IPC communication between AP and DSP is based on shared DRAM and
> mailbox interrupt.
> 
> The change in the mt8186.h is compatible on both mt8186 and
> mt8188. The register controls booting the DSP core with the
> default address or the user specified address. Both mt8186
> and mt8188 should boot with the user specified boot in the driver.
> The usage of the register is the same on both SoC, but the
> control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
> and bit 0 on mt8188. Configure the redundant bit has noside effect
> on both SoCs.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> ---
>   sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
>   sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
>   2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
> index 79da25725987..af0dfc2fc4cc 100644
> --- a/sound/soc/sof/mediatek/mt8186/mt8186.c
> +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
> @@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
>   	.ops = &sof_mt8186_ops,
>   };
>   
> +static const struct sof_dev_desc sof_of_mt8188_desc = {
> +	.ipc_supported_mask	= BIT(SOF_IPC),
> +	.ipc_default		= SOF_IPC,
> +	.default_fw_path = {
> +		[SOF_IPC] = "mediatek/sof",
> +	},
> +	.default_tplg_path = {
> +		[SOF_IPC] = "mediatek/sof-tplg",
> +	},
> +	.default_fw_filename = {
> +		[SOF_IPC] = "sof-mt8188.ri",
> +	},
> +	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
> +	.ops = &sof_mt8186_ops,
> +};
> +
>   static const struct of_device_id sof_of_mt8186_ids[] = {
>   	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
> +	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
>   	{ }
>   };
>   MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
> diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
> index 98b2965e5ba6..886d687449e3 100644
> --- a/sound/soc/sof/mediatek/mt8186/mt8186.h
> +++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
> @@ -52,7 +52,8 @@ struct snd_sof_dev;
>   #define ADSP_PRID			0x0
>   #define ADSP_ALTVEC_C0			0x04
>   #define ADSP_ALTVECSEL			0x0C
> -#define ADSP_ALTVECSEL_C0		BIT(1)
> +/* BIT(1) for mt8186. BIT(0) for mt8188 */

We can be clearer here:

#define MT8188_ADSP_ALTVECSEL_C0	BIT(0)
#define MT8186_ADSP_ALTVECSEL_C0	BIT(1)

/*
  * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
  * We can simplify the driver by safely setting both bits regardless of the SoC.
  */
#define ADSP_ALTVECSEL_C0		(MT8188_ADSP_ALTVECSEL_C0 |
					 MT8186_ADSP_ALTVECSEL_C0)

...so that we don't have to check the commit history to understand what's going
on here, and it becomes clear that ALTVECSEL is not both bits, but one of them.

Cheers,
Angelo


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
@ 2022-12-22 11:09     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:09 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Add support of SOF on MediaTek MT8188 SoC.
> MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
> The IPC communication between AP and DSP is based on shared DRAM and
> mailbox interrupt.
> 
> The change in the mt8186.h is compatible on both mt8186 and
> mt8188. The register controls booting the DSP core with the
> default address or the user specified address. Both mt8186
> and mt8188 should boot with the user specified boot in the driver.
> The usage of the register is the same on both SoC, but the
> control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
> and bit 0 on mt8188. Configure the redundant bit has noside effect
> on both SoCs.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> ---
>   sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
>   sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
>   2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
> index 79da25725987..af0dfc2fc4cc 100644
> --- a/sound/soc/sof/mediatek/mt8186/mt8186.c
> +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
> @@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
>   	.ops = &sof_mt8186_ops,
>   };
>   
> +static const struct sof_dev_desc sof_of_mt8188_desc = {
> +	.ipc_supported_mask	= BIT(SOF_IPC),
> +	.ipc_default		= SOF_IPC,
> +	.default_fw_path = {
> +		[SOF_IPC] = "mediatek/sof",
> +	},
> +	.default_tplg_path = {
> +		[SOF_IPC] = "mediatek/sof-tplg",
> +	},
> +	.default_fw_filename = {
> +		[SOF_IPC] = "sof-mt8188.ri",
> +	},
> +	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
> +	.ops = &sof_mt8186_ops,
> +};
> +
>   static const struct of_device_id sof_of_mt8186_ids[] = {
>   	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
> +	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
>   	{ }
>   };
>   MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
> diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
> index 98b2965e5ba6..886d687449e3 100644
> --- a/sound/soc/sof/mediatek/mt8186/mt8186.h
> +++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
> @@ -52,7 +52,8 @@ struct snd_sof_dev;
>   #define ADSP_PRID			0x0
>   #define ADSP_ALTVEC_C0			0x04
>   #define ADSP_ALTVECSEL			0x0C
> -#define ADSP_ALTVECSEL_C0		BIT(1)
> +/* BIT(1) for mt8186. BIT(0) for mt8188 */

We can be clearer here:

#define MT8188_ADSP_ALTVECSEL_C0	BIT(0)
#define MT8186_ADSP_ALTVECSEL_C0	BIT(1)

/*
  * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
  * We can simplify the driver by safely setting both bits regardless of the SoC.
  */
#define ADSP_ALTVECSEL_C0		(MT8188_ADSP_ALTVECSEL_C0 |
					 MT8186_ADSP_ALTVECSEL_C0)

...so that we don't have to check the commit history to understand what's going
on here, and it becomes clear that ALTVECSEL is not both bits, but one of them.

Cheers,
Angelo


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
@ 2022-12-22 11:09     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:09 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Add support of SOF on MediaTek MT8188 SoC.
> MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
> The IPC communication between AP and DSP is based on shared DRAM and
> mailbox interrupt.
> 
> The change in the mt8186.h is compatible on both mt8186 and
> mt8188. The register controls booting the DSP core with the
> default address or the user specified address. Both mt8186
> and mt8188 should boot with the user specified boot in the driver.
> The usage of the register is the same on both SoC, but the
> control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
> and bit 0 on mt8188. Configure the redundant bit has noside effect
> on both SoCs.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> ---
>   sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
>   sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
>   2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
> index 79da25725987..af0dfc2fc4cc 100644
> --- a/sound/soc/sof/mediatek/mt8186/mt8186.c
> +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
> @@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
>   	.ops = &sof_mt8186_ops,
>   };
>   
> +static const struct sof_dev_desc sof_of_mt8188_desc = {
> +	.ipc_supported_mask	= BIT(SOF_IPC),
> +	.ipc_default		= SOF_IPC,
> +	.default_fw_path = {
> +		[SOF_IPC] = "mediatek/sof",
> +	},
> +	.default_tplg_path = {
> +		[SOF_IPC] = "mediatek/sof-tplg",
> +	},
> +	.default_fw_filename = {
> +		[SOF_IPC] = "sof-mt8188.ri",
> +	},
> +	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
> +	.ops = &sof_mt8186_ops,
> +};
> +
>   static const struct of_device_id sof_of_mt8186_ids[] = {
>   	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
> +	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
>   	{ }
>   };
>   MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
> diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
> index 98b2965e5ba6..886d687449e3 100644
> --- a/sound/soc/sof/mediatek/mt8186/mt8186.h
> +++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
> @@ -52,7 +52,8 @@ struct snd_sof_dev;
>   #define ADSP_PRID			0x0
>   #define ADSP_ALTVEC_C0			0x04
>   #define ADSP_ALTVECSEL			0x0C
> -#define ADSP_ALTVECSEL_C0		BIT(1)
> +/* BIT(1) for mt8186. BIT(0) for mt8188 */

We can be clearer here:

#define MT8188_ADSP_ALTVECSEL_C0	BIT(0)
#define MT8186_ADSP_ALTVECSEL_C0	BIT(1)

/*
  * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
  * We can simplify the driver by safely setting both bits regardless of the SoC.
  */
#define ADSP_ALTVECSEL_C0		(MT8188_ADSP_ALTVECSEL_C0 |
					 MT8186_ADSP_ALTVECSEL_C0)

...so that we don't have to check the commit history to understand what's going
on here, and it becomes clear that ALTVECSEL is not both bits, but one of them.

Cheers,
Angelo


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
  2022-12-22  7:21   ` Tinghan Shen
  (?)
@ 2022-12-22 11:10     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:10 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Set the generic iomem callback for debugfs_add_region_item to support
> sof-logger.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
@ 2022-12-22 11:10     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:10 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Set the generic iomem callback for debugfs_add_region_item to support
> sof-logger.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
@ 2022-12-22 11:10     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:10 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Set the generic iomem callback for debugfs_add_region_item to support
> sof-logger.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
  2022-12-22  7:21   ` Tinghan Shen
  (?)
@ 2022-12-22 11:10     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:10 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
> for pre- and post- audio processing.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
@ 2022-12-22 11:10     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:10 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
> for pre- and post- audio processing.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
@ 2022-12-22 11:10     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-12-22 11:10 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

Il 22/12/22 08:21, Tinghan Shen ha scritto:
> Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
> for pre- and post- audio processing.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
  2022-12-22  7:21   ` Tinghan Shen
  (?)
@ 2022-12-22 12:04     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-22 12:04 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	AngeloGioacchino Del Regno, Allen-KH Cheng
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

On 22/12/2022 08:21, Tinghan Shen wrote:
> Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
> for pre- and post- audio processing.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>


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

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
@ 2022-12-22 12:04     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-22 12:04 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	AngeloGioacchino Del Regno, Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

On 22/12/2022 08:21, Tinghan Shen wrote:
> Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
> for pre- and post- audio processing.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>


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

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
@ 2022-12-22 12:04     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-22 12:04 UTC (permalink / raw)
  To: Tinghan Shen, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	AngeloGioacchino Del Regno, Allen-KH Cheng
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

On 22/12/2022 08:21, Tinghan Shen wrote:
> Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
> for pre- and post- audio processing.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>


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

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
  2022-12-22 11:09     ` AngeloGioacchino Del Regno
  (?)
@ 2023-01-10  8:32       ` TingHan Shen (沈廷翰)
  -1 siblings, 0 replies; 30+ messages in thread
From: TingHan Shen (沈廷翰) @ 2023-01-10  8:32 UTC (permalink / raw)
  To: robh+dt, YC Hung (洪堯俊),
	kai.vehmanen, Chunxu Li (李春旭),
	pierre-louis.bossart, Allen-KH Cheng (程冠勳),
	broonie, tiwai, yung-chuan.liao, lgirdwood,
	krzysztof.kozlowski+dt, matthias.bgg, peter.ujfalusi, perex,
	daniel.baluta, angelogioacchino.delregno, ranjani.sridharan,
	error27
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek,
	sound-open-firmware, alsa-devel, devicetree,
	Project_Global_Chrome_Upstream_Group

Hi Angelo,

On Thu, 2022-12-22 at 12:09 +0100, AngeloGioacchino Del Regno wrote:
> Il 22/12/22 08:21, Tinghan Shen ha scritto:
> > Add support of SOF on MediaTek MT8188 SoC.
> > MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
> > The IPC communication between AP and DSP is based on shared DRAM and
> > mailbox interrupt.
> > 
> > The change in the mt8186.h is compatible on both mt8186 and
> > mt8188. The register controls booting the DSP core with the
> > default address or the user specified address. Both mt8186
> > and mt8188 should boot with the user specified boot in the driver.
> > The usage of the register is the same on both SoC, but the
> > control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
> > and bit 0 on mt8188. Configure the redundant bit has noside effect
> > on both SoCs.
> > 
> > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> > Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> > Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> > ---
> >   sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
> >   sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
> >   2 files changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
> > index 79da25725987..af0dfc2fc4cc 100644
> > --- a/sound/soc/sof/mediatek/mt8186/mt8186.c
> > +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
> > @@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
> >   	.ops = &sof_mt8186_ops,
> >   };
> >   
> > +static const struct sof_dev_desc sof_of_mt8188_desc = {
> > +	.ipc_supported_mask	= BIT(SOF_IPC),
> > +	.ipc_default		= SOF_IPC,
> > +	.default_fw_path = {
> > +		[SOF_IPC] = "mediatek/sof",
> > +	},
> > +	.default_tplg_path = {
> > +		[SOF_IPC] = "mediatek/sof-tplg",
> > +	},
> > +	.default_fw_filename = {
> > +		[SOF_IPC] = "sof-mt8188.ri",
> > +	},
> > +	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
> > +	.ops = &sof_mt8186_ops,
> > +};
> > +
> >   static const struct of_device_id sof_of_mt8186_ids[] = {
> >   	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
> > +	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
> >   	{ }
> >   };
> >   MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
> > diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
> > index 98b2965e5ba6..886d687449e3 100644
> > --- a/sound/soc/sof/mediatek/mt8186/mt8186.h
> > +++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
> > @@ -52,7 +52,8 @@ struct snd_sof_dev;
> >   #define ADSP_PRID			0x0
> >   #define ADSP_ALTVEC_C0			0x04
> >   #define ADSP_ALTVECSEL			0x0C
> > -#define ADSP_ALTVECSEL_C0		BIT(1)
> > +/* BIT(1) for mt8186. BIT(0) for mt8188 */
> 
> We can be clearer here:
> 
> #define MT8188_ADSP_ALTVECSEL_C0	BIT(0)
> #define MT8186_ADSP_ALTVECSEL_C0	BIT(1)
> 
> /*
>   * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
>   * We can simplify the driver by safely setting both bits regardless of the SoC.
>   */
> #define ADSP_ALTVECSEL_C0		(MT8188_ADSP_ALTVECSEL_C0 |
> 					 MT8186_ADSP_ALTVECSEL_C0)
> 
> ...so that we don't have to check the commit history to understand what's going
> on here, and it becomes clear that ALTVECSEL is not both bits, but one of them.
> 
> Cheers,
> Angelo
> 

Ok, I'll udpate in the next version.
Thank you.

--
Best regards,
TingHan

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
@ 2023-01-10  8:32       ` TingHan Shen (沈廷翰)
  0 siblings, 0 replies; 30+ messages in thread
From: TingHan Shen (沈廷翰) @ 2023-01-10  8:32 UTC (permalink / raw)
  To: robh+dt, YC Hung (洪堯俊),
	kai.vehmanen, Chunxu Li (李春旭),
	pierre-louis.bossart, Allen-KH Cheng (程冠勳),
	broonie, tiwai, yung-chuan.liao, lgirdwood,
	krzysztof.kozlowski+dt, matthias.bgg, peter.ujfalusi, perex,
	daniel.baluta, angelogioacchino.delregno, ranjani.sridharan,
	error27
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

Hi Angelo,

On Thu, 2022-12-22 at 12:09 +0100, AngeloGioacchino Del Regno wrote:
> Il 22/12/22 08:21, Tinghan Shen ha scritto:
> > Add support of SOF on MediaTek MT8188 SoC.
> > MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
> > The IPC communication between AP and DSP is based on shared DRAM and
> > mailbox interrupt.
> > 
> > The change in the mt8186.h is compatible on both mt8186 and
> > mt8188. The register controls booting the DSP core with the
> > default address or the user specified address. Both mt8186
> > and mt8188 should boot with the user specified boot in the driver.
> > The usage of the register is the same on both SoC, but the
> > control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
> > and bit 0 on mt8188. Configure the redundant bit has noside effect
> > on both SoCs.
> > 
> > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> > Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> > Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> > ---
> >   sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
> >   sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
> >   2 files changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
> > index 79da25725987..af0dfc2fc4cc 100644
> > --- a/sound/soc/sof/mediatek/mt8186/mt8186.c
> > +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
> > @@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
> >   	.ops = &sof_mt8186_ops,
> >   };
> >   
> > +static const struct sof_dev_desc sof_of_mt8188_desc = {
> > +	.ipc_supported_mask	= BIT(SOF_IPC),
> > +	.ipc_default		= SOF_IPC,
> > +	.default_fw_path = {
> > +		[SOF_IPC] = "mediatek/sof",
> > +	},
> > +	.default_tplg_path = {
> > +		[SOF_IPC] = "mediatek/sof-tplg",
> > +	},
> > +	.default_fw_filename = {
> > +		[SOF_IPC] = "sof-mt8188.ri",
> > +	},
> > +	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
> > +	.ops = &sof_mt8186_ops,
> > +};
> > +
> >   static const struct of_device_id sof_of_mt8186_ids[] = {
> >   	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
> > +	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
> >   	{ }
> >   };
> >   MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
> > diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
> > index 98b2965e5ba6..886d687449e3 100644
> > --- a/sound/soc/sof/mediatek/mt8186/mt8186.h
> > +++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
> > @@ -52,7 +52,8 @@ struct snd_sof_dev;
> >   #define ADSP_PRID			0x0
> >   #define ADSP_ALTVEC_C0			0x04
> >   #define ADSP_ALTVECSEL			0x0C
> > -#define ADSP_ALTVECSEL_C0		BIT(1)
> > +/* BIT(1) for mt8186. BIT(0) for mt8188 */
> 
> We can be clearer here:
> 
> #define MT8188_ADSP_ALTVECSEL_C0	BIT(0)
> #define MT8186_ADSP_ALTVECSEL_C0	BIT(1)
> 
> /*
>   * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
>   * We can simplify the driver by safely setting both bits regardless of the SoC.
>   */
> #define ADSP_ALTVECSEL_C0		(MT8188_ADSP_ALTVECSEL_C0 |
> 					 MT8186_ADSP_ALTVECSEL_C0)
> 
> ...so that we don't have to check the commit history to understand what's going
> on here, and it becomes clear that ALTVECSEL is not both bits, but one of them.
> 
> Cheers,
> Angelo
> 

Ok, I'll udpate in the next version.
Thank you.

--
Best regards,
TingHan

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform
@ 2023-01-10  8:32       ` TingHan Shen (沈廷翰)
  0 siblings, 0 replies; 30+ messages in thread
From: TingHan Shen (沈廷翰) @ 2023-01-10  8:32 UTC (permalink / raw)
  To: robh+dt, YC Hung (洪堯俊),
	kai.vehmanen, Chunxu Li (李春旭),
	pierre-louis.bossart, Allen-KH Cheng (程冠勳),
	broonie, tiwai, yung-chuan.liao, lgirdwood,
	krzysztof.kozlowski+dt, matthias.bgg, peter.ujfalusi, perex,
	daniel.baluta, angelogioacchino.delregno, ranjani.sridharan,
	error27
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek,
	sound-open-firmware, alsa-devel, devicetree,
	Project_Global_Chrome_Upstream_Group

Hi Angelo,

On Thu, 2022-12-22 at 12:09 +0100, AngeloGioacchino Del Regno wrote:
> Il 22/12/22 08:21, Tinghan Shen ha scritto:
> > Add support of SOF on MediaTek MT8188 SoC.
> > MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
> > The IPC communication between AP and DSP is based on shared DRAM and
> > mailbox interrupt.
> > 
> > The change in the mt8186.h is compatible on both mt8186 and
> > mt8188. The register controls booting the DSP core with the
> > default address or the user specified address. Both mt8186
> > and mt8188 should boot with the user specified boot in the driver.
> > The usage of the register is the same on both SoC, but the
> > control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
> > and bit 0 on mt8188. Configure the redundant bit has noside effect
> > on both SoCs.
> > 
> > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> > Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> > Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> > ---
> >   sound/soc/sof/mediatek/mt8186/mt8186.c | 17 +++++++++++++++++
> >   sound/soc/sof/mediatek/mt8186/mt8186.h |  3 ++-
> >   2 files changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
> > index 79da25725987..af0dfc2fc4cc 100644
> > --- a/sound/soc/sof/mediatek/mt8186/mt8186.c
> > +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
> > @@ -625,8 +625,25 @@ static const struct sof_dev_desc sof_of_mt8186_desc = {
> >   	.ops = &sof_mt8186_ops,
> >   };
> >   
> > +static const struct sof_dev_desc sof_of_mt8188_desc = {
> > +	.ipc_supported_mask	= BIT(SOF_IPC),
> > +	.ipc_default		= SOF_IPC,
> > +	.default_fw_path = {
> > +		[SOF_IPC] = "mediatek/sof",
> > +	},
> > +	.default_tplg_path = {
> > +		[SOF_IPC] = "mediatek/sof-tplg",
> > +	},
> > +	.default_fw_filename = {
> > +		[SOF_IPC] = "sof-mt8188.ri",
> > +	},
> > +	.nocodec_tplg_filename = "sof-mt8188-nocodec.tplg",
> > +	.ops = &sof_mt8186_ops,
> > +};
> > +
> >   static const struct of_device_id sof_of_mt8186_ids[] = {
> >   	{ .compatible = "mediatek,mt8186-dsp", .data = &sof_of_mt8186_desc},
> > +	{ .compatible = "mediatek,mt8188-dsp", .data = &sof_of_mt8188_desc},
> >   	{ }
> >   };
> >   MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
> > diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.h b/sound/soc/sof/mediatek/mt8186/mt8186.h
> > index 98b2965e5ba6..886d687449e3 100644
> > --- a/sound/soc/sof/mediatek/mt8186/mt8186.h
> > +++ b/sound/soc/sof/mediatek/mt8186/mt8186.h
> > @@ -52,7 +52,8 @@ struct snd_sof_dev;
> >   #define ADSP_PRID			0x0
> >   #define ADSP_ALTVEC_C0			0x04
> >   #define ADSP_ALTVECSEL			0x0C
> > -#define ADSP_ALTVECSEL_C0		BIT(1)
> > +/* BIT(1) for mt8186. BIT(0) for mt8188 */
> 
> We can be clearer here:
> 
> #define MT8188_ADSP_ALTVECSEL_C0	BIT(0)
> #define MT8186_ADSP_ALTVECSEL_C0	BIT(1)
> 
> /*
>   * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
>   * We can simplify the driver by safely setting both bits regardless of the SoC.
>   */
> #define ADSP_ALTVECSEL_C0		(MT8188_ADSP_ALTVECSEL_C0 |
> 					 MT8186_ADSP_ALTVECSEL_C0)
> 
> ...so that we don't have to check the commit history to understand what's going
> on here, and it becomes clear that ALTVECSEL is not both bits, but one of them.
> 
> Cheers,
> Angelo
> 

Ok, I'll udpate in the next version.
Thank you.

--
Best regards,
TingHan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF
  2022-12-22  7:21 ` Tinghan Shen
  (?)
@ 2023-01-10 16:53   ` Mark Brown
  -1 siblings, 0 replies; 30+ messages in thread
From: Mark Brown @ 2023-01-10 16:53 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Jaroslav Kysela,
	Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	AngeloGioacchino Del Regno, Allen-KH Cheng, Tinghan Shen
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

On Thu, 22 Dec 2022 15:21:47 +0800, Tinghan Shen wrote:
> Add support of MediaTek mt8188 SoC DSP to SOF.
> The sof driver patches in this series are taken from
> thesofproject/linux/tree/topic/sof-dev-rebase.
> 
> Tinghan Shen (3):
>   dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
>   ASoC: SOF: mediatek: Support mt8188 platform
>   ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
      commit: e15ec6892832d586069ce575c222366b94ad6a5e
[2/3] ASoC: SOF: mediatek: Support mt8188 platform
      commit: 6b43538f0698695fba9aa0c0b29a80c555cf1b63
[3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
      commit: 6fa8c0732bff8e0ab794736837b25dc7ac38cd54

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF
@ 2023-01-10 16:53   ` Mark Brown
  0 siblings, 0 replies; 30+ messages in thread
From: Mark Brown @ 2023-01-10 16:53 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Jaroslav Kysela,
	Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	AngeloGioacchino Del Regno, Allen-KH Cheng, Tinghan Shen
  Cc: devicetree, alsa-devel, linux-kernel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

On Thu, 22 Dec 2022 15:21:47 +0800, Tinghan Shen wrote:
> Add support of MediaTek mt8188 SoC DSP to SOF.
> The sof driver patches in this series are taken from
> thesofproject/linux/tree/topic/sof-dev-rebase.
> 
> Tinghan Shen (3):
>   dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
>   ASoC: SOF: mediatek: Support mt8188 platform
>   ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
      commit: e15ec6892832d586069ce575c222366b94ad6a5e
[2/3] ASoC: SOF: mediatek: Support mt8188 platform
      commit: 6b43538f0698695fba9aa0c0b29a80c555cf1b63
[3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
      commit: 6fa8c0732bff8e0ab794736837b25dc7ac38cd54

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF
@ 2023-01-10 16:53   ` Mark Brown
  0 siblings, 0 replies; 30+ messages in thread
From: Mark Brown @ 2023-01-10 16:53 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Jaroslav Kysela,
	Takashi Iwai, Chunxu Li, Dan Carpenter, YC Hung,
	AngeloGioacchino Del Regno, Allen-KH Cheng, Tinghan Shen
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	sound-open-firmware, alsa-devel,
	Project_Global_Chrome_Upstream_Group

On Thu, 22 Dec 2022 15:21:47 +0800, Tinghan Shen wrote:
> Add support of MediaTek mt8188 SoC DSP to SOF.
> The sof driver patches in this series are taken from
> thesofproject/linux/tree/topic/sof-dev-rebase.
> 
> Tinghan Shen (3):
>   dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
>   ASoC: SOF: mediatek: Support mt8188 platform
>   ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible
      commit: e15ec6892832d586069ce575c222366b94ad6a5e
[2/3] ASoC: SOF: mediatek: Support mt8188 platform
      commit: 6b43538f0698695fba9aa0c0b29a80c555cf1b63
[3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
      commit: 6fa8c0732bff8e0ab794736837b25dc7ac38cd54

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-01-10 16:55 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  7:21 [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF Tinghan Shen
2022-12-22  7:21 ` Tinghan Shen
2022-12-22  7:21 ` Tinghan Shen
2022-12-22  7:21 ` [PATCH v1 1/3] dt-bindings: dsp: mediatek: Add mt8188 dsp compatible Tinghan Shen
2022-12-22  7:21   ` Tinghan Shen
2022-12-22  7:21   ` Tinghan Shen
2022-12-22 11:10   ` AngeloGioacchino Del Regno
2022-12-22 11:10     ` AngeloGioacchino Del Regno
2022-12-22 11:10     ` AngeloGioacchino Del Regno
2022-12-22 12:04   ` Krzysztof Kozlowski
2022-12-22 12:04     ` Krzysztof Kozlowski
2022-12-22 12:04     ` Krzysztof Kozlowski
2022-12-22  7:21 ` [PATCH v1 2/3] ASoC: SOF: mediatek: Support mt8188 platform Tinghan Shen
2022-12-22  7:21   ` Tinghan Shen
2022-12-22  7:21   ` Tinghan Shen
2022-12-22 11:09   ` AngeloGioacchino Del Regno
2022-12-22 11:09     ` AngeloGioacchino Del Regno
2022-12-22 11:09     ` AngeloGioacchino Del Regno
2023-01-10  8:32     ` TingHan Shen (沈廷翰)
2023-01-10  8:32       ` TingHan Shen (沈廷翰)
2023-01-10  8:32       ` TingHan Shen (沈廷翰)
2022-12-22  7:21 ` [PATCH v1 3/3] ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core Tinghan Shen
2022-12-22  7:21   ` Tinghan Shen
2022-12-22  7:21   ` Tinghan Shen
2022-12-22 11:10   ` AngeloGioacchino Del Regno
2022-12-22 11:10     ` AngeloGioacchino Del Regno
2022-12-22 11:10     ` AngeloGioacchino Del Regno
2023-01-10 16:53 ` [PATCH v1 0/3] Add support of MediaTek mt8188 to SOF Mark Brown
2023-01-10 16:53   ` Mark Brown
2023-01-10 16:53   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.