Home | History | Annotate | Line # | Download | only in include
ctlreg.h revision 1.28.122.1
      1  1.28.122.1      tls /*	$NetBSD: ctlreg.h,v 1.28.122.1 2014/08/20 00:03:24 tls Exp $ */
      2         1.6  deraadt 
      3         1.1  deraadt /*
      4        1.10       pk  * Copyright (c) 1996
      5        1.12   abrown  *	The President and Fellows of Harvard College. All rights reserved.
      6         1.1  deraadt  * Copyright (c) 1992, 1993
      7         1.1  deraadt  *	The Regents of the University of California.  All rights reserved.
      8         1.1  deraadt  *
      9         1.1  deraadt  * This software was developed by the Computer Systems Engineering group
     10         1.1  deraadt  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
     11         1.1  deraadt  * contributed to Berkeley.
     12         1.1  deraadt  *
     13         1.1  deraadt  * All advertising materials mentioning features or use of this software
     14         1.1  deraadt  * must display the following acknowledgement:
     15        1.10       pk  *	This product includes software developed by Harvard University.
     16         1.1  deraadt  *	This product includes software developed by the University of
     17         1.1  deraadt  *	California, Lawrence Berkeley Laboratory.
     18         1.1  deraadt  *
     19         1.1  deraadt  * Redistribution and use in source and binary forms, with or without
     20         1.1  deraadt  * modification, are permitted provided that the following conditions
     21         1.1  deraadt  * are met:
     22         1.1  deraadt  * 1. Redistributions of source code must retain the above copyright
     23         1.1  deraadt  *    notice, this list of conditions and the following disclaimer.
     24         1.1  deraadt  * 2. Redistributions in binary form must reproduce the above copyright
     25         1.1  deraadt  *    notice, this list of conditions and the following disclaimer in the
     26         1.1  deraadt  *    documentation and/or other materials provided with the distribution.
     27         1.1  deraadt  * 3. All advertising materials mentioning features or use of this software
     28         1.1  deraadt  *    must display the following acknowledgement:
     29         1.1  deraadt  *	This product includes software developed by the University of
     30         1.1  deraadt  *	California, Berkeley and its contributors.
     31         1.1  deraadt  * 4. Neither the name of the University nor the names of its contributors
     32         1.1  deraadt  *    may be used to endorse or promote products derived from this software
     33         1.1  deraadt  *    without specific prior written permission.
     34         1.1  deraadt  *
     35         1.1  deraadt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     36         1.1  deraadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     37         1.1  deraadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     38         1.1  deraadt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     39         1.1  deraadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     40         1.1  deraadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     41         1.1  deraadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     42         1.1  deraadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     43         1.1  deraadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     44         1.1  deraadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     45         1.1  deraadt  * SUCH DAMAGE.
     46         1.1  deraadt  *
     47         1.1  deraadt  *	@(#)ctlreg.h	8.1 (Berkeley) 6/11/93
     48         1.1  deraadt  */
     49         1.1  deraadt 
     50         1.1  deraadt /*
     51        1.12   abrown  * Sun4m support by Aaron Brown, Harvard University.
     52        1.10       pk  * Changes Copyright (c) 1995 The President and Fellows of Harvard College.
     53        1.10       pk  * All rights reserved.
     54        1.10       pk  */
     55        1.10       pk 
     56        1.10       pk /*
     57        1.10       pk  * Sun 4, 4c, and 4m control registers. (includes address space definitions
     58         1.2  deraadt  * and some registers in control space).
     59         1.1  deraadt  */
     60         1.1  deraadt 
     61        1.10       pk /*
     62        1.10       pk  * The Alternate address spaces.
     63        1.10       pk  */
     64        1.10       pk 
     65         1.2  deraadt /*			0x00	   unused */
     66         1.2  deraadt /*			0x01	   unused */
     67         1.2  deraadt #define	ASI_CONTROL	0x02	/* cache enable, context reg, etc */
     68        1.10       pk #define	ASI_SEGMAP	0x03	/* [4/4c] segment maps */
     69        1.10       pk #define ASI_SRMMUFP	0x03	/* [4m] ref mmu flush/probe */
     70        1.10       pk #define	ASI_PTE		0x04	/* [4/4c] PTE space (pmegs) */
     71        1.10       pk #define ASI_SRMMU	0x04	/* [4m] ref mmu registers */
     72        1.10       pk #define	ASI_REGMAP	0x06	/* [4/3-level MMU ] region maps */
     73        1.10       pk #define	ASI_HWFLUSHSEG	0x05	/* [4/4c] hardware assisted version of FLUSHSEG */
     74        1.10       pk #define	ASI_HWFLUSHPG	0x06	/* [4/4c] hardware assisted version of FLUSHPG */
     75        1.10       pk #define ASI_SRMMUDIAG	0x06	/* [4m] */
     76        1.10       pk #define	ASI_HWFLUSHCTX	0x07	/* [4/4c] hardware assisted version of FLUSHCTX */
     77         1.2  deraadt 
     78         1.2  deraadt #define	ASI_USERI	0x08	/* I-space (user) */
     79         1.2  deraadt #define	ASI_KERNELI	0x09	/* I-space (kernel) */
     80         1.2  deraadt #define	ASI_USERD	0x0a	/* D-space (user) */
     81         1.2  deraadt #define	ASI_KERNELD	0x0b	/* D-space (kernel) */
     82         1.2  deraadt 
     83        1.10       pk #define	ASI_FLUSHREG	0x7	/* [4/4c] flush cache by region */
     84        1.10       pk #define	ASI_FLUSHSEG	0x0c	/* [4/4c] flush cache by segment */
     85        1.10       pk #define	ASI_FLUSHPG	0x0d	/* [4/4c] flush cache by page */
     86        1.10       pk #define	ASI_FLUSHCTX	0x0e	/* [4/4c] flush cache by context */
     87        1.10       pk 
     88        1.10       pk #define	ASI_DCACHE	0x0f	/* [4] flush data cache */
     89        1.10       pk 
     90        1.10       pk #define ASI_ICACHETAG	0x0c	/* [4m] instruction cache tag */
     91        1.10       pk #define ASI_ICACHEDATA	0x0d	/* [4m] instruction cache data */
     92        1.10       pk #define ASI_DCACHETAG	0x0e	/* [4m] data cache tag */
     93        1.10       pk #define ASI_DCACHEDATA	0x0f	/* [4m] data cache data */
     94        1.15       pk #define ASI_IDCACHELFP	0x10	/* [4m] flush i&d cache line (page) */
     95        1.15       pk #define ASI_IDCACHELFS	0x11	/* [4m] flush i&d cache line (seg) */
     96        1.15       pk #define ASI_IDCACHELFR	0x12	/* [4m] flush i&d cache line (reg) */
     97        1.15       pk #define ASI_IDCACHELFC	0x13	/* [4m] flush i&d cache line (ctxt) */
     98        1.15       pk #define ASI_IDCACHELFU	0x14	/* [4m] flush i&d cache line (user) */
     99        1.21       pk #define ASI_BLOCKCOPY	0x17	/* [4m] hypersparc: hardware block copy */
    100        1.21       pk #define ASI_BLOCKFILL	0x1f	/* [4m] hypersparc: hardware block fill */
    101        1.10       pk #define ASI_BYPASS	0x20	/* [4m] sun ref mmu bypass,
    102        1.10       pk 				        ie. direct phys access */
    103        1.25      wiz #define	ASI_CSR		0x2f	/* [4d] CPU-unit CSR space */
    104        1.25      wiz #define	ASI_ECSR	0x2f	/* [4d] CPU-unit ECSR space */
    105        1.16       pk #define ASI_HICACHECLR	0x31	/* [4m] hypersparc only: I-cache flash clear */
    106        1.10       pk #define ASI_ICACHECLR	0x36	/* [4m] ms1 only: I-cache flash clear */
    107        1.10       pk #define ASI_DCACHECLR	0x37	/* [4m] ms1 only: D-cache flash clear */
    108        1.10       pk #define ASI_DCACHEDIAG	0x39	/* [4m] data cache diagnostic register access */
    109         1.1  deraadt 
    110        1.10       pk /*
    111        1.10       pk  * [4/4c] Registers in the control space (ASI_CONTROL).
    112        1.10       pk  */
    113        1.10       pk #define	AC_IDPROM	0x00000000	/* [4] ID PROM */
    114        1.10       pk #define	AC_CONTEXT	0x30000000	/* [4/4c] context register (byte) */
    115        1.10       pk #define	AC_SYSENABLE	0x40000000	/* [4/4c] system enable register (byte) */
    116        1.10       pk #define	AC_DVMA_ENABLE	0x50000000	/* [4] enable user dvma */
    117        1.10       pk #define	AC_BUS_ERR	0x60000000	/* [4] bus error register */
    118        1.10       pk #define	AC_SYNC_ERR	0x60000000	/* [4c] sync (memory) error reg */
    119        1.10       pk #define	AC_SYNC_VA	0x60000004	/* [4c] sync error virtual addr */
    120        1.10       pk #define	AC_ASYNC_ERR	0x60000008	/* [4c] async error reg */
    121        1.10       pk #define	AC_ASYNC_VA	0x6000000c	/* [4c] async error virtual addr */
    122        1.10       pk #define	AC_DIAG_REG	0x70000000	/* [4] diagnostic reg */
    123        1.10       pk #define	AC_CACHETAGS	0x80000000	/* [4/4c?] cache tag base address */
    124        1.10       pk #define	AC_CACHEDATA	0x90000000	/* [4] cached data [sun4/400?] */
    125        1.10       pk #define	AC_DVMA_MAP	0xd0000000	/* [4] user dvma map entries */
    126        1.10       pk #define AC_VMEINTVEC	0xe0000000	/* [4] vme interrupt vector */
    127        1.10       pk #define	AC_SERIAL	0xf0000000	/* [4/4c] special serial port sneakiness */
    128         1.1  deraadt 	/* AC_SERIAL is not used in the kernel (it is for the PROM) */
    129         1.4  deraadt 
    130         1.5  deraadt /* XXX: does not belong here */
    131         1.4  deraadt #define	ME_REG_IERR	0x80		/* memory err ctrl reg error intr pending bit */
    132         1.1  deraadt 
    133         1.1  deraadt /*
    134        1.10       pk  * [4/4c]
    135         1.1  deraadt  * Bits in sync error register.  Reading the register clears these;
    136         1.1  deraadt  * otherwise they accumulate.  The error(s) occurred at the virtual
    137         1.1  deraadt  * address stored in the sync error address register, and may have
    138         1.1  deraadt  * been due to, e.g., what would usually be called a page fault.
    139         1.1  deraadt  * Worse, the bits accumulate during instruction prefetch, so
    140         1.1  deraadt  * various bits can be on that should be off.
    141         1.1  deraadt  */
    142         1.1  deraadt #define	SER_WRITE	0x8000		/* error occurred during write */
    143         1.1  deraadt #define	SER_INVAL	0x80		/* PTE had PG_V off */
    144         1.1  deraadt #define	SER_PROT	0x40		/* operation violated PTE prot */
    145         1.1  deraadt #define	SER_TIMEOUT	0x20		/* bus timeout (non-existent mem) */
    146         1.1  deraadt #define	SER_SBUSERR	0x10		/* S-Bus bus error */
    147         1.1  deraadt #define	SER_MEMERR	0x08		/* memory ecc/parity error */
    148  1.28.122.1      tls #define	SER_SZERR	0x02		/* [4/vme] size error (r/w too large) */
    149         1.1  deraadt #define	SER_WATCHDOG	0x01		/* watchdog reset (never see this) */
    150         1.1  deraadt 
    151         1.1  deraadt #define	SER_BITS \
    152         1.1  deraadt "\20\20WRITE\10INVAL\7PROT\6TIMEOUT\5SBUSERR\4MEMERR\2SZERR\1WATCHDOG"
    153         1.1  deraadt 
    154         1.1  deraadt /*
    155        1.10       pk  * [4/4c]
    156         1.1  deraadt  * Bits in async error register (errors from DVMA or Sun-4 cache
    157         1.1  deraadt  * writeback).  The corresponding bit is also set in the sync error reg.
    158         1.1  deraadt  *
    159         1.1  deraadt  * A writeback invalid error means there is a bug in the PTE manager.
    160         1.1  deraadt  *
    161         1.1  deraadt  * The word is that the async error register does not work right.
    162         1.1  deraadt  */
    163         1.1  deraadt #define	AER_WBINVAL	0x80		/* writeback found PTE without PG_V */
    164         1.1  deraadt #define	AER_TIMEOUT	0x20		/* bus timeout */
    165         1.1  deraadt #define	AER_DVMAERR	0x10		/* bus error during DVMA */
    166         1.1  deraadt 
    167         1.1  deraadt #define	AER_BITS	"\20\10WBINVAL\6TIMEOUT\5DVMAERR"
    168         1.1  deraadt 
    169         1.1  deraadt /*
    170        1.10       pk  * [4/4c] Bits in system enable register.
    171         1.1  deraadt  */
    172         1.8       pk #define	SYSEN_DVMA	0x20		/* Enable dvma */
    173         1.8       pk #define	SYSEN_CACHE	0x10		/* Enable cache */
    174         1.8       pk #define	SYSEN_IOCACHE	0x40		/* Enable IO cache */
    175         1.9       pk #define	SYSEN_VIDEO	0x08		/* Enable on-board video */
    176         1.8       pk #define	SYSEN_RESET	0x04		/* Reset the hardware */
    177         1.8       pk #define	SYSEN_RESETVME	0x02		/* Reset the VME bus */
    178         1.2  deraadt 
    179        1.10       pk 
    180        1.10       pk /*
    181        1.20       pk  * [4m] Bits in ASI_CONTROL space, sun4m only.
    182        1.20       pk  */
    183        1.20       pk #define MXCC_STREAM_DATA	0x1c00000	/* Stream data register */
    184        1.20       pk #define MXCC_STREAM_SRC		0x1c00100	/* Stream source register */
    185        1.20       pk #define MXCC_STREAM_DST		0x1c00200	/* Stream dest register */
    186        1.24       pk #define MXCC_BIST		0x1c00800	/* Builtin self test register */
    187        1.20       pk #define MXCC_CTRLREG		0x1c00a00	/* Control register for MXCC */
    188        1.24       pk #define MXCC_STATREG		0x1c00b00	/* Status register for MXCC */
    189        1.24       pk #define MXCC_MRST		0x1c00c00	/* Module reset register */
    190        1.24       pk #define MXCC_ERROR		0x1c00e00	/* Error register */
    191        1.24       pk #define MXCC_MBUSPORT		0x1c00f00	/* MBus port register */
    192        1.20       pk 
    193        1.20       pk /* Bits in MXCC_CTRLREG */
    194        1.22       pk #define MXCC_CTRLREG_HC		0x1	/* Half cache (Xbus only) */
    195        1.22       pk #define MXCC_CTRLREG_CS		0x2	/* E-cache size (Xbus only) */
    196        1.22       pk #define MXCC_CTRLREG_CE		0x4	/* Enable e-cache */
    197        1.22       pk #define MXCC_CTRLREG_PE		0x8	/* Parity enable */
    198        1.22       pk #define MXCC_CTRLREG_MC		0x10	/* Multiple command enable */
    199        1.22       pk #define MXCC_CTRLREG_PF		0x20	/* Prefetch enable */
    200        1.22       pk #define MXCC_CTRLREG_WI		0x40	/* Write invalidate (Xbus only) */
    201        1.22       pk #define MXCC_CTRLREG_BWC_MASK	0x180	/* Bus watch count (Xbus only) */
    202        1.22       pk #define MXCC_CTRLREG_RC		0x200	/* Read reference count */
    203        1.20       pk 
    204        1.24       pk /* Bits in MXCC_MRST */
    205        1.24       pk #define MXCC_MRST_SI		0x00000002	/* Software Internal reset */
    206        1.24       pk #define MXCC_MRST_WD		0x00000004	/* Watchdog reset */
    207        1.24       pk 
    208        1.20       pk /*
    209        1.20       pk  * Stream register usage:
    210        1.20       pk  *	To fill a block with some value, load that value into the 64 byte
    211        1.20       pk  *	stream data register (using double-word access; on Mbus only the
    212        1.20       pk  *	lower 32 bytes are used), then write the physical address of
    213        1.20       pk  *	the destination into the stream destination register.
    214        1.20       pk  *
    215        1.20       pk  *	To copy a block, write the physical address of the source into
    216        1.20       pk  *	the stream source register causing the block to be transferred
    217        1.20       pk  *	into the stream data register, then write the physical address of
    218        1.20       pk  *	the destination into the stream destination register.
    219        1.20       pk  *
    220        1.20       pk  *	In both cases, or in the MXCC_STREAM_CE bit to make the transactions
    221        1.20       pk  *	cache-coherent. Note that stream operations do not cause cache
    222        1.20       pk  *	lines to be allocated.
    223        1.10       pk  */
    224        1.22       pk #define MXCC_STREAM_BLKSZ	32		/* Unit for stream ops */
    225        1.22       pk #define MXCC_STREAM_C		0x1000000000ULL	/* Cacheable bit for stream ops */
    226        1.10       pk 
    227        1.10       pk /*
    228        1.10       pk  * Bits in ASI_SRMMUFP space.
    229        1.10       pk  *	Bits 8-11 determine the type of flush/probe.
    230        1.10       pk  *	Address bits 12-31 hold the page frame.
    231        1.10       pk  */
    232        1.10       pk #define ASI_SRMMUFP_L3	(0<<8)	/* probe L3	| flush L3 PTE */
    233        1.10       pk #define ASI_SRMMUFP_L2	(1<<8)	/* probe L2	| flush L2/L3 PTE/PTD's */
    234        1.10       pk #define ASI_SRMMUFP_L1	(2<<8)	/* probe L1	| flush L1/L2/L3 PTE/PTD's*/
    235        1.10       pk #define ASI_SRMMUFP_L0	(3<<8)	/* probe L0	| flush L0/L1/L2/L3 PTE/PTD's */
    236        1.10       pk #define ASI_SRMMUFP_LN	(4<<8)	/* probe all	| flush all levels */
    237        1.10       pk 
    238        1.10       pk /*
    239        1.10       pk  * [4m] Registers and bits in the SPARC Reference MMU (ASI_SRMMU).
    240        1.10       pk  */
    241         1.8       pk #define SRMMU_PCR	0x00000000	/* Processor control register */
    242         1.8       pk #define SRMMU_CXTPTR	0x00000100	/* Context table pointer register */
    243         1.8       pk #define SRMMU_CXR	0x00000200	/* Context register */
    244        1.18       pk #define SRMMU_SFSR	0x00000300	/* Synchronous fault status reg */
    245        1.18       pk #define SRMMU_SFAR	0x00000400	/* Synchronous fault address reg */
    246        1.18       pk #define SRMMU_AFSR	0x00000500	/* Asynchronous fault status reg (HS) */
    247        1.18       pk #define SRMMU_AFAR	0x00000600	/* Asynchronous fault address reg (HS)*/
    248        1.14       pk #define SRMMU_PCFG	0x00000600	/* Processor configuration reg (TURBO)*/
    249        1.24       pk #define SRMMU_RST	0x00000700	/* Reset reg */
    250         1.2  deraadt #define SRMMU_TLBCTRL	0x00001000	/* TLB replacement control reg */
    251         1.8       pk 
    252        1.13       pk 
    253        1.13       pk /*
    254        1.13       pk  * [4m] Bits in SRMMU control register. One set per module.
    255        1.13       pk  */
    256        1.26       pk 
    257        1.26       pk /* Bits 0 and 1 are common between implementations */
    258        1.26       pk #define SRMMU_PCR_ME	0x00000001	/* MMU Enable */
    259        1.26       pk #define SRMMU_PCR_NF	0x00000002	/* Fault inhibit bit */
    260        1.26       pk 
    261        1.26       pk #define VIKING_PCR_ME	SRMMU_PCR_ME	/* MMU Enable */
    262        1.26       pk #define VIKING_PCR_NF	SRMMU_PCR_NF	/* Fault inhibit bit */
    263        1.13       pk #define VIKING_PCR_PSO	0x00000080	/* Partial Store Ordering enable */
    264        1.13       pk #define VIKING_PCR_DCE	0x00000100	/* Data cache enable bit */
    265        1.13       pk #define VIKING_PCR_ICE	0x00000200	/* SuperSPARC instr. cache enable */
    266        1.13       pk #define VIKING_PCR_SB	0x00000400	/* Store buffer enable bit */
    267        1.13       pk #define VIKING_PCR_MB	0x00000800	/* MBus mode: 0=MXCC, 1=no MXCC */
    268        1.13       pk #define VIKING_PCR_PE	0x00001000	/* Enable memory parity checking */
    269        1.13       pk #define VIKING_PCR_BM	0x00002000	/* 1 iff booting */
    270        1.13       pk #define VIKING_PCR_SE	0x00004000	/* Coherent bus snoop enable */
    271        1.13       pk #define VIKING_PCR_AC	0x00008000	/* 1=cache non-MMU accesses */
    272        1.13       pk #define	VIKING_PCR_TC	0x00010000	/* 1=cache table walks */
    273        1.13       pk 
    274        1.26       pk #define HYPERSPARC_PCR_ME	SRMMU_PCR_ME	/* MMU Enable */
    275        1.26       pk #define HYPERSPARC_PCR_NF	SRMMU_PCR_NF	/* Fault inhibit bit */
    276        1.13       pk #define HYPERSPARC_PCR_CE	0x00000100	/* Cache enable bit */
    277        1.13       pk #define HYPERSPARC_PCR_CM	0x00000400	/* Cache mode: 1=write-back */
    278        1.13       pk #define	HYPERSPARC_PCR_MR	0x00000800	/* Memory reflection: 1 = on */
    279        1.13       pk #define HYPERSPARC_PCR_CS	0x00001000	/* cache size: 1=256k, 0=128k */
    280        1.13       pk #define HYPERSPARC_PCR_C	0x00002000	/* enable cache when MMU off */
    281        1.13       pk #define HYPERSPARC_PCR_BM	0x00004000	/* 1 iff booting */
    282        1.13       pk #define HYPERSPARC_PCR_MID	0x00078000	/* MBus module ID MID<3:0> */
    283        1.13       pk #define HYPERSPARC_PCR_WBE	0x00080000	/* Write buffer enable */
    284        1.13       pk #define HYPERSPARC_PCR_SE	0x00100000	/* Coherent bus snoop enable */
    285        1.13       pk #define HYPERSPARC_PCR_CWR	0x00200000	/* Cache wrap enable */
    286        1.13       pk 
    287        1.26       pk #define CYPRESS_PCR_ME	SRMMU_PCR_ME	/* MMU Enable */
    288        1.26       pk #define CYPRESS_PCR_NF	SRMMU_PCR_NF	/* Fault inhibit bit */
    289        1.13       pk #define CYPRESS_PCR_CE	0x00000100	/* Cache enable bit */
    290        1.13       pk #define CYPRESS_PCR_CL	0x00000200	/* Cache Lock (604 only) */
    291        1.13       pk #define CYPRESS_PCR_CM	0x00000400	/* Cache mode: 1=write-back */
    292        1.13       pk #define	CYPRESS_PCR_MR	0x00000800	/* Memory reflection: 1=on (605 only) */
    293        1.13       pk #define CYPRESS_PCR_C	0x00002000	/* enable cache when MMU off */
    294        1.13       pk #define CYPRESS_PCR_BM	0x00004000	/* 1 iff booting */
    295        1.13       pk #define CYPRESS_PCR_MID	0x00078000	/* MBus module ID MID<3:0> (605 only) */
    296        1.13       pk #define CYPRESS_PCR_MV	0x00080000	/* Multichip Valid */
    297        1.13       pk #define CYPRESS_PCR_MCM	0x00300000	/* Multichip Mask */
    298        1.13       pk #define CYPRESS_PCR_MCA	0x00c00000	/* Multichip Address */
    299        1.13       pk 
    300        1.26       pk #define MS1_PCR_ME	SRMMU_PCR_ME	/* MMU Enable */
    301        1.26       pk #define MS1_PCR_NF	SRMMU_PCR_NF	/* Fault inhibit bit */
    302        1.13       pk #define MS1_PCR_DCE	0x00000100	/* Data cache enable */
    303        1.13       pk #define MS1_PCR_ICE	0x00000200	/* Instruction cache enable */
    304        1.13       pk #define MS1_PCR_RC	0x00000c00	/* DRAM Refresh control */
    305        1.13       pk #define MS1_PCR_PE	0x00001000	/* Enable memory parity checking */
    306        1.13       pk #define MS1_PCR_BM	0x00004000	/* 1 iff booting */
    307        1.13       pk #define MS1_PCR_AC	0x00008000	/* 1=cache if ME==0 (and [ID]CE on) */
    308        1.13       pk #define	MS1_PCR_ID	0x00010000	/* 1=disable ITBR */
    309        1.13       pk #define	MS1_PCR_PC	0x00020000	/* Parity control: 0=even,1=odd */
    310        1.13       pk #define	MS1_PCR_MV	0x00100000	/* Memory data View (diag) */
    311        1.13       pk #define	MS1_PCR_DV	0x00200000	/* Data View (diag) */
    312        1.13       pk #define	MS1_PCR_AV	0x00400000	/* Address View (diag) */
    313        1.13       pk #define	MS1_PCR_STW	0x00800000	/* Software Tablewalk enable */
    314        1.13       pk 
    315        1.26       pk #define SWIFT_PCR_ME	SRMMU_PCR_ME	/* MMU Enable */
    316        1.26       pk #define SWIFT_PCR_NF	SRMMU_PCR_NF	/* Fault inhibit bit */
    317        1.26       pk #define SWIFT_PCR_SA	0x00000080	/* Store Allocate */
    318        1.13       pk #define SWIFT_PCR_DCE	0x00000100	/* Data cache enable */
    319        1.13       pk #define SWIFT_PCR_ICE	0x00000200	/* Instruction cache enable */
    320        1.13       pk #define SWIFT_PCR_RC	0x00003c00	/* DRAM Refresh control */
    321        1.13       pk #define SWIFT_PCR_BM	0x00004000	/* 1 iff booting */
    322        1.13       pk #define SWIFT_PCR_AC	0x00008000	/* 1=cache if ME=0 (and [ID]CE on) */
    323        1.13       pk #define	SWIFT_PCR_PA	0x00010000	/* TCX/SX control */
    324        1.13       pk #define	SWIFT_PCR_PC	0x00020000	/* Parity control: 0=even,1=odd */
    325        1.13       pk #define SWIFT_PCR_PE	0x00040000	/* Enable memory parity checking */
    326        1.13       pk #define	SWIFT_PCR_PMC	0x00180000	/* Page mode control */
    327        1.13       pk #define	SWIFT_PCR_BF	0x00200000	/* Branch Folding */
    328        1.13       pk #define	SWIFT_PCR_WP	0x00400000	/* Watch point enable */
    329        1.13       pk #define	SWIFT_PCR_STW	0x00800000	/* Software Tablewalk enable */
    330        1.13       pk 
    331        1.26       pk #define TURBOSPARC_PCR_ME	SRMMU_PCR_ME	/* MMU Enable */
    332        1.26       pk #define TURBOSPARC_PCR_NF	SRMMU_PCR_NF	/* Fault inhibit bit */
    333        1.13       pk #define TURBOSPARC_PCR_ICS	0x00000004	/* I-cache snoop enable */
    334        1.13       pk #define TURBOSPARC_PCR_PSO	0x00000008	/* Partial Store order (ro!) */
    335        1.13       pk #define TURBOSPARC_PCR_DCE	0x00000100	/* Data cache enable */
    336        1.13       pk #define TURBOSPARC_PCR_ICE	0x00000200	/* Instruction cache enable */
    337        1.13       pk #define TURBOSPARC_PCR_RC	0x00003c00	/* DRAM Refresh control */
    338        1.13       pk #define TURBOSPARC_PCR_BM	0x00004000	/* 1 iff booting */
    339        1.13       pk #define	TURBOSPARC_PCR_PC	0x00020000	/* Parity ctrl: 0=even,1=odd */
    340        1.13       pk #define TURBOSPARC_PCR_PE	0x00040000	/* Enable parity checking */
    341        1.13       pk #define	TURBOSPARC_PCR_PMC	0x00180000	/* Page mode control */
    342        1.14       pk 
    343        1.14       pk /* The Turbosparc's Processor Configuration Register */
    344        1.14       pk #define	TURBOSPARC_PCFG_SCC	0x00000007	/* e-cache config */
    345        1.14       pk #define	TURBOSPARC_PCFG_SE	0x00000008	/* e-cache enable */
    346        1.14       pk #define	TURBOSPARC_PCFG_US2	0x00000010	/* microsparc II compat */
    347        1.14       pk #define	TURBOSPARC_PCFG_WT	0x00000020	/* write-through enable */
    348        1.14       pk #define	TURBOSPARC_PCFG_SBC	0x000000c0	/* SBus Clock */
    349        1.14       pk #define	TURBOSPARC_PCFG_WS	0x03800000	/* DRAM wait states */
    350        1.14       pk #define	TURBOSPARC_PCFG_RAH	0x0c000000	/* DRAM Row Address Hold */
    351        1.14       pk #define	TURBOSPARC_PCFG_AXC	0x30000000	/* AFX Clock */
    352        1.14       pk #define	TURBOSPARC_PCFG_SNP	0x40000000	/* DVMA Snoop enable */
    353        1.14       pk #define	TURBOSPARC_PCFG_IOCLK	0x80000000	/* I/O clock ratio */
    354        1.14       pk 
    355        1.13       pk 
    356        1.13       pk /* Implementation and Version fields are common to all modules */
    357        1.10       pk #define SRMMU_PCR_VER	0x0f000000	/* Version of MMU implementation */
    358        1.10       pk #define SRMMU_PCR_IMPL	0xf0000000	/* Implementation number of MMU */
    359        1.10       pk 
    360        1.10       pk 
    361        1.10       pk /* [4m] Bits in the Synchronous Fault Status Register */
    362        1.10       pk #define SFSR_EM		0x00020000	/* Error mode watchdog reset occurred */
    363         1.8       pk #define SFSR_CS		0x00010000	/* Control Space error */
    364        1.17       pk #define SFSR_SB		0x00008000	/* SS: Store Buffer Error */
    365         1.8       pk #define SFSR_PERR	0x00006000	/* Parity error code */
    366        1.10       pk #define SFSR_P		0x00004000	/* SS: Parity error */
    367        1.10       pk #define SFSR_UC		0x00001000	/* Uncorrectable error */
    368         1.8       pk #define SFSR_TO		0x00000800	/* S-Bus timeout */
    369         1.8       pk #define SFSR_BE		0x00000400	/* S-Bus bus error */
    370         1.8       pk #define SFSR_LVL	0x00000300	/* Pagetable level causing the fault */
    371         1.8       pk #define SFSR_AT		0x000000e0	/* Access type */
    372         1.8       pk #define SFSR_FT		0x0000001c	/* Fault type */
    373         1.8       pk #define SFSR_FAV	0x00000002	/* Fault Address is valid */
    374         1.8       pk #define SFSR_OW		0x00000001	/* Overwritten with new fault */
    375         1.8       pk 
    376        1.17       pk #define	SFSR_BITS	"\177\020"		\
    377        1.17       pk 	"b\21EM\0b\20CS\0b\17SB\0f\15\2PERR\0"	\
    378        1.17       pk 	"b\14UC\0b\13TO\0b\12BE\0f\10\2LVL\0"	\
    379        1.17       pk 	"f\05\3AT\0f\02\3FT\0b\01FAV\0b\01OW"
    380        1.10       pk 
    381        1.10       pk /* [4m] Synchronous Fault Types */
    382        1.10       pk #define SFSR_FT_NONE		(0 << 2) 	/* no fault */
    383        1.10       pk #define SFSR_FT_INVADDR		(1 << 2)	/* invalid address fault */
    384        1.10       pk #define SFSR_FT_PROTERR		(2 << 2)	/* protection fault */
    385        1.10       pk #define SFSR_FT_PRIVERR		(3 << 2)	/* privelege violation */
    386        1.10       pk #define SFSR_FT_TRANSERR	(4 << 2)	/* translation fault */
    387        1.10       pk #define SFSR_FT_BUSERR		(5 << 2)	/* access bus error */
    388        1.10       pk #define SFSR_FT_INTERR		(6 << 2)	/* internal error */
    389        1.10       pk #define SFSR_FT_RESERVED	(7 << 2)	/* reserved */
    390        1.10       pk 
    391        1.10       pk /* [4m] Synchronous Fault Access Types */
    392        1.10       pk #define SFSR_AT_LDUDATA		(0 << 5)     	/* Load user data */
    393        1.10       pk #define SFSR_AT_LDSDATA		(1 << 5)	/* Load supervisor data */
    394        1.10       pk #define SFSR_AT_LDUTEXT		(2 << 5)	/* Load user text */
    395        1.10       pk #define SFSR_AT_LDSTEXT		(3 << 5)	/* Load supervisor text */
    396        1.10       pk #define SFSR_AT_STUDATA		(4 << 5)	/* Store user data */
    397        1.10       pk #define SFSR_AT_STSDATA		(5 << 5) 	/* Store supervisor data */
    398        1.10       pk #define SFSR_AT_STUTEXT		(6 << 5)	/* Store user text */
    399        1.10       pk #define SFSR_AT_STSTEXT		(7 << 5)	/* Store supervisor text */
    400        1.10       pk #define SFSR_AT_SUPERVISOR	(1 << 5)	/* Set iff supervisor */
    401        1.10       pk #define SFSR_AT_TEXT		(2 << 5)	/* Set iff text */
    402        1.10       pk #define SFSR_AT_STORE		(4 << 5)	/* Set iff store */
    403        1.10       pk 
    404        1.10       pk /* [4m] Synchronous Fault PT Levels */
    405        1.10       pk #define SFSR_LVL_0		(0 << 8)	/* Context table entry */
    406        1.10       pk #define SFSR_LVL_1		(1 << 8)	/* Region table entry */
    407        1.10       pk #define SFSR_LVL_2		(2 << 8)	/* Segment table entry */
    408        1.10       pk #define SFSR_LVL_3		(3 << 8)	/* Page table entry */
    409        1.10       pk 
    410        1.10       pk /* [4m] Asynchronous Fault Status Register bits */
    411        1.10       pk #define AFSR_AFO	0x00000001	/* Async. fault occurred */
    412        1.10       pk #define AFSR_AFA	0x000000f0	/* Bits <35:32> of faulting phys addr */
    413        1.10       pk #define AFSR_AFA_RSHIFT	4		/* Shift to get AFA to bit 0 */
    414        1.10       pk #define AFSR_AFA_LSHIFT	28		/* Shift to get AFA to bit 32 */
    415        1.10       pk #define AFSR_BE		0x00000400	/* Bus error */
    416        1.10       pk #define AFSR_TO		0x00000800	/* Bus timeout */
    417        1.10       pk #define AFSR_UC		0x00001000	/* Uncorrectable error */
    418        1.10       pk #define AFSR_SE		0x00002000	/* System error */
    419        1.10       pk 
    420        1.17       pk #define	AFSR_BITS	"\177\020"	\
    421        1.17       pk 	"b\15SE\0b\14UC\0b\13TO\0b\12BE\0f\04\4AFA\0b\0AFO\0"
    422        1.10       pk 
    423        1.10       pk /* [4m] TLB Replacement Control Register bits */
    424         1.8       pk #define TLBC_DISABLE	0x00000020	/* Disable replacement counter */
    425         1.8       pk #define TLBC_RCNTMASK	0x0000001f	/* Replacement counter (0-31) */
    426        1.19       pk 
    427        1.24       pk /* [4m] SRMMU Reset Register bits */
    428        1.24       pk #define SRMMU_RST_SI	0x00000002	/* Software Internal reset */
    429        1.24       pk #define SRMMU_RST_WD	0x00000004	/* Watchdog reset */
    430        1.19       pk 
    431        1.19       pk /*
    432        1.19       pk  * The Ross Hypersparc has an Instruction Cache Control Register (ICCR)
    433        1.19       pk  * It contains an enable bit for the on-chip instruction cache and a bit
    434        1.19       pk  * that controls whether a FLUSH instruction causes an Unimplemented
    435        1.19       pk  * Flush Trap or just flushes the appropriate instruction cache line.
    436        1.19       pk  * The ICCR register is implemented as Ancillary State register number 31.
    437        1.19       pk  */
    438        1.19       pk #define HYPERSPARC_ICCR_ICE	1	/* Instruction cache enable */
    439        1.19       pk #define HYPERSPARC_ICCR_FTD	2	/* Unimpl. flush trap disable */
    440        1.19       pk #define HYPERSPARC_ASRNUM_ICCR	31	/* ICCR == ASR#31 */
    441        1.27      uwe 
    442        1.27      uwe 
    443        1.27      uwe /*
    444        1.27      uwe  * microSPARC-IIep has control space registers in PA[30:28] = 0x1
    445        1.27      uwe  */
    446        1.27      uwe 
    447        1.27      uwe /* Asynchronous memory Fault Status/Address Registers */
    448        1.27      uwe #define MSIIEP_AFSR	0x10001000
    449        1.27      uwe #define MSIIEP_AFAR	0x10001004
    450        1.27      uwe 
    451        1.27      uwe #define MSIIEP_AFSR_ERR		0x80000000 /* summary bit: LE || TO || BE */
    452        1.27      uwe #define MSIIEP_AFSR_LE		0x40000000 /* late error */
    453        1.27      uwe #define MSIIEP_AFSR_TO		0x20000000 /* time out */
    454        1.27      uwe #define MSIIEP_AFSR_BE		0x10000000 /* bus error */
    455        1.27      uwe #define MSIIEP_AFSR_S		0x01000000 /* supervisor */
    456        1.27      uwe #define MSIIEP_AFSR_ME		0x00080000 /* multiple error */
    457        1.27      uwe #define MSIIEP_AFSR_RD		0x00040000 /* read operation */
    458        1.27      uwe #define MSIIEP_AFSR_FAV		0x00020000 /* fault address valid */
    459        1.27      uwe 
    460        1.27      uwe #define MSIIEP_AFSR_BITS	"\177\20"			\
    461        1.27      uwe 		"b\37ERR\0" "b\36LE\0" "b\35TO\0" "b\34BE\0"	\
    462        1.27      uwe 		"b\30S\0" "b\23ME\0" "b\22RD\0" "b\21FAV\0"
    463        1.27      uwe 
    464        1.27      uwe 
    465        1.27      uwe /* Memory Fault Status/Address Registers (parity faults) */
    466        1.27      uwe #define MSIIEP_MFSR	0x10001050
    467        1.27      uwe #define MSIIEP_MFAR	0x10001054
    468        1.27      uwe 
    469        1.27      uwe #define MSIIEP_MFSR_ERR		0x80000000 /* summary bit */
    470        1.27      uwe #define MSIIEP_MFSR_S		0x01000000 /* supervisor */
    471        1.27      uwe #define MSIIEP_MFSR_CP		0x00800000 /* CPU transaction */
    472        1.27      uwe #define MSIIEP_MFSR_ME		0x00080000 /* multiple error */
    473        1.27      uwe #define MSIIEP_MFSR_ATO		0x00008000 /* PCI local bus timeout */
    474        1.27      uwe #define MSIIEP_MFSR_PERR_1	0x00004000 /* parity error [1] */
    475        1.27      uwe #define MSIIEP_MFSR_PERR_0	0x00002000 /* parity error [0] */
    476        1.27      uwe #define MSIIEP_MFSR_BM		0x00001000 /* boot mode */
    477        1.27      uwe #define MSIIEP_MFSR_C		0x00000800 /* cacheable */
    478        1.27      uwe #define MSIIEP_MFSR_REQ		0x000000f0 /* request type */
    479        1.27      uwe 
    480        1.27      uwe #define MSIIEP_MFSR_REQ_NOP		0x00
    481        1.27      uwe #define MSIIEP_MFSR_REQ_RD64		0x10
    482        1.27      uwe #define MSIIEP_MFSR_REQ_RD128		0x20
    483        1.27      uwe #define MSIIEP_MFSR_REQ_RD256		0x40
    484        1.27      uwe #define MSIIEP_MFSR_REQ_WR8		0x90
    485        1.27      uwe #define MSIIEP_MFSR_REQ_WR16		0xa0
    486        1.27      uwe #define MSIIEP_MFSR_REQ_WR32		0xb0
    487        1.27      uwe #define MSIIEP_MFSR_REQ_WR64		0xc0
    488        1.27      uwe 
    489        1.27      uwe #define MSIIEP_MFSR_BITS	"\177\20"				   \
    490        1.27      uwe 		"b\37ERR\0" "b\30S\0" "b\27CP\0" "b\23ME\0" "b\17ATO\0"	   \
    491        1.27      uwe 		"b\16PERR1\0" "b\15PERR0\0" "b\14BM\0" "b\13C\0"	   \
    492        1.27      uwe 		"f\4\4REQ\0" ":\0(NOP)\0" ":\1(RD64)\0" ":\2(RD128)\0"	   \
    493        1.27      uwe 		":\4(RD256)\0" ":\11(WR8)\0" ":\12(WR16)\0" ":\13(WR32)\0" \
    494        1.27      uwe 		":\14(WR64)\0"
    495