Unverified Commit 0bdb2bbe authored by Mark Brown's avatar Mark Brown
Browse files

Add support of MediaTek mt8188 to SOF

Merge series from Tinghan Shen <tinghan.shen@mediatek.com>:

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.
parents 1a77d59e 6fa8c073
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@ description: |

properties:
  compatible:
    const: mediatek,mt8186-dsp
    enum:
      - mediatek,mt8186-dsp
      - mediatek,mt8188-dsp

  reg:
    items:
+20 −0
Original line number Diff line number Diff line
@@ -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,
@@ -625,8 +628,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);
+9 −1
Original line number Diff line number Diff line
@@ -52,7 +52,15 @@ struct snd_sof_dev;
#define ADSP_PRID			0x0
#define ADSP_ALTVEC_C0			0x04
#define ADSP_ALTVECSEL			0x0C
#define ADSP_ALTVECSEL_C0		BIT(1)
#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)

/* dsp bus */
#define ADSP_SRAM_POOL_CON		0x190
+1 −0
Original line number Diff line number Diff line
@@ -637,6 +637,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,