1*95e1ffb1Schristos /* $NetBSD: bireg.h,v 1.10 2005/12/11 12:21:15 christos Exp $ */ 23b01a597Sragge /* 33b01a597Sragge * Copyright (c) 1988 Regents of the University of California. 43b01a597Sragge * All rights reserved. 53b01a597Sragge * 63b01a597Sragge * This code is derived from software contributed to Berkeley by 73b01a597Sragge * Chris Torek. 83b01a597Sragge * 93b01a597Sragge * Redistribution and use in source and binary forms, with or without 103b01a597Sragge * modification, are permitted provided that the following conditions 113b01a597Sragge * are met: 123b01a597Sragge * 1. Redistributions of source code must retain the above copyright 133b01a597Sragge * notice, this list of conditions and the following disclaimer. 143b01a597Sragge * 2. Redistributions in binary form must reproduce the above copyright 153b01a597Sragge * notice, this list of conditions and the following disclaimer in the 163b01a597Sragge * documentation and/or other materials provided with the distribution. 17aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 183b01a597Sragge * may be used to endorse or promote products derived from this software 193b01a597Sragge * without specific prior written permission. 203b01a597Sragge * 213b01a597Sragge * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 223b01a597Sragge * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 233b01a597Sragge * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 243b01a597Sragge * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 253b01a597Sragge * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 263b01a597Sragge * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 273b01a597Sragge * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 283b01a597Sragge * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 293b01a597Sragge * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 303b01a597Sragge * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 313b01a597Sragge * SUCH DAMAGE. 323b01a597Sragge * 333b01a597Sragge * @(#)bireg.h 7.3 (Berkeley) 6/28/90 343b01a597Sragge */ 353b01a597Sragge 363b01a597Sragge /* 373b01a597Sragge * VAXBI node definitions. 383b01a597Sragge */ 393b01a597Sragge 403b01a597Sragge /* 413b01a597Sragge * BI node addresses 423b01a597Sragge */ 438cc5c2c8Sragge #define BI_NODESIZE 0x2000 /* Size of one BI node */ 448cc5c2c8Sragge #define BI_NODE(node) (BI_NODESIZE * (node)) 453b01a597Sragge #define BI_BASE(bi,nod) ((0x20000000 + (bi) * 0x2000000) + BI_NODE(nod)) 463b01a597Sragge #define MAXNBI 16 /* Spec says there can be 16 anyway */ 473b01a597Sragge #define NNODEBI 16 /* 16 nodes per BI */ 483b01a597Sragge 493b01a597Sragge #define BI_PROBE 0x80000 /* CPU on 8200, NBIA on 8800 */ 503b01a597Sragge /* 513b01a597Sragge * BI nodes all start with BI interface registers (those on the BIIC chip). 523b01a597Sragge * These are followed with interface-specific registers. 533b01a597Sragge * 543b01a597Sragge * NB: This structure does NOT include the four GPRs (not anymore!) 551aa825aeSragge * 561aa825aeSragge * 990712: The structs not used anymore due to conversion to bus.h. 573b01a597Sragge */ 581aa825aeSragge #ifdef notdef 593b01a597Sragge struct biiregs { 603b01a597Sragge u_short bi_dtype; /* device type */ 613b01a597Sragge u_short bi_revs; /* revisions */ 623b01a597Sragge u_long bi_csr; /* control and status register */ 633b01a597Sragge u_long bi_ber; /* bus error register */ 643b01a597Sragge u_long bi_eintrcsr; /* error interrupt control register */ 653b01a597Sragge u_long bi_intrdes; /* interrupt destination register */ 663b01a597Sragge /* the rest are not required for all nodes */ 673b01a597Sragge u_long bi_ipintrmsk; /* IP interrupt mask register */ 683b01a597Sragge u_long bi_fipsdes; /* Force-Bit IPINTR/STOP destination reg */ 693b01a597Sragge u_long bi_ipintrsrc; /* IPINTR source register */ 703b01a597Sragge u_long bi_sadr; /* starting address register */ 713b01a597Sragge u_long bi_eadr; /* ending address register */ 723b01a597Sragge u_long bi_bcicsr; /* BCI control and status register */ 733b01a597Sragge u_long bi_wstat; /* write status register */ 743b01a597Sragge u_long bi_fipscmd; /* Force-Bit IPINTR/STOP command reg */ 753b01a597Sragge u_long bi_xxx1[3]; /* unused */ 763b01a597Sragge u_long bi_uintrcsr; /* user interface interrupt control reg */ 773b01a597Sragge u_long bi_xxx2[43]; /* unused */ 783b01a597Sragge /* although these are on the BIIC, their interpretation varies */ 793b01a597Sragge /* u_long bi_gpr[4]; */ /* general purpose registers */ 803b01a597Sragge }; 813b01a597Sragge 823b01a597Sragge /* 833b01a597Sragge * A generic BI node. 843b01a597Sragge */ 853b01a597Sragge struct bi_node { 863b01a597Sragge struct biiregs biic; /* interface */ 873b01a597Sragge u_long bi_xxx[1988]; /* pad to 8K */ 883b01a597Sragge }; 893b01a597Sragge 903b01a597Sragge /* 91d20841bbSwiz * A CPU node. 923b01a597Sragge */ 933b01a597Sragge struct bi_cpu { 943b01a597Sragge struct biiregs biic; /* interface chip */ 953b01a597Sragge u_long bi_gpr[4]; /* gprs (unused) */ 963b01a597Sragge u_long bi_sosr; /* slave only status register */ 973b01a597Sragge u_long bi_xxx[63]; /* pad */ 983b01a597Sragge u_long bi_rxcd; /* receive console data register */ 993b01a597Sragge }; 1001aa825aeSragge #endif 1011aa825aeSragge 1021aa825aeSragge #define BIREG_DTYPE 0x00 1031aa825aeSragge #define BIREG_VAXBICSR 0x04 1041aa825aeSragge #define BIREG_BER 0x08 1051aa825aeSragge #define BIREG_EINTRCSR 0x0c 1061aa825aeSragge #define BIREG_INTRDES 0x10 1071aa825aeSragge #define BIREG_IPINTRMSK 0x14 1081aa825aeSragge #define BIREG_FIPSDES 0x18 1091aa825aeSragge #define BIREG_IPINTRSRC 0x1c 1101aa825aeSragge #define BIREG_SADR 0x20 1111aa825aeSragge #define BIREG_EADR 0x24 1121aa825aeSragge #define BIREG_BCICSR 0x28 1131aa825aeSragge #define BIREG_WSTAT 0x2c 1141aa825aeSragge #define BIREG_FIPSCMD 0x30 1151aa825aeSragge #define BIREG_UINTRCSR 0x40 1163b01a597Sragge 1173b01a597Sragge /* device types */ 1183b01a597Sragge #define BIDT_MS820 0x0001 /* MS820 memory board */ 1193b01a597Sragge #define BIDT_DRB32 0x0101 /* DRB32 (MFA) Supercomputer gateway */ 1203b01a597Sragge #define BIDT_DWBUA 0x0102 /* DWBUA Unibus adapter */ 1213b01a597Sragge #define BIDT_KLESI 0x0103 /* KLESI-B (DWBLA) adapter */ 1223b01a597Sragge #define BIDT_HSB70 0x4104 /* HSB70 */ 123d20841bbSwiz #define BIDT_KA820 0x0105 /* KA820 CPU */ 1243b01a597Sragge #define BIDT_DB88 0x0106 /* DB88 (NBI) adapter */ 1253b01a597Sragge #define BIDT_DWMBA 0x2107 /* XMI-BI (XBI) adapter */ 1263b01a597Sragge #define BIDT_DWMBB 0x0107 /* XMI-BI (XBI) adapter */ 1273b01a597Sragge #define BIDT_CIBCA 0x0108 /* Computer Interconnect adapter */ 1283b01a597Sragge #define BIDT_DMB32 0x0109 /* DMB32 (COMB) adapter */ 1293b01a597Sragge #define BIDT_BAA 0x010a /* BAA */ 1303b01a597Sragge #define BIDT_CIBCI 0x010b /* Computer Interconnect adapter (old) */ 1313b01a597Sragge #define BIDT_DEBNT 0x410b /* (AIE_TK70) Ethernet+TK50/TBK70 */ 1323b01a597Sragge #define BIDT_KA800 0x010c /* KA800 (ACP) slave processor */ 1333b01a597Sragge #define BIDT_KFBTA 0x410d /* RD/RX disk controller */ 1343b01a597Sragge #define BIDT_KDB50 0x010e /* KDB50 (BDA) disk controller */ 1353b01a597Sragge #define BIDT_DEBNK 0x410e /* (AIE_TK) BI Ethernet (Lance) + TK50 */ 1363b01a597Sragge #define BIDT_DEBNA 0x410f /* (AIE) BI Ethernet (Lance) adapter */ 1373b01a597Sragge #define BIDT_DEBNI 0x0118 /* (XNA) BI Ethernet adapter */ 1383b01a597Sragge 1393b01a597Sragge 1403b01a597Sragge /* bits in bi_csr */ 1413b01a597Sragge #define BICSR_IREV(x) ((u_char)((x) >> 24)) /* VAXBI interface rev */ 1423b01a597Sragge #define BICSR_TYPE(x) ((u_char)((x) >> 16)) /* BIIC type */ 1433b01a597Sragge #define BICSR_HES 0x8000 /* hard error summary */ 1443b01a597Sragge #define BICSR_SES 0x4000 /* soft error summary */ 1453b01a597Sragge #define BICSR_INIT 0x2000 /* initialise node */ 1463b01a597Sragge #define BICSR_BROKE 0x1000 /* broke */ 1473b01a597Sragge #define BICSR_STS 0x0800 /* self test status */ 1483b01a597Sragge #define BICSR_NRST 0x0400 /* node reset */ 1493b01a597Sragge #define BICSR_UWP 0x0100 /* unlock write pending */ 1503b01a597Sragge #define BICSR_HEIE 0x0080 /* hard error interrupt enable */ 1513b01a597Sragge #define BICSR_SEIE 0x0040 /* soft error interrupt enable */ 1523b01a597Sragge #define BICSR_ARB_MASK 0x0030 /* mask to get arbitration codes */ 1533b01a597Sragge #define BICSR_ARB_NONE 0x0030 /* no arbitration */ 1543b01a597Sragge #define BICSR_ARB_LOG 0x0020 /* low priority */ 1553b01a597Sragge #define BICSR_ARB_HIGH 0x0010 /* high priority */ 1563b01a597Sragge #define BICSR_ARB_RR 0x0000 /* round robin */ 1573b01a597Sragge #define BICSR_NODEMASK 0x000f /* node ID */ 1583b01a597Sragge 1593b01a597Sragge #define BICSR_BITS \ 1603b01a597Sragge "\20\20HES\17SES\16INIT\15BROKE\14STS\13NRST\11UWP\10HEIE\7SEIE" 1613b01a597Sragge 1623b01a597Sragge /* bits in bi_ber */ 1633b01a597Sragge #define BIBER_MBZ 0x8000fff0 1643b01a597Sragge #define BIBER_NMR 0x40000000 /* no ack to multi-responder command */ 1653b01a597Sragge #define BIBER_MTCE 0x20000000 /* master transmit check error */ 1663b01a597Sragge #define BIBER_CTE 0x10000000 /* control transmit error */ 1673b01a597Sragge #define BIBER_MPE 0x08000000 /* master parity error */ 1683b01a597Sragge #define BIBER_ISE 0x04000000 /* interlock sequence error */ 1693b01a597Sragge #define BIBER_TDF 0x02000000 /* transmitter during fault */ 1703b01a597Sragge #define BIBER_IVE 0x01000000 /* ident vector error */ 1713b01a597Sragge #define BIBER_CPE 0x00800000 /* command parity error */ 1723b01a597Sragge #define BIBER_SPE 0x00400000 /* slave parity error */ 1733b01a597Sragge #define BIBER_RDS 0x00200000 /* read data substitute */ 1743b01a597Sragge #define BIBER_RTO 0x00100000 /* retry timeout */ 1753b01a597Sragge #define BIBER_STO 0x00080000 /* stall timeout */ 1763b01a597Sragge #define BIBER_BTO 0x00040000 /* bus timeout */ 1773b01a597Sragge #define BIBER_NEX 0x00020000 /* nonexistent address */ 1783b01a597Sragge #define BIBER_ICE 0x00010000 /* illegal confirmation error */ 1793b01a597Sragge #define BIBER_UPEN 0x00000008 /* user parity enable */ 1803b01a597Sragge #define BIBER_IPE 0x00000004 /* ID parity error */ 1813b01a597Sragge #define BIBER_CRD 0x00000002 /* corrected read data */ 1823b01a597Sragge #define BIBER_NPE 0x00000001 /* null bus parity error */ 1833b01a597Sragge #define BIBER_HARD 0x4fff0000 1843b01a597Sragge 1853b01a597Sragge #define BIBER_BITS \ 1863b01a597Sragge "\20\37NMR\36MTCE\35CTE\34MPE\33ISE\32TDF\31IVE\30CPE\ 1873b01a597Sragge \27SPE\26RDS\25RTO\24STO\23BTO\22NEX\21ICE\4UPEN\3IPE\2CRD\1NPE" 1883b01a597Sragge 1893b01a597Sragge /* bits in bi_eintrcsr */ 1903b01a597Sragge #define BIEIC_INTRAB 0x01000000 /* interrupt abort */ 1913b01a597Sragge #define BIEIC_INTRC 0x00800000 /* interrupt complete */ 1923b01a597Sragge #define BIEIC_INTRSENT 0x00200000 /* interrupt command sent */ 1933b01a597Sragge #define BIEIC_INTRFORCE 0x00100000 /* interrupt force */ 1943b01a597Sragge #define BIEIC_LEVELMASK 0x000f0000 /* mask for interrupt levels */ 1953b01a597Sragge #define BIEIC_IPL17 0x00080000 /* ipl 0x17 */ 1963b01a597Sragge #define BIEIC_IPL16 0x00040000 /* ipl 0x16 */ 1973b01a597Sragge #define BIEIC_IPL15 0x00020000 /* ipl 0x15 */ 1983b01a597Sragge #define BIEIC_IPL14 0x00010000 /* ipl 0x14 */ 1993b01a597Sragge #define BIEIC_VECMASK 0x00003ffc /* vector mask for error intr */ 2003b01a597Sragge 2013b01a597Sragge /* bits in bi_intrdes */ 2023b01a597Sragge #define BIDEST_MASK 0x0000ffff /* one bit per node to be intr'ed */ 2033b01a597Sragge 2043b01a597Sragge /* bits in bi_ipintrmsk */ 2053b01a597Sragge #define BIIPINTR_MASK 0xffff0000 /* one per node to allow to ipintr */ 2063b01a597Sragge 2073b01a597Sragge /* bits in bi_fipsdes */ 2083b01a597Sragge #define BIFIPSD_MASK 0x0000ffff 2093b01a597Sragge 2103b01a597Sragge /* bits in bi_ipintrsrc */ 2113b01a597Sragge #define BIIPSRC_MASK 0xffff0000 2123b01a597Sragge 2133b01a597Sragge /* sadr and eadr are simple addresses */ 2143b01a597Sragge 2153b01a597Sragge /* bits in bi_bcicsr */ 2163b01a597Sragge #define BCI_BURSTEN 0x00020000 /* burst mode enable */ 2173b01a597Sragge #define BCI_IPSTOP_FRC 0x00010000 /* ipintr/stop force */ 2183b01a597Sragge #define BCI_MCASTEN 0x00008000 /* multicast space enable */ 2193b01a597Sragge #define BCI_BCASTEN 0x00004000 /* broadcast enable */ 2203b01a597Sragge #define BCI_STOPEN 0x00002000 /* stop enable */ 2213b01a597Sragge #define BCI_RSRVDEN 0x00001000 /* reserved enable */ 2223b01a597Sragge #define BCI_IDENTEN 0x00000800 /* ident enable */ 2233b01a597Sragge #define BCI_INVALEN 0x00000400 /* inval enable */ 2243b01a597Sragge #define BCI_WINVEN 0x00000200 /* write invalidate enable */ 2253b01a597Sragge #define BCI_UINTEN 0x00000100 /* user interface csr space enable */ 2263b01a597Sragge #define BCI_BIICEN 0x00000080 /* BIIC csr space enable */ 2273b01a597Sragge #define BCI_INTEN 0x00000040 /* interrupt enable */ 2283b01a597Sragge #define BCI_IPINTEN 0x00000020 /* ipintr enable */ 2293b01a597Sragge #define BCI_PIPEEN 0x00000010 /* pipeline NXT enable */ 2303b01a597Sragge #define BCI_RTOEVEN 0x00000008 /* read timeout EV enable */ 2313b01a597Sragge 2323b01a597Sragge #define BCI_BITS \ 2333b01a597Sragge "\20\22BURSTEN\21IPSTOP_FRC\20MCASTEN\ 2343b01a597Sragge \17BCASTEN\16STOPEN\15RSRVDEN\14IDENTEN\13INVALEN\12WINVEN\11UINTEN\ 2353b01a597Sragge \10BIICEN\7INTEN\6IPINTEN\5PIPEEN\4RTOEVEN" 2363b01a597Sragge 2373b01a597Sragge /* bits in bi_wstat */ 2383b01a597Sragge #define BIW_GPR3 0x80000000 /* gpr 3 was written */ 2393b01a597Sragge #define BIW_GPR2 0x40000000 /* gpr 2 was written */ 2403b01a597Sragge #define BIW_GPR1 0x20000000 /* gpr 1 was written */ 2413b01a597Sragge #define BIW_GPR0 0x10000000 /* gpr 0 was written */ 2423b01a597Sragge 2433b01a597Sragge /* bits in force-bit ipintr/stop command register */ 2443b01a597Sragge #define BIFIPSC_CMDMASK 0x0000f000 /* command */ 2453b01a597Sragge #define BIFIPSC_MIDEN 0x00000800 /* master ID enable */ 2463b01a597Sragge 2473b01a597Sragge /* bits in bi_uintcsr */ 2483b01a597Sragge #define BIUI_INTAB 0xf0000000 /* interrupt abort level */ 2493b01a597Sragge #define BIUI_INTC 0x0f000000 /* interrupt complete bits */ 2503b01a597Sragge #define BIUI_SENT 0x00f00000 /* interrupt sent bits */ 2513b01a597Sragge #define BIUI_FORCE 0x000f0000 /* force interrupt level */ 2523b01a597Sragge #define BIUI_EVECEN 0x00008000 /* external vector enable */ 2533b01a597Sragge #define BIUI_VEC 0x00003ffc /* interrupt vector */ 2543b01a597Sragge 2553b01a597Sragge /* tell if a bi device is a slave (hence has SOSR) */ 2563b01a597Sragge #define BIDT_ISSLAVE(x) (((x) & 0x7f00) == 0) 2573b01a597Sragge 2583b01a597Sragge /* bits in bi_sosr */ 2593b01a597Sragge #define BISOSR_MEMSIZE 0x1ffc0000 /* memory size */ 2603b01a597Sragge #define BISOSR_BROKE 0x00001000 /* broke */ 2613b01a597Sragge 2623b01a597Sragge /* bits in bi_rxcd */ 2633b01a597Sragge #define BIRXCD_BUSY2 0x80000000 /* busy 2 */ 2643b01a597Sragge #define BIRXCD_NODE2 0x0f000000 /* node id 2 */ 2653b01a597Sragge #define BIRXCD_CHAR2 0x00ff0000 /* character 2 */ 2663b01a597Sragge #define BIRXCD_BUSY1 0x00008000 /* busy 1 */ 2673b01a597Sragge #define BIRXCD_NODE1 0x00000f00 /* node id 1 */ 2683b01a597Sragge #define BIRXCD_CHAR1 0x000000ff /* character 1 */ 269