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

Subversion Repositories pcie_ds_dma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /pcie_ds_dma/trunk/soft/linux/common
    from Rev 41 to Rev 54
    Reverse comparison

Rev 41 → Rev 54

/board/board.cpp
222,10 → 222,10
 
//----------BRDSHELL-----------------------------------------------------------
 
u32 board::dma_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
u32 board::dma_allocate_memory(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_alloc(DmaChan, sSCA);
return core_allocate_memory(DmaChan, sSCA);
}
 
//-----------------------------------------------------------------------------
/board/board.h
45,7 → 45,7
virtual int core_resource() = 0;
virtual void core_delay(int ms) = 0;
 
virtual u32 core_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA) = 0;
virtual u32 core_allocate_memory(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA) = 0;
virtual u32 core_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
u32 blkNum, u32 isSysMem, u32 dir,
u32 addr, BRDstrm_Stub **pStub ) = 0;
86,7 → 86,7
int brd_resource();
 
//! Методы управления каналами DMA BRDSHELL
u32 dma_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
u32 dma_allocate_memory(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
u32 dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
u32 blkNum, u32 isSysMem,
u32 dir, u32 addr, BRDstrm_Stub **pStub);
/pex/pex_board.cpp
51,7 → 51,8
if(fd > 0)
return 0;
 
fd = open(name, S_IROTH | S_IWOTH );
//fd = open(name, S_IROTH | S_IWOTH );
fd = open(name, 0666 );
if(fd < 0) {
std::cerr << __FUNCTION__ << "(): " << " error open device: " << name << endl;
goto do_out;
182,6 → 183,24
 
int pex_board::core_reset()
{
/* for test read() syscall in userspace DMA mode
void *data = NULL;
size_t size = sysconf(_SC_PAGESIZE)*16;
size_t align = sysconf(_SC_PAGESIZE);
int res = posix_memalign(&data, align, size);
if(res < 0) {
fprintf(stderr, "error in posix_memalign()\n");
return -1;
}
 
res = read(fd, data, size);
if(res < 0) {
fprintf(stderr, "error in read()\n");
return -1;
}
 
free(data);
*/
return 0;
}
 
364,8 → 383,10
 
u32 pex_board::core_reg_peek_dir( u32 trd, u32 reg )
{
if( (trd>15) || (reg>3) )
if( (trd>15) || (reg>3) ) {
fprintf(stderr, "%s(): Invalid arguments.\n", __FUNCTION__);
return -1;
}
 
u32 offset = trd*0x4000 + reg*0x1000;
u32 ret = *(bar1 + offset/4);
377,8 → 398,10
 
u32 pex_board::core_reg_peek_ind( u32 trd, u32 reg )
{
if( (trd>15) || (reg>0x3FF) )
if( (trd>15) || (reg>0x3FF) ) {
fprintf(stderr, "%s(): Invalid arguments.\n", __FUNCTION__);
return -1;
}
 
u32 status;
u32 Status = trd*0x4000;
411,8 → 434,10
 
void pex_board::core_reg_poke_dir( u32 trd, u32 reg, u32 val )
{
if( (trd>15) || (reg>3) )
if( (trd>15) || (reg>3) ) {
fprintf(stderr, "%s(): Invalid arguments.\n", __FUNCTION__);
return;
}
 
u32 offset = trd*0x4000+reg*0x1000;
 
423,8 → 448,10
 
void pex_board::core_reg_poke_ind( u32 trd, u32 reg, u32 val )
{
if( (trd>15) || (reg>0x3FF) )
if( (trd>15) || (reg>0x3FF) ) {
fprintf(stderr, "%s(): Invalid arguments.\n", __FUNCTION__);
return;
}
 
u32 status;
u32 Status = trd*0x4000;
491,8 → 518,10
 
u32 pex_board::core_block_read( u32 nb, u32 reg )
{
if( (nb>7) || (reg>31) )
if( (nb>7) || (reg>31) ) {
fprintf(stderr, "%s(): Invalid arguments.\n", __FUNCTION__);
return -1;
}
 
u32 ret = 0;
 
505,7 → 534,7
 
//-----------------------------------------------------------------------------
 
u32 pex_board::core_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
u32 pex_board::core_allocate_memory(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
{
m_DescrSize[DmaChan] = sizeof(AMB_MEM_DMA_CHANNEL) + (sSCA->blkNum - 1) * sizeof(void*);
m_Descr[DmaChan] = (AMB_MEM_DMA_CHANNEL*) new u8[m_DescrSize[DmaChan]];
662,12 → 691,15
u32 pex_board::core_free_memory(int DmaChan)
{
for(u32 iBlk = 0; iBlk < m_Descr[DmaChan]->BlockCnt; iBlk++) {
 
munmap( m_Descr[DmaChan]->pBlock[iBlk], m_Descr[DmaChan]->BlockSize );
}
 
fprintf(stderr, "%s(): Unmap blocks - OK\n", __FUNCTION__ );
 
munmap( m_Descr[DmaChan]->pStub, sizeof(AMB_STUB) );
 
fprintf(stderr, "%s(): Unmap stub - OK\n", __FUNCTION__ );
 
if(ioctl(fd, IOCTL_AMB_FREE_MEMIO, m_Descr[DmaChan]) < 0) {
fprintf(stderr, "%s(): Error free memory\n", __FUNCTION__ );
return -1;
/pex/pex_board.h
56,7 → 56,7
int core_resource();
void core_delay(int ms);
 
u32 core_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
u32 core_allocate_memory(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
u32 core_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
u32 blkNum, u32 isSysMem, u32 dir,
u32 addr, BRDstrm_Stub **pStub);
/utils/cl_ambpex.cpp
132,12 → 132,12
 
BRDC_fprintf( stderr, _BRDC("Allocation memory: \r\n")
_BRDC(" Type of buffer: system memory\r\n")
_BRDC(" Buffer size: %lld MB\r\n"), size );
_BRDC(" Buffer size: %ld MB\r\n"), size );
} else {
 
BRDC_fprintf( stderr, _BRDC("Allocation memory: \r\n")
_BRDC(" Type of buffer: userspace memory\r\n")
_BRDC(" Buffer size: %lld MB (%dx%d MB)\r\n"), size, cnt_buf, size_one_buf_of_bytes/(1024*1024) );
_BRDC(" Buffer size: %ld MB (%dx%d MB)\r\n"), size, cnt_buf, size_one_buf_of_bytes/(1024*1024) );
}
 
BRDctrl_StreamCBufAlloc sSCA = {
149,7 → 149,7
NULL,
};
 
u32 err = m_pBoard->dma_alloc( strm, &sSCA );
u32 err = m_pBoard->dma_allocate_memory( strm, &sSCA );
if(err != 0) {
throw( "Error allocate stream memory\n" );
return -1;
/utils/cl_wbpex.cpp
101,12 → 101,12
 
BRDC_fprintf( stderr, _BRDC("Allocation memory: \r\n")
_BRDC(" Type of buffer: system memory\r\n")
_BRDC(" Buffer size: %lld MB (%dx%d MB)\r\n\r\n"), size, cnt_buf, size_one_buf_of_bytes/(1024*1024) );
_BRDC(" Buffer size: %ld MB (%dx%d MB)\r\n\r\n"), size, cnt_buf, size_one_buf_of_bytes/(1024*1024) );
} else {
 
BRDC_fprintf( stderr, _BRDC("Allocation memory: \r\n")
_BRDC(" Type of buffer: userspace memory\r\n")
_BRDC(" Buffer size: %lld MB (%dx%d MB)\r\n\r\n"), size, cnt_buf, size_one_buf_of_bytes/(1024*1024) );
_BRDC(" Buffer size: %ld MB (%dx%d MB)\r\n\r\n"), size, cnt_buf, size_one_buf_of_bytes/(1024*1024) );
}
 
BRDctrl_StreamCBufAlloc sSCA = {
118,7 → 118,7
NULL,
};
 
u32 err = m_pBoard->dma_alloc( strm, &sSCA );
u32 err = m_pBoard->dma_allocate_memory( strm, &sSCA );
if(err != 0) {
throw( "Error allocate stream memory\n" );
return -1;
245,7 → 245,7
 
DEBUG_PRINT("CL_AMBPEX::%s()\n", __FUNCTION__);
 
StreamParam *pStrm= m_streamParam+strm;
//StreamParam *pStrm= m_streamParam+strm;
 
//RegPokeInd( pStrm->trd, 0, 2 );
 
/utils/tf_testbufm2.cpp
780,7 → 780,7
bit_error1[ii]=0;
}
 
for( int ii=0; ii<128*4; ii++ ) {
for( int ii=0; ii<128; ii++ ) {
word_error[ii]=0;
}
 
859,7 → 859,7
*/
 
// len=sprintf( ptr, "%4d Block: %-4d Index: %.8X Waiting: %.16LX Receive: %.16LX \r\n",
len=sprintf( ptr, "%4d Block: %-4d Index: %.8X Waiting: %.16llX Received: %.16llX \r\n",
len=sprintf( ptr, "%4d Block: %-4d Index: %.8X Waiting: %.16lX Received: %.16lX \r\n",
//" Bits: %s\r\n\r\n"
ii, nb, na, dout, din
//bit
/utils/tf_testbufm2.h
82,7 → 82,7
U32 buf_cnt_error; //!< Число неправильных массивов.
U32 word_cnt_error; //!< Число неправильных слов.
U32 buf_current; //!< Номер текущего массива.
__int64 word_error[4*32]; //!< Список ошибок
__int64 word_error[128];//!< Список ошибок
 
char str[10240]; //!< Буфер сообщений
U32 block_mode; //!< Тип блока
/utils/tf_workparam.cpp
166,11 → 166,11
//! Сохранение параметров в памяти
U32 TF_WorkParam::PutParamToMemory( char* ptr, U32 max_size )
{
char str[256];
int len;
//char str[256];
//int len;
int total=0;
U32 ii;
STR_CFG *cfg;
//U32 ii;
//STR_CFG *cfg;
/*
*((U32*)ptr)=max_item;
total=4;
216,12 → 216,12
//! Получение параметров из памяти
void TF_WorkParam::GetParamFromMemory( char* ptr )
{
char *src=ptr;
U32 len;
U32 n;
n=*((U32*)ptr);
U32 ii;
int total=4;
//char *src=ptr;
//U32 len;
//U32 n;
//n=*((U32*)ptr);
//U32 ii;
//int total=4;
/*
for( ii=0; ii<n; ii++ )
{

powered by: WebSVN 2.1.0

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