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.

ARM/DSP RAM access problem

Other Parts Discussed in Thread: OMAP-L138

Hello

I'm currently writing a simple data transfer mechanism for OMAP-L138. Using standard DSPLink functions is not suitable for me because of performance reasons and the fact, that the data transfer is to be between the DSP and Linux kernel space. Unfortunately, I encountered a problem that I cannot sort out for myself. Here is what I did so far:

DSPLink:
- memory reserved for DSP program and standard DSPLink mechanisms is placed from memory address 0xC3E00000 (62 MB) till 0xC3F80000 (63,5MB). The rest I leave unused for the purpose of my data passing mechanism.

Linux/Linux kernel:
- the kernel is run with mem=62M from u-boot
- in my kernel module I remap the physical address to a virtual one:

volatile unsigned int *remap_addr;

request_mem_region(0xC3FB4000, 0x4000, "spcm");
remap_addr = ioremap_nocache(0xC3FB4000, 0x4000);
if (remap_addr == NULL) {
   return -1;
}

I'm using standard writel and readl functions do write and read integers to/from this mapped memory.

DSP:
In the tci file for my DSP program i have defined space for my shared data buffer:

var BFRAME    = prog.module("MEM").create("BFRAME");
BFRAME.base   = 0xC3FB4000;
BFRAME.len    = 0x4000 ;
BFRAME.createHeap  = false;

In the DSP program i have the buffer defined as:

#pragma DATA_SECTION( bframe_smem_buf, ".bframe" )
#pragma DATA_ALIGN( bframe_smem_buf, 1 );
volatile char bframe_smem_buf[2*0x2000];

The DSP porgram polls for any changes in this memory buffer made by the kernel module. When a write on the Linux side is made, the DSP program notices it zeroes the shared memory and sends a DSPLink Notify back to my kernel module. In the Notify I write a single byte to the shared memory so that the proces can start all over again.

The problem is that for some reason the wites made on the Linux side work in a unusual manner. When I perform a write and read operation as such:
writeb(99, remap_addr);
int data = readb(remap_addr);
In the Notify callback function I read back a proper value. But after a short while the value that was written to remap_addr is zeroed for some reason (and not by the DSP, because I do not get any other Notifies). It looks as if the value that was written in Linux does not get  physically written to RAM and is not seen properly by the DSP (I send constant MSGQ frames that display the contents of shared memory from the DSP side).

What could be the cause of this? Is my approach correct? Can RAM be used in a way that I have described?

Regards
Szymon