diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-07-23 19:15:12 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-19 20:12:39 -0400 |
commit | 1fe1a21005c14ad772caeb9005580f473c4b6c57 (patch) | |
tree | 31250b602b80a44a2a43dcaa812e6f6965b04149 /arch/powerpc/include/asm/mmu-book3e.h | |
parent | 29c09e8fbaf65698c51aeffe34acc284a454a38f (diff) |
powerpc/mm: Add more bit definitions for Book3E MMU registers
This adds various additional bit definitions for various MMU related
SPRs used on Book3E.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/mmu-book3e.h')
-rw-r--r-- | arch/powerpc/include/asm/mmu-book3e.h | 168 |
1 files changed, 119 insertions, 49 deletions
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h index 7e74cff81d86..42a39b4aacec 100644 --- a/arch/powerpc/include/asm/mmu-book3e.h +++ b/arch/powerpc/include/asm/mmu-book3e.h | |||
@@ -38,58 +38,128 @@ | |||
38 | #define BOOK3E_PAGESZ_1TB 30 | 38 | #define BOOK3E_PAGESZ_1TB 30 |
39 | #define BOOK3E_PAGESZ_2TB 31 | 39 | #define BOOK3E_PAGESZ_2TB 31 |
40 | 40 | ||
41 | #define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) | 41 | /* MAS registers bit definitions */ |
42 | #define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) | 42 | |
43 | #define MAS0_NV(x) ((x) & 0x00000FFF) | 43 | #define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) |
44 | 44 | #define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) | |
45 | #define MAS1_VALID 0x80000000 | 45 | #define MAS0_NV(x) ((x) & 0x00000FFF) |
46 | #define MAS1_IPROT 0x40000000 | 46 | #define MAS0_HES 0x00004000 |
47 | #define MAS1_TID(x) ((x << 16) & 0x3FFF0000) | 47 | #define MAS0_WQ_ALLWAYS 0x00000000 |
48 | #define MAS1_IND 0x00002000 | 48 | #define MAS0_WQ_COND 0x00001000 |
49 | #define MAS1_TS 0x00001000 | 49 | #define MAS0_WQ_CLR_RSRV 0x00002000 |
50 | #define MAS1_TSIZE(x) ((x << 7) & 0x00000F80) | 50 | |
51 | 51 | #define MAS1_VALID 0x80000000 | |
52 | #define MAS2_EPN 0xFFFFF000 | 52 | #define MAS1_IPROT 0x40000000 |
53 | #define MAS2_X0 0x00000040 | 53 | #define MAS1_TID(x) ((x << 16) & 0x3FFF0000) |
54 | #define MAS2_X1 0x00000020 | 54 | #define MAS1_IND 0x00002000 |
55 | #define MAS2_W 0x00000010 | 55 | #define MAS1_TS 0x00001000 |
56 | #define MAS2_I 0x00000008 | 56 | #define MAS1_TSIZE_MASK 0x00000f80 |
57 | #define MAS2_M 0x00000004 | 57 | #define MAS1_TSIZE_SHIFT 7 |
58 | #define MAS2_G 0x00000002 | 58 | #define MAS1_TSIZE(x) ((x << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK) |
59 | #define MAS2_E 0x00000001 | 59 | |
60 | #define MAS2_EPN 0xFFFFF000 | ||
61 | #define MAS2_X0 0x00000040 | ||
62 | #define MAS2_X1 0x00000020 | ||
63 | #define MAS2_W 0x00000010 | ||
64 | #define MAS2_I 0x00000008 | ||
65 | #define MAS2_M 0x00000004 | ||
66 | #define MAS2_G 0x00000002 | ||
67 | #define MAS2_E 0x00000001 | ||
60 | #define MAS2_EPN_MASK(size) (~0 << (size + 10)) | 68 | #define MAS2_EPN_MASK(size) (~0 << (size + 10)) |
61 | #define MAS2_VAL(addr, size, flags) ((addr) & MAS2_EPN_MASK(size) | (flags)) | 69 | #define MAS2_VAL(addr, size, flags) ((addr) & MAS2_EPN_MASK(size) | (flags)) |
62 | 70 | ||
63 | #define MAS3_RPN 0xFFFFF000 | 71 | #define MAS3_RPN 0xFFFFF000 |
64 | #define MAS3_U0 0x00000200 | 72 | #define MAS3_U0 0x00000200 |
65 | #define MAS3_U1 0x00000100 | 73 | #define MAS3_U1 0x00000100 |
66 | #define MAS3_U2 0x00000080 | 74 | #define MAS3_U2 0x00000080 |
67 | #define MAS3_U3 0x00000040 | 75 | #define MAS3_U3 0x00000040 |
68 | #define MAS3_UX 0x00000020 | 76 | #define MAS3_UX 0x00000020 |
69 | #define MAS3_SX 0x00000010 | 77 | #define MAS3_SX 0x00000010 |
70 | #define MAS3_UW 0x00000008 | 78 | #define MAS3_UW 0x00000008 |
71 | #define MAS3_SW 0x00000004 | 79 | #define MAS3_SW 0x00000004 |
72 | #define MAS3_UR 0x00000002 | 80 | #define MAS3_UR 0x00000002 |
73 | #define MAS3_SR 0x00000001 | 81 | #define MAS3_SR 0x00000001 |
74 | 82 | #define MAS3_SPSIZE 0x0000003e | |
75 | #define MAS4_TLBSELD(x) MAS0_TLBSEL(x) | 83 | #define MAS3_SPSIZE_SHIFT 1 |
76 | #define MAS4_INDD 0x00008000 | 84 | |
77 | #define MAS4_TSIZED(x) MAS1_TSIZE(x) | 85 | #define MAS4_TLBSELD(x) MAS0_TLBSEL(x) |
78 | #define MAS4_X0D 0x00000040 | 86 | #define MAS4_INDD 0x00008000 /* Default IND */ |
79 | #define MAS4_X1D 0x00000020 | 87 | #define MAS4_TSIZED(x) MAS1_TSIZE(x) |
80 | #define MAS4_WD 0x00000010 | 88 | #define MAS4_X0D 0x00000040 |
81 | #define MAS4_ID 0x00000008 | 89 | #define MAS4_X1D 0x00000020 |
82 | #define MAS4_MD 0x00000004 | 90 | #define MAS4_WD 0x00000010 |
83 | #define MAS4_GD 0x00000002 | 91 | #define MAS4_ID 0x00000008 |
84 | #define MAS4_ED 0x00000001 | 92 | #define MAS4_MD 0x00000004 |
85 | 93 | #define MAS4_GD 0x00000002 | |
86 | #define MAS6_SPID0 0x3FFF0000 | 94 | #define MAS4_ED 0x00000001 |
87 | #define MAS6_SPID1 0x00007FFE | 95 | #define MAS4_WIMGED_MASK 0x0000001f /* Default WIMGE */ |
88 | #define MAS6_ISIZE(x) MAS1_TSIZE(x) | 96 | #define MAS4_WIMGED_SHIFT 0 |
89 | #define MAS6_SAS 0x00000001 | 97 | #define MAS4_VLED MAS4_X1D /* Default VLE */ |
90 | #define MAS6_SPID MAS6_SPID0 | 98 | #define MAS4_ACMD 0x000000c0 /* Default ACM */ |
91 | 99 | #define MAS4_ACMD_SHIFT 6 | |
92 | #define MAS7_RPN 0xFFFFFFFF | 100 | #define MAS4_TSIZED_MASK 0x00000f80 /* Default TSIZE */ |
101 | #define MAS4_TSIZED_SHIFT 7 | ||
102 | |||
103 | #define MAS6_SPID0 0x3FFF0000 | ||
104 | #define MAS6_SPID1 0x00007FFE | ||
105 | #define MAS6_ISIZE(x) MAS1_TSIZE(x) | ||
106 | #define MAS6_SAS 0x00000001 | ||
107 | #define MAS6_SPID MAS6_SPID0 | ||
108 | #define MAS6_SIND 0x00000002 /* Indirect page */ | ||
109 | #define MAS6_SIND_SHIFT 1 | ||
110 | #define MAS6_SPID_MASK 0x3fff0000 | ||
111 | #define MAS6_SPID_SHIFT 16 | ||
112 | #define MAS6_ISIZE_MASK 0x00000f80 | ||
113 | #define MAS6_ISIZE_SHIFT 7 | ||
114 | |||
115 | #define MAS7_RPN 0xFFFFFFFF | ||
116 | |||
117 | /* TLBnCFG encoding */ | ||
118 | #define TLBnCFG_N_ENTRY 0x00000fff /* number of entries */ | ||
119 | #define TLBnCFG_HES 0x00002000 /* HW select supported */ | ||
120 | #define TLBnCFG_IPROT 0x00008000 /* IPROT supported */ | ||
121 | #define TLBnCFG_GTWE 0x00010000 /* Guest can write */ | ||
122 | #define TLBnCFG_IND 0x00020000 /* IND entries supported */ | ||
123 | #define TLBnCFG_PT 0x00040000 /* Can load from page table */ | ||
124 | #define TLBnCFG_ASSOC 0xff000000 /* Associativity */ | ||
125 | |||
126 | /* TLBnPS encoding */ | ||
127 | #define TLBnPS_4K 0x00000004 | ||
128 | #define TLBnPS_8K 0x00000008 | ||
129 | #define TLBnPS_16K 0x00000010 | ||
130 | #define TLBnPS_32K 0x00000020 | ||
131 | #define TLBnPS_64K 0x00000040 | ||
132 | #define TLBnPS_128K 0x00000080 | ||
133 | #define TLBnPS_256K 0x00000100 | ||
134 | #define TLBnPS_512K 0x00000200 | ||
135 | #define TLBnPS_1M 0x00000400 | ||
136 | #define TLBnPS_2M 0x00000800 | ||
137 | #define TLBnPS_4M 0x00001000 | ||
138 | #define TLBnPS_8M 0x00002000 | ||
139 | #define TLBnPS_16M 0x00004000 | ||
140 | #define TLBnPS_32M 0x00008000 | ||
141 | #define TLBnPS_64M 0x00010000 | ||
142 | #define TLBnPS_128M 0x00020000 | ||
143 | #define TLBnPS_256M 0x00040000 | ||
144 | #define TLBnPS_512M 0x00080000 | ||
145 | #define TLBnPS_1G 0x00100000 | ||
146 | #define TLBnPS_2G 0x00200000 | ||
147 | #define TLBnPS_4G 0x00400000 | ||
148 | #define TLBnPS_8G 0x00800000 | ||
149 | #define TLBnPS_16G 0x01000000 | ||
150 | #define TLBnPS_32G 0x02000000 | ||
151 | #define TLBnPS_64G 0x04000000 | ||
152 | #define TLBnPS_128G 0x08000000 | ||
153 | #define TLBnPS_256G 0x10000000 | ||
154 | |||
155 | /* tlbilx action encoding */ | ||
156 | #define TLBILX_T_ALL 0 | ||
157 | #define TLBILX_T_TID 1 | ||
158 | #define TLBILX_T_FULLMATCH 3 | ||
159 | #define TLBILX_T_CLASS0 4 | ||
160 | #define TLBILX_T_CLASS1 5 | ||
161 | #define TLBILX_T_CLASS2 6 | ||
162 | #define TLBILX_T_CLASS3 7 | ||
93 | 163 | ||
94 | #ifndef __ASSEMBLY__ | 164 | #ifndef __ASSEMBLY__ |
95 | 165 | ||