SAI2 not configured

Hello. We are having an issue with configuring a second SAI interface in conjunction with an AK4619 codec. I have attached configuration information and comments below, but please let me know if there is additional information that would be helpful.

The problem is that I haven’t been able to get the SAI2 interface to come up. Looking at the MCLK, BICK, LRCLK pins I don’t see any clocks, and I don’t see anything on the SDOUT pin. I do see that the kernel initializes the codec over SPI and the codec responds appropriately. But no audio in or out, no clocks and nothing on the SDOUT/SDIN pins.

We found this problem initially on our hardware, but I have reproduced it using the same pinout on a Verdin dev board connected to our AK4619 breakout board.

We have 5 of the exact same codec connected to SAI1, and all are working well.

Kernel

Linux version string:
Linux verdin-imx8mp-14871182 6.6.23-gbf6ce2b001f9-dirty #31 SMP PREEMPT Sat Aug 2 17:05:30 EDT 2025 aarch64 aarch64 aarch64 GNU/Linux

Hardware

part info
SOM Verdin i.MX 8M Plus
Carrier Board Verdin Development Board
Codec part & driver. AsahiKASEI AK4619
Codec breakout Board basic breakout of pins

Attachments

I have attached the following files:
arch/arm64/boot/dts/freescale/* Device tree source, top level is imx8mp-verdin-dev-icvr.dts
sound/soc/generic multichannel-card.c - modified from simple-card to support multiple codecs connected to a single SAI interface.
sound/soc/codecs ak4619* - the ak4619 I2C driver, modified to support a SPI interface and somewhat customized to our project.

SPI connections

For SAI2, we have two codecs connected to ecspi3 on CS#0 and CS#1. Here are the pins in use.

Function Pin Config
SCK SODIMM 129 MX8MP_IOMUXC_UART1_RXD__ECSPI3_SCLK
MOSI SODIMM 131 MX8MP_IOMUXC_UART1_TXD__ECSPI3_MOSI
MISO SODIMM 137 MX8MP_IOMUXC_UART2_RXD__ECSPI3_MISO
CS#0 SODIMM 139 MX8MP_IOMUXC_UART2_TXD__GPIO5_IO25
CS#1 SODIMM 222 MX8MP_IOMUXC_SAI1_RXC__GPIO4_IO01

SAI connections.

Here are the pins in use for SAI2. We use TDM mode in the codec to get 4 audio channels per lane. The IMX8MP sources all the clocks.

Function Pin Config
MCLK SODIMM 26 MX8MP_IOMUXC_SAI2_MCLK__AUDIOMIX_SAI2_MCLK
BCLK (BICK) SODIMM 17 MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK
LRCLK (TX_SYNC) SODIMM 133 MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC
RX_D0 SODIMM 135 MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00
TX_D0 SODIMM 24 MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00
RD_D1 SODIMM 21 MX8MP_IOMUXC_SAI3_RXFS__AUDIOMIX_SAI2_RX_DATA01
TX_D1 SODIMM 44 MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI2_TX_DATA01

Working SAI1

As mentioned above, SAI1 is connected to 5 AK4619 codecs using ecspi1 & ecspi2, and all the channels are working.

tdx-info output

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.23-gbf6ce2b001f9-dirty #31 SMP PREEMPT Sat Aug  2 17:05:30 EDT 2025
Kernel command line:      root=PARTUUID=c639c21b-02 ro rootwait console=tty1 console=ttymxc2,115200 consoleblank=0 earlycon
Distro name:              NAME="TDX Wayland with XWayland Upstream"
Distro version:           VERSION_ID=6.8.1-build.15
Distro variant:           -
Hostname:                 verdin-imx8mp-14871182
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus on ICVR - Trident Systems
Toradex version:          0063 V1.1A
Serial number:            14871182
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello, and thank you for your detailed summary and configuration information regarding the SAI2 interface and AK4619 codec integration on the Verdin iMX8M Plus.

Based on your description and pin configuration, here are several focused points to help identify and resolve why SAI2 isn’t producing any clocks or data output:


1. Pin Multiplexing and Validity

Not all pins you’re trying to use for SAI2 are standard or native for this interface on the Verdin iMX8M Plus:

  • SODIMM 26 (MCLK): This pin is not listed in the Verdin iMX8M Plus V1.1 datasheet as a standard SAI2_MCLK option. Double-check that this pin can actually provide SAI2_MCLK functionality.
  • SODIMM 17 (BCLK), 133 (LRCLK), 135 (RX_D0): These can function for SAI2 as alternate functions, as per the datasheet.
  • SODIMM 24 (TX_D0): Ensure this pin is also mapped as SAI2_TX_DATA00 in your device tree.
  • SODIMM 21 and 44: These are by default SAI3 pins – if you are reusing them for extra SAI2 lanes, then your device tree must reconfigure these MUX settings explicitly. There are limitations as to which data lines are available for SAI2 on this SoM.

Use the Pinout Designer Tool to double-check for multiplexing conflicts or misconfigured lanes.


2. Device Tree Configuration

Since you have SAI1 working, compare its full configuration with your SAI2 setup. Key device tree considerations:

  • Check proper status = "okay"; in your SAI2 node and its associated pins via the pinctrl settings.
  • Validate that MCLK, BCLK, LRCLK, and data lines are mapped and enabled, and make sure no other interface is claiming these pins.
  • Make sure no two device tree nodes compete for the same pins (for instance, default SAI3 definitions or UARTs).
  • Device tree docs: Device Tree Overview

3. Clock Configuration Issues

There’s a known issue with SAI clock initialization resetting incorrectly after the first use on iMX8M Plus, leading to silence on subsequent operations. Review this discussion for details:

  • SAI clock issue on i.MX8MP Verdin
  • Be sure your driver properly configures and keeps the clocks running after initialization. Sometimes it is necessary to manually write clock parent/source in the device tree or tweak relevant settings if the SoC isn’t auto-configuring SAI2 clocks as for SAI1.

4. Codec and TDM Setup

Since the kernel sees the codecs over SPI and SAI1 with similar codecs works, your multichannel-card and AK4619 modifications are likely correct. The missing clocks indicate the SAI2 block itself isn’t being clocked/enabled, or the device tree/proper initialization isn’t setting it as a clock master.

  • Confirm in your device tree that SAI2’s fsl,sai-mclk-master and fsl,sai-sync-mode properties reflect that it must drive all clocks (required for TDM master operation).
  • Ensure that platform devices in your sound card definition are referencing the correct SAI2 interface—not SAI3 or others due to copy-paste errors.

5. Debugging Actions

  • Check kernel dmesg for messages related to sai2 initialization.
  • Use devmem2 or cat /sys/kernel/debug/pinctrl to verify pinmux at runtime.
  • Test whether you can toggle SAI2 in a simple mode (2-channel I2S, looping playback) before moving to TDM/multichannel operation.

6. Alternative

If SAI2 continues to be problematic, consider SAI1 or SAI3, as these have direct I2S interfaces on the Verdin family:


In Summary

  • Double-check all SAI2-related pinmux settings in your device tree—especially for MCLK and those pins marked for alternate functions.
  • Review SAI2 clock and device tree clock-parent settings.
  • Validate pin assignments with the Pinout Designer Tool.
  • Look at the referenced clock issue thread if SAI2 works only on initial use/reset.

If you can share your SAI2 device tree node(s), I can help review further for possible errors.

Best regards,
Toradex AI Assistant.


References:

The AI answer led me to the problem. When I checked /sys/kernel/debug/pinctrl/pinctrl-maps, I did not find any pinctrl entries for sai2. When I rechecked my DTS, I found I was missing this block:

&sai2 {
	#sound-dai-cells = <0>;
    fsl,dataline = <2 0xFF 0xFF>;
	assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
	assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
	assigned-clock-rates = <24576000>;
	fsl,sai-mclk-direction-output;
    status = "okay";
};

With that added, the clocks and data lines now show activity and I think it is working.