[alsa-devel] [PATCH 0/4] Add a better separation between i.MX8 families
From: Daniel Baluta daniel.baluta@nxp.com
So far the implementation was designed to support a generic platform named i.MX8. Anyhow, now working with specific i.MX8 instances we need to account for the differences.
i.MX8 naming can be confusing at the first glance, so we need to have a clean separation between different platforms.
Here is the split of i.MX8 per platforms. Notice that i.MX8 names the entire family, but also a sub-family.
imx8 ├── imx8 │ └── imx8qm (*) ├── imx8m │ ├── imx8mm │ ├── imx8mn │ ├── imx8mp (*) │ └── imx8mq └── imx8x └── imx8qxp (*)
Platforms marked with (*) contain a DSP. In the future there might be more platforms.
This patchseries does the following: * renames imx8 to imx8x (because the only supported platform now is imx8qxp). * adds support for imx8 (which is imx8qm)
A future patchset will add supprot for i.MX8MP.
Paul Olaru (4): ASoC: SOF: Rename i.MX8 platform to i.MX8X ASoC: SOF: imx8: Add ops for i.MX8QM ASoC: SOF: Add i.MX8QM device descriptor dt-bindings: dsp: fsl: Add fsl,imx8qm-dsp entry
.../devicetree/bindings/dsp/fsl,dsp.yaml | 1 + sound/soc/sof/imx/imx8.c | 57 ++++++++++++++++++- sound/soc/sof/sof-of-dev.c | 10 ++++ 3 files changed, 65 insertions(+), 3 deletions(-)
From: Paul Olaru paul.olaru@nxp.com
i.MX8 and i.MX8X platforms are very similar and were treated the same. Anyhow, we need to account for the differences somehow.
Current supported platform is i.MX8QXP which is from i.MX8X family. Rename i.MX8 platform to i.MX8X to prepare for future i.MX8 platforms.
Signed-off-by: Paul Olaru paul.olaru@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com --- sound/soc/sof/imx/imx8.c | 10 +++++----- sound/soc/sof/sof-of-dev.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index aef6ca167b9c..94481adc2240 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -138,7 +138,7 @@ static int imx8_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) /* * DSP control. */ -static int imx8_run(struct snd_sof_dev *sdev) +static int imx8x_run(struct snd_sof_dev *sdev) { struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->private; int ret; @@ -361,13 +361,13 @@ static struct snd_soc_dai_driver imx8_dai[] = { }, };
-/* i.MX8 ops */ -struct snd_sof_dsp_ops sof_imx8_ops = { +/* i.MX8X ops */ +struct snd_sof_dsp_ops sof_imx8x_ops = { /* probe and remove */ .probe = imx8_probe, .remove = imx8_remove, /* DSP core boot */ - .run = imx8_run, + .run = imx8x_run,
/* Block IO */ .block_read = sof_block_read, @@ -399,6 +399,6 @@ struct snd_sof_dsp_ops sof_imx8_ops = { SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_NO_PERIOD_WAKEUP }; -EXPORT_SYMBOL(sof_imx8_ops); +EXPORT_SYMBOL(sof_imx8x_ops);
MODULE_LICENSE("Dual BSD/GPL"); diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index 39ea8af6213f..2da1bd859d98 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -19,9 +19,9 @@ extern struct snd_sof_dsp_ops sof_imx8_ops; static struct sof_dev_desc sof_of_imx8qxp_desc = { .default_fw_path = "imx/sof", .default_tplg_path = "imx/sof-tplg", - .default_fw_filename = "sof-imx8.ri", + .default_fw_filename = "sof-imx8x.ri", .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", - .ops = &sof_imx8_ops, + .ops = &sof_imx8x_ops, }; #endif
From: Paul Olaru paul.olaru@nxp.com
i.MX8QM and i.MX8QXP are mostly identical platforms with minor hardware differences. One of these differences affects the firmware boot process, requiring the run operation to differ. All other ops are reused.
Signed-off-by: Paul Olaru paul.olaru@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com --- sound/soc/sof/imx/imx8.c | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index 94481adc2240..a849a9380d88 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -178,6 +178,24 @@ static int imx8x_run(struct snd_sof_dev *sdev) return 0; }
+static int imx8_run(struct snd_sof_dev *sdev) +{ + struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->private; + int ret; + + ret = imx_sc_misc_set_control(dsp_priv->sc_ipc, IMX_SC_R_DSP, + IMX_SC_C_OFS_SEL, 0); + if (ret < 0) { + dev_err(sdev->dev, "Error system address offset source select\n"); + return ret; + } + + imx_sc_pm_cpu_start(dsp_priv->sc_ipc, IMX_SC_R_DSP, true, + RESET_VECTOR_VADDR); + + return 0; +} + static int imx8_probe(struct snd_sof_dev *sdev) { struct platform_device *pdev = @@ -361,6 +379,39 @@ static struct snd_soc_dai_driver imx8_dai[] = { }, };
+/* i.MX8 ops */ +struct snd_sof_dsp_ops sof_imx8_ops = { + /* probe and remove */ + .probe = imx8_probe, + .remove = imx8_remove, + /* DSP core boot */ + .run = imx8_run, + + /* Block IO */ + .block_read = sof_block_read, + .block_write = sof_block_write, + + /* ipc */ + .send_msg = imx8_send_msg, + .fw_ready = sof_fw_ready, + .get_mailbox_offset = imx8_get_mailbox_offset, + .get_window_offset = imx8_get_window_offset, + + .ipc_msg_data = imx8_ipc_msg_data, + .ipc_pcm_params = imx8_ipc_pcm_params, + + /* module loading */ + .load_module = snd_sof_parse_module_memcpy, + .get_bar_index = imx8_get_bar_index, + /* firmware loading */ + .load_firmware = snd_sof_load_firmware_memcpy, + + /* DAI drivers */ + .drv = imx8_dai, + .num_drv = 1, /* we have only 1 ESAI interface on i.MX8 */ +}; +EXPORT_SYMBOL(sof_imx8_ops); + /* i.MX8X ops */ struct snd_sof_dsp_ops sof_imx8x_ops = { /* probe and remove */
From: Paul Olaru paul.olaru@nxp.com
Add SOF device and DT descriptors for i.MX8QM platform.
Signed-off-by: Paul Olaru paul.olaru@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com --- sound/soc/sof/sof-of-dev.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index 2da1bd859d98..16e49f2ee629 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -13,6 +13,7 @@ #include "ops.h"
extern struct snd_sof_dsp_ops sof_imx8_ops; +extern struct snd_sof_dsp_ops sof_imx8x_ops;
/* platform specific devices */ #if IS_ENABLED(CONFIG_SND_SOC_SOF_IMX8) @@ -23,6 +24,14 @@ static struct sof_dev_desc sof_of_imx8qxp_desc = { .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8x_ops, }; + +static struct sof_dev_desc sof_of_imx8qm_desc = { + .default_fw_path = "imx/sof", + .default_tplg_path = "imx/sof-tplg", + .default_fw_filename = "sof-imx8.ri", + .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", + .ops = &sof_imx8_ops, +}; #endif
static const struct dev_pm_ops sof_of_pm = { @@ -103,6 +112,7 @@ static int sof_of_remove(struct platform_device *pdev) static const struct of_device_id sof_of_ids[] = { #if IS_ENABLED(CONFIG_SND_SOC_SOF_IMX8) { .compatible = "fsl,imx8qxp-dsp", .data = &sof_of_imx8qxp_desc}, + { .compatible = "fsl,imx8qm-dsp", .data = &sof_of_imx8qm_desc}, #endif { } };
From: Paul Olaru paul.olaru@nxp.com
This is the same DSP from the hardware point of view, but it gets a different compatible string due to usage in a separate platform.
Signed-off-by: Paul Olaru paul.olaru@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com --- Documentation/devicetree/bindings/dsp/fsl,dsp.yaml | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml index f04870d84542..30bc0db7f539 100644 --- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml +++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml @@ -17,6 +17,7 @@ properties: compatible: enum: - fsl,imx8qxp-dsp + - fsl,imx8qm-dsp
reg: description: Should contain register location and length
On 1/28/20 2:06 AM, Daniel Baluta (OSS) wrote:
From: Daniel Baluta daniel.baluta@nxp.com
So far the implementation was designed to support a generic platform named i.MX8. Anyhow, now working with specific i.MX8 instances we need to account for the differences.
i.MX8 naming can be confusing at the first glance, so we need to have a clean separation between different platforms.
Here is the split of i.MX8 per platforms. Notice that i.MX8 names the entire family, but also a sub-family.
imx8 ├── imx8 │ └── imx8qm (*) ├── imx8m │ ├── imx8mm │ ├── imx8mn │ ├── imx8mp (*) │ └── imx8mq └── imx8x └── imx8qxp (*)
Platforms marked with (*) contain a DSP. In the future there might be more platforms.
This patchseries does the following:
- renames imx8 to imx8x (because the only supported platform now is imx8qxp). * adds support for imx8 (which is imx8qm)
A future patchset will add supprot for i.MX8MP.
Paul Olaru (4): ASoC: SOF: Rename i.MX8 platform to i.MX8X ASoC: SOF: imx8: Add ops for i.MX8QM ASoC: SOF: Add i.MX8QM device descriptor dt-bindings: dsp: fsl: Add fsl,imx8qm-dsp entry
This patchset was reviewed on the SOF GitHub. I asked Daniel to send it directly to the relevant mailing list for ARM/Device Tree.
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
.../devicetree/bindings/dsp/fsl,dsp.yaml | 1 + sound/soc/sof/imx/imx8.c | 57 ++++++++++++++++++- sound/soc/sof/sof-of-dev.c | 10 ++++ 3 files changed, 65 insertions(+), 3 deletions(-)
participants (2)
-
Daniel Baluta (OSS)
-
Pierre-Louis Bossart