Hi,
I'm trying to modify loadmodules.sh to optimize linux memory on DM365. After reading this page:
http://wiki.davincidsp.com/index.php/Changing_the_DVEVM_memory_map
I have more questions than answers since DM365 seems to be a simpler device than the DM6446 described in that page. Video encoding is done in hardware components instead of a more generic DSP part, so I suspect that the actual memory map is simpler than the one described in the document.
Looking at the loadmodules.sh supplied with DM365 no dsplink.ko module is loaded and also I've not found the files related to dsplink in my DVSDK. I suspect that no dsplink is used in this device, since there is no real DSP to actually run algorithms.
If this is true, there is also no DDRALGHEAP and DDR sections to be configured since there is no real server, no DSPLINKMEM and RESETVECTOR too. Basically memory is used for Linux and CMEM. Still, I am not sure if my assumptions are correct.
The default configuration supplied in loadmodules.sh for CMEM is this:
/sbin/insmod /opt/dsp/cmemk.ko phys_start=0x85000000 phys_end=0x88000000 pools=6x4096,2x8192,1x11908,2x13184,1x2697152,6x4096,1x30720,3x81920,1x3185664,64x56,1x320,1x640,1x81920,1x6650880,2x608,1x296,1x28,2x24,23x1548288,1x154288 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672
And linux is loaded with MEM=80M (i.e. 0x80000000 - 0x85000000)
In fact CMEM allocates all available memory not used by linux, i.e. range 0x85000000 - 0x88000000 as per CMEM config. This also seems to confirm that no memory is used for DSP since there is no space in this map for other heaps or DSPLINK buffers.
If all this is true, then changing memory map on DM365 can be a lot easier than expected:
1) Calculate the size of CMEM and buffer pools
2) Configure cmem.ko and linux boot "MEM=" argument
Regarding CMEM buffers, I still have to understand if the requirements all depend on the Linux application allocated buffers (uncompressed and compressed video) or ther is more, but I suspect that the hardware compressor need memory that is actually taken from CMEM's pools.
In any case, the methods suggested in the "Changing DVEVM memory map" should be still valid.
Last mistery is this part of CMEM config: "allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672". It seems to reserve 28Kb from ARM's TCM (ARM RAM0, 0x0000-0x3FFF and ARM RAM1 0x4000-0x7FFF), I suspect the first 4Mb are left for ARM's IRQ vectors. Perhaps this memory area is used for DMA?
That's all for now, perhaps you can help me to understand better those points and explain me if I am correct.
Thanks!