Line 471... |
Line 471... |
|
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
|
|
void pex_board::core_bar1_write( u32 offset, u32 val )
|
void pex_board::core_bar1_write( u32 offset, u32 val )
|
{
|
{
|
bar1[offset] = val;
|
bar1[2*offset] = val;
|
}
|
}
|
|
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
|
|
void pex_board::core_block_write( u32 nb, u32 reg, u32 val )
|
void pex_board::core_block_write( u32 nb, u32 reg, u32 val )
|
Line 680... |
Line 680... |
|
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
|
|
u32 pex_board::core_start_dma(int DmaChan, int IsCycling)
|
u32 pex_board::core_start_dma(int DmaChan, int IsCycling)
|
{
|
{
|
|
|
|
fprintf(stderr, "%s(): DmaChan=%d IsCycling=%d \n", __FUNCTION__, DmaChan, IsCycling );
|
if(m_Descr[DmaChan])
|
if(m_Descr[DmaChan])
|
{
|
{
|
AMB_START_DMA_CHANNEL StartDescrip;
|
AMB_START_DMA_CHANNEL StartDescrip;
|
StartDescrip.DmaChanNum = DmaChan;
|
StartDescrip.DmaChanNum = DmaChan;
|
StartDescrip.IsCycling = IsCycling;
|
StartDescrip.IsCycling = IsCycling;
|
|
|
|
fprintf(stderr, "%s(): IOCTL_AMB_START_MEMIO ", __FUNCTION__ );
|
|
|
if (ioctl(fd,IOCTL_AMB_START_MEMIO,&StartDescrip) < 0) {
|
if (ioctl(fd,IOCTL_AMB_START_MEMIO,&StartDescrip) < 0) {
|
fprintf(stderr, "%s(): Error start DMA\n", __FUNCTION__ );
|
fprintf(stderr, "%s(): Error start DMA\n", __FUNCTION__ );
|
return -1;
|
return -1;
|
}
|
}
|
|
fprintf(stderr, " %s - OK \n", __FUNCTION__ );
|
}
|
}
|
return 0;
|
return 0;
|
}
|
}
|
|
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
Line 799... |
Line 804... |
{
|
{
|
AMB_SET_DMA_CHANNEL DmaParam;
|
AMB_SET_DMA_CHANNEL DmaParam;
|
DmaParam.DmaChanNum = DmaChan;
|
DmaParam.DmaChanNum = DmaChan;
|
DmaParam.Param = addr;
|
DmaParam.Param = addr;
|
|
|
|
fprintf(stderr, "%s(): DmaChan=%d addr=0x%.8X \n", __FUNCTION__, DmaChan, addr );
|
|
|
|
|
if(m_Descr[DmaChan])
|
if(m_Descr[DmaChan])
|
{
|
{
|
if (0 > ioctl(fd, IOCTL_AMB_SET_SRC_MEM, &DmaParam)) {
|
if (0 > ioctl(fd, IOCTL_AMB_SET_SRC_MEM, &DmaParam)) {
|
fprintf(stderr, "%s(): Error set source for DMA\n", __FUNCTION__ );
|
fprintf(stderr, "%s(): Error set source for DMA\n", __FUNCTION__ );
|
return -1;
|
return -1;
|
}
|
}
|
|
|
|
|
|
DmaParam.Param = m_Descr[DmaChan]->Direction;
|
|
|
|
if (0 > ioctl(fd, IOCTL_AMB_SET_DIR_MEM, &DmaParam)) {
|
|
fprintf(stderr, "%s(): Error set dir for DMA\n", __FUNCTION__ );
|
|
return -1;
|
|
}
|
|
|
|
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|