OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [or1ksim/] [peripheral/] [dma-defs.h] - Blame information for rev 166

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

Line No. Rev Author Line
1 19 jeremybenn
/* dma-defs.h -- Definition of relative addresses/register bits for DMA
2
 
3
   Copyright (C) 2001 by Erez Volk, erez@opencores.org
4
   Copyright (C) 2008 Embecosm Limited
5
 
6
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7
 
8
   This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
9
 
10
   This program is free software; you can redistribute it and/or modify it
11
   under the terms of the GNU General Public License as published by the Free
12
   Software Foundation; either version 3 of the License, or (at your option)
13
   any later version.
14
 
15
   This program is distributed in the hope that it will be useful, but WITHOUT
16
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
   more details.
19
 
20
   You should have received a copy of the GNU General Public License along
21
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
22
 
23
/* This program is commented throughout in a fashion suitable for processing
24
   with Doxygen. */
25
 
26
 
27
#ifndef DMA_DEFS__H
28
#define DMA_DEFS__H
29
 
30
/* Number of channel per DMA controller */
31
#define DMA_NUM_CHANNELS  31
32
 
33
/* Address space required by one DMA controller */
34
#define DMA_ADDR_SPACE  0x400
35
 
36
/* Relative Register Addresses */
37
#define DMA_CSR        0x00
38
#define DMA_INT_MSK_A  0x04
39
#define DMA_INT_MSK_B  0x08
40
#define DMA_INT_SRC_A  0x0C
41
#define DMA_INT_SRC_B  0x10
42
 
43
/* Channel registers definitions */
44
#define DMA_CH_BASE  0x20       /*!< Offset of first channel registers */
45
#define DMA_CH_SIZE  0x20       /*!< Per-channel address space */
46
 
47
/* Per-channel Register Addresses, relative to channel start */
48
#define DMA_CH_CSR    0x00
49
#define DMA_CH_SZ     0x04
50
#define DMA_CH_A0     0x08
51
#define DMA_CH_AM0    0x0C
52
#define DMA_CH_A1     0x10
53
#define DMA_CH_AM1    0x14
54
#define DMA_CH_DESC   0x18
55
#define DMA_CH_SWPTR  0x1C
56
 
57
/* Field Definitions for the Main CSR */
58
#define DMA_CSR_PAUSE_OFFSET             0
59
 
60
/* Field Definitions for the Channel CSR(s) */
61
#define DMA_CH_CSR_CH_EN_OFFSET           0
62
#define DMA_CH_CSR_DST_SEL_OFFSET         1
63
#define DMA_CH_CSR_SRC_SEL_OFFSET         2
64
#define DMA_CH_CSR_INC_DST_OFFSET         3
65
#define DMA_CH_CSR_INC_SRC_OFFSET         4
66
#define DMA_CH_CSR_MODE_OFFSET            5
67
#define DMA_CH_CSR_ARS_OFFSET             6
68
#define DMA_CH_CSR_USE_ED_OFFSET          7
69
#define DMA_CH_CSR_SZ_WB_OFFSET           8
70
#define DMA_CH_CSR_STOP_OFFSET            9
71
#define DMA_CH_CSR_BUSY_OFFSET           10
72
#define DMA_CH_CSR_DONE_OFFSET           11
73
#define DMA_CH_CSR_ERR_OFFSET            12
74
#define DMA_CH_CSR_PRIORITY_OFFSET       13
75
#define DMA_CH_CSR_PRIORITY_WIDTH         3
76
#define DMA_CH_CSR_REST_EN_OFFSET        16
77
#define DMA_CH_CSR_INE_ERR_OFFSET        17
78
#define DMA_CH_CSR_INE_DONE_OFFSET       18
79
#define DMA_CH_CSR_INE_CHK_DONE_OFFSET   19
80
#define DMA_CH_CSR_INT_ERR_OFFSET        20
81
#define DMA_CH_CSR_INT_DONE_OFFSET       21
82
#define DMA_CH_CSR_INT_CHUNK_DONE_OFFSET 22
83
#define DMA_CH_CSR_RESERVED_OFFSET       23
84
#define DMA_CH_CSR_RESERVED_WIDTH         9
85
 
86
/* Masks -- Writable and readonly parts of the register */
87
#define DMA_CH_CSR_WRITE_MASK            0x000FE3FF
88
 
89
/* Field definitions for Channel Size Registers */
90
#define DMA_CH_SZ_TOT_SZ_OFFSET           0
91
#define DMA_CH_SZ_TOT_SZ_WIDTH           12
92
#define DMA_CH_SZ_CHK_SZ_OFFSET          16
93
#define DMA_CH_SZ_CHK_SZ_WIDTH            9
94
 
95
/* Field definitions for Channel Address Registers CHn_Am */
96
#define DMA_CH_A0_ADDR_OFFSET             2
97
#define DMA_CH_A0_ADDR_WIDTH             30
98
#define DMA_CH_A1_ADDR_OFFSET             2
99
#define DMA_CH_A1_ADDR_WIDTH             30
100
 
101
/* Field definitions for Channel Address Mask Registers CHn_AMm */
102
#define DMA_CH_AM0_MASK_OFFSET            4
103
#define DMA_CH_AM0_MASK_WIDTH            28
104
#define DMA_CH_AM1_MASK_OFFSET            4
105
#define DMA_CH_AM1_MASK_WIDTH            28
106
 
107
/* Field definitions for Channel Linked List descriptor Pointer CHn_DESC */
108
#define DMA_CH_DESC_ADDR_OFFSET           2
109
#define DMA_CH_DESC_ADDR_WIDTH           30
110
 
111
/* Field definitions for Channel Software Pointer */
112
#define DMA_CH_SWPTR_PTR_OFFSET           2
113
#define DMA_CH_SWPTR_PTR_WIDTH           29
114
#define DMA_CH_SWPTR_EN_OFFSET           31
115
 
116
 
117
/* Structure of linked list descriptors (offsets of elements)  */
118
#define DMA_DESC_CSR                     0x00
119
#define DMA_DESC_ADR0                    0x04
120
#define DMA_DESC_ADR1                    0x08
121
#define DMA_DESC_NEXT                    0x0C
122
 
123
/* Field definitions for linked list descriptor DESC_CSR */
124
#define DMA_DESC_CSR_EOL_OFFSET          20
125
#define DMA_DESC_CSR_INC_SRC_OFFSET      19
126
#define DMA_DESC_CSR_INC_DST_OFFSET      18
127
#define DMA_DESC_CSR_SRC_SEL_OFFSET      17
128
#define DMA_DESC_CSR_DST_SEL_OFFSET      16
129
#define DMA_DESC_CSR_TOT_SZ_OFFSET        0
130
#define DMA_DESC_CSR_TOT_SZ_WIDTH        12
131
 
132
#endif  /* DMA_DEFS__H */

powered by: WebSVN 2.1.0

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