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