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.

Accessing shared memory from Linux

Other Parts Discussed in Thread: OMAPL138

Hi,

 

we are trying to access the internal shared memory of the OMAPL138 from Linux thru /dev/mem with the following code

#define DSP_MEM_ADDRESS   (0x80000000)       //must be page aligned
#define DSP_MEM_SIZE      4096               //one page
static int ptt_DSP_sharedMemoryInit(ptt_dsp_mem_t **ptr)
{
  int status = -1;
  int fd1;
  if((fd1=open("/dev/mem",O_RDWR))!=0)
    if((ptt_dsp_mem_t *)-1 != (*ptr = (ptt_dsp_mem_t *)mmap(0, DSP_MEM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd1, DSP_MEM_ADDRESS)))
      status = 0;
  return status;
}

Currently only a single page is being used, so that should stay contiguous in DSP space. Could someone comment on what needs to be taken care off to make sure the caches stay coherent, we are assuming that the DSP will read/write to that memory and Linux /dev/mem should be able to read/write the content.

 

Thanks,

--Gunter