ciareg.h revision 1.10.4.1 1 /* $NetBSD: ciareg.h,v 1.10.4.1 1997/08/23 07:07:08 thorpej Exp $ */
2
3 /*
4 * Copyright Notice:
5 *
6 * Copyright (c) 1997 Christopher G. Demetriou. All rights reserved.
7 *
8 * License:
9 *
10 * This License applies to this software ("Software"), created
11 * by Christopher G. Demetriou ("Author").
12 *
13 * You may use, copy, modify and redistribute this Software without
14 * charge, in either source code form, binary form, or both, on the
15 * following conditions:
16 *
17 * 1. (a) Binary code: (i) a complete copy of the above copyright notice
18 * must be included within each copy of the Software in binary code form,
19 * and (ii) a complete copy of the above copyright notice and all terms
20 * of this License as presented here must be included within each copy of
21 * all documentation accompanying or associated with binary code, in any
22 * medium, along with a list of the software modules to which the license
23 * applies.
24 *
25 * (b) Source Code: A complete copy of the above copyright notice and all
26 * terms of this License as presented here must be included within: (i)
27 * each copy of the Software in source code form, and (ii) each copy of
28 * all accompanying or associated documentation, in any medium.
29 *
30 * 2. The following Acknowledgment must be used in communications
31 * involving the Software as described below:
32 *
33 * This product includes software developed by
34 * Christopher G. Demetriou for the NetBSD Project.
35 *
36 * The Acknowledgment must be conspicuously and completely displayed
37 * whenever the Software, or any software, products or systems containing
38 * the Software, are mentioned in advertising, marketing, informational
39 * or publicity materials of any kind, whether in print, electronic or
40 * other media (except for information provided to support use of
41 * products containing the Software by existing users or customers).
42 *
43 * 3. The name of the Author may not be used to endorse or promote
44 * products derived from this Software without specific prior written
45 * permission (conditions (1) and (2) above are not considered
46 * endorsement or promotion).
47 *
48 * 4. This license applies to: (a) all copies of the Software, whether
49 * partial or whole, original or modified, and (b) your actions, and the
50 * actions of all those who may act on your behalf. All uses not
51 * expressly permitted are reserved to the Author.
52 *
53 * 5. Disclaimer. THIS SOFTWARE IS MADE AVAILABLE BY THE AUTHOR TO THE
54 * PUBLIC FOR FREE AND "AS IS.'' ALL USERS OF THIS FREE SOFTWARE ARE
55 * SOLELY AND ENTIRELY RESPONSIBLE FOR THEIR OWN CHOICE AND USE OF THIS
56 * SOFTWARE FOR THEIR OWN PURPOSES. BY USING THIS SOFTWARE, EACH USER
57 * AGREES THAT THE AUTHOR SHALL NOT BE LIABLE FOR DAMAGES OF ANY KIND IN
58 * RELATION TO ITS USE OR PERFORMANCE.
59 *
60 * 6. If you have a special need for a change in one or more of these
61 * license conditions, please contact the Author via electronic mail to
62 *
63 * cgd (at) NetBSD.ORG
64 *
65 * or via the contact information on
66 *
67 * http://www.NetBSD.ORG/People/Pages/cgd.html
68 */
69
70 /*
71 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
72 * All rights reserved.
73 *
74 * Authors: Chris G. Demetriou, Jason R. Thorpe
75 *
76 * Permission to use, copy, modify and distribute this software and
77 * its documentation is hereby granted, provided that both the copyright
78 * notice and this permission notice appear in all copies of the
79 * software, derivative works or modified versions, and any portions
80 * thereof, and that both notices appear in supporting documentation.
81 *
82 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
83 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
84 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
85 *
86 * Carnegie Mellon requests users of this software to return to
87 *
88 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
89 * School of Computer Science
90 * Carnegie Mellon University
91 * Pittsburgh PA 15213-3890
92 *
93 * any improvements or extensions that they make and grant Carnegie the
94 * rights to redistribute these changes.
95 */
96
97 /*
98 * 21171 Chipset registers and constants.
99 *
100 * Taken from EC-QE18B-TE.
101 */
102
103 #define REGVAL(r) (*(volatile int32_t *)ALPHA_PHYS_TO_K0SEG(r))
104
105 /*
106 * Base addresses
107 * XXX CLEAN UP: split into logical sections, then offsets into section.
108 */
109 #define CIA_PCI_SMEM1 0x8000000000UL
110 #define CIA_PCI_SMEM2 0x8400000000UL
111 #define CIA_PCI_SMEM3 0x8500000000UL
112 #define CIA_PCI_SIO1 0x8580000000UL
113 #define CIA_PCI_SIO2 0x85c0000000UL
114 #define CIA_PCI_DENSE 0x8600000000UL
115 #define CIA_PCI_CONF 0x8700000000UL
116 #define CIA_PCI_IACK 0x8720000000UL
117 #define CIA_CSRS 0x8740000000UL
118 #define CIA_PCI_MC_CSRS 0x8750000000UL
119 #define CIA_PCI_ATRANS 0x8760000000UL
120 #define CIA_PCI_TBIA 0x8760000100UL
121
122 #define CIA_PCI_W0BASE 0x8760000400UL
123 #define CIA_PCI_W0MASK 0x8760000440UL
124 #define CIA_PCI_T0BASE 0x8760000480UL
125
126 #define CIA_PCI_W1BASE 0x8760000500UL
127 #define CIA_PCI_W1MASK 0x8760000540UL
128 #define CIA_PCI_T1BASE 0x8760000580UL
129
130 #define CIA_PCI_W2BASE 0x8760000600UL
131 #define CIA_PCI_W2MASK 0x8760000640UL
132 #define CIA_PCI_T2BASE 0x8760000680UL
133
134 #define CIA_PCI_W3BASE 0x8760000700UL
135 #define CIA_PCI_W3MASK 0x8760000740UL
136 #define CIA_PCI_T3BASE 0x8760000780UL
137
138 /*
139 * Values for CIA_PCI_TBIA
140 */
141 #define CIA_PCI_TBIA_NOOP 0 /* no operation */
142 #define CIA_PCI_TBIA_LOCKED 1 /* invalidate and unlock locked tags */
143 #define CIA_PCI_TBIA_UNLOCKED 2 /* invalidate unlocked tags */
144 #define CIA_PCI_TBIA_ALL 3 /* invalidate and unlock all tags */
145
146 /*
147 * Values for CIA_PCI_WnBASE
148 */
149 #define CIA_PCI_WnBASE_W_BASE 0xfff00000
150 #define CIA_PCI_WnBASE_DAC_EN 0x00000008 /* W3BASE only */
151 #define CIA_PCI_WnBASE_MEMCS_EN 0x00000004 /* W0BASE only */
152 #define CIA_PCI_WnBASE_SG_EN 0x00000002
153 #define CIA_PCI_WnBASE_W_EN 0x00000001
154
155 /*
156 * Values for CIA_PCI_WnMASK
157 */
158 #define CIA_PCI_WnMASK_W_MASK 0xfff00000
159 #define CIA_PCI_WnMASK_1M 0x00000000
160 #define CIA_PCI_WnMASK_2M 0x00100000
161 #define CIA_PCI_WnMASK_4M 0x00300000
162 #define CIA_PCI_WnMASK_8M 0x00700000
163 #define CIA_PCI_WnMASK_16M 0x00f00000
164 #define CIA_PCI_WnMASK_32M 0x01f00000
165 #define CIA_PCI_WnMASK_64M 0x03f00000
166 #define CIA_PCI_WnMASK_128M 0x07f00000
167 #define CIA_PCI_WnMASK_256M 0x0ff00000
168 #define CIA_PCI_WnMASK_512M 0x1ff00000
169 #define CIA_PCI_WnMASK_1G 0x3ff00000
170 #define CIA_PCI_WnMASK_2G 0x7ff00000
171 #define CIA_PCI_WnMASK_4G 0xfff00000
172
173 /*
174 * Values for CIA_PCI_TnBASE
175 */
176 #define CIA_PCI_TnBASE_MASK 0xfffffff0
177 #define CIA_PCI_TnBASE_SHIFT 2
178
179 /*
180 * General CSRs
181 */
182
183 #define CIA_CSR_CIA_REV (CIA_CSRS + 0x080)
184
185 #define CIA_REV_REV_MASK 0x000000ff
186 #define CIA_REV_REV_SHIFT 0
187
188 #define CIA_REV_ALT_MEM 0x00000100 /* 21172 only */
189
190 #define CIA_CSR_PCI_LAT (CIA_CSRS + 0x0c0)
191
192 #define CIA_CSR_CIA_CTRL (CIA_CSRS + 0x100)
193
194 #define CIA_CSR_CIA_CNFG (CIA_CSRS + 0x140) /* 21172 only */
195
196 #define CIA_CNFG_IOA_BWEN 0x00000001 /* 21172 only */
197
198 #define CIA_CSR_HAE_MEM (CIA_CSRS + 0x400)
199
200 #define HAE_MEM_REG1_START(x) (((u_int32_t)(x) & 0xe0000000UL) << 0)
201 #define HAE_MEM_REG1_MASK 0x1fffffffUL
202 #define HAE_MEM_REG2_START(x) (((u_int32_t)(x) & 0x0000f800UL) << 16)
203 #define HAE_MEM_REG2_MASK 0x07ffffffUL
204 #define HAE_MEM_REG3_START(x) (((u_int32_t)(x) & 0x000000fcUL) << 24)
205 #define HAE_MEM_REG3_MASK 0x03ffffffUL
206
207 #define CIA_CSR_HAE_IO (CIA_CSRS + 0x440)
208
209 #define HAE_IO_REG1_START(x) 0UL
210 #define HAE_IO_REG1_MASK 0x01ffffffUL
211 #define HAE_IO_REG2_START(x) (((u_int32_t)(x) & 0xfe000000UL) << 0)
212 #define HAE_IO_REG2_MASK 0x01ffffffUL
213
214 #define CIA_CSR_CFG (CIA_CSRS + 0x480)
215
216 #define CIA_CSR_CACK_EN (CIA_CSRS + 0x600)
217
218 #define CIA_CSR_CIA_ERR (CIA_CSRS + 0x8200)
219