cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gvirbila
Explorer
Explorer
237 Views
Registered: ‎07-01-2013

DMA Memory Resizing

Current working design uses 16 DMAs to write to 4GB DDR memory. I have increased the size of the DDR memory size to 16GB. I don't have a good understanding of the parameters used to initialize the DMAs.

Below is the working code used initialize the DMA under the 4GB DDR setup. How would I go about changing the parameters for the 16GB DDR setup?

// Locations and sizes of buffers used for data, and the DMA descriptor ring
static const uint64_t PL_BUF_BASE = PL_DDR_BASE;
//#define PL_BUF_BASE PL_DDR_BASE
// Note: -4 here, since the max size is 0x3ffffff, but we want 32-bit aligned addrs
static const uint32_t PL_BUF_SIZE = 0x4000000 - 4; //Changed from 0x1000 to 0x2000 Ver8
static const uint64_t PL_RING_BASE = PL_DDR_BASE + 0xF0000000;

print("Initializing DMA engines\n");
for (uint32_t i=0; i < CHANNEL_COUNT; i++) {
// printf("Initializing DMA Channel: %d\n", i);
XAxiDma_CfgInitialize(&dmas[i], XAxiDma_LookupConfig(i));
rings[i] = XAxiDma_GetRxRing(&dmas[i]);
XAxiDma_Bd* bdptr;
XAxiDma_BdRingCreate(rings[i], PL_RING_BASE + (i * PL_RING_SPACING), PL_RING_BASE + (i * PL_RING_SPACING), XAXIDMA_BD_MINIMUM_ALIGNMENT, 1);
XAxiDma_BdRingAlloc(rings[i], 1, &bdptr);
XAxiDma_BdSetBufAddr(bdptr, PL_BUF_BASE + (i * PL_BUF_SIZE));
XAxiDma_BdSetLength(bdptr, PL_BUF_SIZE, rings[i]->MaxTransferLen); //0x1000 to 0x2000 Ver8//4096? //AG Change from 0x1000 to 0x2000
XAxiDma_BdSetCtrl(bdptr, 0);
XAxiDma_BdRingToHw(rings[i], 1, bdptr);
XAxiDma_BdRingStart(rings[i]);
}

Tags (4)
0 Kudos
0 Replies