/*
* Copyright (c) 1997, 2000 by Matthew Jacob
* NASA AMES Research Center.
* All rights reserved.
*
* Based in part upon a prototype version by Jason Thorpe
* Copyright (c) 1996 by Jason Thorpe.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice immediately at the beginning of the file, without modification,
* this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Definitions for the TurboLaser System Bus found on
* AlphaServer 8200/8400 systems.
*/
/*
* There are 9 TurboLaser nodes, 0 though 8. Their uses are defined as
* follows:
*
* Node Module
* ---- ------
* 0 CPU, Memory
* 1 CPU, Memory
* 2 CPU, Memory
* 3 CPU, Memory
* 4 CPU, Memory, I/O
* 5 CPU, Memory, I/O
* 6 CPU, Memory, I/O
* 7 CPU, Memory, I/O
* 8 I/O
*
* A node occurs every 0x00400000 bytes.
*
* Note, the AlphaServer 8200 only has nodes 4 though 8.
*/
/* Access the specified register on the specified node. */
#define TLSB_GET_NODEREG(_node, _reg) \
*(volatile uint32_t *)(TLSB_NODE_REG_ADDR((_node), (_reg)))
#define TLSB_PUT_NODEREG(_node, _reg, _val) \
*(volatile uint32_t *)(TLSB_NODE_REG_ADDR((_node), (_reg))) = (_val)
/*
* Some registers are shared by all TurboLaser nodes, and appear in
* the TurboLaser Broadcast space.
*/
#define TLSB_BCAST_BASE 0x000000ff8e000000 /* Dense */
/* Access the specified register in the broadcast space. */
#define TLSB_GET_BCASTREG(_reg) \
*(volatile uint32_t *)(TLSB_BCAST_REG_ADDR + (_reg))
#define TLSB_PUT_BCASTREG(_reg, _val) \
*(volatile uint32_t *)(TLSB_BCAST_REG_ADDR + (_reg)) = (_val)
/*
* Location of the Gbus, the per-CPU bus containing the clock and
* console hardware.
*/
#define TLSB_GBUS_BASE 0x000000ff90000000 /* Dense */
/*
* Note that not every module type supports each TurboLaser register.
* The following defines the keys used to denote module support for
* a given register:
*
* C Supported by CPU module
* M Supported by Memory module
* I Supported by I/O module
*/
/*
* TLBER - Bus Error Register
*
* Access: R/W
*
* Notes:
* This register contains information about TLSB errors detected by
* nodes on the TLSB. The register will become locked when:
*
* * Any error occurs and the "lock on first error"
* bit of the Configuration Register is set.
*
* * Any bit other than 20-23 (DS0-DS3) becomes set.
*
* and will remain locked until either:
*
* * All bits in the TLBER are cleared.
*
* * The "lock on first error" bit is cleared.
*
* TLBER locking is intended for diagnostic purposes only, and
* not for general use.
*/
#define TLBER_ATCE 0x00000001 /* Addr Transmit Ck Error */
#define TLBER_APE 0x00000002 /* Addr Parity Error */
#define TLBER_BAE 0x00000004 /* Bank Avail Violation Error */
#define TLBER_LKTO 0x00000008 /* Bank Lock Timeout */
#define TLBER_NAE 0x00000010 /* No Ack Error */
#define TLBER_RTCE 0x00000020 /* Read Transmit Ck Error */
#define TLBER_ACKTCE 0x00000040 /* Ack Transmit Ck Error */
#define TLBER_MMRE 0x00000080 /* Mem Mapping Register Error */
#define TLBER_FNAE 0x00000100 /* Fatal No Ack Error */
#define TLBER_REQDE 0x00000200 /* Request Deassertion Error */
#define TLBER_ATDE 0x00000400 /* Addredd Transmitter During Error */
#define TLBER_UDE 0x00010000 /* Uncorrectable Data Error */
#define TLBER_CWDE 0x00020000 /* Correctable Write Data Error */
#define TLBER_CRDE 0x00040000 /* Correctable Read Data Error */
#define TLBER_CRDE2 0x00080000 /* ...ditto... */
#define TLBER_DS0 0x00100000 /* Data Synd 0 */
#define TLBER_DS1 0x00200000 /* Data Synd 1 */
#define TLBER_DS2 0x00400000 /* Data Synd 2 */
#define TLBER_DS3 0x00800000 /* Data Synd 3 */
#define TLBER_DTDE 0x01000000 /* Data Transmitter During Error */
#define TLBER_FDTCE 0x02000000 /* Fatal Data Transmit Ck Error */
#define TLBER_UACKE 0x04000000 /* Unexpected Ack Error */
#define TLBER_ABTCE 0x08000000 /* Addr Bus Transmit Error */
#define TLBER_DCTCE 0x10000000 /* Data Control Transmit Ck Error */
#define TLBER_SEQE 0x20000000 /* Sequence Error */
#define TLBER_DSE 0x40000000 /* Data Status Error */
#define TLBER_DTO 0x80000000 /* Data Timeout Error */
/*
* TLCNR - Configuration Register
*
* Access: R/W
*/
#define TLCNR_CWDD 0x00000001 /* Corr Write Data Err INTR Dis */
#define TLCNR_CRDD 0x00000002 /* Corr Read Data Err INTR Dis */
#define TLCNR_LKTOD 0x00000004 /* Bank Lock Timeout Disable */
#define TLCNR_DTOD 0x00000008 /* Data Timeout Disable */
#define TLCNR_STF_A 0x00001000 /* Self-Test Fail A */
#define TLCNR_STF_B 0x00002000 /* Self-Test Fail B */
#define TLCNR_HALT_A 0x00100000 /* Halt A */
#define TLCNR_HALT_B 0x00200000 /* Halt B */
#define TLCNR_RSTSTAT 0x10000000 /* Reset Status */
#define TLCNR_NRST 0x40000000 /* Node Reset */
#define TLCNR_LOFE 0x80000000 /* Lock On First Error */
/*
* TLVID - Virtual ID Register
*
* Access: R/W
*
* Notes:
* Virtual units can be CPUs or Memory boards. The units are
* are addressed using virtual IDs. These virtual IDs are assigned
* by writing to the TLVID register. The upper 24 bits of this
* register are reserved and must be written as `0'.
*/
#define TLVID_VIDA_MASK 0x0000000f /* Virtual ID for unit 0 */
#define TLVID_VIDA_SHIFT 0
#define TLVID_VIDB_MASK 0x000000f0 /* Virtual ID for unit 1 */
#define TLVID_VIDB_SHIFT 4
/*
* TLMMRn - Memory Mapping Registers
*
* Access: W
*
* Notes:
* Contains mapping information for doing a bank-decode.
*/
#define TLMMR_INTMASK 0x00000003 /* Valid bits in Interleave */
#define TLMMR_ADRMASK 0x000000f0 /* Valid bits in Address */
#define TLMMR_SBANK 0x00000800 /* Single-bank indicator */
#define TLMMR_VALID 0x80000000 /* Indicated mapping is valid */
#define TLMMR_INTLV_MASK 0x00000700 /* Mask for interleave value */
#define TLMMR_INTLV_SHIFT 8
#define TLMMR_ADDRESS_MASK 0x03fff000 /* Mask for address value */
#define TLMMR_ADDRESS_SHIFT 12
/*
* TLFADRn - Failing Address Registers
*
* Access: R/W
*
* Notes:
* These registers contain status information for a failed address.
* Not all nodes preserve this information. The validation bits
* indicate the validity of a given field.
*/
/*
* CPU Interrupt Mask Register
*
* The PAL code reads this register for each CPU on a TLSB CPU board
* to see what is or isn't enabled.
*/
#define TLINTRMASK_CONHALT 0x100 /* Enable ^P Halt */
#define TLINTRMASK_HALT 0x080 /* Enable Halt */
#define TLINTRMASK_CLOCK 0x040 /* Enable Clock Interrupts */
#define TLINTRMASK_XCALL 0x020 /* Enable Interprocessor Interrupts */
#define TLINTRMASK_IPL17 0x010 /* Enable IPL 17 Interrupts */
#define TLINTRMASK_IPL16 0x008 /* Enable IPL 16 Interrupts */
#define TLINTRMASK_IPL15 0x004 /* Enable IPL 15 Interrupts */
#define TLINTRMASK_IPL14 0x002 /* Enable IPL 14 Interrupts */
#define TLINTRMASK_DUART 0x001 /* Enable GBUS Duart0 Interrupts */
/*
* CPU Interrupt Summary Register
*
* The PAL code reads this register at interrupt time to figure out
* which interrupt line to assert to the CPU. Note that when the
* interrupt is actually vectored through the PAL code, it arrives
* here already presorted as to type (clock, halt, iointr).
*/
#define TLINTRSUM_HALT (1 << 28) /* Halted via TLCNR register */
#define TLINTRSUM_CONHALT (1 << 27) /* Halted via ^P (W1C) */
#define TLINTRSUM_CLOCK (1 << 6) /* Clock Interrupt (W1C) */
#define TLINTRSUM_XCALL (1 << 5) /* Interprocessor Int (W1C) */
#define TLINTRSUM_IPL17 (1 << 4) /* IPL 17 Interrupt Summary */
#define TLINTRSUM_IPL16 (1 << 3) /* IPL 16 Interrupt Summary */
#define TLINTRSUM_IPL15 (1 << 2) /* IPL 15 Interrupt Summary */
#define TLINTRSUM_IPL14 (1 << 1) /* IPL 14 Interrupt Summary */
#define TLINTRSUM_DUART (1 << 0) /* Duart Int (W1C) */
/* after checking the summaries, you can get the source node for each level */
#define TLINTRSUM_IPL17_SOURCE(x) ((x >> 22) & 0x1f)
#define TLINTRSUM_IPL16_SOURCE(x) ((x >> 17) & 0x1f)
#define TLINTRSUM_IPL15_SOURCE(x) ((x >> 12) & 0x1f)
#define TLINTRSUM_IPL14_SOURCE(x) ((x >> 7) & 0x1f)
/*
* (some of) TurboLaser CPU ADG error register defines.
*/
#define TLEPAERR_IBOX_TMO 0x1800 /* window space read failed */
#define TLEPAERR_WSPC_RD 0x0600 /* window space read failed */