Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Register definitions specific to the A2 core
0004  *
0005  *  Copyright (C) 2008 Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp.
0006  */
0007 
0008 #ifndef __ASM_POWERPC_REG_A2_H__
0009 #define __ASM_POWERPC_REG_A2_H__
0010 
0011 #include <asm/asm-const.h>
0012 
0013 #define SPRN_TENSR  0x1b5
0014 #define SPRN_TENS   0x1b6   /* Thread ENable Set */
0015 #define SPRN_TENC   0x1b7   /* Thread ENable Clear */
0016 
0017 #define SPRN_A2_CCR0    0x3f0   /* Core Configuration Register 0 */
0018 #define SPRN_A2_CCR1    0x3f1   /* Core Configuration Register 1 */
0019 #define SPRN_A2_CCR2    0x3f2   /* Core Configuration Register 2 */
0020 #define SPRN_MMUCR0 0x3fc   /* MMU Control Register 0 */
0021 #define SPRN_MMUCR1 0x3fd   /* MMU Control Register 1 */
0022 #define SPRN_MMUCR2 0x3fe   /* MMU Control Register 2 */
0023 #define SPRN_MMUCR3 0x3ff   /* MMU Control Register 3 */
0024 
0025 #define SPRN_IAR    0x372
0026 
0027 #define SPRN_IUCR0  0x3f3
0028 #define IUCR0_ICBI_ACK  0x1000
0029 
0030 #define SPRN_XUCR0  0x3f6   /* Execution Unit Config Register 0 */
0031 
0032 #define A2_IERAT_SIZE   16
0033 #define A2_DERAT_SIZE   32
0034 
0035 /* A2 MMUCR0 bits */
0036 #define MMUCR0_ECL  0x80000000  /* Extended Class for TLB fills */
0037 #define MMUCR0_TID_NZ   0x40000000  /* TID is non-zero */
0038 #define MMUCR0_TS   0x10000000  /* Translation space for TLB fills */
0039 #define MMUCR0_TGS  0x20000000  /* Guest space for TLB fills */
0040 #define MMUCR0_TLBSEL   0x0c000000  /* TLB or ERAT target for TLB fills */
0041 #define MMUCR0_TLBSEL_U 0x00000000  /*  TLBSEL = UTLB */
0042 #define MMUCR0_TLBSEL_I 0x08000000  /*  TLBSEL = I-ERAT */
0043 #define MMUCR0_TLBSEL_D 0x0c000000  /*  TLBSEL = D-ERAT */
0044 #define MMUCR0_LOCKSRSH 0x02000000  /* Use TLB lock on tlbsx. */
0045 #define MMUCR0_TID_MASK 0x000000ff  /* TID field */
0046 
0047 /* A2 MMUCR1 bits */
0048 #define MMUCR1_IRRE     0x80000000  /* I-ERAT round robin enable */
0049 #define MMUCR1_DRRE     0x40000000  /* D-ERAT round robin enable */
0050 #define MMUCR1_REE      0x20000000  /* Reference Exception Enable*/
0051 #define MMUCR1_CEE      0x10000000  /* Change exception enable */
0052 #define MMUCR1_CSINV_ALL    0x00000000  /* Inval ERAT on all CS evts */
0053 #define MMUCR1_CSINV_NISYNC 0x04000000  /* Inval ERAT on all ex isync*/
0054 #define MMUCR1_CSINV_NEVER  0x0c000000  /* Don't inval ERAT on CS */
0055 #define MMUCR1_ICTID        0x00080000  /* IERAT class field as TID */
0056 #define MMUCR1_ITTID        0x00040000  /* IERAT thdid field as TID */
0057 #define MMUCR1_DCTID        0x00020000  /* DERAT class field as TID */
0058 #define MMUCR1_DTTID        0x00010000  /* DERAT thdid field as TID */
0059 #define MMUCR1_DCCD     0x00008000  /* DERAT class ignore */
0060 #define MMUCR1_TLBWE_BINV   0x00004000  /* back invalidate on tlbwe */
0061 
0062 /* A2 MMUCR2 bits */
0063 #define MMUCR2_PSSEL_SHIFT  4
0064 
0065 /* A2 MMUCR3 bits */
0066 #define MMUCR3_THID     0x0000000f  /* Thread ID */
0067 
0068 /* *** ERAT TLB bits definitions */
0069 #define TLB0_EPN_MASK       ASM_CONST(0xfffffffffffff000)
0070 #define TLB0_CLASS_MASK     ASM_CONST(0x0000000000000c00)
0071 #define TLB0_CLASS_00       ASM_CONST(0x0000000000000000)
0072 #define TLB0_CLASS_01       ASM_CONST(0x0000000000000400)
0073 #define TLB0_CLASS_10       ASM_CONST(0x0000000000000800)
0074 #define TLB0_CLASS_11       ASM_CONST(0x0000000000000c00)
0075 #define TLB0_V          ASM_CONST(0x0000000000000200)
0076 #define TLB0_X          ASM_CONST(0x0000000000000100)
0077 #define TLB0_SIZE_MASK      ASM_CONST(0x00000000000000f0)
0078 #define TLB0_SIZE_4K        ASM_CONST(0x0000000000000010)
0079 #define TLB0_SIZE_64K       ASM_CONST(0x0000000000000030)
0080 #define TLB0_SIZE_1M        ASM_CONST(0x0000000000000050)
0081 #define TLB0_SIZE_16M       ASM_CONST(0x0000000000000070)
0082 #define TLB0_SIZE_1G        ASM_CONST(0x00000000000000a0)
0083 #define TLB0_THDID_MASK     ASM_CONST(0x000000000000000f)
0084 #define TLB0_THDID_0        ASM_CONST(0x0000000000000001)
0085 #define TLB0_THDID_1        ASM_CONST(0x0000000000000002)
0086 #define TLB0_THDID_2        ASM_CONST(0x0000000000000004)
0087 #define TLB0_THDID_3        ASM_CONST(0x0000000000000008)
0088 #define TLB0_THDID_ALL      ASM_CONST(0x000000000000000f)
0089 
0090 #define TLB1_RESVATTR       ASM_CONST(0x00f0000000000000)
0091 #define TLB1_U0         ASM_CONST(0x0008000000000000)
0092 #define TLB1_U1         ASM_CONST(0x0004000000000000)
0093 #define TLB1_U2         ASM_CONST(0x0002000000000000)
0094 #define TLB1_U3         ASM_CONST(0x0001000000000000)
0095 #define TLB1_R          ASM_CONST(0x0000800000000000)
0096 #define TLB1_C          ASM_CONST(0x0000400000000000)
0097 #define TLB1_RPN_MASK       ASM_CONST(0x000003fffffff000)
0098 #define TLB1_W          ASM_CONST(0x0000000000000800)
0099 #define TLB1_I          ASM_CONST(0x0000000000000400)
0100 #define TLB1_M          ASM_CONST(0x0000000000000200)
0101 #define TLB1_G          ASM_CONST(0x0000000000000100)
0102 #define TLB1_E          ASM_CONST(0x0000000000000080)
0103 #define TLB1_VF         ASM_CONST(0x0000000000000040)
0104 #define TLB1_UX         ASM_CONST(0x0000000000000020)
0105 #define TLB1_SX         ASM_CONST(0x0000000000000010)
0106 #define TLB1_UW         ASM_CONST(0x0000000000000008)
0107 #define TLB1_SW         ASM_CONST(0x0000000000000004)
0108 #define TLB1_UR         ASM_CONST(0x0000000000000002)
0109 #define TLB1_SR         ASM_CONST(0x0000000000000001)
0110 
0111 /* A2 erativax attributes definitions */
0112 #define ERATIVAX_RS_IS_ALL      0x000
0113 #define ERATIVAX_RS_IS_TID      0x040
0114 #define ERATIVAX_RS_IS_CLASS        0x080
0115 #define ERATIVAX_RS_IS_FULLMATCH    0x0c0
0116 #define ERATIVAX_CLASS_00       0x000
0117 #define ERATIVAX_CLASS_01       0x010
0118 #define ERATIVAX_CLASS_10       0x020
0119 #define ERATIVAX_CLASS_11       0x030
0120 #define ERATIVAX_PSIZE_4K       (TLB_PSIZE_4K >> 1)
0121 #define ERATIVAX_PSIZE_64K      (TLB_PSIZE_64K >> 1)
0122 #define ERATIVAX_PSIZE_1M       (TLB_PSIZE_1M >> 1)
0123 #define ERATIVAX_PSIZE_16M      (TLB_PSIZE_16M >> 1)
0124 #define ERATIVAX_PSIZE_1G       (TLB_PSIZE_1G >> 1)
0125 
0126 /* A2 eratilx attributes definitions */
0127 #define ERATILX_T_ALL           0
0128 #define ERATILX_T_TID           1
0129 #define ERATILX_T_TGS           2
0130 #define ERATILX_T_FULLMATCH     3
0131 #define ERATILX_T_CLASS0        4
0132 #define ERATILX_T_CLASS1        5
0133 #define ERATILX_T_CLASS2        6
0134 #define ERATILX_T_CLASS3        7
0135 
0136 /* XUCR0 bits */
0137 #define XUCR0_TRACE_UM_T0       0x40000000  /* Thread 0 */
0138 #define XUCR0_TRACE_UM_T1       0x20000000  /* Thread 1 */
0139 #define XUCR0_TRACE_UM_T2       0x10000000  /* Thread 2 */
0140 #define XUCR0_TRACE_UM_T3       0x08000000  /* Thread 3 */
0141 
0142 /* A2 CCR0 register */
0143 #define A2_CCR0_PME_DISABLED        0x00000000
0144 #define A2_CCR0_PME_SLEEP       0x40000000
0145 #define A2_CCR0_PME_RVW         0x80000000
0146 #define A2_CCR0_PME_DISABLED2       0xc0000000
0147 
0148 /* A2 CCR2 register */
0149 #define A2_CCR2_ERAT_ONLY_MODE      0x00000001
0150 #define A2_CCR2_ENABLE_ICSWX        0x00000002
0151 #define A2_CCR2_ENABLE_PC       0x20000000
0152 #define A2_CCR2_ENABLE_TRACE        0x40000000
0153 
0154 #endif /* __ASM_POWERPC_REG_A2_H__ */