Tool/software:
I am attempting to move from using CMEM to DMA-heap/dma-bufs on the AM57x using SDK9.03.
The existing application has a CMEM area of memory in the OCMC for DSP1 and this memory is shared between the DSP and the ARM. The memory is divided into different regions and the DSP and ARM invalidate the cache as control of a particular region moves from one processor to the other. There is one region of memory as far as CMEM is concerned but there are about 40+ different smaller regions as used by the DSP and the ARM.
I have tried using DMA-heap and have added a reserved-memory area and seen the corresponding /dev/dma_heap/my_reserved_memory device file. The alloc ioctl can be used to get a dma-buf and the sync ioctls can be used to control the cache for the entire reserved-memory area. This is fine for a simple demo but is not sufficient for the existing application.
I was hoping the alloc ioctl could actually allocate a piece of the reserved memory but it seems this is not the case. There is only one block of memory and it is not clear how to divide it into pieces. The sync ioctls seem to only operate on the whole chunk of memory for the dma-buf.
It is possible to specify multiple reserved-memory areas (up to 7 with default kernel code or more with a change to a #define and a rebuilt kernel) but that seems like having to put more information into the device tree than might be desirable.
Is it possible to specify a pool details so that the dma-heap pool is multiple blocks rather than just one? It seems like the genalloc system has some ability to support this for devices but the carveout-dma-heap code does not seem to make use of this.
How can a linux user program get cache control over specific regions of memory without having to specify low-level details in the device tree? This was possible with cmem. How can it be done using dma-heap and dma-bufs? Am I misunderstanding the capabilities of dma-heap/dma-buf? Is having 40+ dma-heap reserved memory regions the only available alternative?