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/board
    from Rev 2 to Rev 6
    Reverse comparison

Rev 2 → Rev 6

/board.cpp
1,6 → 1,6
 
#ifndef __BOARD_H__
#include "board.h"
#include "board.h"
#endif
 
//-----------------------------------------------------------------------------
32,6 → 32,7
 
int board::brd_open(const char *name)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_open(name);
}
 
39,6 → 40,7
 
int board::brd_init()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_init();
}
 
46,6 → 48,7
 
int board::brd_reset()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_reset();
}
 
53,6 → 56,7
 
int board::brd_close()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_close();
}
 
60,6 → 64,7
 
int board::brd_load_dsp()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_load_dsp();
}
 
67,6 → 72,7
 
int board::brd_load_pld()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_load_pld();
}
 
74,6 → 80,7
 
int board::brd_board_info()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_board_info();
}
 
81,6 → 88,7
 
int board::brd_pld_info()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_pld_info();
}
 
88,10 → 96,18
 
int board::brd_resource()
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_resource();
}
 
//-----------------------------------------------------------------------------
 
void board::brd_delay(int ms)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
core_delay(ms);
}
 
/*
std::vector<struct memory_block>* board::dma_alloc(u32 dmaChannel, u32 blockNumber, u32 blockSize)
{
144,6 → 160,7
 
u32 board::brd_reg_peek_dir( u32 trd, u32 reg )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_reg_peek_dir( trd, reg );
}
 
151,6 → 168,7
 
u32 board::brd_reg_peek_ind( u32 trd, u32 reg )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_reg_peek_ind( trd, reg );
}
 
158,6 → 176,7
 
void board::brd_reg_poke_dir( u32 trd, u32 reg, u32 val )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_reg_poke_dir( trd, reg, val );
}
 
165,6 → 184,7
 
void board::brd_reg_poke_ind( u32 trd, u32 reg, u32 val )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_reg_poke_ind( trd, reg, val );
}
 
172,6 → 192,7
 
u32 board::brd_bar0_read( u32 offset )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_bar0_read( offset );
}
 
179,6 → 200,7
 
void board::brd_bar0_write( u32 offset, u32 val )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_bar0_write( offset, val );
}
 
186,6 → 208,7
 
u32 board::brd_bar1_read( u32 offset )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_bar1_read( offset );
}
 
193,6 → 216,7
 
void board::brd_bar1_write( u32 offset, u32 val )
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_bar1_write(offset, val);
}
 
200,14 → 224,19
 
u32 board::dma_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_alloc(DmaChan, sSCA);
}
 
//-----------------------------------------------------------------------------
 
u32 board::dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize, u32 blkNum, u32 isSysMem, u32 dir, u32 addr)
u32 board::dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
u32 blkNum, u32 isSysMem, u32 dir,
u32 addr, BRDstrm_Stub **pStub)
{
return core_allocate_memory(DmaChan, pBuf, blkSize, blkNum, isSysMem, dir, addr);
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_allocate_memory(DmaChan, pBuf, blkSize,
blkNum, isSysMem, dir, addr, pStub);
}
 
//-----------------------------------------------------------------------------
214,6 → 243,7
 
u32 board::dma_free_memory(int DmaChan)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_free_memory(DmaChan);
}
 
221,6 → 251,7
 
u32 board::dma_start(int DmaChan, int IsCycling)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_start_dma(DmaChan, IsCycling);
}
 
228,6 → 259,7
 
u32 board::dma_stop(int DmaChan)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_stop_dma(DmaChan);
}
 
235,6 → 267,7
 
u32 board::dma_state(int DmaChan, u32 msTimeout, int& state, u32& blkNum)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_state_dma(DmaChan, msTimeout, state, blkNum);
}
 
242,6 → 275,7
 
u32 board::dma_wait_buffer(int DmaChan, u32 msTimeout)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_wait_buffer(DmaChan, msTimeout);
}
 
249,6 → 283,7
 
u32 board::dma_wait_block(int DmaChan, u32 msTimeout)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_wait_block(DmaChan, msTimeout);
}
 
256,6 → 291,7
 
u32 board::dma_reset_fifo(int DmaChan)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_reset_fifo(DmaChan);
}
 
263,6 → 299,7
 
u32 board::dma_set_local_addr(int DmaChan, u32 addr)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_set_local_addr(DmaChan, addr);
}
 
270,6 → 307,7
 
u32 board::dma_adjust(int DmaChan, u32 mode)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_adjust(DmaChan, mode);
}
 
277,6 → 315,7
 
u32 board::dma_done(int DmaChan, u32 blockNumber)
{
DEBUG_PRINT("%s()\n", __FUNCTION__);
return core_done(DmaChan, blockNumber);
}
 
/brd_info.h
1,11 → 1,40
#ifndef _BRD_INFO_H_
#define _BRD_INFO_H_
 
#ifndef __BRD_INFO_H__
#define __BRD_INFO_H__
//-----------------------------------------------------------------------------
// board configuration data structure
 
#include <string>
struct board_info {
size_t PhysAddress[6];
void* VirtAddress[6];
size_t Size[6];
size_t InterruptLevel;
size_t InterruptVector;
unsigned short vendor_id;
unsigned short device_id;
};
/*
//-----------------------------------------------------------------------------
// memory block structure
struct memory_block {
size_t phys;
void* virt;
size_t size;
};
 
struct board_info_t {
std::string name;
//-----------------------------------------------------------------------------
// memory block structure
struct memory_descriptor {
size_t dma_channel;
size_t total_blocks;
struct memory_block *blocks;
};
 
#endif //__BRD_INFO_H__
//-----------------------------------------------------------------------------
// stub memory structure
struct stub_descriptor {
size_t dma_channel;
struct memory_block stub;
};
*/
#endif
/board.h
23,6 → 23,13
#include "ctrlstrm.h"
#endif
 
#ifdef __VERBOSE__
#include <stdio.h>
#define DEBUG_PRINT(fmt, args...) fprintf(stderr, fmt, ## args)
#else
#define DEBUG_PRINT(fmt, args...)
#endif
 
class board {
 
private:
36,9 → 43,12
virtual int core_board_info() = 0;
virtual int core_pld_info() = 0;
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, void** pBuf, u32 blkSize, u32 blkNum, u32 isSysMem, u32 dir, u32 addr) = 0;
virtual u32 core_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
u32 blkNum, u32 isSysMem, u32 dir,
u32 addr, BRDstrm_Stub **pStub ) = 0;
virtual u32 core_free_memory(int DmaChan) = 0;
virtual u32 core_start_dma(int DmaChan, int IsCycling) = 0;
virtual u32 core_stop_dma(int DmaChan) = 0;
69,6 → 79,7
int brd_close();
int brd_load_dsp();
int brd_load_pld();
void brd_delay(int ms);
 
int brd_board_info();
int brd_pld_info();
76,7 → 87,9
 
//! Методы управления каналами DMA BRDSHELL
u32 dma_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
u32 dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize, u32 blkNum, u32 isSysMem, u32 dir, u32 addr);
u32 dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
u32 blkNum, u32 isSysMem,
u32 dir, u32 addr, BRDstrm_Stub **pStub);
u32 dma_free_memory(int DmaChan);
u32 dma_start(int DmaChan, int IsCycling);
u32 dma_stop(int DmaChan);
100,9 → 113,7
void brd_bar1_write( u32 offset, u32 val );
};
 
//#define RegPeekDir(trd, reg) brd_reg_peek_dir((trd), (reg))
//#define RegPeekInd(trd, reg) brd_reg_peek_ind((trd), (reg));
//#define RegPokeDir(trd, reg, val) brd_reg_poke_dir((trd), (reg), (val));
//#define RegPokeOnd(trd, reg, val) brd_reg_poke_ind((trd), (reg), (val));
//! Тип конструктора объектов
typedef board* (*board_factory)(void);
 
#endif //__BOARD_H__
/Makefile
0,0 → 1,29
#
#change this makefile for your target...
#
 
BASENAME = libboard.so
SONAME = $(BASENAME).0
LIBNAME = $(BASENAME).0.0
 
ROOT_DIR := $(shell pwd)
LIBDIR := ../../lib
 
SRC := $(wildcard *.cpp)
SOURCE := $(SRC)
OBJ_FILES := $(SOURCE:.cpp=.o)
 
all: $(LIBNAME)
 
CFLAGS += -I. -I../utils
 
$(LIBNAME): $(OBJ_FILES)
$(LD) -g -shared -rdynamic -Wl,-soname,$(SONAME) \
-o $(LIBNAME) $(notdir $(OBJ_FILES)) -ldl -lrt -lc -lpthread
chmod 666 $(LIBNAME)
ln -sf $(LIBNAME) $(SONAME)
ln -sf $(SONAME) $(BASENAME)
cp -vfa $(BASENAME) $(SONAME) $(LIBNAME) $(LIBDIR)
rm *.o *.d
 
include ../Mk.Rules

powered by: WebSVN 2.1.0

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