mc68450reg.h revision 1.2 1 1.2 minoura /* $NetBSD: mc68450reg.h,v 1.2 1999/02/10 16:00:54 minoura Exp $ */
2 1.1 minoura
3 1.1 minoura /*-
4 1.1 minoura * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
5 1.1 minoura * All rights reserved.
6 1.1 minoura *
7 1.1 minoura * This code is derived from software contributed to The NetBSD Foundation
8 1.1 minoura * by Minoura Makoto.
9 1.1 minoura *
10 1.1 minoura * Redistribution and use in source and binary forms, with or without
11 1.1 minoura * modification, are permitted provided that the following conditions
12 1.1 minoura * are met:
13 1.1 minoura * 1. Redistributions of source code must retain the above copyright
14 1.1 minoura * notice, this list of conditions and the following disclaimer.
15 1.1 minoura * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 minoura * notice, this list of conditions and the following disclaimer in the
17 1.1 minoura * documentation and/or other materials provided with the distribution.
18 1.1 minoura * 3. All advertising materials mentioning features or use of this software
19 1.1 minoura * must display the following acknowledgement:
20 1.1 minoura * This product includes software developed by the NetBSD
21 1.1 minoura * Foundation, Inc. and its contributors.
22 1.1 minoura * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 minoura * contributors may be used to endorse or promote products derived
24 1.1 minoura * from this software without specific prior written permission.
25 1.1 minoura *
26 1.1 minoura * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 minoura * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 minoura * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 minoura * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 minoura * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 minoura * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 minoura * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 minoura * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 minoura * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 minoura * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 minoura * POSSIBILITY OF SUCH DAMAGE.
37 1.1 minoura */
38 1.1 minoura
39 1.1 minoura /*
40 1.1 minoura * Motorola MC68450 DMAC register definition.
41 1.1 minoura */
42 1.1 minoura
43 1.1 minoura #define DMAC_NCHAN 4 /* Number of channels */
44 1.1 minoura #define DMAC_CHAN_SIZE 0x40 /* I/O area size per channes */
45 1.1 minoura
46 1.1 minoura /* register location per channel */
47 1.1 minoura #define DMAC_REG_CSR 0x00 /* Channel Status Register */
48 1.1 minoura #define DMAC_REG_CER 0x01 /* Channel Error Register */
49 1.1 minoura #define DMAC_REG_DCR 0x04 /* Device Control Register */
50 1.1 minoura #define DMAC_REG_OCR 0x05 /* Operation Control Register */
51 1.1 minoura #define DMAC_REG_SCR 0x06 /* Sequence Control Register */
52 1.1 minoura #define DMAC_REG_CCR 0x07 /* Channel Control Register */
53 1.1 minoura #define DMAC_REG_MTCR 0x0a /* Memory Transfer Count Register */
54 1.1 minoura #define DMAC_REG_MAR 0x0c /* Memory Address Register */
55 1.1 minoura #define DMAC_REG_DAR 0x14 /* Device Address Register */
56 1.1 minoura #define DMAC_REG_BTCR 0x1a /* Base Transfer Count Register */
57 1.1 minoura #define DMAC_REG_BAR 0x1c /* Base Address Register */
58 1.1 minoura #define DMAC_REG_NIVR 0x25 /* Normal Interrupt Vector Register */
59 1.1 minoura #define DMAC_REG_EIVR 0x27 /* Error Interrupt Vector Register */
60 1.1 minoura #define DMAC_REG_MFCR 0x29 /* Memory Function Code Register */
61 1.1 minoura #define DMAC_REG_CPR 0x2d /* Channel Priority Register */
62 1.1 minoura #define DMAC_REG_DFCR 0x31 /* Device Function Code Register */
63 1.1 minoura #define DMAC_REG_BFCR 0x39 /* Base Function Code Register */
64 1.1 minoura #define DMAC_REG_GCR 0x3f /* General Control Register */
65 1.1 minoura
66 1.1 minoura /* CSR bits */
67 1.1 minoura #define DMAC_CSR_COC 0x80 /* Channel Operation Complete */
68 1.1 minoura #define DMAC_CSR_BTC 0x40 /* Block Transfer Complete */
69 1.1 minoura #define DMAC_CSR_NDT 0x20 /* Normal Device Termination */
70 1.1 minoura #define DMAC_CSR_ERR 0x10 /* Error */
71 1.1 minoura #define DMAC_CSR_ACT 0x08 /* Channel Active */
72 1.1 minoura #define DMAC_CSR_PCT 0x02 /* PCL Transition */
73 1.1 minoura #define DMAC_CSR_PCS 0x01 /* PCL Level */
74 1.1 minoura
75 1.1 minoura /* CER meanings */
76 1.1 minoura /*
77 1.1 minoura * 0x00: No error
78 1.1 minoura * 0x01: Configuration error
79 1.1 minoura * 0x02: Operation timing error
80 1.1 minoura * 0x05: Address error in memory transfer
81 1.1 minoura * 0x06: Address error in device transfer
82 1.1 minoura * 0x07: Address error in base address reading
83 1.1 minoura * 0x09: Bus error in memory transfer
84 1.1 minoura * 0x0a: Bus error in device transfer
85 1.1 minoura * 0x0b: Bus error in base address reading
86 1.1 minoura * 0x0d: Count error in memory transfer count
87 1.1 minoura * 0x0e: Count error in device transfer count
88 1.1 minoura * 0x0f: Count error in base address
89 1.1 minoura * 0x10: External abort
90 1.1 minoura * 0x11: Software abort
91 1.1 minoura */
92 1.1 minoura
93 1.1 minoura /* DCR bits */
94 1.1 minoura #define DMAC_DCR_XRM_MASK 0xc0
95 1.1 minoura #define DMAC_DCR_XRM_BURST 0x00 /* Burst mode */
96 1.1 minoura #define DMAC_DCR_XRM_CSWOH 0x80 /* Cycle steal w/o hold */
97 1.1 minoura #define DMAC_DCR_XRM_CSWH 0xc0 /* Cycle steal w/ hold */
98 1.1 minoura #define DMAC_DCR_OTYP_MASK 0x30
99 1.1 minoura #define DMAC_DCR_OTYP_EASYNC 0x00 /* Explicit M68000 */
100 1.1 minoura #define DMAC_DCR_OTYP_ESYNC 0x10 /* Explicit M6800 */
101 1.1 minoura #define DMAC_DCR_OTYP_IA 0x20 /* Implicit with ack */
102 1.1 minoura #define DMAC_DCR_OTYP_IAR 0x30 /* Implicit with ack and rdy */
103 1.1 minoura #define DMAC_DCR_OPS_MASK 0x08
104 1.1 minoura #define DMAC_DCR_OPS_8BIT 0x00 /* 8bit */
105 1.1 minoura #define DMAC_DCR_OPS_16BIT 0x08 /* 16bit */
106 1.1 minoura #define DMAC_DCR_PCL_MASK 0x03
107 1.1 minoura #define DMAC_DCR_PCL_STATUS 0x00
108 1.1 minoura #define DMAC_DCR_PCL_INTERRUPT 0x01
109 1.1 minoura #define DMAC_DCR_PCL_STARTPLS 0x02
110 1.1 minoura #define DMAC_DCR_PCL_ABORT 0x03
111 1.1 minoura
112 1.1 minoura /* OCR bits */
113 1.1 minoura #define DMAC_OCR_DIR_MASK 0x80
114 1.1 minoura #define DMAC_OCR_DIR_MTD 0x00 /* Direction: memory to device */
115 1.1 minoura #define DMAC_OCR_DIR_DTM 0x80 /* Direction: device to memory */
116 1.1 minoura #define DMAC_OCR_SIZE_MASK 0x30
117 1.1 minoura #define DMAC_OCR_SIZE_BYTE 0x00 /* Size: byte */
118 1.1 minoura #define DMAC_OCR_SIZE_WORD 0x10 /* Size: word */
119 1.1 minoura #define DMAC_OCR_SIZE_LONGWORD 0x20 /* Size: longword */
120 1.1 minoura #define DMAC_OCR_SIZE_BYTE_NOPACK 0x30 /* Size: byte, no packing */
121 1.1 minoura #define DMAC_OCR_CHAIN_MASK 0x0c
122 1.1 minoura #define DMAC_OCR_CHAIN_DISABLED 0x00 /* Chain mode disabled */
123 1.1 minoura #define DMAC_OCR_CHAIN_ARRAY 0x08 /* Array chain mode */
124 1.1 minoura #define DMAC_OCR_CHAIN_LINKARRAY 0x0c /* Linked array chain mode */
125 1.1 minoura #define DMAC_OCR_REQG_MASK 0x03
126 1.1 minoura #define DMAC_OCR_REQG_LIMITED_RATE 0x00 /* Internal limited rate */
127 1.1 minoura #define DMAC_OCR_REQG_MAXIMUM_RATE 0x01 /* Internal maximum rate */
128 1.1 minoura #define DMAC_OCR_REQG_EXTERNAL 0x02 /* External */
129 1.1 minoura #define DMAC_OCR_REQG_AUTO_START 0x03 /* Auto start, external */
130 1.1 minoura
131 1.1 minoura /* SCR bits */
132 1.1 minoura #define DMAC_SCR_MAC_MASK 0x0c
133 1.1 minoura #define DMAC_SCR_MAC_NO_COUNT 0x00 /* Fixed memory address */
134 1.1 minoura #define DMAC_SCR_MAC_COUNT_UP 0x04 /* Memory address count up */
135 1.1 minoura #define DMAC_SCR_MAC_COUNT_DOWN 0x08 /* Memory address count down */
136 1.1 minoura #define DMAC_SCR_DAC_MASK 0x03
137 1.1 minoura #define DMAC_SCR_DAC_NO_COUNT 0x00 /* Fixed device address */
138 1.1 minoura #define DMAC_SCR_DAC_COUNT_UP 0x01 /* Device address count up */
139 1.1 minoura #define DMAC_SCR_DAC_COUNT_DOWN 0x02 /* Device address count down */
140 1.1 minoura
141 1.1 minoura /* CCR bits */
142 1.1 minoura #define DMAC_CCR_STR 0x80 /* Start channel */
143 1.1 minoura #define DMAC_CCR_CNT 0x40 /* Continue operation */
144 1.1 minoura #define DMAC_CCR_HLT 0x20 /* Software halt */
145 1.1 minoura #define DMAC_CCR_SAB 0x10 /* Software abort */
146 1.1 minoura #define DMAC_CCR_INT 0x08 /* Interrupt enable */
147 1.1 minoura
148 1.1 minoura /* GCR bits */
149 1.1 minoura #define DMAC_GCR_BT_MASK 0x0c
150 1.1 minoura #define DMAC_GCR_BT_16 0x00 /* 16clocks */
151 1.1 minoura #define DMAC_GCR_BT_32 0x04 /* 32clocks */
152 1.1 minoura #define DMAC_GCR_BT_64 0x08 /* 64clocks */
153 1.1 minoura #define DMAC_GCR_BT_128 0x0c /* 128clocks */
154 1.1 minoura #define DMAC_GCR_BR_MASK 0x03
155 1.1 minoura #define DMAC_GCR_BR_50 0x00 /* 50% bandwidth */
156 1.1 minoura #define DMAC_GCR_BR_25 0x01 /* 25% bandwidth */
157 1.1 minoura #define DMAC_GCR_BR_12 0x02 /* 12.5% bandwidth */
158 1.1 minoura #define DMAC_GCR_BR_6 0x03 /* 6.25% bandwidth */
159 1.1 minoura
160 1.1 minoura /* MFC/DFC function codes */
161 1.1 minoura #define DMAC_FC_USER_DATA 0x01
162 1.1 minoura #define DMAC_FC_USER_PROGRAM 0x02
163 1.1 minoura #define DMAC_FC_KERNEL_DATA 0x05
164 1.1 minoura #define DMAC_FC_KERNEL_PROGRAM 0x06
165 1.1 minoura #define DMAC_FC_CPU 0x07
166 1.1 minoura
167 1.1 minoura /*
168 1.1 minoura * An element of the array used in DMAC scatter-gather transfer
169 1.1 minoura * (array chaining mode)
170 1.1 minoura */
171 1.1 minoura struct dmac_sg_array {
172 1.2 minoura u_int32_t da_addr;
173 1.1 minoura u_int16_t da_count;
174 1.1 minoura };
175