Hi,
I'm working on TMS320C6670. I have written the code/API for DDR3 controller initialization which i have derived/extracted from the .gel file for C6670 EVM. I would like to define two separate ddr memory sections each of size 4MB for CorePac 0 and CorePac 1. Also i would like to access the ddr memory using virtual addresses. Hence, i'm using the Extended Memory Controller (XMC) for doing the necessary virtual address mapping using the following piece of sample code( Using CSL):
void set_MPAX(int index, Uint32 bAddr, Uint32 rAddr, Uint8 segSize)
{
CSL_XMC_XMPAXH mpaxh;
mpaxh.bAddr = VirtualAddr >> CSL_XMC_XMPAXH_BADDR_SHIFT /*12*/ );
mpaxh.segSize = segSize;
CSL_XMC_XMPAXL mpaxl;
mpaxl.rAddr = (PhysicalAddr >> 12 /*CSL_XMC_XMPAXL_RADDR_SHIFT*/);
mpaxl.sr = 1;
mpaxl.sw = 1;
mpaxl.sx = 1;
mpaxl.ur = 1;
mpaxl.uw = 1;
mpaxl.ux = 1;
CSL_XMC_setXMPAXH(index, &mpaxh);
CSL_XMC_setXMPAXL(index, &mpaxl);
}
MEMORY:
C0_DDR (RWX) : org = 0xd0000000, len = 0x400000
C1_DDR (RWX) : org = 0xd1000000, len = 0x400000
If i declare a buffer in "C0_DDR" which sits in the 0xd0000000( virtual address of ddr) and try writing some data, the data is not getting written at all. But if i declare a buffer in physical address of ddr 0x80000000, the data is getting written. Hence, which means the ddr is initialized properly!!!
The issue i'm facing is i'm not able to access/write data in the ddr memory using the virtual addresses. Please assist. Am I missing some thing??