Home | History | Annotate | Line # | Download | only in tlsb
tlsbreg.h revision 1.1
      1 /*	$NetBSD: tlsbreg.h,v 1.1 1997/03/12 19:20:19 cgd Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1997
      5  * Matthew Jacob
      6  * NASA AMES Research Center.
      7  * All rights reserved.
      8  *
      9  * Based in part upon a prototype version by Jason Thorpe
     10  * Copyright (c) 1996 by Jason Thorpe.
     11  *
     12  * Redistribution and use in source and binary forms, with or without
     13  * modification, are permitted provided that the following conditions
     14  * are met:
     15  * 1. Redistributions of source code must retain the above copyright
     16  *    notice immediately at the beginning of the file, without modification,
     17  *    this list of conditions, and the following disclaimer.
     18  * 2. Redistributions in binary form must reproduce the above copyright
     19  *    notice, this list of conditions and the following disclaimer in the
     20  *    documentation and/or other materials provided with the distribution.
     21  * 3. The name of the author may not be used to endorse or promote products
     22  *    derived from this software without specific prior written permission.
     23  *
     24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
     28  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34  * SUCH DAMAGE.
     35  */
     36 
     37 /*
     38  * Definitions for the TurboLaser System Bus found on
     39  * AlphaServer 8200/8400 systems.
     40  */
     41 
     42 /*
     43  * There are 9 TurboLaser nodes, 0 though 8.  Their uses are defined as
     44  * follows:
     45  *
     46  *	Node	Module
     47  *	----    ------
     48  *	0	CPU, Memory
     49  *	1	CPU, Memory
     50  *	2	CPU, Memory
     51  *	3	CPU, Memory
     52  *	4	CPU, Memory, I/O
     53  *	5	CPU, Memory, I/O
     54  *	6	CPU, Memory, I/O
     55  *	7	CPU, Memory, I/O
     56  *	8	I/O
     57  *
     58  * A node occurs every 0x00400000 bytes.
     59  *
     60  * Note, the AlphaServer 8200 only has nodes 4 though 8.
     61  */
     62 
     63 #define TLSB_NODE_BASE		0x000000ff88000000	/* Dense */
     64 #define TLSB_NODE_SIZE		0x00400000
     65 #define TLSB_NODE_MAX		8
     66 
     67 /* Translate a node number to an address. */
     68 #define TLSB_NODE_ADDR(_node)					\
     69 	(long)(TLSB_NODE_BASE + ((_node) * TLSB_NODE_SIZE))
     70 
     71 #define TLSB_NODE_REG_ADDR(_node, _reg)				\
     72 	KV((long)TLSB_NODE_ADDR((_node)) + (_reg))
     73 
     74 /* Access the specified register on the specified node. */
     75 #define TLSB_GET_NODEREG(_node, _reg)				\
     76 	*(volatile u_int32_t *)(TLSB_NODE_REG_ADDR((_node), (_reg)))
     77 #define TLSB_PUT_NODEREG(_node, _reg, _val)			\
     78 	*(volatile u_int32_t *)(TLSB_NODE_REG_ADDR((_node), (_reg))) = (_val)
     79 
     80 /*
     81  * Some registers are shared by all TurboLaser nodes, and appear in
     82  * the TurboLaser Broadcast space.
     83  */
     84 #define TLSB_BCAST_BASE		0x000000ff8e000000	/* Dense */
     85 
     86 #define TLSB_BCAST_REG_ADDR(_reg)	KV((long)(TLSB_BCASE_BASE + (_reg)))
     87 
     88 /* Access the specified register in the broadcast space. */
     89 #define TLSB_GET_BCASTREG(_reg)					\
     90 	*(volatile u_int32_t *)(TLSB_BCAST_REG_ADDR + (_reg))
     91 #define TLSB_PUT_BCASTREG(_reg, _val)				\
     92 	*(volatile u_int32_t *)(TLSB_BCAST_REG_ADDR + (_reg)) = (_val)
     93 
     94 /*
     95  * Location of the Gbus, the per-CPU bus containing the clock and
     96  * console hardware.
     97  */
     98 #define TLSB_GBUS_BASE		0x000000ff90000000	/* Dense */
     99 
    100 /*
    101  * Note that not every module type supports each TurboLaser register.
    102  * The following defines the keys used to denote module support for
    103  * a given register:
    104  *
    105  *	C	Supported by CPU module
    106  *	M	Supported by Memory module
    107  *	I	Supported by I/O module
    108  */
    109 
    110 /*
    111  * Per-node TurboLaser System Bus registers, offsets from the
    112  * base of the node.
    113  */
    114 #define TLDEV		0x0000		/* CMI: Device Register */
    115 #define TLBER		0x0040		/* CMI: Bus Error Register */
    116 #define TLCNR		0x0080		/* CMI: Congfiguration Register */
    117 #define TLVID		0x00c0		/* CM: Virtual ID Register */
    118 #define TLMMR0		0x0200		/* CM: Memory Mapping Register 0 */
    119 #define TLMMR1		0x0240		/* CM: Memory Mapping Register 1 */
    120 #define TLMMR2		0x0280		/* CM: Memory Mapping Register 2 */
    121 #define TLMMR3		0x02c0		/* CM: Memory Mapping Register 3 */
    122 #define TLMMR4		0x0300		/* CM: Memory Mapping Register 4 */
    123 #define TLMMR5		0x0340		/* CM: Memory Mapping Register 5 */
    124 #define TLMMR6		0x0380		/* CM: Memory Mapping Register 6 */
    125 #define TLMMR7		0x03c0		/* CM: Memory Mapping Register 7 */
    126 #define TLFADR0		0x0600		/* MI: Failing Address Register 0 */
    127 #define TLFADR1		0x0640		/* MI: Failing Address Register 1 */
    128 #define TLESR0		0x0680		/* CMI: Error Syndrome Register 0 */
    129 #define TLESR1		0x06c0		/* CMI: Error Syndrome Register 1 */
    130 #define TLESR2		0x0700		/* CMI: Error Syndrome Register 2 */
    131 #define TLESR3		0x0740		/* CMI: Error Syndrome Register 3 */
    132 #define TLILID0		0x0a00		/* I: Int. Level 0 IDENT Register */
    133 #define TLILID1		0x0a40		/* I: Int. Level 1 IDENT Register */
    134 #define TLILID2		0x0a80		/* I: Int. Level 2 IDENT Register */
    135 #define TLILID3		0x0ac0		/* I: Int. Level 3 IDENT Register */
    136 #define TLCPUMASK	0x0b00		/* I: CPU Interrupt Mask Register */
    137 #define TLMBPTR		0x0c00		/* I: Mailbox Pointer Register */
    138 #define	TLEPAERR	0x1500		/* C: ADG error register */
    139 
    140 /*
    141  * Registers shared between TurboLaser nodes, offsets from the
    142  * TurboLaser Broadcast Base.
    143  */
    144 #define TLPRIVATE	0x0000		/* CMI: private "global" space */
    145 #define TLIPINTR	0x0040		/* C: Interprocessor Int. Register */
    146 #define TLIOINTR4	0x0100		/* C: I/O Interrupt Register 4 */
    147 #define TLIOINTR5	0x0140		/* C: I/O Interrupt Register 5 */
    148 #define TLIOINTR6	0x0180		/* C: I/O Interrupt Register 6 */
    149 #define TLIOINTR7	0x01c0		/* C: I/O Interrupt Register 7 */
    150 #define TLIOINTR8	0x0200		/* C: I/O Interrupt Register 8 */
    151 #define TLWSDQR4	0x0400		/* C: Win Spc Dcr Que Ctr Reg 4 */
    152 #define TLWSDQR5	0x0440		/* C: Win Spc Dcr Que Ctr Reg 5 */
    153 #define TLWSDQR6	0x0480		/* C: Win Spc Dcr Que Ctr Reg 6 */
    154 #define TLWSDQR7	0x04c0		/* C: Win Spc Dcr Que Ctr Reg 7 */
    155 #define TLWSDQR8	0x0500		/* C: Win Spc Dcr Que Ctr Reg 8 */
    156 #define TLRMDQRX	0x0600		/* C: Mem Chan Dcr Que Ctr Reg X */
    157 #define TLRMDQR8	0x0640		/* C: Mem Chan Dcr Que Ctr Reg 8 */
    158 #define TLRDRD		0x0800		/* C: CSR Read Data Rtn Data Reg */
    159 #define TLRDRE		0x0840		/* C: CSR Read Data Rtn Error Reg */
    160 #define TLMCR		0x1880		/* M: Memory Control Register */
    161 
    162 /*
    163  * TLDEV - Device Register
    164  *
    165  * Access: R/W
    166  *
    167  * Notes:
    168  *	Register is loaded during initialization with information
    169  *	that identifies a node.  A zero value indicates a non-initialized
    170  *	(slot empty) node.
    171  *
    172  *	Bits 0-15 contain the hardware device type, bits 16-23
    173  *	the board's software revision, and bits 24-31 the board's
    174  *	hardware revision.
    175  *
    176  *	The device type portion is laid out as follows:
    177  *
    178  *		Bit 15: identifies a CPU
    179  *		Bit 14: identifies a memory board
    180  *		Bit 13: identifies an I/O board
    181  *		Bits 0-7: specify the ID of a node type
    182  */
    183 #define TLDEV_DTYPE_MASK	0x0000ffff
    184 #define TLDEV_DTYPE_KFTHA	0x2000		/* KFTHA board, I/O */
    185 #define TLDEV_DTYPE_KFTIA	0x2020		/* KFTIA board, I/O */
    186 #define TLDEV_DTYPE_MS7CC	0x5000		/* Memory board */
    187 #define TLDEV_DTYPE_SCPU4	0x8011		/* 1 CPU, 4mb cache */
    188 #define TLDEV_DTYPE_SCPU16	0x8012		/* 1 CPU, 16mb cache */
    189 #define TLDEV_DTYPE_DCPU4	0x8014		/* 2 CPU, 4mb cache */
    190 #define TLDEV_DTYPE_DCPU16	0x8015		/* 2 CPU, 16mb cache */
    191 
    192 #define TLDEV_DTYPE(_val)	((_val) & TLDEV_DTYPE_MASK)
    193 #	define	TLDEV_ISCPU(_val)	(TLDEV_DTYPE(_val) & 0x8000)
    194 #	define	TLDEV_ISMEM(_val)	(TLDEV_DTYPE(_val) & 0x4000)
    195 #	define	TLDEV_ISIOPORT(_val)	(TLDEV_DTYPE(_val) & 0x2000)
    196 #define TLDEV_SWREV(_val)	(((_val) >> 16) & 0xff)
    197 #define TLDEV_HWREV(_val)	(((_val) >> 24) & 0xff)
    198 
    199 /*
    200  * TLBER - Bus Error Register
    201  *
    202  * Access: R/W
    203  *
    204  * Notes:
    205  *	This register contains information about TLSB errors detected by
    206  *	nodes on the TLSB.  The register will become locked when:
    207  *
    208  *		* Any error occurs and the "lock on first error"
    209  *		  bit of the Configuration Register is set.
    210  *
    211  *		* Any bit other than 20-23 (DS0-DS3) becomes set.
    212  *
    213  *	and will remain locked until either:
    214  *
    215  *		* All bits in the TLBER are cleared.
    216  *
    217  *		* The "lock on first error" bit is cleared.
    218  *
    219  *	TLBER locking is intended for diagnosic purposes only, and
    220  *	not for general use.
    221  */
    222 #define TLBER_ATCE	0x00000001	/* Addr Transmit Ck Error */
    223 #define TLBER_APE	0x00000002	/* Addr Parity Error */
    224 #define TLBER_BAE	0x00000004	/* Bank Avail Violation Error */
    225 #define TLBER_LKTO	0x00000008	/* Bank Lock Timeout */
    226 #define TLBER_NAE	0x00000010	/* No Ack Error */
    227 #define TLBER_RTCE	0x00000020	/* Read Transmit Ck Error */
    228 #define TLBER_ACKTCE	0x00000040	/* Ack Transmit Ck Error */
    229 #define TLBER_MMRE	0x00000080	/* Mem Mapping Register Error */
    230 #define TLBER_FNAE	0x00000100	/* Fatal No Ack Error */
    231 #define TLBER_REQDE	0x00000200	/* Request Deassertion Error */
    232 #define TLBER_ATDE	0x00000400	/* Addredd Transmitter During Error */
    233 #define TLBER_UDE	0x00010000	/* Uncorrectable Data Error */
    234 #define TLBER_CWDE	0x00020000	/* Correctable Write Data Error */
    235 #define TLBER_CRDE	0x00040000	/* Correctable Read Data Error */
    236 #define TLBER_CRDE2	0x00080000	/* ...ditto... */
    237 #define TLBER_DS0	0x00100000	/* Data Synd 0 */
    238 #define TLBER_DS1	0x00200000	/* Data Synd 1 */
    239 #define TLBER_DS2	0x00400000	/* Data Synd 2 */
    240 #define TLBER_DS3	0x00800000	/* Data Synd 3 */
    241 #define TLBER_DTDE	0x01000000	/* Data Transmitter During Error */
    242 #define TLBER_FDTCE	0x02000000	/* Fatal Data Transmit Ck Error */
    243 #define TLBER_UACKE	0x04000000	/* Unexpected Ack Error */
    244 #define TLBER_ABTCE	0x08000000	/* Addr Bus Transmit Error */
    245 #define TLBER_DCTCE	0x10000000	/* Data Control Transmit Ck Error */
    246 #define TLBER_SEQE	0x20000000	/* Sequence Error */
    247 #define TLBER_DSE	0x40000000	/* Data Status Error */
    248 #define TLBER_DTO	0x80000000	/* Data Timeout Error */
    249 
    250 /*
    251  * TLCNR - Configuration Register
    252  *
    253  * Access: R/W
    254  */
    255 #define TLCNR_CWDD	0x00000001	/* Corr Write Data Err INTR Dis */
    256 #define TLCNR_CRDD	0x00000002	/* Corr Read Data Err INTR Dis */
    257 #define TLCNR_LKTOD	0x00000004	/* Bank Lock Timeout Disable */
    258 #define TLCNR_DTOD	0x00000008	/* Data Timeout Disable */
    259 #define TLCNR_STF_A	0x00001000	/* Self-Test Fail A */
    260 #define TLCNR_STF_B	0x00002000	/* Self-Test Fail B */
    261 #define TLCNR_HALT_A	0x00100000	/* Halt A */
    262 #define TLCNR_HALT_B	0x00200000	/* Halt B */
    263 #define TLCNR_RSTSTAT	0x10000000	/* Reset Status */
    264 #define TLCNR_NRST	0x40000000	/* Node Reset */
    265 #define TLCNR_LOFE	0x80000000	/* Lock On First Error */
    266 
    267 #define TLCNR_NODE_MASK	0x000000f0	/* Node ID mask */
    268 #define TLCNR_NODE_SHIFT	 4
    269 
    270 #define TLCNR_VCNT_MASK	0x00000f00	/* VCNT mask */
    271 #define TLCNR_VCNT_SHIFT	 8
    272 
    273 /*
    274  * TLVID - Virtual ID Register
    275  *
    276  * Access: R/W
    277  *
    278  * Notes:
    279  *	Virtual units can be CPUs or Memory boards.  The units are
    280  *	are addressed using virtual IDs.  These virtual IDs are assigned
    281  *	by writing to the TLVID register.  The upper 24 bits of this
    282  *	register are reserved and must be written as `0'.
    283  */
    284 #define TLVID_VIDA_MASK	0x0000000f	/* Virtual ID for unit 0 */
    285 #define TLVID_VIDA_SHIFT	 0
    286 
    287 #define TLVID_VIDB_MASK	0x000000f0	/* Virtual ID for unit 1 */
    288 #define TLVID_VIDB_SHIFT	 4
    289 
    290 /*
    291  * TLMMRn - Memory Mapping Registers
    292  *
    293  * Access: W
    294  *
    295  * Notes:
    296  *	Contains mapping information for doing a bank-decode.
    297  */
    298 #define TLMMR_INTMASK	0x00000003	/* Valid bits in Interleave */
    299 #define TLMMR_ADRMASK	0x000000f0	/* Valid bits in Address */
    300 #define TLMMR_SBANK	0x00000800	/* Single-bank indicator */
    301 #define TLMMR_VALID	0x80000000	/* Indicated mapping is valid */
    302 
    303 #define TLMMR_INTLV_MASK 0x00000700	/* Mask for interleave value */
    304 #define TLMMR_INTLV_SHIFT	  8
    305 
    306 #define TLMMR_ADDRESS_MASK 0x03fff000	/* Mask for address value */
    307 #define TLMMR_ADDRESS_SHIFT	   12
    308 
    309 /*
    310  * TLFADRn - Failing Address Registers
    311  *
    312  * Access: R/W
    313  *
    314  * Notes:
    315  *	These registers contain status information for a failed address.
    316  *	Not all nodes preserve this information.  The validation bits
    317  *	indicate the validity of a given field.
    318  */
    319 
    320