diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:51:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-15 12:51:09 -0400 |
commit | 723e9db7a46e328527cc3da2b478b831184fe828 (patch) | |
tree | cdeda255633057dcb4c84097bed27b2bbf76970f /arch/powerpc/include/asm/mmu-book3e.h | |
parent | ada3fa15057205b7d3f727bba5cd26b5912e350f (diff) | |
parent | d331d8305cba713605854aab63a000fb892353a7 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (134 commits)
powerpc/nvram: Enable use Generic NVRAM driver for different size chips
powerpc/iseries: Fix oops reading from /proc/iSeries/mf/*/cmdline
powerpc/ps3: Workaround for flash memory I/O error
powerpc/booke: Don't set DABR on 64-bit BookE, use DAC1 instead
powerpc/perf_counters: Reduce stack usage of power_check_constraints
powerpc: Fix bug where perf_counters breaks oprofile
powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops
powerpc/irq: Improve nanodoc
powerpc: Fix some late PowerMac G5 with PCIe ATI graphics
powerpc/fsl-booke: Use HW PTE format if CONFIG_PTE_64BIT
powerpc/book3e: Add missing page sizes
powerpc/pseries: Fix to handle slb resize across migration
powerpc/powermac: Thermal control turns system off too eagerly
powerpc/pci: Merge ppc32 and ppc64 versions of phb_scan()
powerpc/405ex: support cuImage via included dtb
powerpc/405ex: provide necessary fixup function to support cuImage
powerpc/40x: Add support for the ESTeem 195E (PPC405EP) SBC
powerpc/44x: Add Eiger AMCC (AppliedMicro) PPC460SX evaluation board support.
powerpc/44x: Update Arches defconfig
powerpc/44x: Update Arches dts
...
Fix up conflicts in drivers/char/agp/uninorth-agp.c
Diffstat (limited to 'arch/powerpc/include/asm/mmu-book3e.h')
-rw-r--r-- | arch/powerpc/include/asm/mmu-book3e.h | 208 |
1 files changed, 159 insertions, 49 deletions
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h index 7e74cff81d86..74695816205c 100644 --- a/arch/powerpc/include/asm/mmu-book3e.h +++ b/arch/powerpc/include/asm/mmu-book3e.h | |||
@@ -38,58 +38,140 @@ | |||
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 | /* Bit definitions for MMUCSR0 */ | ||
118 | #define MMUCSR0_TLB1FI 0x00000002 /* TLB1 Flash invalidate */ | ||
119 | #define MMUCSR0_TLB0FI 0x00000004 /* TLB0 Flash invalidate */ | ||
120 | #define MMUCSR0_TLB2FI 0x00000040 /* TLB2 Flash invalidate */ | ||
121 | #define MMUCSR0_TLB3FI 0x00000020 /* TLB3 Flash invalidate */ | ||
122 | #define MMUCSR0_TLBFI (MMUCSR0_TLB0FI | MMUCSR0_TLB1FI | \ | ||
123 | MMUCSR0_TLB2FI | MMUCSR0_TLB3FI) | ||
124 | #define MMUCSR0_TLB0PS 0x00000780 /* TLB0 Page Size */ | ||
125 | #define MMUCSR0_TLB1PS 0x00007800 /* TLB1 Page Size */ | ||
126 | #define MMUCSR0_TLB2PS 0x00078000 /* TLB2 Page Size */ | ||
127 | #define MMUCSR0_TLB3PS 0x00780000 /* TLB3 Page Size */ | ||
128 | |||
129 | /* TLBnCFG encoding */ | ||
130 | #define TLBnCFG_N_ENTRY 0x00000fff /* number of entries */ | ||
131 | #define TLBnCFG_HES 0x00002000 /* HW select supported */ | ||
132 | #define TLBnCFG_IPROT 0x00008000 /* IPROT supported */ | ||
133 | #define TLBnCFG_GTWE 0x00010000 /* Guest can write */ | ||
134 | #define TLBnCFG_IND 0x00020000 /* IND entries supported */ | ||
135 | #define TLBnCFG_PT 0x00040000 /* Can load from page table */ | ||
136 | #define TLBnCFG_ASSOC 0xff000000 /* Associativity */ | ||
137 | |||
138 | /* TLBnPS encoding */ | ||
139 | #define TLBnPS_4K 0x00000004 | ||
140 | #define TLBnPS_8K 0x00000008 | ||
141 | #define TLBnPS_16K 0x00000010 | ||
142 | #define TLBnPS_32K 0x00000020 | ||
143 | #define TLBnPS_64K 0x00000040 | ||
144 | #define TLBnPS_128K 0x00000080 | ||
145 | #define TLBnPS_256K 0x00000100 | ||
146 | #define TLBnPS_512K 0x00000200 | ||
147 | #define TLBnPS_1M 0x00000400 | ||
148 | #define TLBnPS_2M 0x00000800 | ||
149 | #define TLBnPS_4M 0x00001000 | ||
150 | #define TLBnPS_8M 0x00002000 | ||
151 | #define TLBnPS_16M 0x00004000 | ||
152 | #define TLBnPS_32M 0x00008000 | ||
153 | #define TLBnPS_64M 0x00010000 | ||
154 | #define TLBnPS_128M 0x00020000 | ||
155 | #define TLBnPS_256M 0x00040000 | ||
156 | #define TLBnPS_512M 0x00080000 | ||
157 | #define TLBnPS_1G 0x00100000 | ||
158 | #define TLBnPS_2G 0x00200000 | ||
159 | #define TLBnPS_4G 0x00400000 | ||
160 | #define TLBnPS_8G 0x00800000 | ||
161 | #define TLBnPS_16G 0x01000000 | ||
162 | #define TLBnPS_32G 0x02000000 | ||
163 | #define TLBnPS_64G 0x04000000 | ||
164 | #define TLBnPS_128G 0x08000000 | ||
165 | #define TLBnPS_256G 0x10000000 | ||
166 | |||
167 | /* tlbilx action encoding */ | ||
168 | #define TLBILX_T_ALL 0 | ||
169 | #define TLBILX_T_TID 1 | ||
170 | #define TLBILX_T_FULLMATCH 3 | ||
171 | #define TLBILX_T_CLASS0 4 | ||
172 | #define TLBILX_T_CLASS1 5 | ||
173 | #define TLBILX_T_CLASS2 6 | ||
174 | #define TLBILX_T_CLASS3 7 | ||
93 | 175 | ||
94 | #ifndef __ASSEMBLY__ | 176 | #ifndef __ASSEMBLY__ |
95 | 177 | ||
@@ -100,6 +182,34 @@ typedef struct { | |||
100 | unsigned int active; | 182 | unsigned int active; |
101 | unsigned long vdso_base; | 183 | unsigned long vdso_base; |
102 | } mm_context_t; | 184 | } mm_context_t; |
185 | |||
186 | /* Page size definitions, common between 32 and 64-bit | ||
187 | * | ||
188 | * shift : is the "PAGE_SHIFT" value for that page size | ||
189 | * penc : is the pte encoding mask | ||
190 | * | ||
191 | */ | ||
192 | struct mmu_psize_def | ||
193 | { | ||
194 | unsigned int shift; /* number of bits */ | ||
195 | unsigned int enc; /* PTE encoding */ | ||
196 | }; | ||
197 | extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; | ||
198 | |||
199 | /* The page sizes use the same names as 64-bit hash but are | ||
200 | * constants | ||
201 | */ | ||
202 | #if defined(CONFIG_PPC_4K_PAGES) | ||
203 | #define mmu_virtual_psize MMU_PAGE_4K | ||
204 | #elif defined(CONFIG_PPC_64K_PAGES) | ||
205 | #define mmu_virtual_psize MMU_PAGE_64K | ||
206 | #else | ||
207 | #error Unsupported page size | ||
208 | #endif | ||
209 | |||
210 | extern int mmu_linear_psize; | ||
211 | extern int mmu_vmemmap_psize; | ||
212 | |||
103 | #endif /* !__ASSEMBLY__ */ | 213 | #endif /* !__ASSEMBLY__ */ |
104 | 214 | ||
105 | #endif /* _ASM_POWERPC_MMU_BOOK3E_H_ */ | 215 | #endif /* _ASM_POWERPC_MMU_BOOK3E_H_ */ |