DSPRelated.com
Forums

EBIU DMA Transfer Querry for BLACKFIN BF561

Started by isni...@gmail.com March 19, 2010
Hello All,
I have developed a custom Board from Blackfin BF-561 processor.
I am interfacing DSP with FPGA.
I have interfaced the DSP to FPGA using EBIU Interface.
I want to read the data from FPGA RAM though EBIU interface.

I was able to successfully read the data from FPGA RAM using Core EBIU data transfer.

But the read is quite slow, Hence I want to perform the DMA transfer.

I have written the code for DMA trasfer, but was not successful,
kindly find the Code snipped attached below.

What are the steps that I need to follow for the same??

The problem I am facing is that the DMA trasfer is in RUN state,
but the address is not getting incremented.
/* CODE SNIPPET */
/*****************************************************************/

/* EBIU Intialization */
void Init_EBIU () {
*pEBIU_AMGCTL = 0x00FF;
ssync();
*pEBIU_AMBCTL0 = 0x22642264;
*pEBIU_AMBCTL1 = 0x22642264;
ssync();
}

/* Interrupt Handler For Receive Operation */
EX_INTERRUPT_HANDLER(MDMA_ISR)
{

*pMDMA1_D0_IRQ_STATUS |= DMA_DONE; // DMA transfer completed, acknowledge DMA done
*pMDMA1_D0_CONFIG &= (~DMAEN); // disable DMA
dma_done=1;
}

/* DMA Initialization for Receive Operation */
void Init_DMA_receive(unsigned char* Data, short DataSize)
{

*pMDMA1_D0_PERIPHERAL_MAP |= CTYPE;

*pMDMA1_D0_CONFIG = WDSIZE_8 |DI_EN |WNR;

*pMDMA1_D0_X_MODIFY =0x0001;

*pMDMA1_D0_START_ADDR = Data;

*pMDMA1_D0_X_COUNT = DataSize;
}

/* Interrupts Intilaization */
void Init_Interrupts_receive(void)
{
*pSICA_IAR0 = 0xffffffff;
*pSICA_IAR1 = 0xffffffff;
*pSICA_IAR2 = 0xffffffff;
*pSICA_IAR3 = 0xffffffff;
*pSICA_IAR4 = 0xffffffff;
*pSICA_IAR5 = 0xffffffff;
*pSICA_IAR6 = 0xff1fffff; // For MDMA 0 Interrupt
*pSICA_IAR7 = 0xffffffff;

//Register interrupt handler for MDMA0 receive module
register_handler(ik_ivg8, MDMA_ISR);

*pSICA_IMASK1 |= 0x00200000;
*pSICA_ISR1 |= 0x00200000;
*pSICA_IWR1 |= 0x00200000;

}

/* Start the DMA trasfer READ */
void Start_receive() {

*pMDMA1_D0_CONFIG = *pMDMA1_D0_CONFIG | DMAEN; // enable DMA

}

/* Main Function */
int main()
{

Init_EBIU();
Init_DMA_receive(Read_Buffer,Size);
Init_Interrupts_receive();
Start_receive();

while(!dma_done);
dma_done=0;
printf("Done\n");

}

/*****************************************************************/

Regards,
NKS