OpenCores
URL https://opencores.org/ocsvn/kiss-board/kiss-board/trunk

Subversion Repositories kiss-board

[/] [kiss-board/] [tags/] [initial/] [kiss-board_soc/] [sw/] [boot_flash/] [dma.h] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 fukuchi
 
2
#ifndef __DMA_H
3
#define __DMA_H
4
 
5
#include "support.h"
6
 
7
//
8
// TSR1000x-board
9
//
10
#define DMA_IRQ                 3
11
#define DMA_BASE                0x9f000000
12
 
13
//
14
// parameter
15
//
16
#define DMA_CH_SIZE             1
17
#define DMA_BUF_SIZE            4 //8192
18
 
19
//
20
// dma io
21
//
22
#define DMA_BASE_CSR            0x00000000
23
#define DMA_BASE_INT_MSK_A      0x00000004
24
#define DMA_BASE_INT_MSK_B      0x00000008
25
#define DMA_BASE_INT_SRC_A      0x0000000c
26
#define DMA_BASE_INT_SRC_B      0x00000010
27
#define DMA_CH_CSR              0x00000000
28
#define DMA_CH_SZ               0x00000004
29
#define DMA_CH_A0               0x00000008
30
#define DMA_CH_AM0              0x0000000c
31
#define DMA_CH_A1               0x00000010
32
#define DMA_CH_AM1              0x00000014
33
#define DMA_CH_DESC             0x00000018
34
#define DMA_CH_SWPTR            0x0000001c
35
 
36
struct dma_buffer {
37
        void *src;
38
        void *dst;
39
        unsigned long int size;
40
} typedef DMA_BUFFER;
41
 
42
struct dma_channel {
43
        unsigned long int wp;
44
        unsigned long int rp;
45
        unsigned long int busy;
46
        unsigned long int buf_size;
47
        unsigned long int info_add_a0;
48
        unsigned long int info_add_a1;
49
        unsigned long int info_add_sz;
50
        unsigned long int info_add_csr;
51
        DMA_BUFFER *buf;
52
} typedef DMA_CHANNEL;
53
 
54
struct dma {
55
        unsigned long int base;
56
        unsigned long int irq;
57
        unsigned long int ch_size;
58
        unsigned long int info_add_intsrca;
59
        DMA_CHANNEL *ch;
60
} typedef DMA;
61
 
62
// private
63
void                            dma_handler(void *argv)                                                                 __attribute__ ((section(".icm")));
64
 
65
// public
66
void                            dma_init(DMA *dma,unsigned long int base,unsigned long int irq)                         __attribute__ ((section(".text")));
67
void                            dma_add(DMA *dma,unsigned long int ch,void *src,void *dst,unsigned long int size)       __attribute__ ((section(".text")));
68
unsigned long int               dma_add_full(DMA *dma,unsigned long int ch)                                             __attribute__ ((section(".text")));
69
 
70
#endif
71
 

powered by: WebSVN 2.1.0

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