Hello, All!
I have two questions about DMA memory allocation in linux-c6x,
1) I try to allocate DMA memory (via dma_alloc_coherent()) for my PCI express device connected to 6678 on custom board. But by default DMA memory allocated only in cached area, because dma_memory_size and dma_memory_start is zero (arch/c6x/mm/dma-coherent.c). I try to pass memdma parameter in kernel command line but it is not parsed in parse_cmdline_early() in arch/c6x/kernel/setup.c
Here is my bootlog:
Kernel command line: console=ttyS0,115200 \
ip=dhcp eth0:on eth1:on \
root=/dev/nfs nfsroot=192.168.0.121:/home/embedded/targetfs-c6x,v3,tcp \
rw earlyprintk \
mem=256M@0x80000000 \
memdma=4M@0x8FC00000 \
riohdid=0 rioports=1,2,3,4 rioinit=enum riomode=0 rioedma-threshold=32768
As workaround at this time I was hardcoded dma_memory_size and dma_memory_start and DMA channel is working Ok. If I try use cashed memory DMA channel working not stable and very slowly or not started (in most cases) at all.
Tell me, please how properly set memdma parameter for linux kernel?
2) On my board I have 1GB of DDR3 memory, and I want use upper 512MB for DMA channel. My memory map show below (first part is original linux-c6x memory layout):
User memory Range ====================== NetCP MSMC 0x0C000000-0x0C003000 SysLink MSMC 0x0C008000-0x0C0F8000 (For SharedRegion 0) Linux DDR 0x80000000-0x8FFFFFFF (Managed by Linux on core 0, assumes mem=256M) SysLink DDR 0x9FC00000-0x9FFFFFFF (For SharedRegion 1 and User specified SharedRegion)
DMA DDR 0xA0000000-0xBFFFFFFF (For my DMA channel)
I increase memory size in /include/mach/board-evm6678.h
#define BOARD_RAM_SIZE 0x40000000
And pass to kernel this memory parameter: mem=256M@0x80000000 mem=512M@0xA0000000 and linux booting and start allocate memory in this area. (dma_memory_size dma_memory_start I update for new configuration) DMA channel start and complete transfer, but after few time system is always core dumped. I want to ask maybe I need somthig else for changing memroy layout? Or may be this is issue similar to the dmamem= parsing?
Thank you for all!