Hi Toradex team,
Hope you can give me some guidance over here.
I’m trying to create an overlay to enable the WM8904 codec on my Mallow board. I don’t have all the information on my side but a previous HW colleague used the reference design of the Dahlia board and used the same DAC on a custom hardware extension board that is connected to the Mallow board.
I have base by .dts file on the Dahlia and Verdin available on toradex git but i’m getting errors while building using the Torizon Builde plugin on the Visual Code.
My .dts file is as follow:
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,verdin-imx8mp-mallow";
/* Simple Audio Card */
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "Mallow-I2S";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&codec_dai>;
simple-audio-card,frame-master = <&codec_dai>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"IN2L", "Line In Jack",
"IN2R", "Line In Jack",
"Headphone Jack", "MICBIAS",
"IN1L", "Headphone Jack";
simple-audio-card,widgets =
"Microphone", "Headphone Jack",
"Headphone", "Headphone Jack",
"Line", "Line In Jack";
codec_dai: simple-audio-card,codec {
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
sound-dai = <&wm8904_1a>;
};
simple-audio-card,cpu {
sound-dai = <&sai1>;
};
};
/* Enable I2C3 */
&i2c3 {
status = "okay";
};
/* Audio Codec on I2C4 */
&i2c1 {
status = "okay";
wm8904_1a: audio-codec@1a {
compatible = "wlf,wm8904";
reg = <0x1a>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
#sound-dai-cells = <0>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
clock-names = "mclk";
AVDD-supply = <®_1p8v>;
CPVDD-supply = <®_1p8v>;
DBVDD-supply = <®_1p8v>;
DCVDD-supply = <®_1p8v>;
MICVDD-supply = <®_1p8v>;
};
};
/* 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;
status = "okay";
};
/* Pin Control for SAI1 */
&pinctrl_sai1 {
fsl,sai1-bclk {
fsl,pins = <
MX8MP_IOMUXC_SAI1_TXFS__SAI1_TX_BCLK 0x1c6
>;
};
fsl,sai1-tx {
fsl,pins = <
MX8MP_IOMUXC_SAI1_TXD0__SAI1_TX_DATA0 0x1c6
>;
};
fsl,sai1-rx {
fsl,pins = <
MX8MP_IOMUXC_SAI1_RXD0__SAI1_RX_DATA0 0x1c6
>;
};
fsl,sai1-mclk {
fsl,pins = <
MX8MP_IOMUXC_SAI1_MCLK__SAI1_MCLK 0x1c6
>;
};
};
};
The errors i’m getting are
2025-01-28 18:38:16,250 - torizon.tcbuilder.cli.build - INFO -
=> Adding device-tree overlay 'overlays/mallow-verdin-i2s-overlay.dts'
2025-01-28 18:38:16,402 - torizon.tcbuilder.backend.dt - ERROR - Error: overlays/mallow-verdin-i2s-overlay.dts:28.39-40 syntax error
FATAL ERROR: Unable to parse input tree
2025-01-28 18:38:16,403 - torizon.tcbuilder.cli.dto - ERROR - error: cannot apply overlays/mallow-verdin-i2s-overlay.dts.
I think this is related to the device-tree missing some flags, but of right now I don’t know how to overcome this, i’m a bit on high water here and still learning by trial.
I would appreciate any guidance/help you could provide me, or point me to the right path.
Thanks in advance
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.148-6.8.0+git.8c5c2dcbf6ba #1-TorizonCore SMP PREEMPT Tue Aug 6 10:01:59 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.0/torizon/4ba8fb87dbcbe4eef169c350696ae1ce34e2585cf534963f9395709a06466082/0
Distro name: NAME="TorizonCore"
Distro version: VERSION_ID=6.8.0-build.22
Distro variant: VARIANT="Docker"
Hostname: verdin-imx8mp-15459446
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Verdin iMX8M Plus on Verdin Development Board
Toradex version: 0063 V1.1B
Serial number: 15459446
Processor arch: aarch64
------------------------------------------------------------