/*
* Copyright (c) 1996
* The President and Fellows of Harvard College. All rights reserved.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Harvard University.
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* 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, 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
*
* @(#)ctlreg.h 8.1 (Berkeley) 6/11/93
*/
/*
* Sun4m support by Aaron Brown, Harvard University.
* Changes Copyright (c) 1995 The President and Fellows of Harvard College.
* All rights reserved.
*/
/*
* Sun 4, 4c, and 4m control registers. (includes address space definitions
* and some registers in control space).
*/
/*
* [4/4c] Registers in the control space (ASI_CONTROL).
*/
#define AC_IDPROM 0x00000000 /* [4] ID PROM */
#define AC_CONTEXT 0x30000000 /* [4/4c] context register (byte) */
#define AC_SYSENABLE 0x40000000 /* [4/4c] system enable register (byte) */
#define AC_DVMA_ENABLE 0x50000000 /* [4] enable user dvma */
#define AC_BUS_ERR 0x60000000 /* [4] bus error register */
#define AC_SYNC_ERR 0x60000000 /* [4c] sync (memory) error reg */
#define AC_SYNC_VA 0x60000004 /* [4c] sync error virtual addr */
#define AC_ASYNC_ERR 0x60000008 /* [4c] async error reg */
#define AC_ASYNC_VA 0x6000000c /* [4c] async error virtual addr */
#define AC_DIAG_REG 0x70000000 /* [4] diagnostic reg */
#define AC_CACHETAGS 0x80000000 /* [4/4c?] cache tag base address */
#define AC_CACHEDATA 0x90000000 /* [4] cached data [sun4/400?] */
#define AC_DVMA_MAP 0xd0000000 /* [4] user dvma map entries */
#define AC_VMEINTVEC 0xe0000000 /* [4] vme interrupt vector */
#define AC_SERIAL 0xf0000000 /* [4/4c] special serial port sneakiness */
/* AC_SERIAL is not used in the kernel (it is for the PROM) */
/* XXX: does not belong here */
#define ME_REG_IERR 0x80 /* memory err ctrl reg error intr pending bit */
/*
* [4/4c]
* Bits in sync error register. Reading the register clears these;
* otherwise they accumulate. The error(s) occurred at the virtual
* address stored in the sync error address register, and may have
* been due to, e.g., what would usually be called a page fault.
* Worse, the bits accumulate during instruction prefetch, so
* various bits can be on that should be off.
*/
#define SER_WRITE 0x8000 /* error occurred during write */
#define SER_INVAL 0x80 /* PTE had PG_V off */
#define SER_PROT 0x40 /* operation violated PTE prot */
#define SER_TIMEOUT 0x20 /* bus timeout (non-existent mem) */
#define SER_SBUSERR 0x10 /* S-Bus bus error */
#define SER_MEMERR 0x08 /* memory ecc/parity error */
#define SER_SZERR 0x02 /* [4/vme] size error (r/w too large) */
#define SER_WATCHDOG 0x01 /* watchdog reset (never see this) */
/*
* [4/4c]
* Bits in async error register (errors from DVMA or Sun-4 cache
* writeback). The corresponding bit is also set in the sync error reg.
*
* A writeback invalid error means there is a bug in the PTE manager.
*
* The word is that the async error register does not work right.
*/
#define AER_WBINVAL 0x80 /* writeback found PTE without PG_V */
#define AER_TIMEOUT 0x20 /* bus timeout */
#define AER_DVMAERR 0x10 /* bus error during DVMA */
/*
* Stream register usage:
* To fill a block with some value, load that value into the 64 byte
* stream data register (using double-word access; on Mbus only the
* lower 32 bytes are used), then write the physical address of
* the destination into the stream destination register.
*
* To copy a block, write the physical address of the source into
* the stream source register causing the block to be transferred
* into the stream data register, then write the physical address of
* the destination into the stream destination register.
*
* In both cases, or in the MXCC_STREAM_CE bit to make the transactions
* cache-coherent. Note that stream operations do not cause cache
* lines to be allocated.
*/
#define MXCC_STREAM_BLKSZ 32 /* Unit for stream ops */
#define MXCC_STREAM_C 0x1000000000ULL /* Cacheable bit for stream ops */
/*
* Bits in ASI_SRMMUFP space.
* Bits 8-11 determine the type of flush/probe.
* Address bits 12-31 hold the page frame.
*/
#define ASI_SRMMUFP_L3 (0<<8) /* probe L3 | flush L3 PTE */
#define ASI_SRMMUFP_L2 (1<<8) /* probe L2 | flush L2/L3 PTE/PTD's */
#define ASI_SRMMUFP_L1 (2<<8) /* probe L1 | flush L1/L2/L3 PTE/PTD's*/
#define ASI_SRMMUFP_L0 (3<<8) /* probe L0 | flush L0/L1/L2/L3 PTE/PTD's */
#define ASI_SRMMUFP_LN (4<<8) /* probe all | flush all levels */
/*
* [4m] Bits in SRMMU control register. One set per module.
*/
/* Bits 0 and 1 are common between implementations */
#define SRMMU_PCR_ME 0x00000001 /* MMU Enable */
#define SRMMU_PCR_NF 0x00000002 /* Fault inhibit bit */
/* Implementation and Version fields are common to all modules */
#define SRMMU_PCR_VER 0x0f000000 /* Version of MMU implementation */
#define SRMMU_PCR_IMPL 0xf0000000 /* Implementation number of MMU */
/* [4m] Bits in the Synchronous Fault Status Register */
#define SFSR_EM 0x00020000 /* Error mode watchdog reset occurred */
#define SFSR_CS 0x00010000 /* Control Space error */
#define SFSR_SB 0x00008000 /* SS: Store Buffer Error */
#define SFSR_PERR 0x00006000 /* Parity error code */
#define SFSR_P 0x00004000 /* SS: Parity error */
#define SFSR_UC 0x00001000 /* Uncorrectable error */
#define SFSR_TO 0x00000800 /* S-Bus timeout */
#define SFSR_BE 0x00000400 /* S-Bus bus error */
#define SFSR_LVL 0x00000300 /* Pagetable level causing the fault */
#define SFSR_AT 0x000000e0 /* Access type */
#define SFSR_FT 0x0000001c /* Fault type */
#define SFSR_FAV 0x00000002 /* Fault Address is valid */
#define SFSR_OW 0x00000001 /* Overwritten with new fault */
/*
* The Ross Hypersparc has an Instruction Cache Control Register (ICCR)
* It contains an enable bit for the on-chip instruction cache and a bit
* that controls whether a FLUSH instruction causes an Unimplemented
* Flush Trap or just flushes the appropriate instruction cache line.
* The ICCR register is implemented as Ancillary State register number 31.
*/
#define HYPERSPARC_ICCR_ICE 1 /* Instruction cache enable */
#define HYPERSPARC_ICCR_FTD 2 /* Unimpl. flush trap disable */
#define HYPERSPARC_ASRNUM_ICCR 31 /* ICCR == ASR#31 */
/*
* microSPARC-IIep has control space registers in PA[30:28] = 0x1
*/