iomdreg.h revision 1.2.2.2 1 1.2.2.2 thorpej /* $NetBSD: iomdreg.h,v 1.2.2.2 2002/01/10 19:38:07 thorpej Exp $ */
2 1.2.2.2 thorpej
3 1.2.2.2 thorpej /*
4 1.2.2.2 thorpej * Copyright (c) 1994-1997 Mark Brinicombe.
5 1.2.2.2 thorpej * Copyright (c) 1994 Brini.
6 1.2.2.2 thorpej * All rights reserved.
7 1.2.2.2 thorpej *
8 1.2.2.2 thorpej * This code is derived from software written for Brini by Mark Brinicombe
9 1.2.2.2 thorpej *
10 1.2.2.2 thorpej * Redistribution and use in source and binary forms, with or without
11 1.2.2.2 thorpej * modification, are permitted provided that the following conditions
12 1.2.2.2 thorpej * are met:
13 1.2.2.2 thorpej * 1. Redistributions of source code must retain the above copyright
14 1.2.2.2 thorpej * notice, this list of conditions and the following disclaimer.
15 1.2.2.2 thorpej * 2. Redistributions in binary form must reproduce the above copyright
16 1.2.2.2 thorpej * notice, this list of conditions and the following disclaimer in the
17 1.2.2.2 thorpej * documentation and/or other materials provided with the distribution.
18 1.2.2.2 thorpej * 3. All advertising materials mentioning features or use of this software
19 1.2.2.2 thorpej * must display the following acknowledgement:
20 1.2.2.2 thorpej * This product includes software developed by Mark Brinicombe.
21 1.2.2.2 thorpej * 4. The name of the company nor the name of the author may be used to
22 1.2.2.2 thorpej * endorse or promote products derived from this software without specific
23 1.2.2.2 thorpej * prior written permission.
24 1.2.2.2 thorpej *
25 1.2.2.2 thorpej * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 1.2.2.2 thorpej * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27 1.2.2.2 thorpej * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 1.2.2.2 thorpej * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29 1.2.2.2 thorpej * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 1.2.2.2 thorpej * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 1.2.2.2 thorpej * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 1.2.2.2 thorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 1.2.2.2 thorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 1.2.2.2 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 1.2.2.2 thorpej * SUCH DAMAGE.
36 1.2.2.2 thorpej *
37 1.2.2.2 thorpej * RiscBSD kernel project
38 1.2.2.2 thorpej *
39 1.2.2.2 thorpej * iomd.h
40 1.2.2.2 thorpej *
41 1.2.2.2 thorpej * IOMD registers
42 1.2.2.2 thorpej *
43 1.2.2.2 thorpej * Created : 18/09/94
44 1.2.2.2 thorpej *
45 1.2.2.2 thorpej * Based on kate/display/iomd.h
46 1.2.2.2 thorpej */
47 1.2.2.2 thorpej
48 1.2.2.2 thorpej #define IOMD_HW_BASE 0x03200000
49 1.2.2.2 thorpej
50 1.2.2.2 thorpej #define IOMD_BASE 0xf6000000
51 1.2.2.2 thorpej
52 1.2.2.2 thorpej #define IOMD_IOCR 0x00000000
53 1.2.2.2 thorpej #define IOMD_KBDDAT 0x00000001
54 1.2.2.2 thorpej #define IOMD_KBDCR 0x00000002
55 1.2.2.2 thorpej #define IOMD_IOLINES 0x00000003 /* ARM7500FE */
56 1.2.2.2 thorpej
57 1.2.2.2 thorpej #define IOMD_IRQSTA 0x00000004
58 1.2.2.2 thorpej #define IOMD_IRQRQA 0x00000005
59 1.2.2.2 thorpej #define IOMD_IRQMSKA 0x00000006
60 1.2.2.2 thorpej #define IOMD_SUSMODE 0x00000007 /* ARM7500 */
61 1.2.2.2 thorpej
62 1.2.2.2 thorpej #define IOMD_IRQSTB 0x00000008
63 1.2.2.2 thorpej #define IOMD_IRQRQB 0x00000009
64 1.2.2.2 thorpej #define IOMD_IRQMSKB 0x0000000a
65 1.2.2.2 thorpej #define IOMD_STOPMODE 0x0000000b /* ARM7500 */
66 1.2.2.2 thorpej
67 1.2.2.2 thorpej #define IOMD_FIQST 0x0000000c
68 1.2.2.2 thorpej #define IOMD_FIQRQ 0x0000000d
69 1.2.2.2 thorpej #define IOMD_FIQMSK 0x0000000e
70 1.2.2.2 thorpej #define IOMD_CLKCTL 0x0000000f /* ARM7500 */
71 1.2.2.2 thorpej
72 1.2.2.2 thorpej #define IOMD_T0LOW 0x00000010
73 1.2.2.2 thorpej #define IOMD_T0HIGH 0x00000011
74 1.2.2.2 thorpej #define IOMD_T0GO 0x00000012
75 1.2.2.2 thorpej #define IOMD_T0LATCH 0x00000013
76 1.2.2.2 thorpej
77 1.2.2.2 thorpej #define IOMD_T1LOW 0x00000014
78 1.2.2.2 thorpej #define IOMD_T1HIGH 0x00000015
79 1.2.2.2 thorpej #define IOMD_T1GO 0x00000016
80 1.2.2.2 thorpej #define IOMD_T1LATCH 0x00000017
81 1.2.2.2 thorpej
82 1.2.2.2 thorpej /*
83 1.2.2.2 thorpej * For ARM7500, it's not really a IOMD device.
84 1.2.2.2 thorpej */
85 1.2.2.2 thorpej
86 1.2.2.2 thorpej #define IOMD_IRQSTC 0x00000018 /* ARM7500 */
87 1.2.2.2 thorpej #define IOMD_IRQRQC 0x00000019 /* ARM7500 */
88 1.2.2.2 thorpej #define IOMD_IRQMSKC 0x0000001a /* ARM7500 */
89 1.2.2.2 thorpej #define IOMD_VIDMUX 0x0000001b /* ARM7500 */
90 1.2.2.2 thorpej
91 1.2.2.2 thorpej #define IOMD_IRQSTD 0x0000001c /* ARM7500 */
92 1.2.2.2 thorpej #define IOMD_IRQRQD 0x0000001d /* ARM7500 */
93 1.2.2.2 thorpej #define IOMD_IRQMSKD 0x0000001e /* ARM7500 */
94 1.2.2.2 thorpej
95 1.2.2.2 thorpej #define IOMD_ROMCR0 0x00000020
96 1.2.2.2 thorpej #define IOMD_ROMCR1 0x00000021
97 1.2.2.2 thorpej #define IOMD_DRAMCR 0x00000022 /* !ARM7500 */
98 1.2.2.2 thorpej #define IOMD_VREFCR 0x00000023 /* !ARM7500 */
99 1.2.2.2 thorpej #define IOMD_REFCR 0x00000023 /* ARM7500 */
100 1.2.2.2 thorpej
101 1.2.2.2 thorpej #define IOMD_FSIZE 0x00000024
102 1.2.2.2 thorpej #define IOMD_ID0 0x00000025
103 1.2.2.2 thorpej #define IOMD_ID1 0x00000026
104 1.2.2.2 thorpej #define IOMD_VERSION 0x00000027
105 1.2.2.2 thorpej
106 1.2.2.2 thorpej #define IOMD_MOUSEX 0x00000028
107 1.2.2.2 thorpej #define IOMD_MOUSEY 0x00000029
108 1.2.2.2 thorpej #define IOMD_MSDATA 0x0000002a /* ARM7500 */
109 1.2.2.2 thorpej #define IOMD_MSCR 0x0000002b /* ARM7500 */
110 1.2.2.2 thorpej
111 1.2.2.2 thorpej #define IOMD_DMATCR 0x00000030
112 1.2.2.2 thorpej #define IOMD_IOTCR 0x00000031
113 1.2.2.2 thorpej #define IOMD_ECTCR 0x00000032
114 1.2.2.2 thorpej #define IOMD_DMAEXT 0x00000033 /* !ARM7500 */
115 1.2.2.2 thorpej #define IOMD_ASTCR 0x00000033 /* ARM7500 */
116 1.2.2.2 thorpej
117 1.2.2.2 thorpej #define IOMD_DRAMWID 0x00000034 /* ARM7500 */
118 1.2.2.2 thorpej #define IOMD_SELFREF 0x00000035 /* ARM7500 */
119 1.2.2.2 thorpej
120 1.2.2.2 thorpej #define IOMD_ATODICR 0x00000038 /* ARM7500 */
121 1.2.2.2 thorpej #define IOMD_ATODSR 0x00000039 /* ARM7500 */
122 1.2.2.2 thorpej #define IOMD_ATODCR 0x0000003a /* ARM7500 */
123 1.2.2.2 thorpej #define IOMD_ATODCNT1 0x0000003b /* ARM7500 */
124 1.2.2.2 thorpej #define IOMD_ATODCNT2 0x0000003c /* ARM7500 */
125 1.2.2.2 thorpej #define IOMD_ATODCNT3 0x0000003d /* ARM7500 */
126 1.2.2.2 thorpej #define IOMD_ATODCNT4 0x0000003e /* ARM7500 */
127 1.2.2.2 thorpej
128 1.2.2.2 thorpej #define IOMD_DMA_SIZE 24
129 1.2.2.2 thorpej #define IOMD_DMA_SPACING 32
130 1.2.2.2 thorpej #define IOMD_IO0CURA 0x00000040
131 1.2.2.2 thorpej #define IOMD_IO0ENDA 0x00000041
132 1.2.2.2 thorpej #define IOMD_IO0CURB 0x00000042
133 1.2.2.2 thorpej #define IOMD_IO0ENDB 0x00000043
134 1.2.2.2 thorpej #define IOMD_IO0CR 0x00000044
135 1.2.2.2 thorpej #define IOMD_IO0ST 0x00000045
136 1.2.2.2 thorpej #define IOMD_IO1CURA 0x00000048
137 1.2.2.2 thorpej #define IOMD_IO1ENDA 0x00000049
138 1.2.2.2 thorpej #define IOMD_IO1CURB 0x0000004a
139 1.2.2.2 thorpej #define IOMD_IO1ENDB 0x0000004b
140 1.2.2.2 thorpej #define IOMD_IO1CR 0x0000004c
141 1.2.2.2 thorpej #define IOMD_IO1ST 0x0000004d
142 1.2.2.2 thorpej #define IOMD_IO2CURA 0x00000050
143 1.2.2.2 thorpej #define IOMD_IO2ENDA 0x00000051
144 1.2.2.2 thorpej #define IOMD_IO2CURB 0x00000052
145 1.2.2.2 thorpej #define IOMD_IO2ENDB 0x00000053
146 1.2.2.2 thorpej #define IOMD_IO2CR 0x00000054
147 1.2.2.2 thorpej #define IOMD_IO2ST 0x00000055
148 1.2.2.2 thorpej #define IOMD_IO3CURA 0x00000058
149 1.2.2.2 thorpej #define IOMD_IO3ENDA 0x00000059
150 1.2.2.2 thorpej #define IOMD_IO3CURB 0x0000005a
151 1.2.2.2 thorpej #define IOMD_IO3ENDB 0x0000005b
152 1.2.2.2 thorpej #define IOMD_IO3CR 0x0000005c
153 1.2.2.2 thorpej #define IOMD_IO3ST 0x0000005d
154 1.2.2.2 thorpej
155 1.2.2.2 thorpej #define IOMD_SD0CURA 0x00000060
156 1.2.2.2 thorpej #define IOMD_SD0ENDA 0x00000061
157 1.2.2.2 thorpej #define IOMD_SD0CURB 0x00000062
158 1.2.2.2 thorpej #define IOMD_SD0ENDB 0x00000063
159 1.2.2.2 thorpej #define IOMD_SD0CR 0x00000064
160 1.2.2.2 thorpej #define IOMD_SD0ST 0x00000065
161 1.2.2.2 thorpej
162 1.2.2.2 thorpej #define IOMD_SD1CURA 0x00000068
163 1.2.2.2 thorpej #define IOMD_SD1ENDA 0x00000069
164 1.2.2.2 thorpej #define IOMD_SD1CURB 0x0000006a
165 1.2.2.2 thorpej #define IOMD_SD1ENDB 0x0000006b
166 1.2.2.2 thorpej #define IOMD_SD1CR 0x0000006c
167 1.2.2.2 thorpej #define IOMD_SD1ST 0x0000006d
168 1.2.2.2 thorpej
169 1.2.2.2 thorpej #define IOMD_CURSCUR 0x00000070
170 1.2.2.2 thorpej #define IOMD_CURSINIT 0x00000071
171 1.2.2.2 thorpej #define IOMD_VIDCURB 0x00000072 /* ARM7500 */
172 1.2.2.2 thorpej
173 1.2.2.2 thorpej #define IOMD_VIDCUR 0x00000074
174 1.2.2.2 thorpej #define IOMD_VIDEND 0x00000075
175 1.2.2.2 thorpej #define IOMD_VIDSTART 0x00000076
176 1.2.2.2 thorpej #define IOMD_VIDINIT 0x00000077
177 1.2.2.2 thorpej #define IOMD_VIDCR 0x00000078
178 1.2.2.2 thorpej
179 1.2.2.2 thorpej #define IOMD_VIDINITB 0x0000007a /* ARM7500 */
180 1.2.2.2 thorpej
181 1.2.2.2 thorpej #define IOMD_DMAST 0x0000007c
182 1.2.2.2 thorpej #define IOMD_DMARQ 0x0000007d
183 1.2.2.2 thorpej #define IOMD_DMAMSK 0x0000007e
184 1.2.2.2 thorpej
185 1.2.2.2 thorpej #define IOMD_SIZE 0x100 /* XXX - should be words ? */
186 1.2.2.2 thorpej
187 1.2.2.2 thorpej /*
188 1.2.2.2 thorpej * Ok these mouse buttons are not strickly part of the iomd but
189 1.2.2.2 thorpej * this register is required if the IOMD supports a quadrature mouse
190 1.2.2.2 thorpej */
191 1.2.2.2 thorpej
192 1.2.2.2 thorpej #define IO_HW_MOUSE_BUTTONS 0x03210000
193 1.2.2.2 thorpej #define IO_MOUSE_BUTTONS 0xf6010000
194 1.2.2.2 thorpej
195 1.2.2.2 thorpej #define MOUSE_BUTTON_RIGHT 0x10
196 1.2.2.2 thorpej #define MOUSE_BUTTON_MIDDLE 0x20
197 1.2.2.2 thorpej #define MOUSE_BUTTON_LEFT 0x40
198 1.2.2.2 thorpej
199 1.2.2.2 thorpej #define FREQCON (iomd_base + 0x40000)
200 1.2.2.2 thorpej
201 1.2.2.2 thorpej #define RPC600_IOMD_ID 0xd4e7
202 1.2.2.2 thorpej #define ARM7500_IOC_ID 0x5b98
203 1.2.2.2 thorpej #define ARM7500FE_IOC_ID 0xaa7c
204 1.2.2.2 thorpej
205 1.2.2.2 thorpej #define IOMD_ADDRESS(reg) (iomd_base + (reg << 2))
206 1.2.2.2 thorpej #define IOMD_WRITE_BYTE(reg, val) \
207 1.2.2.2 thorpej (*((volatile unsigned char *)(IOMD_ADDRESS(reg))) = (val))
208 1.2.2.2 thorpej #define IOMD_WRITE_WORD(reg, val) \
209 1.2.2.2 thorpej (*((volatile unsigned int *)(IOMD_ADDRESS(reg))) = (val))
210 1.2.2.2 thorpej #define IOMD_READ_BYTE(reg) \
211 1.2.2.2 thorpej (*((volatile unsigned char *)(IOMD_ADDRESS(reg))))
212 1.2.2.2 thorpej #define IOMD_READ_WORD(reg) \
213 1.2.2.2 thorpej (*((volatile unsigned int *)(IOMD_ADDRESS(reg))))
214 1.2.2.2 thorpej
215 1.2.2.2 thorpej #define IOMD_ID (IOMD_READ_BYTE(IOMD_ID0) | (IOMD_READ_BYTE(IOMD_ID1) << 8))
216 1.2.2.2 thorpej
217 1.2.2.2 thorpej /* End of iomdreg.h */
218