Objective
Connect 4 mono audio devices to the iMX using the codec CS4234 (i2s)
Description
The audio codec requires a master clock and as i2s master, the iMX should generate it. A custom device tree overlay is applied to configure i2s (see below), but there is no clock signal at the configured pin. The file imx8mp-verdin-dev.dtsi
was used as reference.
dmesg contains the error fsl-aud2htx 30cb0000.aud2htx: failed to pcm register
5 times.
dmesg.log (32.4 KB)
/dts-v1/;
/plugin/;
#include <dt-bindings/clock/imx8mp-clock.h>
#include <dt-bindings/gpio/gpio.h>
#include "imx8mp-pinfunc.h"
/ {
compatible = "toradex,verdin-imx8mp";
};
&{/} {
sound {
compatible = "simple-audio-card";
simple-audio-card,bitclock-master = <&codec_dai>;
simple-audio-card,format = "i2s";
simple-audio-card,frame-master = <&codec_dai>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,name = "radios";
simple-audio-card,routing =
"Line Out", "R1OUT",
"Line Out", "R2OUT",
"Line Out", "R3OUT",
"Line Out", "R4OUT",
"R1IN", "Line In",
"R2IN", "Line In",
"R3IN", "Line In",
"R4IN", "Line In";
simple-audio-card,widgets =
"Line Out", "Line Out",
"Line", "Line In";
codec_dai: simple-audio-card,codec {
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
sound-dai = <&cs4234>;
};
simple-audio-card,cpu {
sound-dai = <&sai1>;
};
};
};
/* Verdin I2C_1 */
&i2c4 {
status = "okay";
/* Audio Codec */
cs4234: audio-codec@10 {
compatible = "cirrus,cs4234";
reg = <0x10>;
VA-supply = <®_5p0v>;
VL-supply = <®_1p8v>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
#sound-dai-cells = <0>;
};
};
/* Verdin I2S_1 */
&sai1 {
assigned-clocks = <&clk IMX8MP_CLK_SAI1>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
fsl,sai-mclk-direction-output;
fsl,sai-synchronous-rx;
status = "okay";
};
tcbuild.yaml (757 Bytes)
The codec is connected to the I2S_1, pins 11 to 15 of X19 (SODIMM Pins 30, 32, 34, 36, 38) and I2C_1, pins 10 and 11 of X10 (SODIMM Pins 12 and 14). All I2S pins just keep having ground level.
Device
Software summary
Bootloader: U-Boot
Kernel version: 6.6.54-7.1.0-g3493ccd66900 #1-Torizon SMP PREEMPT Tue Dec 17 21:04:41 UTC 2024
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/126e49fd181914e3dee90ccea67ccf14d4897990e0e223ebde4654af4f5fd774/0
Distro name: NAME=“Torizon OS”
Distro version: VERSION_ID=7.1.0-build.4
Distro variant: VARIANT=“Docker”
Hostname: verdin-imx8mp-15010410
Hardware info
HW model: Toradex Verdin iMX8M Plus on Mallow Board
Toradex version: 0065 V1.1A
Serial number: 15010410
Processor arch: aarch64