iMX6 Solo Lite, Linux kernel and CMA

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

iMX6 Solo Lite, Linux kernel and CMA

Jump to solution
3,602 Views
louisconvert
Contributor I

Hello,

We are facing a problem with Linux Kernel configuration on iMX6 Solo Lite.

We are trying to bring up a custom board with an iMX6 Solo Lite, 128 MB of DDR3, Ethernet, USB... with Linux Kernel 3.10.9

The problem we are facing currently is the following :

On Freescale iMX6 Solo Lite evaluation board, we are able to have everything working on Linux with the same kernel 3.10.9. However, on our custom board, we can't configure the CMA to work.

2 cases append :

  • Either the CONFIG_CMA_SIZE_MB is set at a value >= 128 MB, then the CMA can't success initialisation of the zone (there is not enough RAM), and the kernel is booting without support of DMA/CMA dependent devices (for example Ethernet interface).

  • Either the CONFIG_CMA_SIZE_MB is set to a reasonable value (we tried different values from 2 MB to 64 MB) OR the CMA is not activated (which should be possible), then the kernel is not starting anymore. Symptoms are :
    • On the console, we can't see any activity once the kernel is starting (even with early printk option set)
    • With the trace, we can see the kernel is looping in different memory initialisation functions.

What we don't understand is :

  • What are the links between CONFIG_CMA_SIZE_MB and the early kernel memory initialisation functions ? It seems only the source file dma-contiguous.c is referring to this parameter, and what we see with the trace seems that no functions from this file is called when the kernel is not starting.
  • Why does the kernel don't start when we don't set CONFIG_CMA ? Looking at the documentation, CONFIG_CMA is optional and not setting it should not introduce any problem.

We don't know how to debug this problem. Using the debugger, we have difficulties to follow the code, as the code is compiled with optimisation, and it seems not possible to desactivate optimisation on the kernel.

We have tried similar configuration with the iMX6 Solo Lite evaluation board from Freescale, with same result : desactivating CONFIG_CMA or putting a value lower than 128MB as CONFIG_CMA_SIZE_MB makes the kernel not booting.

What is the solution ? We don't need more than 128 MB of DDR3 and we don't want to pay more DD3 than needed on this board. Then we must find a solution to make the kernel boot with DMA activated and "only" 128 MB of DDR3.

Any help will be REALLY appreciated !

Thanks a lot !

0 Kudos
1 Solution
1,412 Views
louisconvert
Contributor I

Hello,

For an unknown reason, I could not see the early printk when I wrote the message above.

Now I can see what happens and I have a workaround to my problem, but there is still something not functionning.

What happens ?

When I configure CONFIG_CMA_SIZE_MB with a proper value (let say 32 MB for example), the CMA successfully allocates a 32 MB range of memory, BUT after that when drivers attempt to allocate pages, there is a crash. If someone is interested in the details of the crash, please let me know and I will reproduce the problem to put here printk output.

When I do not use CMA (CONFIG_CMA not set), before I could see the early printk, I was thinking something was wrong around DMA. But now I know that in fact, DMA is working correctly and the crash came from a CSI driver trying to load after having it's memory pages allocated. Surely because we are not using CSI on our board !

So now, desactivating all not used drivers, my kernel starts, without using CMA, and the FEC and USB devices are working correctly.

View solution in original post

0 Kudos
1 Reply
1,413 Views
louisconvert
Contributor I

Hello,

For an unknown reason, I could not see the early printk when I wrote the message above.

Now I can see what happens and I have a workaround to my problem, but there is still something not functionning.

What happens ?

When I configure CONFIG_CMA_SIZE_MB with a proper value (let say 32 MB for example), the CMA successfully allocates a 32 MB range of memory, BUT after that when drivers attempt to allocate pages, there is a crash. If someone is interested in the details of the crash, please let me know and I will reproduce the problem to put here printk output.

When I do not use CMA (CONFIG_CMA not set), before I could see the early printk, I was thinking something was wrong around DMA. But now I know that in fact, DMA is working correctly and the crash came from a CSI driver trying to load after having it's memory pages allocated. Surely because we are not using CSI on our board !

So now, desactivating all not used drivers, my kernel starts, without using CMA, and the FEC and USB devices are working correctly.

0 Kudos