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.h] - Blame information for rev 27

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

Line No. Rev Author Line
1 2 dsmv
 
2
#ifndef __PEX_BOARD_H__
3
#define __PEX_BOARD_H__
4
 
5
#ifndef __BOARD__H__
6
    #include "board.h"
7
#endif
8
#ifndef _STREAMLL_H_
9
    #include "streamll.h"
10
#endif
11
#ifndef _PEXIOCTL_H_
12
    #include "pexioctl.h"
13
#endif
14
#ifndef _AMBPEXREGS_H_
15
    #include "ambpexregs.h"
16
#endif
17
 
18
#include <vector>
19
#include <string>
20
#include <stdint.h>
21
 
22
//-----------------------------------------------------------------------------
23
 
24 6 v.karak
//class dma_memory;
25 2 dsmv
 
26
//-----------------------------------------------------------------------------
27
#define MAX_NUMBER_OF_DMACHANNELS 4
28
//-----------------------------------------------------------------------------
29
 
30
class pex_board : public board {
31
 
32
private:
33
    int fd;
34
    u32 *bar0;
35
    u32 *bar1;
36
    struct board_info bi;
37
    void core_pause(int ms);
38
 
39 6 v.karak
    //dma_memory *m_dma;
40 2 dsmv
 
41
    AMB_MEM_DMA_CHANNEL *m_Descr[MAX_NUMBER_OF_DMACHANNELS];
42
    u32                  m_DescrSize[MAX_NUMBER_OF_DMACHANNELS];
43
 
44
public:
45
    pex_board();
46
    virtual ~pex_board();
47
 
48
    int core_open(const char *name);
49
    int core_init();
50
    int core_reset();
51
    int core_close();
52
    int core_load_dsp();
53
    int core_load_pld();
54
    int core_board_info();
55
    int core_pld_info();
56
    int core_resource();
57 6 v.karak
    void core_delay(int ms);
58 2 dsmv
 
59
    u32 core_alloc(int DmaChan, BRDctrl_StreamCBufAlloc* sSCA);
60 6 v.karak
    u32 core_allocate_memory(int DmaChan, void** pBuf, u32 blkSize,
61
                             u32 blkNum, u32 isSysMem, u32 dir,
62
                             u32 addr, BRDstrm_Stub **pStub);
63 2 dsmv
    u32 core_free_memory(int DmaChan);
64
    u32 core_start_dma(int DmaChan, int IsCycling);
65
    u32 core_stop_dma(int DmaChan);
66
    u32 core_state_dma(int DmaChan, u32 msTimeout, int& state, u32& blkNum);
67
    u32 core_wait_buffer(int DmaChan, u32 msTimeout);
68
    u32 core_wait_block(int DmaChan, u32 msTimeout);
69
    u32 core_reset_fifo(int DmaChan);
70
    u32 core_set_local_addr(int DmaChan, u32 addr);
71
    u32 core_adjust(int DmaChan, u32 mode);
72
    u32 core_done(int DmaChan, u32 blockNumber);
73
 
74
    u32 core_reg_peek_dir( u32 trd, u32 reg );
75
    u32 core_reg_peek_ind( u32 trd, u32 reg );
76
    void core_reg_poke_dir( u32 trd, u32 reg, u32 val );
77
    void core_reg_poke_ind( u32 trd, u32 reg, u32 val );
78
    u32  core_bar0_read( u32 offset );
79
    void core_bar0_write( u32 offset, u32 val );
80
    u32  core_bar1_read( u32 offset );
81
    void core_bar1_write( u32 offset, u32 val );
82
 
83
    void core_block_write( u32 nb, u32 reg, u32 val );
84
    u32  core_block_read( u32 nb, u32 reg );
85
};
86
 
87
 
88
#endif //__PEX_BOARD_H__

powered by: WebSVN 2.1.0

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