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