Hello,
I am using mmap(..) to allow user space to view physical addresses.
This has worked well when I am using it to view registers within the
Davinci. My problems occur when I try to use mmap(..) to view a FPGA
connected to CE3. I cannot read the contents from Linux application.
Using a program running under Code Composer can read the contents
without any issues.
The FPGA only uses the lower 8 bits and I am setting the
configuration register at 0x01e0 0014 to 0x08f2479c. ( 8 bit data path)
This matches my program from the CCS project.
uiTemp = 0
| ( 0 << 31 ) // selectStrobe = 0; // normal mode
| ( 0 << 30 ) // extWait = 0; //
| ( 2 << 26 ) // writeSetup = 2; // 13.1 ns * 2
| ( 15<< 20 ) // writeStrobe = 13; // 13.1 ns * 15
| ( 1 << 17 ) // writeHold = 1; // 13.1 ns
| ( 2 << 13 ) // readSetup = 2; // 13.1 ns * 2
| ( 15<< 7 ) // readStrobe = 13; // 13.1 ns * 15
| ( 1 << 4 ) // readHold = 1; // 13.1 ns
| ( 3 << 2 ) // turnAround = 3; // 13.1 ns * 3
| ( 0 << 0 ) // asyncSize = 0; // 8-bit bus
;
printf( "cfg = 0x%x\n", uiTemp);
Code snippet:
if ((imc->sLinux.uiDevMemFd=open("/dev/mem",O_RDWR|O_SYNC))==-1)
return (FALSE);
imc->sLinux.vpCE3base=( U8 *) mmap((void*) 0x04000000, 4096,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_SHARED,imc->sLinux.uiDevMemFd, 0x04000000);
if (imc->sLinux.vpCE3base !=(U8 *)0x04000000)
return FALSE;
if ((imc->uiRegFd=open("/dev/mem",O_RDWR|O_SYNC))==-1)
return (FALSE);
imc->puiRegs=( U32 *) mmap((void *) 0x01e00000, 4096,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED,imc->uiRegFd,
0x01e00000);
imc->puiRegs[5]=0x8f2479c;
Any ideas what I am doing wrong?
Bob
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source