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/] [board/] [board.h] - Blame information for rev 21

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
 
2
#ifndef __BOARD_H__
3
#define __BOARD_H__
4
 
5
#ifndef __BRD_RESOURCE_H__
6
#include "brd_resource.h"
7
#endif
8
#ifndef __BRD_INFO_H__
9
#include "brd_info.h"
10
#endif
11
 
12
#include <vector>
13
#include <string>
14
#include <stdint.h>
15
 
16
typedef uint8_t   u8;
17
typedef uint16_t  u16;
18
typedef uint32_t  u32;
19
typedef int32_t   s32;
20
typedef uint64_t  u64;
21
 
22
#ifndef _CTRL_STRM_H_
23
#include "ctrlstrm.h"
24
#endif
25
 
26 6 v.karak
#ifdef __VERBOSE__
27
#include <stdio.h>
28
#define DEBUG_PRINT(fmt, args...)    fprintf(stderr, fmt, ## args)
29
#else
30
#define DEBUG_PRINT(fmt, args...)
31
#endif
32
 
33 2 dsmv
class board {
34
 
35
private:
36
 
37
    virtual int core_open(const char *name) = 0;
38
    virtual int core_init() = 0;
39
    virtual int core_reset() = 0;
40
    virtual int core_close() = 0;
41
    virtual int core_load_dsp() = 0;
42
    virtual int core_load_pld() = 0;
43
    virtual int core_board_info() = 0;
44
    virtual int core_pld_info() = 0;
45
    virtual int core_resource() = 0;
46 6 v.karak
    virtual void core_delay(int ms) = 0;
47 2 dsmv
 
48
    virtual u32 core_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA) = 0;
49 6 v.karak
    virtual u32 core_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
50
                                     u32 blkNum, u32 isSysMem, u32 dir,
51
                                     u32 addr, BRDstrm_Stub **pStub ) = 0;
52 2 dsmv
    virtual u32 core_free_memory(int DmaChan) = 0;
53
    virtual u32 core_start_dma(int DmaChan, int IsCycling) = 0;
54
    virtual u32 core_stop_dma(int DmaChan) = 0;
55
    virtual u32 core_state_dma(int DmaChan, u32 msTimeout, int& state, u32& blkNum) = 0;
56
    virtual u32 core_wait_buffer(int DmaChan, u32 msTimeout) = 0;
57
    virtual u32 core_wait_block(int DmaChan, u32 msTimeout) = 0;
58
    virtual u32 core_reset_fifo(int DmaChan) = 0;
59
    virtual u32 core_set_local_addr(int DmaChan, u32 addr) = 0;
60
    virtual u32 core_adjust(int DmaChan, u32 mode) = 0;
61
    virtual u32 core_done(int DmaChan, u32 blockNumber) = 0;
62
 
63
    virtual u32 core_reg_peek_dir( u32 trd, u32 reg ) = 0;
64
    virtual u32 core_reg_peek_ind( u32 trd, u32 reg ) = 0;
65
    virtual void core_reg_poke_dir( u32 trd, u32 reg, u32 val ) = 0;
66
    virtual void core_reg_poke_ind( u32 trd, u32 reg, u32 val ) = 0;
67
    virtual u32  core_bar0_read( u32 addr ) = 0;
68
    virtual void core_bar0_write( u32 addr, u32 val ) = 0;
69
    virtual u32  core_bar1_read( u32 addr ) = 0;
70
    virtual void core_bar1_write( u32 addr, u32 val ) = 0;
71
 
72
public:
73
    board();
74
    virtual ~board();
75
 
76
    int brd_open(const char *name);
77
    int brd_init();
78
    int brd_reset();
79
    int brd_close();
80
    int brd_load_dsp();
81
    int brd_load_pld();
82 6 v.karak
    void brd_delay(int ms);
83 2 dsmv
 
84
    int brd_board_info();
85
    int brd_pld_info();
86
    int brd_resource();
87
 
88
    //! Методы управления каналами DMA BRDSHELL
89
    u32 dma_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
90 6 v.karak
    u32 dma_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
91
                            u32 blkNum, u32 isSysMem,
92
                            u32 dir, u32 addr, BRDstrm_Stub **pStub);
93 2 dsmv
    u32 dma_free_memory(int DmaChan);
94
    u32 dma_start(int DmaChan, int IsCycling);
95
    u32 dma_stop(int DmaChan);
96
    u32 dma_state(int DmaChan, u32 msTimeout, int& state, u32& blkNum);
97
    u32 dma_wait_buffer(int DmaChan, u32 msTimeout);
98
    u32 dma_wait_block(int DmaChan, u32 msTimeout);
99
    u32 dma_reset_fifo(int DmaChan);
100
    u32 dma_set_local_addr(int DmaChan, u32 addr);
101
    u32 dma_adjust(int DmaChan, u32 mode);
102
    u32 dma_done(int DmaChan, u32 blockNumber);
103
 
104
    //-----------------------------
105
 
106
    u32 brd_reg_peek_dir( u32 trd, u32 reg );
107
    u32 brd_reg_peek_ind( u32 trd, u32 reg );
108
    void brd_reg_poke_dir( u32 trd, u32 reg, u32 val );
109
    void brd_reg_poke_ind( u32 trd, u32 reg, u32 val );
110
    u32  brd_bar0_read( u32 offset );
111
    void brd_bar0_write( u32 offset, u32 val );
112
    u32  brd_bar1_read( u32 offset );
113
    void brd_bar1_write( u32 offset, u32 val );
114
};
115
 
116 6 v.karak
//! Тип конструктора объектов
117
typedef board* (*board_factory)(void);
118 2 dsmv
 
119
#endif //__BOARD_H__

powered by: WebSVN 2.1.0

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