Home | History | Annotate | Line # | Download | only in booke
spr.h revision 1.1.4.4
      1  1.1.4.2  rmind /*	$NetBSD: spr.h,v 1.1.4.4 2011/06/12 00:24:04 rmind Exp $	*/
      2      1.1   matt /*-
      3  1.1.4.2  rmind  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
      4      1.1   matt  * All rights reserved.
      5      1.1   matt  *
      6      1.1   matt  * This code is derived from software contributed to The NetBSD Foundation
      7  1.1.4.2  rmind  * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects
      8  1.1.4.2  rmind  * Agency and which was developed by Matt Thomas of 3am Software Foundry.
      9  1.1.4.2  rmind  *
     10  1.1.4.2  rmind  * This material is based upon work supported by the Defense Advanced Research
     11  1.1.4.2  rmind  * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
     12  1.1.4.2  rmind  * Contract No. N66001-09-C-2073.
     13  1.1.4.2  rmind  * Approved for Public Release, Distribution Unlimited
     14      1.1   matt  *
     15      1.1   matt  * Redistribution and use in source and binary forms, with or without
     16      1.1   matt  * modification, are permitted provided that the following conditions
     17      1.1   matt  * are met:
     18      1.1   matt  * 1. Redistributions of source code must retain the above copyright
     19      1.1   matt  *    notice, this list of conditions and the following disclaimer.
     20      1.1   matt  * 2. Redistributions in binary form must reproduce the above copyright
     21      1.1   matt  *    notice, this list of conditions and the following disclaimer in the
     22      1.1   matt  *    documentation and/or other materials provided with the distribution.
     23      1.1   matt  *
     24      1.1   matt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     25      1.1   matt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     26      1.1   matt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     27      1.1   matt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     28      1.1   matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     29      1.1   matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     30      1.1   matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     31      1.1   matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     32      1.1   matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     33      1.1   matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     34      1.1   matt  * POSSIBILITY OF SUCH DAMAGE.
     35      1.1   matt  */
     36      1.1   matt 
     37      1.1   matt #ifndef _POWERPC_BOOKE_SPR_H_
     38      1.1   matt #define	_POWERPC_BOOKE_SPR_H_
     39      1.1   matt 
     40      1.1   matt #define PVR_MPCe500		  0x8020
     41      1.1   matt #define PVR_MPCe500v2		  0x8021
     42  1.1.4.2  rmind 
     43      1.1   matt #define	SVR_MPC8548v1		  0x80310010
     44      1.1   matt #define	SVR_MPC8548v1plus	  0x80310011
     45      1.1   matt #define	SVR_MPC8548v2		  0x80310020
     46      1.1   matt #define	SVR_MPC8547v2		  0x80310120
     47      1.1   matt #define	SVR_MPC8545v2		  0x80310220
     48  1.1.4.2  rmind #define	SVR_MPC8543v1		  0x80320010
     49  1.1.4.2  rmind #define	SVR_MPC8543v1plus	  0x80320011
     50      1.1   matt #define	SVR_MPC8543v2		  0x80320020
     51  1.1.4.2  rmind 
     52  1.1.4.2  rmind #define	SVR_MPC8544v1		  0x80340110
     53  1.1.4.2  rmind #define	SVR_MPC8544v1plus	  0x80340111
     54  1.1.4.2  rmind #define	SVR_MPC8533		  0x80340010
     55  1.1.4.2  rmind 
     56  1.1.4.2  rmind #define	SVR_MPC8536v1		  0x80370091
     57  1.1.4.2  rmind 
     58  1.1.4.2  rmind #define	SVR_MPC8555v1		  0x80710110
     59  1.1.4.2  rmind #define	SVR_MPC8541v1		  0x80720111
     60  1.1.4.2  rmind 
     61  1.1.4.2  rmind #define	SVR_MPC8567v1		  0x80750111
     62  1.1.4.2  rmind #define	SVR_MPC8568v1		  0x80750011
     63  1.1.4.2  rmind 
     64  1.1.4.2  rmind #define	SVR_MPC8572v1		  0x80e00011
     65  1.1.4.2  rmind 
     66  1.1.4.2  rmind #define	SVR_P2020v2		  0x80e20020
     67  1.1.4.2  rmind #define	SVR_P2010v2		  0x80e30020
     68  1.1.4.3  rmind #define	SVR_P1011v2		  0x80e50020
     69  1.1.4.3  rmind #define	SVR_P1012v2		  0x80e50120
     70  1.1.4.3  rmind #define	SVR_P1013v2		  0x80e70020
     71  1.1.4.3  rmind #define	SVR_P1020v2		  0x80e40020
     72  1.1.4.3  rmind #define	SVR_P1021v2		  0x80e40120
     73  1.1.4.3  rmind #define	SVR_P1022v2		  0x80e60020
     74  1.1.4.2  rmind 
     75  1.1.4.2  rmind #define	SVR_SECURITY_P(svr)	  (((svr) & 0x00080000) != 0)
     76      1.1   matt 
     77      1.1   matt /*
     78      1.1   matt  * Special Purpose Register declarations.
     79      1.1   matt  *
     80      1.1   matt  * The first column in the comments indicates which PowerPC architectures the
     81      1.1   matt  * SPR is valid on - E for BookE series, 4 for 4xx series,
     82      1.1   matt  * 6 for 6xx/7xx series and 8 for 8xx and 8xxx (but not 85xx) series.
     83      1.1   matt  */
     84      1.1   matt 
     85      1.1   matt #define	SPR_PID0		48	/* E4.. 440 Process ID */
     86      1.1   matt #define	SPR_DECAR		54	/* E... Decrementer Auto-reload */
     87      1.1   matt #define	SPR_CSRR0		58	/* E... Critical Save/Restore Reg. 0 */
     88      1.1   matt #define	SPR_CSRR1		59	/* E... Critical Save/Restore Reg. 1 */
     89      1.1   matt #define	SPR_DEAR		61	/* E... Data Exception Address Reg. */
     90      1.1   matt #define	SPR_ESR			62	/* E... Exception Syndrome Register */
     91      1.1   matt #define	  ESR_PIL		  0x08000000 /* 4: Program ILlegal */
     92      1.1   matt #define	  ESR_PPR		  0x04000000 /* 5: Program PRivileged */
     93      1.1   matt #define	  ESR_PTR		  0x02000000 /* 6: Program TRap */
     94      1.1   matt #define	  ESR_ST		  0x00800000 /* 8: Store operation */
     95      1.1   matt #define	  ESR_DLK		  0x00200000 /* 10: dcache exception */
     96      1.1   matt #define	  ESR_ILK		  0x00100000 /* 11: icache exception */
     97      1.1   matt #define	  ESR_AP		  0x00100000 /* 12: Auxiliary Processor operation exception */
     98      1.1   matt #define	  ESR_PUO		  0x00100000 /* 13: Program Unimplemented Operation exception */
     99      1.1   matt #define	  ESR_BO		  0x00020000 /* 14: Byte ordering exception */
    100      1.1   matt #define	  ESR_PIE		  0x00020000 /* 14: Program Imprecise Exception */
    101      1.1   matt #define	  ESR_SPV		  0x00000080 /* 24: SPE exception */
    102      1.1   matt #define	  ESR_VLEMI		  0x00000080 /* 26: VLE exception */
    103      1.1   matt #define	  ESR_MIF		  0x00000080 /* 30: VLE Misaligned Instruction Fetch */
    104      1.1   matt #define	  ESR_XTE		  0x00000080 /* 31: eXternal Transaction Error */
    105      1.1   matt #define	SPR_IVPR		63	/* E... Interrupt Vector Prefix Reg. */
    106      1.1   matt #define	SPR_USPRG0		256	/* E4.. User SPR General 0 */
    107      1.1   matt #define	SPR_USPRG3		259	/* E... User SPR General 3 */
    108      1.1   matt #define	SPR_USPRG4		260	/* E... User SPR General 4 */
    109      1.1   matt #define	SPR_USPRG5		261	/* E... User SPR General 5 */
    110      1.1   matt #define	SPR_USPRG6		262	/* E... User SPR General 6 */
    111      1.1   matt #define	SPR_USPRG7		263	/* E... User SPR General 7 */
    112      1.1   matt #define	SPR_RTBL		268	/* E468 Time Base Lower (RO) */
    113      1.1   matt #define	SPR_RTBU		269	/* E468 Time Base Upper (RO) */
    114      1.1   matt #define	SPR_WTBL		284	/* E468 Time Base Lower (WO) */
    115      1.1   matt #define	SPR_WTBU		285	/* E468 Time Base Upper (WO) */
    116  1.1.4.2  rmind #define	SPR_PIR			286	/* E... Processor ID Register (RO) */
    117      1.1   matt 
    118      1.1   matt #define	SPR_DBSR		304	/* E... Debug Status Register (W1C) */
    119      1.1   matt #define   DBSR_IDE		  0x80000000 /* 0: Imprecise debug event */
    120      1.1   matt #define	  DBSR_UDE		  0x40000000 /* 1: Unconditional debug event */
    121      1.1   matt #define	  DBSR_MRR_HARD		  0x20000000 /* 2: Most Recent Reset (Hard) */
    122      1.1   matt #define	  DBSR_MRR_SOFT		  0x10000000 /* 3: Most Recent Reset (Soft) */
    123      1.1   matt #define	  DBSR_ICMP		  0x08000000 /* 4: Instruction completion debug event */
    124      1.1   matt #define	  DBSR_BRT		  0x04000000 /* 5: Branch Taken debug event */
    125      1.1   matt #define	  DBSR_IRPT		  0x02000000 /* 6: Interrupt Taken debug event */
    126      1.1   matt #define	  DBSR_TRAP		  0x01000000 /* 7: Trap Instruction debug event */
    127  1.1.4.2  rmind #define   DBSR_IAC		  0x00f00000 /* 8-11: IAC debug event */
    128      1.1   matt #define	  DBSR_IAC1		  0x00800000 /* 8: IAC1 debug event */
    129      1.1   matt #define	  DBSR_IAC2		  0x00400000 /* 9: IAC2 debug event */
    130  1.1.4.2  rmind #define	  DBSR_IAC3		  0x00200000 /* 10: IAC3 debug event */
    131  1.1.4.2  rmind #define	  DBSR_IAC4		  0x00100000 /* 11: IAC4 debug event */
    132  1.1.4.2  rmind #define   DBSR_DAC		  0x000f0000 /* 12-15: DAC debug event */
    133  1.1.4.2  rmind #define	  DBSR_DAC1R		  0x00080000 /* 12: DAC1 Read debug event */
    134  1.1.4.2  rmind #define	  DBSR_DAC1W		  0x00040000 /* 13: DAC1 Write debug event */
    135  1.1.4.2  rmind #define	  DBSR_DAC2R		  0x00020000 /* 14: DAC2 Read debug event */
    136  1.1.4.2  rmind #define	  DBSR_DAC2W		  0x00010000 /* 15: DAC2 Write debug event */
    137      1.1   matt #define	  DBSR_RET		  0x00008000 /* 16: Return debug event */
    138      1.1   matt #define	SPR_DBCR0		308	/* E... Debug Control Register 0 */
    139      1.1   matt #define	  DBCR0_EDM		  0x80000000 /* 0: External Debug Mode */
    140      1.1   matt #define	  DBCR0_IDM		  0x40000000 /* 1: Internal Debug Mode */
    141      1.1   matt #define	  DBCR0_RST_MASK	  0x30000000 /* 2..3: ReSeT */
    142      1.1   matt #define	  DBCR0_RST_NONE	  0x00000000 /*   No action */
    143      1.1   matt #define	  DBCR0_RST_CORE	  0x10000000 /*   Core reset */
    144      1.1   matt #define	  DBCR0_RST_CHIP	  0x20000000 /*   Chip reset */
    145      1.1   matt #define	  DBCR0_RST_SYSTEM	  0x30000000 /*   System reset */
    146  1.1.4.2  rmind #define	  DBCR0_ICMP		  0x08000000 /* 4: Instruction Completion debug event */
    147  1.1.4.2  rmind #define	  DBCR0_BRT		  0x04000000 /* 5: Branch Taken debug event */
    148  1.1.4.2  rmind #define	  DBCR0_IRPT		  0x02000000 /* 6: Interrupt Taken debug event */
    149  1.1.4.2  rmind #define	  DBCR0_TRAP		  0x01000000 /* 7: Trap Instruction Debug Event */
    150  1.1.4.2  rmind #define	  DBCR0_IAC1		  0x00800000 /* 8: IAC (Instruction Address Compare) 1 debug event */
    151  1.1.4.2  rmind #define	  DBCR0_IAC2		  0x00400000 /* 9: IAC 2 debug event */
    152  1.1.4.2  rmind #define	  DBCR0_IAC3		  0x00200000 /* 10: IAC 3 debug event */
    153  1.1.4.2  rmind #define	  DBCR0_IAC4		  0x00100000 /* 11: IAC 4 debug event */
    154  1.1.4.2  rmind #define	  DBCR0_DAC1_LOAD	  0x00080000 /* 12: DAC (Data Address Compare) 1 load event */
    155  1.1.4.2  rmind #define	  DBCR0_DAC1_STORE	  0x00040000 /* 13: DAC (Data Address Compare) 1 store event */
    156  1.1.4.2  rmind #define	  DBCR0_DAC2_LOAD	  0x00020000 /* 14: DAC 2 load event */
    157  1.1.4.2  rmind #define	  DBCR0_DAC2_STORE	  0x00010000 /* 15: DAC 2 store event */
    158  1.1.4.2  rmind #define	  DBCR0_RET		  0x00008000 /* 16: Return debug event */
    159      1.1   matt #define	  DBCR0_FT		  0x00000001 /* 31: Freeze Timers on debug event */
    160      1.1   matt #define	SPR_DBCR1		309	/* E... Debug Control Register 1 */
    161  1.1.4.2  rmind #define	  DBCR1_IAC1US		  0xc0000000 /*  0-1: Data Address Compare 1 user/supervisor mode */
    162  1.1.4.2  rmind #define	  DBCR1_IAC1US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    163  1.1.4.2  rmind #define	  DBCR1_IAC1US_KERNEL	  0x80000000 /*  MSR[PR] = 0 */
    164  1.1.4.2  rmind #define	  DBCR1_IAC1US_USER	  0xc0000000 /*  MSR[PR] = 1 */
    165  1.1.4.2  rmind #define	  DBCR1_IAC1ER		  0x30000000 /*  2-3: Data Address Compare 1 effective/real mode */
    166  1.1.4.2  rmind #define	  DBCR1_IAC1ER_DSX	  0x00000000 /*  effective address */
    167  1.1.4.2  rmind #define	  DBCR1_IAC1ER_REAL	  0x10000000 /*  real address */
    168  1.1.4.2  rmind #define	  DBCR1_IAC1ER_DS0	  0x20000000 /*  effective address MSR[DS] = 0 */
    169  1.1.4.2  rmind #define	  DBCR1_IAC1ER_DS1	  0x30000000 /*  effective address MSR[DS] = 1 */
    170  1.1.4.2  rmind #define	  DBCR1_IAC2US		  0x0c000000 /*  4-5: Data Address Compare 1 user/supervisor mode */
    171  1.1.4.2  rmind #define	  DBCR1_IAC2US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    172  1.1.4.2  rmind #define	  DBCR1_IAC2US_KERNEL	  0x08000000 /*  MSR[PR] = 0 */
    173  1.1.4.2  rmind #define	  DBCR1_IAC2US_USER	  0x0c000000 /*  MSR[PR] = 1 */
    174  1.1.4.2  rmind #define	  DBCR1_IAC2ER		  0x03000000 /*  6-7: Data Address Compare 1 effective/real mode */
    175  1.1.4.2  rmind #define	  DBCR1_IAC2ER_DSX	  0x00000000 /*  effective address */
    176  1.1.4.2  rmind #define	  DBCR1_IAC2ER_REAL	  0x01000000 /*  real address */
    177  1.1.4.2  rmind #define	  DBCR1_IAC2ER_DS0	  0x02000000 /*  effective address MSR[DS] = 0 */
    178  1.1.4.2  rmind #define	  DBCR1_IAC2ER_DS1	  0x03000000 /*  effective address MSR[DS] = 1 */
    179  1.1.4.2  rmind #define	  DBCR1_IAC12M		  0x00c00000 /*  8-9: Data Address Compare 1 effective/real mode */
    180  1.1.4.2  rmind #define	  DBCR1_IAC12M_EXACT	  0x00000000 /*  equal IAC1 or IAC2 */
    181  1.1.4.2  rmind #define	  DBCR1_IAC12M_MASK	  0x00400000 /*  (addr & IAC2) == (IAC1 & IAC2) */
    182  1.1.4.2  rmind #define	  DBCR1_IAC12M_INCLUSIVE  0x00800000 /*  IAC1 <= addr < IAC2 */
    183  1.1.4.2  rmind #define	  DBCR1_IAC12M_EXCLUSIVE  0x00c00000 /*  addr < IAC1 || IAC2 <= addr */
    184  1.1.4.2  rmind #define	  DBCR1_IAC3US		  0x0000c000 /*  16-17: Data Address Compare 3 user/supervisor mode */
    185  1.1.4.2  rmind #define	  DBCR1_IAC3US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    186  1.1.4.2  rmind #define	  DBCR1_IAC3US_KERNEL	  0x00008000 /*  MSR[PR] = 0 */
    187  1.1.4.2  rmind #define	  DBCR1_IAC3US_USER	  0x0000c000 /*  MSR[PR] = 1 */
    188  1.1.4.2  rmind #define	  DBCR1_IAC3ER		  0x00003000 /*  18-19: Data Address Compare 3 effective/real mode */
    189  1.1.4.2  rmind #define	  DBCR1_IAC3ER_DSX	  0x00000000 /*  effective address */
    190  1.1.4.2  rmind #define	  DBCR1_IAC3ER_REAL	  0x00001000 /*  real address */
    191  1.1.4.2  rmind #define	  DBCR1_IAC3ER_DS0	  0x00002000 /*  effective address MSR[DS] = 0 */
    192  1.1.4.2  rmind #define	  DBCR1_IAC3ER_DS1	  0x00003000 /*  effective address MSR[DS] = 1 */
    193  1.1.4.2  rmind #define	  DBCR1_IAC4US		  0x00000c00 /*  20-21: Data Address Compare 3 user/supervisor mode */
    194  1.1.4.2  rmind #define	  DBCR1_IAC4US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    195  1.1.4.2  rmind #define	  DBCR1_IAC4US_KERNEL	  0x00000800 /*  MSR[PR] = 0 */
    196  1.1.4.2  rmind #define	  DBCR1_IAC4US_USER	  0x00000c00 /*  MSR[PR] = 1 */
    197  1.1.4.2  rmind #define	  DBCR1_IAC4ER		  0x00000300 /*  22-23: Data Address Compare 4 effective/real mode */
    198  1.1.4.2  rmind #define	  DBCR1_IAC4ER_DSX	  0x00000000 /*  effective address */
    199  1.1.4.2  rmind #define	  DBCR1_IAC4ER_REAL	  0x00000100 /*  real address */
    200  1.1.4.2  rmind #define	  DBCR1_IAC4ER_DS0	  0x00000200 /*  effective address MSR[DS] = 0 */
    201  1.1.4.2  rmind #define	  DBCR1_IAC4ER_DS1	  0x00000300 /*  effective address MSR[DS] = 1 */
    202  1.1.4.2  rmind #define	  DBCR1_IAC34M		  0x000000c0 /*  24-25: Data Address Compare 4 effective/real mode */
    203  1.1.4.2  rmind #define	  DBCR1_IAC34M_EXACT	  0x00000000 /*  equal IAC3 or IAC4 */
    204  1.1.4.2  rmind #define	  DBCR1_IAC34M_MASK	  0x00000040 /*  (addr & IAC4) == (IAC3 & IAC4) */
    205  1.1.4.2  rmind #define	  DBCR1_IAC34M_INCLUSIVE  0x00000080 /*  IAC3 <= addr < IAC4 */
    206  1.1.4.2  rmind #define	  DBCR1_IAC34M_EXCLUSIVE  0x000000c0 /*  addr < IAC3 || IAC4 <= addr */
    207      1.1   matt #define	SPR_DBCR2		310	/* E... Debug Control Register 2 */
    208  1.1.4.2  rmind #define	  DBCR2_DAC1US		  0xc0000000 /*  0-1: Data Address Compare 1 user/supervisor mode */
    209  1.1.4.2  rmind #define	  DBCR2_DAC1US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    210  1.1.4.2  rmind #define	  DBCR2_DAC1US_KERNEL	  0x80000000 /*  MSR[PR] = 0 */
    211  1.1.4.2  rmind #define	  DBCR2_DAC1US_USER	  0xc0000000 /*  MSR[PR] = 1 */
    212  1.1.4.2  rmind #define	  DBCR2_DAC1ER		  0x30000000 /*  2-3: Data Address Compare 1 effective/real mode */
    213  1.1.4.2  rmind #define	  DBCR2_DAC1ER_DSX	  0x00000000 /*  effective address */
    214  1.1.4.2  rmind #define	  DBCR2_DAC1ER_REAL	  0x10000000 /*  real address */
    215  1.1.4.2  rmind #define	  DBCR2_DAC1ER_DS0	  0x20000000 /*  effective address MSR[DS] = 0 */
    216  1.1.4.2  rmind #define	  DBCR2_DAC1ER_DS1	  0x30000000 /*  effective address MSR[DS] = 1 */
    217  1.1.4.2  rmind #define	  DBCR2_DAC2US		  0x0c000000 /*  4-5: Data Address Compare 1 user/supervisor mode */
    218  1.1.4.2  rmind #define	  DBCR2_DAC2US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    219  1.1.4.2  rmind #define	  DBCR2_DAC2US_KERNEL	  0x08000000 /*  MSR[PR] = 0 */
    220  1.1.4.2  rmind #define	  DBCR2_DAC2US_USER	  0x0c000000 /*  MSR[PR] = 1 */
    221  1.1.4.2  rmind #define	  DBCR2_DAC2ER		  0x03000000 /*  6-7: Data Address Compare 1 effective/real mode */
    222  1.1.4.2  rmind #define	  DBCR2_DAC2ER_DSX	  0x00000000 /*  effective address */
    223  1.1.4.2  rmind #define	  DBCR2_DAC2ER_REAL	  0x01000000 /*  real address */
    224  1.1.4.2  rmind #define	  DBCR2_DAC2ER_DS0	  0x02000000 /*  effective address MSR[DS] = 0 */
    225  1.1.4.2  rmind #define	  DBCR2_DAC2ER_DS1	  0x03000000 /*  effective address MSR[DS] = 1 */
    226  1.1.4.2  rmind #define	  DBCR2_DAC12M		  0x00c00000 /*  8-9: Data Address Compare 1 effective/real mode */
    227  1.1.4.2  rmind #define	  DBCR2_DAC12M_EXACT	  0x00000000 /*  equal DAC1 or DAC2 */
    228  1.1.4.2  rmind #define	  DBCR2_DAC12M_MASK	  0x00400000 /*  (addr & DAC2) == (DAC1 & DAC2) */
    229  1.1.4.2  rmind #define	  DBCR2_DAC12M_INCLUSIVE  0x00800000 /*  DAC1 <= addr < DAC2 */
    230  1.1.4.2  rmind #define	  DBCR2_DAC12M_EXCLUSIVE  0x00c00000 /*  addr < DAC1 || DAC2 <= addr */
    231  1.1.4.2  rmind #define	  DBCR2_DAC3US		  0x0000c000 /*  16-17: Data Address Compare 3 user/supervisor mode */
    232  1.1.4.2  rmind #define	  DBCR2_DAC3US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    233  1.1.4.2  rmind #define	  DBCR2_DAC3US_KERNEL	  0x00008000 /*  MSR[PR] = 0 */
    234  1.1.4.2  rmind #define	  DBCR2_DAC3US_USER	  0x0000c000 /*  MSR[PR] = 1 */
    235  1.1.4.2  rmind #define	  DBCR2_DAC3ER		  0x00003000 /*  18-19: Data Address Compare 3 effective/real mode */
    236  1.1.4.2  rmind #define	  DBCR2_DAC3ER_DSX	  0x00000000 /*  effective address */
    237  1.1.4.2  rmind #define	  DBCR2_DAC3ER_REAL	  0x00001000 /*  real address */
    238  1.1.4.2  rmind #define	  DBCR2_DAC3ER_DS0	  0x00002000 /*  effective address MSR[DS] = 0 */
    239  1.1.4.2  rmind #define	  DBCR2_DAC3ER_DS1	  0x00003000 /*  effective address MSR[DS] = 1 */
    240  1.1.4.2  rmind #define	  DBCR2_DAC4US		  0x00000c00 /*  20-21: Data Address Compare 3 user/supervisor mode */
    241  1.1.4.2  rmind #define	  DBCR2_DAC4US_ANY	  0x00000000 /*  MSR[PR] = don't care */
    242  1.1.4.2  rmind #define	  DBCR2_DAC4US_KERNEL	  0x00000800 /*  MSR[PR] = 0 */
    243  1.1.4.2  rmind #define	  DBCR2_DAC4US_USER	  0x00000c00 /*  MSR[PR] = 1 */
    244  1.1.4.2  rmind #define	  DBCR2_DAC4ER		  0x00000300 /*  22-23: Data Address Compare 4 effective/real mode */
    245  1.1.4.2  rmind #define	  DBCR2_DAC4ER_DSX	  0x00000000 /*  effective address */
    246  1.1.4.2  rmind #define	  DBCR2_DAC4ER_REAL	  0x00000100 /*  real address */
    247  1.1.4.2  rmind #define	  DBCR2_DAC4ER_DS0	  0x00000200 /*  effective address MSR[DS] = 0 */
    248  1.1.4.2  rmind #define	  DBCR2_DAC4ER_DS1	  0x00000300 /*  effective address MSR[DS] = 1 */
    249  1.1.4.2  rmind #define	  DBCR2_DAC34M		  0x000000c0 /*  24-25: Data Address Compare 4 effective/real mode */
    250  1.1.4.2  rmind #define	  DBCR2_DAC34M_EXACT	  0x00000000 /*  equal DAC3 or DAC4 */
    251  1.1.4.2  rmind #define	  DBCR2_DAC34M_MASK	  0x00000040 /*  (addr & DAC4) == (DAC3 & DAC4) */
    252  1.1.4.2  rmind #define	  DBCR2_DAC34M_INCLUSIVE  0x00000080 /*  DAC3 <= addr < DAC4 */
    253  1.1.4.2  rmind #define	  DBCR2_DAC34M_EXCLUSIVE  0x000000c0 /*  addr < DAC3 || DAC4 <= addr */
    254      1.1   matt #define	SPR_IAC1		312	/* E... Instruction Address Compare 1 */
    255      1.1   matt #define	SPR_IAC2		313	/* E... Instruction Address Compare 2 */
    256      1.1   matt #define	SPR_IAC3		314	/* E... Instruction Address Compare 3 */
    257      1.1   matt #define	SPR_IAC4		315	/* E... Instruction Address Compare 4 */
    258      1.1   matt #define	SPR_DAC1		316	/* E... Data Address Compare 1 */
    259      1.1   matt #define	SPR_DAC2		317	/* E... Data Address Compare 2 */
    260      1.1   matt #define	SPR_TSR			336	/* E... Timer Status Register */
    261      1.1   matt #define   TSR_ENW		  0x80000000 /* Enable Next Watchdog (W1C) */
    262      1.1   matt #define   TSR_WIS		  0x40000000 /* Watchdog Interrupt Status (W1C) */
    263      1.1   matt #define   TSR_WRS		  0x30000000 /* Watchdog Reset Status (W1C) */
    264      1.1   matt #define   TSR_DIS		  0x08000000 /* Decementer Interrupt Status (W1C) */
    265      1.1   matt #define   TSR_FIS		  0x04000000 /* Fixed-interval Interrupt Status (W1C) */
    266      1.1   matt #define	SPR_TCR			340	/* E... Timer Control Register */
    267      1.1   matt #define   TCR_WP		  0xc0000000 /* Watchdog Period */
    268  1.1.4.2  rmind #define	  TCR_WP_2_N(n)		  (__SHIFTIN((n), TCR_WP) | __SHIFTIN((n) >> 2, TCR_WPEXT))
    269  1.1.4.1  rmind #define	  TCR_WP_2_64		  0x00000000
    270  1.1.4.1  rmind #define	  TCR_WP_2_1		  0xc01e0000
    271      1.1   matt #define   TCR_WRC		  0x30000000 /* Watchdog Timer Reset Control */
    272  1.1.4.2  rmind #define   TCR_WRC_RESET		  0x20000000
    273      1.1   matt #define   TCR_WIE		  0x08000000 /* Watchdog Time Interrupt Enable */
    274      1.1   matt #define   TCR_DIE		  0x04000000 /* Decremnter Interrupt Enable */
    275      1.1   matt #define   TCR_FP		  0x03000000 /* Fixed-interval Timer Period */
    276  1.1.4.2  rmind #define	  TCR_FP_2_N(n)		  ((((64 - (n)) & 0x30) << 20) | (((64 - (n)) & 0xf) << 13))
    277  1.1.4.1  rmind #define	  TCR_FP_2_64		  0x00000000
    278  1.1.4.1  rmind #define	  TCR_FP_2_1		  0x0301e000
    279      1.1   matt #define   TCR_FIE		  0x00800000 /* Fixed-interval Interrupt Enable */
    280      1.1   matt #define   TCR_ARE		  0x00400000 /* Auto-reload Enable */
    281  1.1.4.1  rmind #define   TCR_WPEXT		  0x001e0000 /* Watchdog Period Extension */
    282  1.1.4.1  rmind #define   TCR_FPEXT		  0x0001e000 /* Fixed-interval Period Extension */
    283      1.1   matt 
    284      1.1   matt #define	SPR_IVOR0		400	/* E... Critical input interrupt offset */
    285      1.1   matt #define	SPR_IVOR1		401	/* E... Machine check interrupt offset */
    286      1.1   matt #define	SPR_IVOR2		402	/* E... Data storage interrupt offset */
    287      1.1   matt #define	SPR_IVOR3		403	/* E... Instruction storage interrupt offset */
    288      1.1   matt #define	SPR_IVOR4		404	/* E... External input interrupt offset */
    289      1.1   matt #define	SPR_IVOR5		405	/* E... Alignment interrupt offset */
    290      1.1   matt #define	SPR_IVOR6		406	/* E... Program interrupt offset */
    291      1.1   matt #define	SPR_IVOR8		408	/* E... Syscall call interrupt offset */
    292      1.1   matt #define	SPR_IVOR10		410	/* E... Decrementer interrupt offset */
    293      1.1   matt #define	SPR_IVOR11		411	/* E... Fixed-interval timer interrupt offset */
    294      1.1   matt #define	SPR_IVOR12		412	/* E... Watchdog timer interrupt offset */
    295      1.1   matt #define	SPR_IVOR13		413	/* E... Data TLB error interrupt offset */
    296      1.1   matt #define	SPR_IVOR14		414	/* E... Instruction TLB error interrupt offset */
    297      1.1   matt #define	SPR_IVOR15		415	/* E... Debug interrupt offset */
    298      1.1   matt #define SPR_SPEFSCR		512	/* E... Signal processing and embedded floating-point status and control register */
    299      1.1   matt #define  SPEFSCR_SOVH		  0x80000000 /* 0: Summary Integer Overflow High */
    300      1.1   matt #define  SPEFSCR_OVH		  0x40000000 /* 1: Integer Overflow High */
    301      1.1   matt #define  SPEFSCR_FGH		  0x20000000 /* 2: Embedded Floating-Point Guard Bit High */
    302      1.1   matt #define  SPEFSCR_FXH		  0x10000000 /* 3: Embedded Floating-Point Sticky Bit High */
    303      1.1   matt #define  SPEFSCR_FINVH		  0x08000000 /* 4: Embedded Floating-Point Invalid Operation High */
    304      1.1   matt #define  SPEFSCR_FDBZH		  0x04000000 /* 5: Embedded Floating-Point Divide By Zero Error High */
    305      1.1   matt #define  SPEFSCR_FUNFH		  0x02000000 /* 6: Embedded Floating-Point Underflow Error High */
    306      1.1   matt #define  SPEFSCR_FOVFH		  0x01000000 /* 7: Embedded Floating-Point Overflow Error High */
    307      1.1   matt #define  SPEFSCR_FINXS		  0x00200000 /* 10: Embedded Floating-Point Inexact Sticky Bit */
    308      1.1   matt #define  SPEFSCR_FINVS		  0x00100000 /* 11: Embedded Floating-Point Invalid Operation Sticky Bit */
    309      1.1   matt #define  SPEFSCR_FDBZS		  0x00080000 /* 12: Embedded Floating-Point Divide By Zero Sticky Bit */
    310      1.1   matt #define  SPEFSCR_FUNFS		  0x00040000 /* 13: Embedded Floating-Point Underflow Sticky Bit */
    311      1.1   matt #define  SPEFSCR_FOVFS		  0x00020000 /* 14: Embedded Floating-Point Overflow Sticky Bit */
    312      1.1   matt #define  SPEFSCR_MODE		  0x00010000 /* 15: Embedded Floating-Point Mode */
    313      1.1   matt #define  SPEFSCR_SOV		  0x80000000 /* 16: Summary Integer Overflow */
    314      1.1   matt #define  SPEFSCR_OV		  0x00004000 /* 17: Integer Overflow */
    315      1.1   matt #define  SPEFSCR_FG		  0x00002000 /* 18: Embedded Floating-Point Guard Bit */
    316      1.1   matt #define  SPEFSCR_FX		  0x00001000 /* 19: Embedded Floating-Point Sticky Bit */
    317      1.1   matt #define  SPEFSCR_FINV		  0x00000800 /* 20: Embedded Floating-Point Invalid Operation */
    318      1.1   matt #define  SPEFSCR_FDBZ		  0x00000400 /* 21: Embedded Floating-Point Divide By Zero Error */
    319      1.1   matt #define  SPEFSCR_FUNF		  0x00000200 /* 22: Embedded Floating-Point Underflow Error */
    320      1.1   matt #define  SPEFSCR_FOVF		  0x00000100 /* 23: Embedded Floating-Point Overflow Error */
    321      1.1   matt #define  SPEFSCR_FINXE		  0x00000040 /* 25: Embedded Floating-Point Inexact Execption Enable */
    322      1.1   matt #define  SPEFSCR_FINVE		  0x00000020 /* 26: Embedded Floating-Point Invalid Operation/Input Error Execption Enable */
    323      1.1   matt #define  SPEFSCR_FDBZE		  0x00000010 /* 27: Embedded Floating-Point Divide By Zero Exception Enable */
    324      1.1   matt #define  SPEFSCR_FUNFE		  0x00000008 /* 28: Embedded Floating-Point Underflow Exception Enable */
    325      1.1   matt #define  SPEFSCR_FOVFE		  0x00000004 /* 29: Embedded Floating-Point Overflow Exception Enable */
    326      1.1   matt #define  SPEFSCR_FRMC_MASK	  0x00000003 /* 30..31: Embedded Floating-Point Rounding Mode Control */
    327      1.1   matt #define  SPEFSCR_FRMC_DOWNWARD	  0x00000003 /* Round toward -infinity */
    328      1.1   matt #define  SPEFSCR_FRMC_UPWARD	  0x00000002 /* Round toward +infinity */
    329      1.1   matt #define  SPEFSCR_FRMC_TOWARDZERO  0x00000001 /* Round toward zero */
    330      1.1   matt #define  SPEFSCR_FRMC_TONEAREST	  0x00000000 /* Round to nearest */
    331      1.1   matt #define	SPR_BBEAR		513	/* E... Brach buffer entry addr register */
    332      1.1   matt #define	SPR_BBTAR		514	/* E... Brach buffer target addr register */
    333      1.1   matt #define	SPR_L1CFG0		515	/* E... L1 Cache Configuration Register 0 */
    334      1.1   matt #define	SPR_L1CFG1		516	/* E... L1 Cache Configuration Register 1 */
    335      1.1   matt #define   L1CFG_CARCH_GET(n)	  (((n) >> 30) & 3)
    336      1.1   matt #define   L1CFG_CARCH_HARVARD	  0
    337      1.1   matt #define   L1CFG_CARCH_UNIFIED	  1
    338      1.1   matt #define   L1CFG_CBSIZE_GET(n)	  (((n) >> 23) & 3)
    339      1.1   matt #define   L1CFG_CBSIZE_32B	  0
    340      1.1   matt #define   L1CFG_CBSIZE_64B	  1
    341      1.1   matt #define   L1CFG_CREPL_GET(n)	  (((n) >> 21) & 3)
    342      1.1   matt #define   L1CFG_CREPL_TRUE_LRU	  0
    343      1.1   matt #define   L1CFG_CREPL_PSEUDO_LRU  1
    344      1.1   matt #define   L1CFG_CLA_P(n)	  (((n) >> 20) & 1)
    345      1.1   matt #define   L1CFG_CPA_P(n)	  (((n) >> 19) & 1)
    346  1.1.4.2  rmind #define   L1CFG_CNWAY_GET(n)	  ((((n) >> 11) & 0xff) + 1)
    347      1.1   matt #define   L1CFG_CSIZE_GET(n)	  ((((n) >>  0) & 0x7ff) << 10)
    348      1.1   matt #define	SPR_ATBL		526	/* E... Alternate Time Base Lower */
    349      1.1   matt #define	SPR_ATBU		527	/* E... Alternate Time Base Upper */
    350      1.1   matt #define	SPR_IVOR32		528	/* E... SPE unavailable interrupt offset */
    351      1.1   matt #define	SPR_IVOR33		529	/* E... Floating-point data exception interrupt offset */
    352      1.1   matt #define	SPR_IVOR34		530	/* E... Floating-point round exception interrupt offset */
    353      1.1   matt #define	SPR_IVOR35		531	/* E... Performance monitor interrupt offset */
    354      1.1   matt #define SPR_MCARU		569	/* E... Machine check address register upper */
    355      1.1   matt #define SPR_MCSRR0		570	/* E... Machine check save/restore register 0 */
    356      1.1   matt #define SPR_MCSRR1		571	/* E... Machine check save/restore register 1 */
    357      1.1   matt #define SPR_MCSR		572	/* E... Machine check syndrome register */
    358      1.1   matt #define   MCSR_MCP		  0x80000000 /* 0: Machine Check Input Pin */
    359      1.1   matt #define   MCSR_ICPERR		  0x40000000 /* 1: Instruction Cache Parity Error */
    360      1.1   matt #define   MCSR_DCP_PERR		  0x20000000 /* 2: Data Cache Push Parity Error */
    361      1.1   matt #define   MCSR_DCPERR		  0x10000000 /* 3: Data Cache Parity Error */
    362      1.1   matt #define   MCSR_NMI		  0x00100000 /* 12: non maskable interrupt */
    363      1.1   matt #define   MCSR_MAV		  0x00080000 /* 13: MCAR address valid */
    364      1.1   matt #define   MCSR_MEA		  0x00040000 /* 14: MCAR [is an] effective address */
    365      1.1   matt #define   MCSR_BUS_IAERR	  0x00000080 /* 24: Bus Instruction Address Error */
    366      1.1   matt #define   MCSR_BUS_RAERR	  0x00000040 /* 25: Bus Read Address Error */
    367      1.1   matt #define   MCSR_BUS_WAERR	  0x00000020 /* 26: Bus Write Address Error */
    368      1.1   matt #define   MCSR_BUS_IBERR	  0x00000010 /* 27: Bus Instruction Data Bus Error */
    369      1.1   matt #define   MCSR_BUS_RBERR	  0x00000008 /* 28: Bus Read Data Bus Error */
    370      1.1   matt #define   MCSR_BUS_WBERR	  0x00000004 /* 29: Bus Write Data Bus Error */
    371      1.1   matt #define   MCSR_BUS_IPERR	  0x00000002 /* 30: Bus Instruction Parity Error */
    372      1.1   matt #define   MCSR_BUS_RPERR	  0x00000001 /* 31: Bus Read Parity Error */
    373      1.1   matt #define SPR_MCAR		573	/* E... Machine check address register */
    374      1.1   matt #define	SPR_MAS0		624	/* E... MAS Register 0 */
    375  1.1.4.2  rmind #define   MAS0_TLBSEL		  0x30000000 /* Select TLB<n> for access */
    376  1.1.4.2  rmind #define   MAS0_TLBSEL_TLB3	  0x30000000 /* Select TLB3 for access */
    377  1.1.4.2  rmind #define   MAS0_TLBSEL_TLB2	  0x20000000 /* Select TLB2 for access */
    378  1.1.4.2  rmind #define   MAS0_TLBSEL_TLB1	  0x10000000 /* Select TLB1 for access */
    379      1.1   matt #define   MAS0_TLBSEL_TLB0	  0x00000000 /* Select TLB0 for access */
    380      1.1   matt #define   MASX_TLBSEL_GET(n)	  (((n) >> 28) & 3)
    381      1.1   matt #define   MASX_TLBSEL_MAKE(n)	  (((n) & 3) << 28)
    382      1.1   matt #define   MAS0_ESEL		  0x0fff0000 /* entry (way) select for tlbwe */
    383      1.1   matt #define   MAS0_ESEL_GET(n)	  (((n) >> 16) & 4095)
    384      1.1   matt #define   MAS0_ESEL_MAKE(n)	  (((n) & 4095) << 16)
    385      1.1   matt #define   MAS0_NV		  0x00000fff /* next victim fr TLB0[NV] */
    386      1.1   matt #define	SPR_MAS1		625	/* E... MAS Register 1 */
    387      1.1   matt #define	  MAS1_V		  0x80000000 /* TLB Valid Bit */
    388      1.1   matt #define   MAS1_IPROT		  0x40000000 /* Invalidate Protect */
    389      1.1   matt #define   MAS1_TID		  0x0fff0000 /* Translation Identity */
    390      1.1   matt #define   MASX_TID_GET(n)	  (((n) >> 16) & 4095)
    391      1.1   matt #define   MASX_TID_MAKE(n)	  (((n) & 4095) << 16)
    392      1.1   matt #define   MAS1_TS		  0x00001000 /* Translation Space [IS/DS MSR] */
    393      1.1   matt #define	  MAS1_TS_SHIFT		  12
    394      1.1   matt #define   MAS1_TSIZE		  0x00000f00 /* Translation Size (4KB**tsize) */
    395  1.1.4.2  rmind #define   MASX_TSIZE_4KB	  0x00000100 /*   4KB TSIZE */
    396  1.1.4.2  rmind #define   MASX_TSIZE_16KB	  0x00000200 /*  16KB TSIZE */
    397  1.1.4.2  rmind #define   MASX_TSIZE_64KB	  0x00000300 /*  64KB TSIZE */
    398  1.1.4.2  rmind #define   MASX_TSIZE_256KB	  0x00000400 /* 256KB TSIZE */
    399  1.1.4.2  rmind #define   MASX_TSIZE_1MB	  0x00000500 /*   1MB TSIZE */
    400  1.1.4.2  rmind #define   MASX_TSIZE_4MB	  0x00000600 /*   4MB TSIZE */
    401  1.1.4.2  rmind #define   MASX_TSIZE_16MB	  0x00000700 /*  16MB TSIZE */
    402  1.1.4.2  rmind #define   MASX_TSIZE_64MB	  0x00000800 /*  64MB TSIZE */
    403  1.1.4.2  rmind #define   MASX_TSIZE_256MB	  0x00000900 /* 256MB TSIZE */
    404  1.1.4.2  rmind #define   MASX_TSIZE_1GB	  0x00000a00 /*   1GB TSIZE */
    405  1.1.4.2  rmind #define   MASX_TSIZE_4GB	  0x00000b00 /*   4GB TSIZE */
    406      1.1   matt #define   MASX_TSIZE_GET(n)	  (((n) >> 8) & 15)
    407      1.1   matt #define   MASX_TSIZE_MAKE(n)	  (((n) & 15) << 8)
    408      1.1   matt #define	SPR_MAS2		626	/* E... MAS Register 2 */
    409      1.1   matt #define   MAS2_EPN		  0xfffff000 /* Effective Page Number */
    410      1.1   matt #define   MAS2_EPN_GET(n)	  (((n) >> 12) & 1048575)
    411      1.1   matt #define   MAS2_EPN_MAKE(n)	  (((n) & 1048575) << 12)
    412      1.1   matt #define	  MAS2_X0		  0x00000040 /* Impl. dependent page attr. */
    413      1.1   matt #define	  MAS2_ACM		  0x000000c0 /* Alternate Coherency Mode. */
    414      1.1   matt #define	  MAS2_X1		  0x00000020 /* Impl. dependent page attr. */
    415      1.1   matt #define	  MAS2_VLE		  0x00000020 /* VLE mode. */
    416      1.1   matt #define	  MAS2_WIMGE		  0x0000001f /* Mask of next 5 bits */
    417      1.1   matt #define	  MAS2_W		  0x00000010 /* Write-through */
    418      1.1   matt #define	  MAS2_I		  0x00000008 /* cache-Inhibited */
    419      1.1   matt #define	  MAS2_M		  0x00000004 /* Memory coherency required */
    420      1.1   matt #define	  MAS2_G		  0x00000002 /* Gaurded */
    421      1.1   matt #define	  MAS2_E		  0x00000001 /* [little] Endianness */
    422      1.1   matt #define	SPR_MAS3		627	/* E... MAS Register 3 */
    423      1.1   matt #define   MAS3_RPN		  0xfffff000 /* Real Page Number */
    424      1.1   matt #define   MAS3_RPN_GET(n)	  (((n) >> 12) & 1048575)
    425      1.1   matt #define   MAS3_RPN_MAKE(n)	  (((n) & 1048575) << 12)
    426      1.1   matt #define   MAS3_U0		  0x00000200 /* User attribute 0 */
    427      1.1   matt #define   MAS3_U1		  0x00000100 /* User attribute 1 */
    428      1.1   matt #define   MAS3_U2		  0x00000080 /* User attribute 2 */
    429      1.1   matt #define   MAS3_U3		  0x00000040 /* User attribute 3 */
    430      1.1   matt #define   MAS3_UX		  0x00000020 /* User execute permission */
    431      1.1   matt #define   MAS3_SX		  0x00000010 /* System execute permission */
    432      1.1   matt #define   MAS3_UW		  0x00000008 /* User write permission */
    433      1.1   matt #define   MAS3_SW		  0x00000004 /* System write permission */
    434      1.1   matt #define   MAS3_UR		  0x00000002 /* User read permission */
    435      1.1   matt #define   MAS3_SR		  0x00000001 /* System read permission */
    436      1.1   matt #define	SPR_MAS4		628	/* E... MAS Register 4 */
    437      1.1   matt #define   MAS4_TLBSELD		  0x30000000 /* TLBSEL default value */
    438  1.1.4.2  rmind #define   MAS4_TLBSEL_TLB3	  0x30000000 /* Select TLB3 for access */
    439  1.1.4.2  rmind #define   MAS4_TLBSEL_TLB2	  0x20000000 /* Select TLB2 for access */
    440  1.1.4.2  rmind #define   MAS4_TLBSEL_TLB1	  0x10000000 /* Select TLB1 for access */
    441  1.1.4.2  rmind #define   MAS4_TLBSEL_TLB0	  0x00000000 /* Select TLB0 for access */
    442  1.1.4.2  rmind #define   MAS4_TIDSELD		  0x00030000 /* select TID default value */
    443  1.1.4.2  rmind #define   MAS4_TIDSELD_TIDZ	  0x00030000 /* fill in MAS1[TID] with 0 */
    444  1.1.4.2  rmind #define   MAS4_TIDSELD_PID2	  0x00020000 /* fill in MAS1[TAD] from ... */
    445  1.1.4.2  rmind #define   MAS4_TIDSELD_PID1	  0x00010000 /* fill in MAS1[TAD] from ... */
    446  1.1.4.2  rmind #define   MAS4_TIDSELD_PID0	  0x00000000 /* fill in MAS1[TAD] from ... */
    447      1.1   matt #define   MAS4_TSIZED		  0x00000f00 /* TSIZE default value */
    448  1.1.4.2  rmind #define   MAS4_TSIZED_4KB	  0x00000100 /* 4KB TSIZE */
    449      1.1   matt #define	  MAS4_ACMD		  0x000000c0 /* Alternate Coherency Mode. */
    450      1.1   matt #define	  MAS4_X0D		  0x00000040 /* default Impl. dep. page attr. */
    451      1.1   matt #define	  MAS4_VLED		  0x00000020 /* VLE mode. */
    452      1.1   matt #define	  MAS4_X1D		  0x00000020 /* default Impl. dep. page attr. */
    453      1.1   matt #define	  MAS4_WD		  0x00000010 /* default Write-through */
    454      1.1   matt #define	  MAS4_ID		  0x00000008 /* default Cache-inhibited */
    455      1.1   matt #define	  MAS4_MD		  0x00000004 /* default Memory coherency req. */
    456      1.1   matt #define	  MAS4_GD		  0x00000002 /* default Gaurded */
    457      1.1   matt #define	  MAS4_ED		  0x00000001 /* default [little] Endianness */
    458      1.1   matt #define	SPR_MAS6		630	/* E... MAS Register 6 (TLB Seach CTX) */
    459      1.1   matt #define   MAS6_SPID0		  0x0fff0000 /* PID used with tlbsx */
    460      1.1   matt #define	  MAS6_SPID0_SHIFT	  16
    461      1.1   matt #define   MAS6_SAS		  0x00000001 /* Address space (IS/DS MSR) ... */
    462      1.1   matt #define   MAS6_SAS_USER		  0x00000001 /* Address space (IS/DS MSR) ... */
    463      1.1   matt #define	SPR_PID1		633	/* E... PID Register 1 */
    464      1.1   matt #define	SPR_PID2		634	/* E... PID Register 2 */
    465      1.1   matt #define	SPR_TLB0CFG		688	/* E... TLB Configuration Register 0 */
    466      1.1   matt #define	SPR_TLB1CFG		689	/* E... TLB Configuration Register 1 */
    467      1.1   matt #define	  TLBCFG_ASSOC(n)	  (((n) >> 24) & 0xff) /* assoc of tlb */
    468      1.1   matt #define	  TLBCFG_MINSIZE(n)	  (((n) >> 20) & 0x0f) /* minpagesize */
    469      1.1   matt #define	  TLBCFG_MAXSIZE(n)	  (((n) >> 16) & 0x0f) /* maxpagesize */
    470      1.1   matt #define	  TLBCFG_IPROT_P(n)	  (((n) >> 15) & 0x01)
    471      1.1   matt #define	  TLBCFG_AVAIL_P(n)	  (((n) >> 14) & 0x01) /* variable page size */
    472      1.1   matt #define	  TLBCFG_NENTRY(n)	  (((n) >>  0) & 0xfff) /* # entrys */
    473      1.1   matt #define	SPR_MAS7		944	/* E... MAS Register 7 */
    474      1.1   matt #define	 MAS7_RPNHI		  0x00000004 /* bits 32-35 of RPN */
    475      1.1   matt #define	SPR_HID0		1008
    476  1.1.4.2  rmind #define   HID0_EMCP		  0x80000000 /* Enable Machine Check Pin */
    477  1.1.4.2  rmind #define   HID0_DOZE		  0x00800000 /* Core in doze mode */
    478  1.1.4.2  rmind #define   HID0_NAP		  0x00400000 /* Core in nap mode */
    479  1.1.4.2  rmind #define   HID0_SLEEP		  0x00200000 /* Core in sleep mode */
    480  1.1.4.2  rmind #define   HID0_TBEN		  0x00004000 /* Time Base ENable */
    481  1.1.4.2  rmind #define   HID0_SEL_TBCLK	  0x00002000 /* SELect Time Base Clock */
    482  1.1.4.2  rmind #define   HID0_EN_MAS7_UPDATE	  0x00000080 /* ENable MAS7 UPDATE */
    483  1.1.4.2  rmind #define   HID0_DCFA		  0x00000040 /* Data Cache Flush Assist */
    484  1.1.4.2  rmind #define   HID0_NOOPTI		  0x00000001 /* NO-OP Touch Instructions */
    485      1.1   matt #define	SPR_HID1		1009
    486  1.1.4.4  rmind #define   HID1_ASTME		  0x00004000 /* Address Streaming Enable */
    487  1.1.4.4  rmind #define   HID1_ABE		  0x00001000 /* Address Broadcast Enable */
    488      1.1   matt #define	SPR_L1CSR0		1010	/* E... L1 Cache Control and Status Register 0 (Data) */
    489      1.1   matt #define	SPR_L1CSR1		1011	/* E... L1 Cache Control and Status Register 1 (Instruction) */
    490      1.1   matt #define   L1CSR_CPE		  0x00010000 /* 15: Cache Parity Error */
    491      1.1   matt #define   L1CSR_CPI		  0x00008000 /* 16: Cache Parity Injection Enable */
    492      1.1   matt #define   L1CSR_CSLC		  0x00000800 /* 20: Cache Snoop Lock Clear */
    493      1.1   matt #define   L1CSR_CUL		  0x00000400 /* 21: Cache Unable to Lock (W0C) */
    494      1.1   matt #define   L1CSR_CLO		  0x00000200 /* 22: Cache Lock Overflow (W0C) */
    495      1.1   matt #define   L1CSR_CLFR		  0x00000100 /* 23: Cache Lock Bits Flash Reset */
    496      1.1   matt #define   L1CSR_CFI		  0x00000002 /* 30: Cache Flash Invalidate */
    497      1.1   matt #define   L1CSR_CE		  0x00000001 /* 31: Cache Enable */
    498      1.1   matt #define	SPR_MMUCSR0		1012	/* E... MMU Control and Status Register 0 */
    499      1.1   matt #define	  MMUCSR0_TLB2_FI	  0x00000040 /* TLB2 Flash Invalidate */
    500      1.1   matt #define	  MMUCSR0_TLB3_FI	  0x00000020 /* TLB3 Flash Invalidate */
    501      1.1   matt #define	  MMUCSR0_TLB0_FI	  0x00000004 /* TLB0 Flash Invalidate */
    502      1.1   matt #define	  MMUCSR0_TLB1_FI	  0x00000002 /* TLB1 Flash Invalidate */
    503      1.1   matt #define SPR_BUCSR		1013	/* E... Branch Unit Control and Status Register */
    504      1.1   matt #define	SPR_MMUCFG		1015	/* E... MMU Configuration Register */
    505      1.1   matt #define   MMUCFG_RASIZE_GET(n)	  (((n) >> 17) & 127) /* Real Address Size */
    506      1.1   matt #define	  MMUCFG_NPIDS_GET(n)	  (((n) >> 11) & 15) /* # of PID registers */
    507      1.1   matt #define	  MMUCFG_PIDSIZE_GET(n)	  (((n) >> 6) & 31) /* PID is PIDSIZE+1 bits wide */
    508      1.1   matt #define	  MMUCFG_NTLBS_GET(n)	  (((n) >> 2) & 3) /* NTLBS is max value of MAS0[TLBSEL] */
    509      1.1   matt #define	  MMUCFG_MAVN		  0x00000003 /* MMU Architecture Version Number */
    510      1.1   matt #define	  MMUCFG_MAVN_V1	  0
    511      1.1   matt #define	SPR_SVR			1023	/* E... System Version Register */
    512      1.1   matt 
    513      1.1   matt #define	PMR_PMC0		16
    514      1.1   matt #define	PMR_PMC1		17
    515      1.1   matt #define	PMR_PMC2		18
    516      1.1   matt #define	PMR_PMC3		19
    517      1.1   matt #define	PMR_PMLCa0		144
    518      1.1   matt #define	PMR_PMLCa1		145
    519      1.1   matt #define	PMR_PMLCa2		146
    520      1.1   matt #define	PMR_PMLCa3		147
    521      1.1   matt #define   PMLCa_FC		  0x80000000 /* 0: Freeze Counter */
    522      1.1   matt #define   PMLCa_FCS		  0x40000000 /* 1: Freeze Counter In Super */
    523      1.1   matt #define   PMLCa_FCU		  0x20000000 /* 2: Freeze Counter In User */
    524      1.1   matt #define   PMLCa_FCM1		  0x10000000 /* 3: Freeze Counter While Mark=1 */
    525      1.1   matt #define   PMLCa_FCM0		  0x08000000 /* 4: Freeze Counter While Mark=0 */
    526      1.1   matt #define   PMLCa_CE		  0x04000000 /* 5: Condition Enable */
    527      1.1   matt #define   PMLCa_EVENT		  0x007f0000 /* 9..15: Event */
    528      1.1   matt #define   PMLCa_EVENT_GET(n)	  (((n) >> 16) & 127)
    529      1.1   matt #define   PMLCa_EVENT_MAKE(n)	  (((n) & 127) << 16)
    530      1.1   matt 
    531      1.1   matt #define	PMR_PMLCb0		272
    532      1.1   matt #define	PMR_PMLCb1		273
    533      1.1   matt #define	PMR_PMLCb2		274
    534      1.1   matt #define	PMR_PMLCb3		275
    535      1.1   matt #define   PMLCb_THRESHMUL	  0x00007f00 /* 21..23: multiply threshold by 2**<n> */
    536      1.1   matt #define   PMLCb_THRESHMUL_GET(n)  (((n) >> 16) & 127)
    537      1.1   matt #define   PMLCb_THRESHMUL_MAKE(n) (((n) & 127) << 16)
    538      1.1   matt #define   PMLCb_THRESHOLD	  0x0000003f /* 26..31: threshold */
    539      1.1   matt #define   PMLCb_THRESHOLD_GET(n)  (((n) >> 0) & 63)
    540      1.1   matt #define   PMLCb_THRESHOLD_MAKE(n) (((n) & 63) << 0)
    541      1.1   matt #define	PMR_PMGC0		400
    542      1.1   matt #define   PMGC0_FAC		  0x80000000 /* 0: Freeze All Counters */
    543      1.1   matt #define	  PMGC0_PMIE		  0x40000000 /* 1: Performance Monitor Interrupt Enable */
    544      1.1   matt #define	  PMGC0_FCECE		  0x40000000 /* 1: Freeze count on enabled condition or event */
    545      1.1   matt #define   PMGC0_TBSEL		  0x00001800 /* 19..20: Time base selector */
    546      1.1   matt #define   PMGC0_TBEE		  0x00000100 /* 23: Time base transition event exception enable */
    547      1.1   matt 
    548      1.1   matt #define	PMR_UPMC0			(PMR_PMC0 - 16)
    549      1.1   matt #define	PMR_UPMC1			(PMR_PMC1 - 16)
    550      1.1   matt #define	PMR_UPMC2			(PMR_PMC2 - 16)
    551      1.1   matt #define	PMR_UPMC3			(PMR_PMC3 - 16)
    552      1.1   matt #define	PMR_UPMLCa0			(PMR_PMLCa0 - 16)
    553      1.1   matt #define	PMR_UPMLCa1			(PMR_PMLCa1 - 16)
    554      1.1   matt #define	PMR_UPMLCa2			(PMR_PMLCa2 - 16)
    555      1.1   matt #define	PMR_UPMLCa3			(PMR_PMLCa3 - 16)
    556      1.1   matt #define	PMR_UPMLCb0			(PMR_PMLCb0 - 16)
    557      1.1   matt #define	PMR_UPMLCb1			(PMR_PMLCb1 - 16)
    558      1.1   matt #define	PMR_UPMLCb2			(PMR_PMLCb2 - 16)
    559      1.1   matt #define	PMR_UPMLCb3			(PMR_PMLCb3 - 16)
    560      1.1   matt #define	PMR_UPMGC0			(PMR_PMGC0 - 16)
    561      1.1   matt 
    562  1.1.4.2  rmind #endif /* !_POWERPC_BOOKE_SPR_H_ */
    563