OpenCores
URL https://opencores.org/ocsvn/pcie_ds_dma/pcie_ds_dma/trunk

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [common/] [pex/] [pex_board.cpp] - Diff between revs 6 and 19

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 6 Rev 19
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;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.