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