Hi,
How do I read/write the 128K L3 RAM from ARM/Linux?
Thanks
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.
Hi,
How do I read/write the 128K L3 RAM from ARM/Linux?
Thanks
Hi Liz,
You meant OMAP-L138? An OMAP expert should answer but meanwhile please let me answer from general ARM Linux standpoint.
If the memory (you meant 128K from 0x80000000?) is visible in ARM Linux kernel logical address (please refer Chapter 15 of http://lwn.net/Kernel/LDD3/), any user process which has root privilege can access the memory by /dev/mem and mmap() system call as following code fragment. (Please refer man pages of open and mmap.)
#include <fcntl.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
const int LEN_MEM = 128 * 1024;
void foo(void)
{
int fd, a, b;
int *vaddr;
fd = open("/dev/mem", O_RDWR);
vaddr = mmap(NULL, LEN_MEM, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0x80000000); // Assuming the address 0x80000000
a = vaddr[0];
b = vaadr[1];
// and so on
}
Does this help? (I need OMAP experts' confirmation.)
Best Regards,
Atsushi