The blog was helpful, especially the last part concerning the clocks.
If I understand it correctly, and the translation via google is correct. The clock for sai is off, and the devmem2 command it used to turn it on.
Of course the CCM peripheral for the imx6ull and the imx8mp is very different, and there is no CCM Clock Output Source Register (CCM_CCOSR) register or such on the imx8mp.
Is the devmem2 command indeed to turn the clock on, and how would I do that for the imx8mp?
Hello @rikte ,
I passed your question internally to the author of the article. Meanwhile we ordered a MAX98357A to do some tests ourselves. We will keep you updated.
Hi @rikte , I used to bring up MAX98357A on Colibri iMX6ULL and on Verdin iMX8MP, I did the same again. Here is what I do.
First, max98357a driver needed to be added to Linux kernel.
Sadly playing any audio gives a similar error as before.
I do not have the DAC hooked up to SAI3, but to SAI1 but as it’s a simple DAC with no feedback I think that should not be an issue and I should at least be able to play audio and see I2S data using a scope.
Could you tell me what version of the kernel and such you used, then we can try to recreate that on our side. Or perhaps for a test include the build kernel, module and dtb?
Hi @rikte . My kernel was also fetched from toradex_5.4-2.3.x-imx branch. It is 5.4.193. By default, SAI1 is routed to a codec NAU88C22YG on Verdin Development or WM8904CGEFL on Dahlia. The two carrier boards have their own device tree binaries where the codec is configured. The imx8mp-verdin-dahlia.dtsi provided above only uses SAI3. For SAI1, it should be modified. Which carrier board do you have now? And which device tree is applied? You can check it on the serial console during U-Boot loading.
## Executing script at 47000000
Loading DeviceTree: imx8mp-verdin-nonwifi-dev.dtb
88435 bytes read in 11 ms (7.7 MiB/s)
86 bytes read in 7 ms (11.7 KiB/s)
Applying Overlay: verdin-imx8mp_native-hdmi_overlay.dtbo
1860 bytes read in 15 ms (121.1 KiB/s)
Applying Overlay: verdin-imx8mp_lt8912_overlay.dtbo
1987 bytes read in 17 ms (113.3 KiB/s)
10643094 bytes read in 102 ms (99.5 MiB/s)
I had some time to look into it and have solved the issue. My steps:
Flash the multimedia reference image.
Checkout toradex_5.4-2.3.x-imx, add the MAX98357a driver, change the device tree to the one supplied above and compile.
Swap out the Image.gz and device tree blob
After this I still got the issue that it could not open component 30c10000.sai.
It took me some debugging, but the issue is that my kernel, being checked out, changed and build, has a -dirty flag.
But the folder in /lib/modules/ with the modules was of course called 5.4.193-5.7.2+git.b60d3160fd04
So the modules just never got loaded.
After renaming that folder to match my kernel name and changing the device tree so it used SAI1, I got sound out. Next is integrating it in our own Yocto build, I will keep you posted on that.
You can clone the git repo via:
git clone git://git.toradex.com/linux-toradex.git
And after it is done, use git checkout to switch to the toradex_5.4-2.3.x-imx- branch.
A guide on how to build and such is here: Build Linux Kernel from Source Code | Toradex Developer Center
3: I just copy the binaries to a USB stick, insert in the board and use “cp” to copy them to the /boot/ folder on the board.
@josep.tx
We recently switched to Kirkstone and BSP 6 for our boards, but with the identical approach and settings, I get a new error:
[ 6.044363] snd_soc_fsl_sai: disagrees about version of symbol devm_snd_soc_register_component
[ 6.056164] snd_soc_fsl_sai: Unknown symbol devm_snd_soc_register_component (err -22)
I can’t find much online about it. Do you have any ideas perhaps?
I verified that I have the exact same kernel, modules and such. So I am not sure if that is the issue.
I used the steps I mentioned in my previous post to build the kernel with driver.
if someone on your side would be able to validate or check if they can reproduce it, that would be very appreciated.
Hi @rikte ,
Since BSP6, we have provided downstream and upstream kernels for Verdin IMX8MP. You have to check BSP installed on your Verdin iMX8MP and the Linux source code you downloaded.