Kernel 5.4, imx.6q : sdma firmware not ready!, SPI transfer failed: -22

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Kernel 5.4, imx.6q : sdma firmware not ready!, SPI transfer failed: -22

跳至解决方案
6,982 次查看
lmhdoms
Contributor III

Hello,

Porting our yocto based kernel from 4.9.67 to 5.4.81 (linux-fslc-imx), I face issues when accessing the spi flash device.

The kernel is configured with:

CONFIG_IMX_SDMA=y

CONFIG_DMA_VIRTUAL_CHANNELS=y

I have added the sdma firmware like this:

IMAGE_INSTALL_append = " linux-firmware-imx-sdma-imx6q"

And it gets installed here:

root@cpb539:~# ls -al /lib/firmware/imx/sdma/
-rw-r--r-- 1 root root 2746 Mar 9 2018 sdma-imx6q.bin

The DTS looks like:

sdma: sdma@20ec000 {
compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
reg = <0x020ec000 0x4000>;
interrupts = <0 2 4>;
clocks = <&clks 62>,
<&clks 155>;
clock-names = "ipg", "ahb";
#dma-cells = <3>;
fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q.bin";
};
};

During boot, the fw was not installed, but using ROM.. should be ok at this point?

[ 0.140059] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
[ 0.140136] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
[ 0.140152] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware

The SPI flash devices gets probed ok:

[ 1.031793] spi-nor spi0.0: m25p32 (4096 Kbytes)
[ 1.036466] 5 cmdlinepart partitions found on MTD device spi0.0
[ 1.042391] Creating 5 MTD partitions on "spi0.0":
[ 1.047218] 0x0000003f0000-0x000000400000 : "boardid"
[ 1.055693] 0x0000003e0000-0x0000003f0000 : "u-boot-env"
[ 1.062571] 0x0000003c0000-0x0000003e0000 : "uploadlog"
[ 1.075590] 0x0000003b0000-0x0000003c0000 : "u-boot-env2"
[ 1.085624] 0x000000000400-0x000000060400 : "u-boot"
[ 1.095754] spi_imx 2008000.spi: probed
[ 1.100815] spi-nor spi2.0: found m25p16, expected s25fl216k
[ 1.106523] spi-nor spi2.0: m25p16 (2048 Kbytes)
[ 1.115946] spi_imx 2010000.spi: probed
[ 1.120662] spi_imx 2018000.spi: probed

Now reading from the spi flash fails:

root@cpb539:~# dd if=/dev/mtd1 of=/tmp/env.bin bs=65535 count=1
[ 802.819901] imx-sdma 20ec000.sdma: sdma firmware not ready!
[ 802.825563] spi-nor spi0.0: SPI transfer failed: -22
[ 802.830673] spi_master spi0: failed to transfer one message from queue
dd: /dev/mtd1: Invalid argument

What am I missing in getting SPI access to work? how do I make the sdma firmware ready?

Thanks

Lars

0 项奖励
回复
1 解答
6,937 次查看
lmhdoms
Contributor III

Success: adding the kernel-modules gets the imx-sdma.ko installed. Also the sdma fw 3.5 gets loaded successfully.

Regards,

Lars

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
6,951 次查看
lmhdoms
Contributor III

Hi Christian,

Yes, I did study your previous advice, and tried it. But when I try to build the imx-sdma module as loadable, it is build but not installed in the rootfs image. How do I get it to be installed?

Regards,

Lars

 

0 项奖励
回复
6,947 次查看
lmhdoms
Contributor III

With this added to local.conf, I get the loadable modules installed.

CORE_IMAGE_EXTRA_INSTALL += " kernel-modules"

Now on to the tests.

0 项奖励
回复
6,938 次查看
lmhdoms
Contributor III

Success: adding the kernel-modules gets the imx-sdma.ko installed. Also the sdma fw 3.5 gets loaded successfully.

Regards,

Lars

 

0 项奖励
回复
6,972 次查看
ceggers1
Contributor IV

Hi Lars,

I already answered this question several times in this forum. See here.
https://community.nxp.com/t5/i-MX-Processors/imx6-linux-imx-sdma-firmware-load-failed-error/m-p/1193...

regards,
Christian

0 项奖励
回复