Support for AD1938 on Verdin

Using:
HW model: Toradex Verdin iMX8M Plus on Verdin Development Board
Toradex version: 0063 V1.1A

We have 3 AD1938 modules to interface to the i.MX8 with SPI and I2S.
The first hurdle is that the AD193x driver isn’t included in the kernel I am using, 5.15.77-6.2.0+git.aa0ff7e3554e, (6.2.0-build.2).

The AD1938 driver doesn’t seem to support device tree configuration, so I suspect I will have to create a custom board file to configure the 3 SPI bus connections. I’ve been following the steps for Build Linux Kernel from Source Code | Toradex Developer Center but when I get to the " Deploying the Kernel to an Image" stage, the image for i.MX8MP doesn’t contain a ‘bootfs.tar.xz’ archive and I’m not clear on how to install the kernel, modules and DTB into the Easy Installer Image.

Please advise,
thanks,
David

Hey @dwinant,

With the AD1938 I can see the driver source code ad193x-spi will be used as an SPI device. So there isn’t a need to work with the device tree on for this device. (SPI is a generic bus that is already enabled in our device tree).

What you will have to do is enable the CONFIG_SND_SOC_AD193X_SPI with menuconfig. This isn’t by default in our kernel. This should be the only change required before it works on boot.

Also, if you are using TorizonCore, we can ask the team to enable this driver on the next nightly.

I hope this helps.

-Eric


One of my colleagues shared with me that the driver does seem to be missing an associated specific SPI bus (and chipselect). And looking at the kernel documentation it would seem you do need to put that information into a board file. This is not a modern way of implementing the driver.

  • Eric (pt 2)

Thank you Eric. I understand how to enable the driver and build the kernel, but I don’t see how to put the kernel and driver files into the easy installer image that I have. Or get them on the board some other way.

David

Hey @dwinant ,

Here is the link for the subsection describing how to deploy : Build Linux Kernel from Source Code | Toradex Developer Center

Let me know what specific issues you run into.

Thanks

-Eric

Eric,

Thanks. I have followed the instructions there, and the specific issue is that on step 2, “Integrate Artifacts”, there’s no file bootfs.tar.xz. The corresponding file for the i.MX8M seems to be trident-verdin-imx8mp.ota.tar.zst, which is a zstd-compressed tarball which contains ostree-style images and I do not understand where & how to replace the kernel and driver files.

Thanks,
David

Hey @dwinant,

A clarifying question. Are you using TorizonCore as your OS? From your tarball this seems to be the case. If so this would be the correct article.

Also, the driver files in question are quite old and have not been ported to the ‘new’ device tree style. This is indicative of using older software that we would not recommend. Do you have the option to use newer supported drivers?

-Eric

Eric,

I am currently using a TorizonCore image. I am thinking about using a simple BSP approach if you support that.

You are correct, the driver is old and doesn’t use device tree settings, but it is the most current that I have available.

Thanks,
David

Hey @dwinant,

Once you have an image you can deploy it via the guides here

You can manually install the modules on the target (here) and copy the kernel image to to correct location. For IMX8 the kernel image is located @ arch/arm64/boot/Image.gz via the kernel build directory and this file needs to be copied on the target @ /boot/Image.gz

-Eric

Eric,

Thanks, I’ve got it going. I think I was hung up trying to fit it into a Torizon Core image, and when I found the BSP downloads it worked out much better. I have booting over TFTP with rootfs on NFS all working and I can modify the kernel as needed.

Thanks again,

David