SDMA errors with compiled kernel

Hello,

I have been using a customized kernel based on the Toradex one for years. I have almost done everything on the Colibri iMX7 target. Everything works fine, except on detail. The SDMA will not work when I want to use it with any UART except the UART0. Following the instructions from the link, I compiled a clean kernel.
https://developer.toradex.com/knowledge-base/build-u-boot-and-linux-kernel-from-source-code

I took this toolchain
https://releases.linaro.org/archive/14.11/components/toolchain/binaries/arm-linux-gnueabihf/

The naked kernel I compiled got exactly the same errors. If I took a binary directly from the BSP, I will not get any errors. I assume, I made some wrong steps to compile. Did I take the right toolchaine. I run everything on Debian 10 x86_64.

make clean
git checkout Colibri-iMX7-eMMC_Console-Image_3.0b4.254-20200421
make ARCH=arm CROSS_COMPILE=~/bin/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- PATH=~/bin/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/:$PATH colibri_imx7_defconfig
make ARCH=arm CROSS_COMPILE=~/bin/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- PATH=~/bin/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/:$PATH -j8 zImage

How I compiled the kernel.

stty -F /dev/ttymxc2 115200
[   15.226092] imx-sdma 30bd0000.sdma: sdma firmware not ready!
[   15.233843] imx-uart 30880000.serial: Prepare for the RX slave dma failed!

How I tried to configure the serial port

echo salut > /dev/ttymxc2
[60687.803378] imx-sdma 30bd0000.sdma: sdma firmware not ready!
[60687.811289] imx-uart 30880000.serial: Prepare for the RX slave dma failed!
[60687.820579] imx-sdma 30bd0000.sdma: sdma firmware not ready!
[60687.828490] imx-uart 30880000.serial: We cannot prepare for the TX slave dma!
[60687.837896] imx-sdma 30bd0000.sdma: sdma firmware not ready!
[60687.845796] imx-uart 30880000.serial: We cannot prepare for the TX slave dma!

How I tried to send something

Thanks a lot !

PS: I found this topic Colibri imx6ull sdma firmware with kernel 4.14 - Toradex Community but it didn’t help me.

Yes I did.

make ARCH=arm CROSS_COMPILE=~/bin/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- PATH=~/bin/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/:$PATH colibri_imx7_defconfig

My .config file https://pastebin.com/ds4yBPkk

I will check to send the kernel module. I’ll check this on the target on Monday.

Thanks !

The SDMA module is running.

I also copy the modules:

lsmod

...
imx_sdma               28672  0
virt_dma               16384  1 imx_sdma
...


sudo cp drivers/dma/imx-sdma.ko /srv/nfs/lib/modules/4.14.170/
sudo cp drivers/dma/virt-dma.ko /srv/nfs/lib/modules/4.14.170/kernel/drivers/dma/
cp arch/arm/boot/zImage /srv/tftp/

I use network boot. I still have the same issue …

I cannot get the same checksum for binary files. Is there a way to reproduce exactly the same output files ? By compiling out of the tree ?

I rolled back to this kernel commit 07d40f6ffcbb9b3db3c146f0949725752ed61b63
It’s a 4.9 version. Then it works !

Hi @arnaud_infoteam!

Thanks for the feedback. I’m glad that it works now. Does the kernel in this commit have any different files or a specific SDMA firmware?

It’s just an older version https://git.toradex.com/cgit/linux-toradex.git/commit/?h=colibri&id=07d40f6ffcbb9b3db3c146f0949725752ed61b63

Colibri-iMX7_LXDE-Image_2.8b3.111-20180627

A 2 years old kernel … I would prefer to keep the 4.14 version. At least I can deal with it.

It’s a workaround, I would like to be able to reproduce the same binary file using your documentation.

The SDMA is very critical to us. I really expect a better reply from Toradex …

@arnaud_infoteam,

I’ll try to reproduce this issue on my side and let you know the results.

Greetings @arnaud_infoteam.

Did you run a make colibri_imx7_defconfig before compiling the kernel?

Can you please share your kernel config (i.e. .config)? It seems that the sdma firmware was not built or was not loaded by the kernel.

I also recommend you to rebuild the kernel modules and send them to the board. The new kernel you installed may have a different hash, which would prevent the existing kernel modules to load correctly.

Thank you a lot !

Thank you for reproducing this. I am going to reproduce, I will keep you updated as soon as I get results.

I reproduced once before the week-end. It didn’t work but I’m gonna try to start from scratch. I have to do my part of the job.

It works ! Thank you ! I took the wrong compiler !

@arnaud_infoteam,

I’m glad that this works!

Do not hesitate to contact us if you have any further questions.

@arnaud_infoteam,

I wasn’t able to reproduce the issue. I’ll show you what we’ve done on our side and can you please try reproducing that?

First, clone the kernel repository on branch toradex_4.14-2.3.x-imx.

Make colibri_imx7_defconfig, compile the kernel and the modules. Load the new kernel and modules.

The output we had was this:

root@colibri-imx7-emmc:~# stty -F /dev/ttymxc2 115200
root@colibri-imx7-emmc:~# echo salut > /dev/ttymxc2
root@colibri-imx7-emmc:~# dmesg | grep sdma
[    4.613476] imx-sdma 30bd0000.sdma: no iram assigned, using external mem
[    4.632023] imx-sdma 30bd0000.sdma: loaded firmware 4.2

So as far as we could test it, the firmware was compiled and loaded fine.

We used Linaro GCC 5.2-2015.11-2, a slightly newer version than yours.

Can you please try that and see if it works?