Skip to content

Add initial support for i.MX8 SOF driver - #1048

Merged
plbossart merged 3 commits into
thesofproject:topic/sof-devfrom
dbaluta:sof-dev-3
Aug 12, 2019
Merged

plbossart merged 3 commits into
thesofproject:topic/sof-devfrom
dbaluta:sof-dev-3

Conversation

@dbaluta

@dbaluta dbaluta commented Jun 18, 2019 •

Copy link
Copy Markdown
Collaborator

Hello @plbossart @ranj063 @lgirdwood
This is version 4 of the patches that add the initial DSP Linux driver for i.MX8 into SOF.

This version only contains SOF related patches and fixes review comments from @plbossart and Lucas Stach from arm mailing list:

https://lore.kernel.org/linux-arm-kernel/[email protected]/

This patches would require IMX DSP interface driver (which I hope to be soon merged by Shawn Guo - imx maintainer).

https://lkml.org/lkml/2019/8/1/260

Now there is the tricky part: how do we bring all these patches together because SOF Linux driver
depends on IMX DSP. I have handled this through KConfig depenencies. So, one cannot select SOF Linux driver compilation without imx dsp.


Hello @lgirdwood @ranj063 @plbossart
This is version 3 of the patch to add the initial DSP Linux driver for i.MX8 into SOF.

For compilation you need to use the following kconfig fragment:
thesofproject/kconfig#13

I have added all patches related to DSP here in order to be able to do a proper compilation.

these patches are under review with arm64/imx community
ASoC: SOF: Add DT DSP device support
dt-bindings: dsp: fsl: Add DSP core binding support
arm64: dts: imx8qxp: Add DSP DT node

these patches need to be reviewed by SOF community
ASoC: SOF: Add DT DSP device support
ASoC: SOF: topology: Add dummy support for i.MX8 DAIs
ASoC: SOF: imx: Add i.MX8 HW support

this patch is under review:
firmware: imx: Add DSP IPC protocol interface

Patches below are already accepted into Shawn's Guo tree for i.mx8 arm.

clk: imx8: Add DSP related clocks
firmware: imx: scu-pd: Add IRQSTR_DSP PD range
firmware: imx: scu-pd: Add mu13 b side PD range
firmware: imx: scu-pd: Rename mu PD range to mu_a
arm64: dts: imx8qxp: sort LSIO subsystem devices
arm64: dts: imx8qxp: Add lsio_mu13 node


Version 2:
Hello veryone @ranj063 @plbossart @lgirdwood. This is version 2 of the PR trying to add basic support for i.MX8.

What changed since v1:

  • i tried to address all your comments. We now support only no-codec mode
  • i removed the patches related to dsp ipc / dts / pd because I have sent them separately to corresponding maintainers.

All patches are here, together with some patches for serial console to work.
https://github.com/dbaluta/linux/commits/topic/sof-dev

All this patches were sent to review, as follows:

  1. power domains related changes:

https://lkml.org/lkml/2019/7/18/252

  1. DSP IPC interface

https://lkml.org/lkml/2019/7/18/123

  1. DSP DT node

@plbossart @lgirdwood what do you think would be the appropriate way to have this reviewed with the alsa community? I guess starting the patches to alsa-devel would be the right way to do?


Version 1:
This patch series add basic support for i.MX8 SOF driver.

First 3 patches introduce DSP IPC protocol driver (review with community ongoing - https://lkml.org/lkml/2019/6/14/165)

505a33c dt-bindings: arm: fsl: Add DSP IPC binding support
00a5e98 firmware: imx: Add DSP IPC protocol driver
d2a410a mailbox: imx: Clear GIEn bit at shutdown

Next 3 patches add DT nodes corresponding to DSP. Review will be started with community soon.

15ccaaa arm64: dts: imx8qxp: Add DSP DT node
d4dfab8 arm64: dts: imx8qxp: Add DSP MU node
76760c1 clk: imx8qxp: Add DSP clocks

Next 2 patches are small SOF cleanups that can be merged as they are:

7310ddc ASoC: SOF: loader: Dont ignore SRAM block types
23159b1 ASoC: SOF: loader: Use the BAR provided by FW

Last 3 patches are the actual support for i.MX8 SOF driver.

70dd8da ASoC: SOF: Add DT DSP device support
5b28a5e ASoC: SOF: topology: Add dummy support for i.MX8 DAIs
b79c490 ASoC: SOF: imx: Add i.MX8 HW support

Would like to see some review for last 5 patches.

Comment thread sound/soc/sof/topology.c Resolved
Comment thread sound/soc/sof/sof-dt-dev.c Resolved

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dbaluta, this is really cool.
I have a couple of comments below, mostly to make sure the license choice is intentional and on the machine driver load. This will likely need a bit more work to reconcile the DT and ACPI ways of dealing with the machine driver.
But yes, nice work!

Comment thread drivers/firmware/imx/imx-dsp.c Resolved
Comment thread drivers/firmware/imx/imx-dsp.c Resolved
Comment thread drivers/firmware/imx/imx-dsp.c Resolved
Comment thread sound/soc/sof/loader.c Resolved
Comment thread sound/soc/sof/loader.c Resolved
Comment thread sound/soc/sof/imx/imx8.c Resolved
Comment thread include/sound/sof/dai-imx.h Resolved
Comment thread sound/soc/sof/Kconfig Resolved
Comment thread sound/soc/sof/sof-dt-dev.c Resolved
Comment thread sound/soc/sof/sof-dt-dev.c Resolved
@dbaluta
dbaluta requested a review from plbossart July 23, 2019 15:00
@dbaluta dbaluta changed the title [RFC] Add initial support for i.MX8 SOF driver Add initial support for i.MX8 SOF driver Aug 7, 2019

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @dbaluta. Can you fix the Makefile conflicts (see comment below) and let's merge.
Thanks!

Comment thread sound/soc/sof/Makefile Resolved
Add support for device tree based SOF DSP devices.

Signed-off-by: Daniel Baluta <[email protected]>
plbossart
plbossart previously approved these changes Aug 9, 2019

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dbaluta
I'd like a second reviewer, I guess it'll be one of the usual suspects @ranj063 @kv2019i :-)

Comment thread sound/soc/sof/imx/imx8.c
static int imx8_run(struct snd_sof_dev *sdev)
{
int ret;
struct imx8_priv *dsp_priv = (struct imx8_priv *)sdev->private;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbaluta only minor but for the sake of consistency can you please switch the 2 statements so the struct goes first.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment thread sound/soc/sof/imx/imx8.c
static int imx8_remove(struct snd_sof_dev *sdev)
{
int i;
struct imx8_priv *priv = (struct imx8_priv *)sdev->private;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@ranj063

ranj063 commented Aug 9, 2019

Copy link
Copy Markdown
Collaborator

@dbaluta just wondering if you forgot to include a header file? where are the functions like imx_ring_doorbell() defined?

Add support for the audio DSP hardware found on NXP i.MX8 platform.

Signed-off-by: Daniel Baluta <[email protected]>
Add dummy support for SAI/ESAI digital audio interface
IPs found on i.MX8 boards.

Signed-off-by: Daniel Baluta <[email protected]>
@dbaluta

dbaluta commented Aug 11, 2019 •

Copy link
Copy Markdown
Collaborator Author

@ranj063 imx_ring_doorbell prototype is defined in #include <linux/firmware/imx/dsp.h>. This header is already included at the top of imx8.c file

dsp.h file will reach linux tree via imx8 maintainer. The patch was already send and reviewed here:

https://patchwork.kernel.org/patch/11048657/

Now, theoretically this PR doesn't compile on its own. It needs the patch above. Anyhow, the imx8 SOF driver has a Kconfig dependency on IMX DSP so practically we won't be able to select it for compilation until all changes get merged into the same tree.

@dbaluta

dbaluta commented Aug 12, 2019

Copy link
Copy Markdown
Collaborator Author

SOFCI TEST

@plbossart

Copy link
Copy Markdown
Member

ok let's merge and start including i.MX support!

@plbossart
plbossart merged commit c9da397 into thesofproject:topic/sof-dev Aug 12, 2019
@dbaluta

ghost commented Aug 12, 2019 •

Copy link
Copy Markdown
Collaborator Author

@plbossart thanks! IMX DSP protocol interface was accepted through Shawn's tree:

https://lkml.org/lkml/2019/8/12/605

We are still waiting for DTS file review and hopefully with your next rebase of sof-dev we will have a working imx initial support!

Thanks again for support and review!

@dbaluta
dbaluta deleted the sof-dev-3 branch August 12, 2019 15:37
@plbossart

ghost commented Aug 12, 2019 via email

Copy link
Copy Markdown
Member

@plbossart

ghost commented Aug 12, 2019

Copy link
Copy Markdown
Member

@dbaluta I just did a rebase on upstream, do you want me to send the patches directly to Mark?
see the topic/sof-dev-rebase branch.

@dbaluta

ghost commented Aug 12, 2019

Copy link
Copy Markdown
Collaborator Author

@plbossart yes, please send them to Mark. Also, for patches merged via other trees would be nice to cherry pick them if it isnt too stressful for you. Will provide with a pointer to linux-next once the patches are there.

@plbossart

ghost commented Aug 12, 2019 via email

Copy link
Copy Markdown
Member

@dbaluta

ghost commented Aug 12, 2019

Copy link
Copy Markdown
Collaborator Author

@plbossart thanks! Done.

#1125

What is the difference between topic/sof-dev and topic/sof-dev/rebase ?

Another question: are you also shipping SOF with 4.19 kernel?

@plbossart

ghost commented Aug 12, 2019 via email

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants