Error in DMA for ESAI1 in i.MX8QM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in DMA for ESAI1 in i.MX8QM

715 Views
asconcepcion
Contributor I

Hi,

We're trying to use ESAI1 to communicate with an I2S device. We use Linux kernel 5.10. Below you can find the device tree configuration for that.

 

&iomuxc {
	pinctrl_esai1: esai1grp {
		fsl,pins = <
			IMX8QM_ESAI1_FST_AUD_ESAI1_FST          0x00000061
			IMX8QM_ESAI1_SCKT_AUD_ESAI1_SCKT        0x00000061
			IMX8QM_ESAI1_TX0_AUD_ESAI1_TX0          0x00000061
			IMX8QM_ESAI1_TX5_RX0_AUD_ESAI1_TX5_RX0  0x00000020
		>;
	};
};


&esai1 {
	#sound-dai-cells = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_esai1>;
	assigned-clocks = <&acm IMX_ADMA_ACM_ESAI1_MCLK_SEL>,
			<&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_PLL>,
			<&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_SLV_BUS>,
			<&clk IMX_SC_R_AUDIO_PLL_0 IMX_SC_PM_CLK_MST_BUS>,
			<&esai1_lpcg 0>;
	assigned-clock-parents = <&aud_pll_div0_lpcg 0>;
	assigned-clock-rates = <0>, <786432000>, <49152000>, <12288000>, <49152000>;
	fsl,txs-rxm;
	status = "okay";
};

/* Define sound card */
/ {
	sound-card {
		compatible = "test,soundcard";
		model = "custom-soundcard";
		audio-cpu = <&esai1>;
		audio-codec = <&codec>;
	};
};

 

 

The problem is that we don't see any ALSA sound-card in the system, and in the kernel log we see an error coming from ESAI1 that seems related to DMA:

 

[   13.282432] fsl-esai-dai 59810000.esai: Missing dma channel for stream: 0
[   13.304312] fsl-esai-dai 59810000.esai: ASoC: error at snd_soc_pcm_component_new on 59810000.esai: -22

 

 

Could there be anything missing in our configuration?

Thanks!

 

0 Kudos
Reply
2 Replies

708 Views
asconcepcion
Contributor I

Hi,

It looks like the original eDMA node didn't expose the channels required for ESAI1. Adding the following lines made the error disappear:

@@ -40,22 +40,27 @@ &edma1{
                <0x59A30000 0x10000>,
                <0x59A40000 0x10000>,
                <0x59A50000 0x10000>,
+               <0x59A60000 0x10000>, /* esai1 rx */
+               <0x59A70000 0x10000>, /* esai1 tx */
                <0x59A80000 0x10000>, /* sai6 rx */
                <0x59A90000 0x10000>, /* sai6 tx */
                <0x59AA0000 0x10000>; /* sai7 tx */
-       dma-channels = <9>;
+       dma-channels = <11>;
        interrupts = <GIC_SPI 382 IRQ_TYPE_LEVEL_HIGH>, /* asrc1 */
                        <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 384 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 385 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 387 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 412 IRQ_TYPE_LEVEL_HIGH>, /* esai1 */
+                       <GIC_SPI 412 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>, /* sai6 */
                        <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>; /* sai7 */
        interrupt-names = "edma3-chan0-rx", "edma3-chan1-rx", /* asrc1 */
                        "edma3-chan2-rx", "edma3-chan3-tx",
                        "edma3-chan4-tx", "edma3-chan5-tx",
+                       "edma3-chan6-tx", "edma3-chan7-tx", /* esai1 */
                        "edma3-chan8-rx", "edma3-chan9-tx", /* sai6 */
                        "edma3-chan10-tx";                 /* sai7 */
        power-domains = <&pd IMX_SC_R_DMA_3_CH0>,
@@ -64,12 +69,15 @@ &edma1{
                        <&pd IMX_SC_R_DMA_3_CH3>,
                        <&pd IMX_SC_R_DMA_3_CH4>,
                        <&pd IMX_SC_R_DMA_3_CH5>,
+                       <&pd IMX_SC_R_DMA_3_CH6>,
+                       <&pd IMX_SC_R_DMA_3_CH7>,
                        <&pd IMX_SC_R_DMA_3_CH8>,
                        <&pd IMX_SC_R_DMA_3_CH9>,
                        <&pd IMX_SC_R_DMA_3_CH10>;
        power-domain-names = "edma3-chan0", "edma3-chan1",
                             "edma3-chan2", "edma3-chan3",
                             "edma3-chan4", "edma3-chan5",
+                            "edma3-chan6", "edma3-chan7",
                             "edma3-chan8", "edma3-chan9",
                             "edma3-chan10";
 };

 

Can someone confirm that I'm assigning the correct IRQ number for the channels 6 and 7 of the eDMA meant for ESAI1? Is there anything else needed to make ESAI1 work with a 4 channels 48kHz soundcard?

0 Kudos
Reply

700 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @asconcepcion,

According to “Table 17-3. eDMA1 Channel Map”, the ESAI1 channel number in edma is 6 and 7.

 

Best Regards,
Dhruvit.

0 Kudos
Reply