vme_pccreg.h revision 1.5 1 1.5 scw /* $NetBSD: vme_pccreg.h,v 1.5 2000/11/24 09:27:42 scw Exp $ */
2 1.1 chuck
3 1.1 chuck /*-
4 1.1 chuck * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 1.1 chuck * All rights reserved.
6 1.1 chuck *
7 1.1 chuck * This code is derived from software contributed to The NetBSD Foundation
8 1.1 chuck * by Jason R. Thorpe.
9 1.1 chuck *
10 1.1 chuck * Redistribution and use in source and binary forms, with or without
11 1.1 chuck * modification, are permitted provided that the following conditions
12 1.1 chuck * are met:
13 1.1 chuck * 1. Redistributions of source code must retain the above copyright
14 1.1 chuck * notice, this list of conditions and the following disclaimer.
15 1.1 chuck * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 chuck * notice, this list of conditions and the following disclaimer in the
17 1.1 chuck * documentation and/or other materials provided with the distribution.
18 1.1 chuck * 3. All advertising materials mentioning features or use of this software
19 1.1 chuck * must display the following acknowledgement:
20 1.1 chuck * This product includes software developed by the NetBSD
21 1.1 chuck * Foundation, Inc. and its contributors.
22 1.1 chuck * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 chuck * contributors may be used to endorse or promote products derived
24 1.1 chuck * from this software without specific prior written permission.
25 1.1 chuck *
26 1.1 chuck * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 chuck * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 chuck * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.2 jtc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.2 jtc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 chuck * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 chuck * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 chuck * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 chuck * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 chuck * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 chuck * POSSIBILITY OF SUCH DAMAGE.
37 1.1 chuck */
38 1.1 chuck
39 1.3 scw #ifndef _MVME68K_VME_PCCREG_H
40 1.3 scw #define _MVME68K_VME_PCCREG_H
41 1.1 chuck
42 1.1 chuck /*
43 1.1 chuck * Register map of the Type 1 VMEchip found on the MVME-147
44 1.1 chuck * Peripheral Channel Controller.
45 1.1 chuck */
46 1.1 chuck
47 1.3 scw /*
48 1.3 scw * Local control registers...
49 1.3 scw */
50 1.3 scw #define VME1REG_SCON 0x01
51 1.3 scw #define VME1_SCON_SWITCH 0x01 /* SCON jumper is set */
52 1.3 scw #define VME1_SCON_SRESET 0x02 /* assert SRESET on bus */
53 1.3 scw #define VME1_SCON_SYSFAIL 0x04 /* assert SYSFAIL on bus */
54 1.3 scw #define VME1_SCON_ROBIN 0x08 /* round robin bus requests */
55 1.3 scw
56 1.3 scw #define VME1REG_REQCONF 0x03
57 1.3 scw #define VME1_REQ_IPLMASK 0x03 /* interrupt level for requester */
58 1.3 scw #define VME1_REQ_RNEVER 0x08
59 1.3 scw #define VME1_REQ_RWD 0x10
60 1.3 scw #define VME1_REQ_DHB 0x40
61 1.3 scw #define VME1_REQ_DWB 0x80
62 1.3 scw
63 1.3 scw #define VME1REG_MASCONF 0x05
64 1.3 scw #define VME1_MAS_D16 0x01 /* force d8/16 accesses only */
65 1.3 scw #define VME1_MAS_MASA24 0x02 /* send address mod for A24 access */
66 1.3 scw #define VME1_MAS_MASA16 0x04 /* send address mod for A16 access */
67 1.3 scw #define VME1_MAS_MASUAT 0x08 /* handle unaligned VME cycles */
68 1.3 scw #define VME1_MAS_CFILL 0x10 /* DO NOT USE */
69 1.3 scw #define VME1_MAS_MASWP 0x20 /* VME fast mode (DO NOT USE) */
70 1.3 scw
71 1.3 scw #define VME1REG_SLCONF 0x07
72 1.3 scw #define VME1_SLAVE_SLVD16 0x01 /* DO NOT USE */
73 1.3 scw #define VME1_SLAVE_SLVWP 0x20 /* DO NOT USE */
74 1.3 scw #define VME1_SLAVE_SLVEN 0x80 /* allow access to onboard DRAM */
75 1.3 scw
76 1.3 scw #define VME1REG_TIMERCONF 0x09
77 1.3 scw #define VME1_TIMER_LOCAL_MASK 0x03
78 1.3 scw #define VME1_TIMER_LOCAL_T0 0x00 /* local timeout 102 microsec */
79 1.3 scw #define VME1_TIMER_LOCAL_T1 0x01 /* local timeout 205 microsec */
80 1.3 scw #define VME1_TIMER_LOCAL_T2 0x02 /* local timeout 410 microsec */
81 1.3 scw #define VME1_TIMER_LOCAL_T3 0x03 /* local timeout disabled */
82 1.3 scw #define VME1_TIMER_VMEACC_MASK 0x0c
83 1.3 scw #define VME1_TIMER_VMEACC_T0 0x00 /* VME access timeout 102 microsec */
84 1.3 scw #define VME1_TIMER_VMEACC_T1 0x04 /* VME access timeout 1.6 millisec */
85 1.3 scw #define VME1_TIMER_VMEACC_T2 0x08 /* VME access timeout 51 millisec */
86 1.3 scw #define VME1_TIMER_VMEACC_T3 0x0c /* VME access timeout disabled */
87 1.3 scw #define VME1_TIMER_VMEGLO_MASK 0x30
88 1.3 scw #define VME1_TIMER_VMEGLO_T0 0x00 /* VME glob timeout 102 microsec */
89 1.3 scw #define VME1_TIMER_VMEGLO_T1 0x10 /* VME glob timeout 205 microsec */
90 1.3 scw #define VME1_TIMER_VMEGLO_T2 0x20 /* VME glob timeout 410 microsec */
91 1.3 scw #define VME1_TIMER_VMEGLO_T3 0x30 /* VME glob timeout disabled */
92 1.3 scw #define VME1_TIMER_ARBTO 0x40 /* enable VME arbitration timer */
93 1.3 scw
94 1.3 scw #define VME1REG_SLADDRMOD 0x0b
95 1.3 scw #define VME1_SLMOD_DATA 0x01
96 1.3 scw #define VME1_SLMOD_PRGRM 0x02
97 1.3 scw #define VME1_SLMOD_BLOCK 0x04
98 1.3 scw #define VME1_SLMOD_SHORT 0x08
99 1.3 scw #define VME1_SLMOD_STND 0x10
100 1.3 scw #define VME1_SLMOD_EXTED 0x20
101 1.3 scw #define VME1_SLMOD_USER 0x40
102 1.3 scw #define VME1_SLMOD_SUPER 0x80
103 1.3 scw
104 1.3 scw #define VME1REG_MSADDRMOD 0x0d
105 1.3 scw #define VME1_MSMOD_AM_MASK 0x3f
106 1.3 scw #define VME1_MSMOD_AMSEL 0x80
107 1.3 scw
108 1.3 scw #define VME1REG_IRQEN 0x0f
109 1.3 scw #define VME1_IRQ_VME(x) (1 << (x))
110 1.3 scw
111 1.3 scw #define VME1REG_UIREQEN 0x11
112 1.3 scw #define VME1REG_UIRQ 0x13
113 1.3 scw #define VME1REG_IRQ 0x15
114 1.3 scw #define VME1REG_VMEID 0x17
115 1.3 scw #define VME1REG_BUSERR 0x19
116 1.3 scw #define VME1REG_GCSR 0x1b
117 1.1 chuck
118 1.1 chuck
119 1.3 scw /*
120 1.3 scw * Global Status and Control registers.
121 1.3 scw */
122 1.3 scw #define VME1REG_GCSR_GR0 0x21
123 1.3 scw #define VME1REG_GCSR_GR1 0x23
124 1.3 scw #define VME1REG_GCSR_BOARDID 0x25
125 1.3 scw #define VME1REG_GCSR_GPR0 0x27
126 1.3 scw #define VME1REG_GCSR_GPR1 0x29
127 1.3 scw #define VME1REG_GCSR_GPR2 0x2b
128 1.3 scw #define VME1REG_GCSR_GPR3 0x2d
129 1.3 scw #define VME1REG_GCSR_GPR4 0x2f
130 1.1 chuck
131 1.3 scw /*
132 1.3 scw * Length of the VME chip's register mapping
133 1.3 scw */
134 1.3 scw #define VME1REG_SIZE 0x30
135 1.1 chuck
136 1.1 chuck
137 1.3 scw /*
138 1.3 scw * Convenience macros for reading and writing the registers
139 1.3 scw */
140 1.3 scw #define vme1_reg_read(sc,r) \
141 1.5 scw bus_space_read_1((sc)->sc_mvmebus.sc_bust, (sc)->sc_bush, (r))
142 1.3 scw #define vme1_reg_write(sc,r,v) \
143 1.5 scw bus_space_write_1((sc)->sc_mvmebus.sc_bust, (sc)->sc_bush, (r), (v))
144 1.1 chuck
145 1.1 chuck /*
146 1.1 chuck * The Type 1 VMEchip decoder maps VME address space to system addresses
147 1.1 chuck * like this:
148 1.1 chuck *
149 1.4 scw * A24D32: 0x00000000 - 0x00ffffff
150 1.3 scw * A32D32: 0x01000000 - 0xefffffff
151 1.3 scw * A24D16: 0xf0000000 - 0xf0ffffff
152 1.3 scw * A32D16: 0xf1000000 - 0xff7fffff
153 1.1 chuck * A16D16: 0xffff0000 - 0xffffffff
154 1.1 chuck *
155 1.3 scw * Note that the first A24D32 range is overlayed with onboard RAM. Thus
156 1.3 scw * an 8Mb board will only allow A24D32:0x00800000 - 0x00ffffff. When
157 1.3 scw * onboard RAM is >= 16Mb, the A24D32 range is unavailable and the RAM
158 1.3 scw * starts encroaching on the A32D32 range.
159 1.1 chuck */
160 1.3 scw #define VME1_A24D32_LOC_START (0x00000000u)
161 1.3 scw #define VME1_A24D32_START (0x00000000u)
162 1.3 scw #define VME1_A24D32_END (0x00ffffffu)
163 1.3 scw
164 1.3 scw #define VME1_A32D32_LOC_START (0x00000000u)
165 1.3 scw #define VME1_A32D32_START (0x01000000u)
166 1.3 scw #define VME1_A32D32_END (0xefffffffu)
167 1.3 scw
168 1.3 scw #define VME1_A24D16_LOC_START (0xf0000000u)
169 1.3 scw #define VME1_A24D16_START (0x00000000u)
170 1.3 scw #define VME1_A24D16_END (0x00ffffffu)
171 1.3 scw
172 1.3 scw #define VME1_A32D16_LOC_START (0x00000000u)
173 1.3 scw #define VME1_A32D16_START (0xf1000000u)
174 1.3 scw #define VME1_A32D16_END (0xff7fffffu)
175 1.3 scw
176 1.3 scw #define VME1_A16D16_LOC_START (0xffff0000u)
177 1.3 scw #define VME1_A16D16_START (0x00000000u)
178 1.3 scw #define VME1_A16D16_END (0x0000ffffu)
179 1.3 scw
180 1.3 scw #define VME1_A32_MASK (0xffffffffu)
181 1.3 scw #define VME1_A24_MASK (0x00ffffffu)
182 1.3 scw #define VME1_A16_MASK (0x0000ffffu)
183 1.3 scw
184 1.3 scw #endif /* _MVME68K_VME_PCCREG_H */
185