AnsweredAssumed Answered

i.mx6q I2S sdma hangs

Question asked by Alexander Smirnov on Mar 27, 2013

Dear all,

 

I have a custom board based on i.MX6q SoC. There is a codec installed on the board which is connected to AUDPORT4 over I2S.

I created a simple drivers for ALSA based on existing ones. In my case i.MX6q is master, so I changed relative options, below are most important configuration prints from my codec:

 

static int cs4344_params(struct snd_pcm_substream *substream,

        struct snd_pcm_hw_params *params)

{

          dai_format = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |

                              SND_SOC_DAIFMT_CBS_CFS;

 

          ssi_mode->flags |= IMX_SSI_SYN;

 

          snd_soc_dai_set_tdm_slot(cpu_dai, 0xfffffffc, 0xfffffffc, 2, 32);

 

          ret = snd_soc_dai_set_fmt(cpu_dai, dai_format);

          if (ret < 0)

               return ret;

 

          snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, SND_SOC_CLOCK_OUT);

          snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PM, 4);

          snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_2, 1);

          snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PSR, 0);

}

 

static int imx_audmux_config(int slave, int master)

{

        unsigned int ptcr = 0, pdcr = 0;

        slave = slave - 1;

        master = master - 1;

 

        mxc_audmux_v2_configure_port(slave, ptcr, pdcr);

        mxc_audmux_v2_configure_port(master, ptcr, pdcr);

 

        /* SSI0 mastered by port 5 */

        ptcr = MXC_AUDMUX_V2_PTCR_SYN |

                MXC_AUDMUX_V2_PTCR_TFSDIR |

                MXC_AUDMUX_V2_PTCR_TFSEL(master) |

                MXC_AUDMUX_V2_PTCR_TCLKDIR |

                MXC_AUDMUX_V2_PTCR_TCSEL(master);

        pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(master);

        mxc_audmux_v2_configure_port(slave, ptcr, pdcr);

 

        ptcr = MXC_AUDMUX_V2_PTCR_SYN;

        pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(slave);

        mxc_audmux_v2_configure_port(master, ptcr, pdcr);

 

        return 0;

}

 

static int __devinit imx_cs4344_probe(struct platform_device *pdev)

{

 

 

....

          imx_audmux_config(plat->ext_port, plat->src_port);

...

}

 

As a result, I try to run aplay, but it hangs. But meantime I see on oscilloscope, that TXC and TXFS clocks are working. I've enabled debug info in sdma and attached the log.

 

What can be the problem, why SDMA isn't working? Also I pushed sdma firmware to /lib/firmware/sdma folder and now my board hangs for about 60 sec during boot.

 

Thank a lot in advance!

 

Alex

Original Attachment has been moved to: aplay.log.zip

Outcomes