Home | History | Annotate | Line # | Download | only in include
ctlreg.h revision 1.5
      1 /*
      2  * Copyright (c) 1992, 1993
      3  *	The Regents of the University of California.  All rights reserved.
      4  *
      5  * This software was developed by the Computer Systems Engineering group
      6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
      7  * contributed to Berkeley.
      8  *
      9  * All advertising materials mentioning features or use of this software
     10  * must display the following acknowledgement:
     11  *	This product includes software developed by the University of
     12  *	California, Lawrence Berkeley Laboratory.
     13  *
     14  * Redistribution and use in source and binary forms, with or without
     15  * modification, are permitted provided that the following conditions
     16  * are met:
     17  * 1. Redistributions of source code must retain the above copyright
     18  *    notice, this list of conditions and the following disclaimer.
     19  * 2. Redistributions in binary form must reproduce the above copyright
     20  *    notice, this list of conditions and the following disclaimer in the
     21  *    documentation and/or other materials provided with the distribution.
     22  * 3. All advertising materials mentioning features or use of this software
     23  *    must display the following acknowledgement:
     24  *	This product includes software developed by the University of
     25  *	California, Berkeley and its contributors.
     26  * 4. Neither the name of the University nor the names of its contributors
     27  *    may be used to endorse or promote products derived from this software
     28  *    without specific prior written permission.
     29  *
     30  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     31  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     32  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     33  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     34  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     35  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     36  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     37  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     38  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     39  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     40  * SUCH DAMAGE.
     41  *
     42  *	@(#)ctlreg.h	8.1 (Berkeley) 6/11/93
     43  *
     44  * from: Header: ctlreg.h,v 1.6 93/04/27 14:29:07 torek Exp
     45  * $Id: ctlreg.h,v 1.5 1994/10/26 07:15:09 deraadt Exp $
     46  */
     47 
     48 /*
     49  * Sun-4, 4c, and 4m control registers. (includes address space definitions
     50  * and some registers in control space).
     51  */
     52 
     53 /*			0x00	   unused */
     54 /*			0x01	   unused */
     55 #if defined(SUN4C) || defined(SUN4)
     56 #define	ASI_CONTROL	0x02	/* cache enable, context reg, etc */
     57 #define	ASI_SEGMAP	0x03	/* segment maps (so we can reach each pmeg) */
     58 #define	ASI_PTE		0x04	/* PTE space (pmegs) */
     59 #define	ASI_HWFLUSHSEG	0x05	/* hardware assisted version of FLUSHSEG */
     60 #define	ASI_HWFLUSHPG	0x06	/* hardware assisted version of FLUSHPG */
     61 #define	ASI_HWFLUSHCTX	0x07	/* hardware assisted version of FLUSHCTX */
     62 #endif
     63 #if defined(SUN4M)
     64 #define ASI_SRMMUFP	0x03	/* ref mmu flush/probe */
     65 #define ASI_SRMMUFP_L3	(0<<8)	/* probe L3	| flush L3 PTE */
     66 #define ASI_SRMMUFP_L2	(1<<8)	/* probe L2	| flush L2/L3 PTE/PTD's */
     67 #define ASI_SRMMUFP_L1	(2<<8)	/* probe L1	| flush L1/L2/L3 PTE/PTD's*/
     68 #define ASI_SRMMUFP_L0	(3<<8)	/* probe L0	| flush L0/L1/L2/L3 PTE/PTD's */
     69 #define ASI_SRMMUFP_LN	(4<<8)	/* probe all	| flush all levels */
     70 
     71 #define ASI_SRMMU	0x04	/* ref mmu registers */
     72 #define ASI_SRMMUDIAG	0x06
     73 #endif
     74 
     75 #define	ASI_USERI	0x08	/* I-space (user) */
     76 #define	ASI_KERNELI	0x09	/* I-space (kernel) */
     77 #define	ASI_USERD	0x0a	/* D-space (user) */
     78 #define	ASI_KERNELD	0x0b	/* D-space (kernel) */
     79 
     80 #if defined(SUN4C) || defined(SUN4)
     81 #define	ASI_FLUSHSEG	0x0c	/* causes hardware to flush cache segment */
     82 #define	ASI_FLUSHPG	0x0d	/* causes hardware to flush cache page */
     83 #define	ASI_FLUSHCTX	0x0e	/* causes hardware to flush cache context */
     84 #endif
     85 #if defined(SUN4)
     86 #define	ASI_DCACHE	0x0f	/* flush data cache; not used on 4c */
     87 #endif
     88 
     89 #if defined(SUN4M)
     90 #define ASI_ICACHETAG	0x0c	/* instruction cache tag */
     91 #define ASI_ICACHEDATA	0x0d	/* instruction cache data */
     92 #define ASI_DCACHETAG	0x0e	/* data cache tag */
     93 #define ASI_DCACHEDATA	0x0f	/* data cache data */
     94 #define ASI_IDCACHELFP	0x10	/* ms2 only: flush i&d cache line (page) */
     95 #define ASI_IDCACHELFS	0x11	/* ms2 only: flush i&d cache line (seg) */
     96 #define ASI_IDCACHELFR	0x12	/* ms2 only: flush i&d cache line (reg) */
     97 #define ASI_IDCACHELFC	0x13	/* ms2 only: flush i&d cache line (ctxt) */
     98 #define ASI_IDCACHELFU	0x14	/* ms2 only: flush i&d cache line (user) */
     99 #define ASI_SRMMUTLB	0x20	/* sun ref mmu bypass, ie. direct tlb access */
    100 #define ASI_ICACHECLR	0x36	/* ms1 only: instruction cache flash clear */
    101 #define ASI_DCACHECLR	0x37	/* ms1 only: data cache clear */
    102 #define ASI_DCACHEDIAG	0x39	/* data cache diagnostic register access */
    103 #endif
    104 
    105 #if defined(SUN4C) || defined(SUN4)
    106 /* registers in the control space */
    107 #define	AC_CONTEXT	0x30000000	/* context register (byte) */
    108 #define	AC_SYSENABLE	0x40000000	/* system enable register (byte) */
    109 #define	AC_CACHETAGS	0x80000000	/* cache tag base address */
    110 #define	AC_SERIAL	0xf0000000	/* special serial port sneakiness */
    111 	/* AC_SERIAL is not used in the kernel (it is for the PROM) */
    112 #endif
    113 
    114 #if defined(SUN4)
    115 #define	AC_IDPROM	0x00000000	/* ID PROM */
    116 #define	AC_DVMA_ENABLE	0x50000000	/* enable user dvma */
    117 #define	AC_BUS_ERR	0x60000000	/* bus error register */
    118 #define	AC_DIAG_REG	0x70000000	/* diagnostic reg */
    119 #define	AC_DVMA_MAP	0xd0000000	/* user dvma map entries */
    120 #define AC_VMEINTVEC	0xe0000000	/* vme interrupt vector */
    121 
    122 /* XXX: does not belong here */
    123 #define	ME_REG_IERR	0x80		/* memory err ctrl reg error intr pending bit */
    124 #endif
    125 
    126 #if defined(SUN4C)
    127 #define	AC_SYNC_ERR	0x60000000	/* sync (memory) error reg */
    128 #define	AC_SYNC_VA	0x60000004	/* sync error virtual addr */
    129 #define	AC_ASYNC_ERR	0x60000008	/* async error reg */
    130 #define	AC_ASYNC_VA	0x6000000c	/* async error virtual addr */
    131 #define	AC_CACHEDATA	0x90000000	/* cached data */
    132 #endif
    133 
    134 #if defined(SUN4C) || defined(SUN4)
    135 /*
    136  * Bits in sync error register.  Reading the register clears these;
    137  * otherwise they accumulate.  The error(s) occurred at the virtual
    138  * address stored in the sync error address register, and may have
    139  * been due to, e.g., what would usually be called a page fault.
    140  * Worse, the bits accumulate during instruction prefetch, so
    141  * various bits can be on that should be off.
    142  */
    143 #define	SER_WRITE	0x8000		/* error occurred during write */
    144 #define	SER_INVAL	0x80		/* PTE had PG_V off */
    145 #define	SER_PROT	0x40		/* operation violated PTE prot */
    146 #define	SER_TIMEOUT	0x20		/* bus timeout (non-existent mem) */
    147 #define	SER_SBUSERR	0x10		/* S-Bus bus error */
    148 #define	SER_MEMERR	0x08		/* memory ecc/parity error */
    149 #define	SER_SZERR	0x02		/* size error, whatever that is */
    150 #define	SER_WATCHDOG	0x01		/* watchdog reset (never see this) */
    151 
    152 #define	SER_BITS \
    153 "\20\20WRITE\10INVAL\7PROT\6TIMEOUT\5SBUSERR\4MEMERR\2SZERR\1WATCHDOG"
    154 
    155 /*
    156  * Bits in async error register (errors from DVMA or Sun-4 cache
    157  * writeback).  The corresponding bit is also set in the sync error reg.
    158  *
    159  * A writeback invalid error means there is a bug in the PTE manager.
    160  *
    161  * The word is that the async error register does not work right.
    162  */
    163 #define	AER_WBINVAL	0x80		/* writeback found PTE without PG_V */
    164 #define	AER_TIMEOUT	0x20		/* bus timeout */
    165 #define	AER_DVMAERR	0x10		/* bus error during DVMA */
    166 
    167 #define	AER_BITS	"\20\10WBINVAL\6TIMEOUT\5DVMAERR"
    168 
    169 /*
    170  * Bits in system enable register.
    171  */
    172 #define	SYSEN_DVMA	0x20		/* enable dvma */
    173 #define	SYSEN_CACHE	0x10		/* enable cache */
    174 #define	SYSEN_RESET	0x04		/* reset the hardware */
    175 #endif
    176 
    177 #if defined(SUN4M)
    178 #define SRMMU_PCR	0x00000000	/* processor control register */
    179 #define SRMMU_CXTPTR	0x00000100	/* context table pointer register */
    180 #define SRMMU_CXR	0x00000200	/* context register */
    181 #define SRMMU_SFSTAT	0x00000300	/* syncronous fault status reg */
    182 #define SRMMU_SFADDR	0x00000400	/* syncronous fault address reg */
    183 #define SRMMU_TLBCTRL	0x00001000	/* TLB replacement control reg */
    184 #endif
    185