SDMA error in serial ports (sumo-4.14.78-1.0.0_ga)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDMA error in serial ports (sumo-4.14.78-1.0.0_ga)

Jump to solution
10,339 Views
jareyes
Contributor II

Hi,

I have recently updated my distro version for being generated with Yocto Sumo instead of Yocto Rocko. After launching kernel  I begin receiving messages complaining about sdma in serial ports:

imx-sdma 20ec000.sdma: sdma firmware not ready!
imx-uart 21f0000.serial: Prepare for the RX slave dma failed!
imx-sdma 20ec000.sdma: sdma firmware not ready!
imx-uart 21fc000.serial: Prepare for the RX slave dma failed!
imx-sdma 20ec000.sdma: sdma firmware not ready!
imx-uart 21fc000.serial: We cannot prepare for the TX slave dma!
imx-sdma 20ec000.sdma: sdma firmware not ready!
imx-uart 21fc000.serial: We cannot prepare for the TX slave dma!
imx-sdma 20ec000.sdma: sdma firmware not ready!
imx-uart 21f4000.serial: Prepare for the RX slave dma failed!
imx-sdma 20ec000.sdma: sdma firmware not ready!
imx-uart 21f4000.serial: We cannot prepare for the TX slave dma!
imx-sdma 20ec000.sdma: sdma firmware not ready!

Same image with kernel 4.9.88 has no problems with serial ports. Any idea?

Thanks

1 Solution
6,750 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Juan Alfonso,

The version of linux that you are updating it is only for i.MX8 Devices, we do not have support for i.MX6 with this distros, the HW it is very different from i.Mx6 and i.MX8 so the SDMA should be a problem for the i.MX8.

You cannot update the i.MX6 to Linux 4.14

View solution in original post

0 Kudos
13 Replies
6,750 Views
jane-jiajuan_zh
Contributor III

I meet the same problem on sumo-4.14 imx6solo.

I think the root case is because the sdma need load firmware which is in rootfs, so some bus like SPI which need use sdma will meet error. Most time we need do some spi read operation in probe, we can't wait rootfs run.

I think there are many ways to fix them, some guys had described.

1. make the spi device to module, we can run it very late in init---------------but it is too strong coupling for kernel and rootfs.

2. call the spi_register_driver() function at the end of sdma_load_firmware()---------------but it is too strong coupling for spi driver and sdma driver.

3. don't use sdma in spi. just modify .has_dmamode = false in file spi-imx.c-----------------maybe some big number bytes transport will be low efficient, but most device is acceptable.

I choose 3.

6,750 Views
max_merchel
Contributor II

Hello Juan Alfonso,

We had the message on our i.MX7 boards.
After changing imx_sdma from y to m we can use it.
CONFIG_IMX_SDMA=m

6,750 Views
jareyes
Contributor II

Hi Max,

we are currently working with no modules in order to pull everything kernel related apart from root file system. We will try it anyway.

Thank you!

0 Kudos
6,750 Views
ceggers
Contributor V

I would also assume that it's not legal to link the SDMA firmware files inside the kernel image. I see the following options:

  1. Load SDMA driver as a module (after a rootfs/initramfs is available). The firmware will be loaded by the kernel from the file system without any user mode helpers.
  2. Disable the SDMA in the device tree and activate it after the rootfs/initramfs is available. Unfortunately there seems to be no mechanism to do this from user space.
  3. Don't use a SDMA firmware at all. This should be sufficient if you only need ROM scripts.

I personally use option 1. Loading the SDMA driver as a kernel module should also work, if SDMA client drivers (e.g. UART or SPI) are compiled as built in. Most client drivers allocate SDMA channels first when actually data is transferred (not on driver initialization). The imx serial driver will never use SDMA for the console UART. But it will use SDMA for other UARTs if configured in device tree.

6,750 Views
bernhardfink
NXP Employee
NXP Employee

The GA release of BSP 4.14.78 is valid for all released i.MX 6/7/8 platforms (and some non-released i.MX 8 platforms).

We received this problem report as well from someone using the 6UL.

We did a test with our pre-build image for the 6UL EVK and the SDMA firmware is loaded correctly:

[ 0.657183] imx-sdma 20ec000.sdma: Falling back to user helper
[ 19.846128] imx-sdma 20ec000.sdma: loaded firmware 3.4

Did you get this log as well when you boot your device? I expect not, because if it's loaded then it should be ready to be used.

Regards,

Bernhard.

0 Kudos
6,750 Views
Niebel-TQ
Contributor IV

[ 19.846128] imx-sdma 20ec000.sdma: loaded firmware 3.4

This is far too late for some use cases and AFAIK user mode helper for firmware loading is a bit deprecated nowadays ...

Even the newest mainline kernel has the opportunity to include the firmware in the kernel image, but

  1. do not know if this is a license issue with SDMA
  2. do not know (yet) how to achive this in a clean way with yocto

What is the reason to not built in SDMA firmware in kernel as done in older BSP versions?

6,750 Views
simonecumar
Contributor II

This is the point. Built-in firmwares have been removed and everything was put out of the kernel git tree.
For more information on this you can consult:

As said in the documentation, you can add firmware by configuring the kernel when compliant with GPL. Sdma for imx6q binary is still available in kernel 4.1.15 from NXP, I haven't checked why NXP didn't added it back again in their repository.

0 Kudos
6,750 Views
jareyes
Contributor II

Thank you! There would be a new kernel version for imx6ul or is 4.9  probably the last version?

0 Kudos
6,751 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Juan Alfonso,

The version of linux that you are updating it is only for i.MX8 Devices, we do not have support for i.MX6 with this distros, the HW it is very different from i.Mx6 and i.MX8 so the SDMA should be a problem for the i.MX8.

You cannot update the i.MX6 to Linux 4.14

0 Kudos
6,750 Views
ceggers
Contributor V

I'm using vanilla kernel 4.14 on i.MX6UL. SDMA is working fine, but I had to add information about SDMA events and channel types in my board device tree.

6,750 Views
ilyyxfe
Contributor I

could pls make a example how you config the SDMA dts to make it work on 4.14?

0 Kudos
6,750 Views
ceggers
Contributor V

You should add the following code to you device tree:

&uart1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uart1>;
    /* note: imx_startup() will not enable DMA if UART is used as a console */
    /*               4 MCU domain UART */
    /*               5 Shared UART */
    /*                  2 Low priority     */
    dmas = <&sdma 25 5 2>, <&sdma 26 5 2>;
    dma-names = "rx", "tx";
    status = "okay";
};

You have to modify the "dmas" entry accoding to you system.

  • 25 and 26 are the DMA Events for UART1_RX and UART1_TX (from Reference Manual, Section "SDMA Event mapping").
  • 5 is the peripheral type (IMX_DMATYPE_UART_SP from include/linux/platform_data/dma-imx.h)
    • IMX_DMATYPE_UART (4) should work for all UARTs
    • IMX_DMATYPE_UART_SP (5) is more efficient but only works for UARTs connected to SPBA bus (check whether you UART appears in section "DMA memory map").
  • 2 is the DMA prority (low). The highest possible value is 0 (high).

Please let me know whether this answers you question.

6,750 Views
ilyyxfe
Contributor I

very appreciate for your answer.

i use another way to fix the problem。because it is emergency,i have no time to try your suggestion yet.

my board is base on imx6sllevk .and i use the 4.14.78 yocto。our uart and ssi both use the sdma。

copy your building project/all-poky-linux/firmware-imx/1_8.0-r0/image/imx onto your sdcard/lib/firmware/ by manual.

then system will load the firmware automatically.

i guess the copy file imx-sdma-6q.bin is used for the sdma function.

our uart and ssi is working now.

in the future, if i tried ,i will let you know

best regards

zhang

0 Kudos