lloyd not sure if you came any further with this, but this is my dts file
As @theophile suggested it has the include of the axg-audio-clck.h
/dts-v1/;
/plugin/;
#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
#include <dt-bindings/clock/axg-audio-clkc.h>
/ {
compatible = "radxa,zero", "amlogic,g12a";
fragment@0 {
target = <&sound>;
__overlay__ {
audio-aux-devs = <&tdmout_a>, <&tdmout_b>;
audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
"TDMOUT_A IN 1", "FRDDR_B OUT 0",
"TDMOUT_A IN 2", "FRDDR_C OUT 0",
"TDM_A Playback", "TDMOUT_A OUT",
"TDMOUT_B IN 0", "FRDDR_A OUT 1",
"TDMOUT_B IN 1", "FRDDR_B OUT 1",
"TDMOUT_B IN 2", "FRDDR_C OUT 1",
"TDM_B Playback", "TDMOUT_B OUT";
dai-link-5 {
sound-dai = <&tdmif_a>;
dai-format = "i2s";
dai-tdm-slot-tx-mask-0 = <1 1>;
mclk-fs = <256>;
codec {
sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
};
};
};
};
fragment@1 {
target-path = <&tdmif_a>;
__overlay__ {
status = "okay";
pinctrl-0 = <&tdm_a_dout0_pins>, <&tdm_a_fs_pins>,
<&tdm_a_sclk_pins>, <&mclk0_ao_pins>;
pinctrl-names = "default";
assigned-clocks = <&clkc_audio AUD_CLKID_TDM_MCLK_PAD0>,
<&clkc_audio AUD_CLKID_TDM_SCLK_PAD0>,
<&clkc_audio AUD_CLKID_TDM_LRCLK_PAD0>;
assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
<&clkc_audio AUD_CLKID_MST_A_SCLK>,
<&clkc_audio AUD_CLKID_MST_A_LRCLK>;
assigned-clock-rates = <0>, <0>, <0>;
};
};
fragment@2 {
target = <&tdmout_a>;
__overlay__ {
status = "okay";
};
};
};
I also tried adding a fragment to set the function of pins as you suggested earlier. Got this off of a standard overlay from Raspberry Pi. Ofc also not sure if this is the right approach, not sure if the syntax is correct either…
fragment@3 {
target = <&gpio>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&i2s_func2pins>;
i2s_func2pins: i2s_func2pins {
radxa,pins = <8 9 10 11>;
radxa,function = <2 1 1 1>;
};
};
};
I’ve put it in the rock user space and then ran this to compile from within /usr/src/linux-headers-5.10.69-12-amlogic-g98700611d064:
cpp -nostdinc -I include -undef -x assembler-with-cpp -o ~/radxa.tmp ~/radxa-zero-i2s.dts
dtc -O dtb -b 0 -o ~/radxa-zero-i2s.dtbo ~/radxa.tmp
sudo cp ~/radxa-zero-i2s.dtbo /boot/dtbs/5.10.69-12-amlogic-g98700611d064/amlogic/overlays/
It compiles fine but I also don’t see any change after reboot so it doesn’t actually work.
The overlays entry in my /boot/uEnv.txt looks like this (pretty standard I guess)
overlays=meson-g12a-uart-ao-a-on-gpioao-0-gpioao-1 radxa-zero-i2s
In the above I copy it to the same location as the uart dtb that is already stated in the uEnv.txt file, hoping it would be picked up.
I even tried to prefix it with “meson-” to see if it made a difference (in uEnv.txt there’s “overlay_prefix=meson”, not sure what that means, a filter maybe?).
Bottom line is that the only way I came closer was to patch as suggested by Jerome Brunet from BayLibre and compile the original dts which involved getting some more included files and cheating in one place where I couldn’t find a needed constant.
Now when I use the resulting dtb I see TDMOUT_A entries in Alsamixer which are not there in the original.
@radxa we really need you to jump in here and help us with the last steps to use you product
Questions:
- Are we on the right track with the overlay file?
- If not, what’s wrong/missing in order to get I2S to work on the pin header?
- Where do we put the overlay files in order for them to be picked up on boot?
- What should the entry be in uEnv.txt for this to happen?