1 #ifndef _ASM_POWERPC_MMU_H_
2 #define _ASM_POWERPC_MMU_H_
5 #include <linux/types.h>
7 #include <asm/asm-compat.h>
17 #define MMU_FTR_HPTE_TABLE ASM_CONST(0x00000001)
18 #define MMU_FTR_TYPE_8xx ASM_CONST(0x00000002)
19 #define MMU_FTR_TYPE_40x ASM_CONST(0x00000004)
20 #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)
21 #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)
22 #define MMU_FTR_TYPE_3E ASM_CONST(0x00000020)
23 #define MMU_FTR_TYPE_47x ASM_CONST(0x00000040)
30 #define MMU_FTR_USE_HIGH_BATS ASM_CONST(0x00010000)
35 #define MMU_FTR_BIG_PHYS ASM_CONST(0x00020000)
41 #define MMU_FTR_USE_TLBIVAX_BCAST ASM_CONST(0x00040000)
45 #define MMU_FTR_USE_TLBILX ASM_CONST(0x00080000)
51 #define MMU_FTR_LOCK_BCAST_INVAL ASM_CONST(0x00100000)
57 #define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000)
62 #define MMU_FTR_USE_TLBRSRV ASM_CONST(0x00800000)
66 #define MMU_FTR_USE_PAIRED_MAS ASM_CONST(0x01000000)
70 #define MMU_FTR_SLB ASM_CONST(0x02000000)
74 #define MMU_FTR_16M_PAGE ASM_CONST(0x04000000)
78 #define MMU_FTR_TLBIEL ASM_CONST(0x08000000)
82 #define MMU_FTR_LOCKLESS_TLBIE ASM_CONST(0x10000000)
86 #define MMU_FTR_CI_LARGE_PAGE ASM_CONST(0x20000000)
90 #define MMU_FTR_1T_SEGMENT ASM_CONST(0x40000000)
94 #define MMU_FTR_NO_SLBIE_B ASM_CONST(0x80000000)
97 #define MMU_FTRS_DEFAULT_HPTE_ARCH_V2 \
98 MMU_FTR_HPTE_TABLE | MMU_FTR_PPCAS_ARCH_V2
99 #define MMU_FTRS_POWER4 MMU_FTRS_DEFAULT_HPTE_ARCH_V2
100 #define MMU_FTRS_PPC970 MMU_FTRS_POWER4
101 #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
102 #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
103 #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
104 #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
105 MMU_FTR_CI_LARGE_PAGE
106 #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
107 MMU_FTR_CI_LARGE_PAGE | MMU_FTR_NO_SLBIE_B
108 #define MMU_FTRS_A2 MMU_FTR_TYPE_3E | MMU_FTR_USE_TLBILX | \
109 MMU_FTR_USE_TLBIVAX_BCAST | \
110 MMU_FTR_LOCK_BCAST_INVAL | \
111 MMU_FTR_USE_TLBRSRV | \
112 MMU_FTR_USE_PAIRED_MAS | \
116 #include <asm/cputable.h>
118 #ifdef CONFIG_PPC_FSL_BOOK3E
119 #include <asm/percpu.h>
123 static inline int mmu_has_feature(
unsigned long feature)
128 static inline void mmu_clear_feature(
unsigned long feature)
133 extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup;
137 extern void early_init_mmu_secondary(
void);
146 extern u64 ppc64_rma_size;
150 #ifdef CONFIG_DEBUG_VM
151 extern void assert_pte_locked(
struct mm_struct *mm,
unsigned long addr);
153 static inline void assert_pte_locked(
struct mm_struct *mm,
unsigned long addr)
176 #define MMU_PAGE_4K 0
177 #define MMU_PAGE_16K 1
178 #define MMU_PAGE_64K 2
179 #define MMU_PAGE_64K_AP 3
180 #define MMU_PAGE_256K 4
181 #define MMU_PAGE_1M 5
182 #define MMU_PAGE_4M 6
183 #define MMU_PAGE_8M 7
184 #define MMU_PAGE_16M 8
185 #define MMU_PAGE_64M 9
186 #define MMU_PAGE_256M 10
187 #define MMU_PAGE_1G 11
188 #define MMU_PAGE_16G 12
189 #define MMU_PAGE_64G 13
191 #define MMU_PAGE_COUNT 14
193 #if defined(CONFIG_PPC_STD_MMU_64)
196 #elif defined(CONFIG_PPC_STD_MMU_32)
199 #elif defined(CONFIG_40x)
202 #elif defined(CONFIG_44x)
205 #elif defined(CONFIG_PPC_BOOK3E_MMU)
208 #elif defined (CONFIG_PPC_8xx)