This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Davinci Memory

Hi,

 

I am a beginner of Davinci.

 I want to talk about my simple understanding of Davinci Memory.

 Please feel free to tell me my mistakes or your opinion.

 

 There are 3 parts in Davinci Memory.

 Linux memory (ARM)              +                Share memory  (Cmem)                  +                DSP memory

We can use malloc in ARM application code to get Linux memory, which is virtual memory and discontinuous memory.

It is managed by Linux OS, and can be changed when the board boot. (u-boot ?)

Because it's discontinuous, DSP can not use it.

 

So we need a shared memory which ARM and DSP can access it both.

There is a cmem module in Linux, we can change the size of share memory, and make some pools.

Applications in ARM side can use Memory_alloc to get memory, DSP maybe also can use that function?

 

DSP memory is set by BIOS. DSTK2 in FC manage the memory for algos in DSP side.

There are Algalloc and Algfree API in Codec examples, we can make more memtabs to get more memory for algo.

In your code you just need to assign the memtabs to your pointers before you use them.

But I think this method can not alloc memories dynamically.

Also, If the memory is just a temp memory used only in one codec.

You can use malloc or MEM_alloc to get memory from the heap managed by BIOS.(I am not sure).

It will work because malloc get memory from different heaps, on my board C6A8168 is "DDR2_HEAP" and "DDRALG_HEAP".

 

I think there are lots of mistakes in my understanding, Davinci memory system should be more complex than this.

Any opinions will be greatly appreciated.

Thank you.

 

yours ,

wang

 

 

  • If there are lots of mistakes hard to explain,

    can anyone tell me which document I should read to get more information about memories?

    Any reply will be greatly appreciated.

     

    Best regards,

    wang

  • Hi wang,

    I do not have much idea on the memory that will be used on the DSP side, but your explanation of memories that will be used from Linux side looks correct for me. Note that the "mem=" argument which will be passed from boot loader such as U-Boot to Linux, informs the kernel about the memory available for the Linux Kernel. For example, on DM6446, though 128MB ofmemory is available, we pass mem=120M to kernel and the rest is reserved for DSP side. If we are planning to make use of cmem module, then the mem argument will be passed as 60M or some other value and the rest is reserved for CMEM and DSP.

    Regards, Sudhakar

  • Hi Wang,

    concerning Davinci memory handling for me these links had been a good starting point:

    Additionally, the universal_copy CodecEngine sample from within the EZSDK gives an insight how to manage buffers between ARM and DSP.

    The further in detail depends from what you are going to do concretely and by which tool sets you are developing.

    And I fear for enhancing speed, especially DSP side, there will be no way but to make use of the cache and internal memory and to use EDMA as well... but yet working on that, not yet enough experienced by myself.

    Regards,
    Joern.