aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/pgtable-radix.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/pgtable-radix.c')
-rw-r--r--arch/powerpc/mm/pgtable-radix.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 7931e1496f0d..003ff48a11b6 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -21,8 +21,11 @@
21 21
22#include <trace/events/thp.h> 22#include <trace/events/thp.h>
23 23
24static int native_update_partition_table(u64 patb1) 24static int native_register_process_table(unsigned long base, unsigned long pg_sz,
25 unsigned long table_size)
25{ 26{
27 unsigned long patb1 = base | table_size | PATB_GR;
28
26 partition_tb->patb1 = cpu_to_be64(patb1); 29 partition_tb->patb1 = cpu_to_be64(patb1);
27 return 0; 30 return 0;
28} 31}
@@ -168,7 +171,7 @@ redo:
168 * of process table here. But our linear mapping also enable us to use 171 * of process table here. But our linear mapping also enable us to use
169 * physical address here. 172 * physical address here.
170 */ 173 */
171 ppc_md.update_partition_table(__pa(process_tb) | (PRTB_SIZE_SHIFT - 12) | PATB_GR); 174 ppc_md.register_process_table(__pa(process_tb), 0, PRTB_SIZE_SHIFT - 12);
172 pr_info("Process table %p and radix root for kernel: %p\n", process_tb, init_mm.pgd); 175 pr_info("Process table %p and radix root for kernel: %p\n", process_tb, init_mm.pgd);
173} 176}
174 177
@@ -182,7 +185,8 @@ static void __init radix_init_partition_table(void)
182 partition_tb = early_alloc_pgtable(1UL << PATB_SIZE_SHIFT); 185 partition_tb = early_alloc_pgtable(1UL << PATB_SIZE_SHIFT);
183 partition_tb->patb0 = cpu_to_be64(rts_field | __pa(init_mm.pgd) | 186 partition_tb->patb0 = cpu_to_be64(rts_field | __pa(init_mm.pgd) |
184 RADIX_PGD_INDEX_SIZE | PATB_HR); 187 RADIX_PGD_INDEX_SIZE | PATB_HR);
185 printk("Partition table %p\n", partition_tb); 188 pr_info("Initializing Radix MMU\n");
189 pr_info("Partition table %p\n", partition_tb);
186 190
187 memblock_set_current_limit(MEMBLOCK_ALLOC_ANYWHERE); 191 memblock_set_current_limit(MEMBLOCK_ALLOC_ANYWHERE);
188 /* 192 /*
@@ -194,7 +198,7 @@ static void __init radix_init_partition_table(void)
194 198
195void __init radix_init_native(void) 199void __init radix_init_native(void)
196{ 200{
197 ppc_md.update_partition_table = native_update_partition_table; 201 ppc_md.register_process_table = native_register_process_table;
198} 202}
199 203
200static int __init get_idx_from_shift(unsigned int shift) 204static int __init get_idx_from_shift(unsigned int shift)
@@ -341,8 +345,9 @@ void __init radix__early_init_mmu(void)
341 345
342 radix_init_page_sizes(); 346 radix_init_page_sizes();
343 if (!firmware_has_feature(FW_FEATURE_LPAR)) { 347 if (!firmware_has_feature(FW_FEATURE_LPAR)) {
348 radix_init_native();
344 lpcr = mfspr(SPRN_LPCR); 349 lpcr = mfspr(SPRN_LPCR);
345 mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); 350 mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR);
346 radix_init_partition_table(); 351 radix_init_partition_table();
347 } 352 }
348 353
@@ -357,7 +362,7 @@ void radix__early_init_mmu_secondary(void)
357 */ 362 */
358 if (!firmware_has_feature(FW_FEATURE_LPAR)) { 363 if (!firmware_has_feature(FW_FEATURE_LPAR)) {
359 lpcr = mfspr(SPRN_LPCR); 364 lpcr = mfspr(SPRN_LPCR);
360 mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); 365 mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR);
361 366
362 mtspr(SPRN_PTCR, 367 mtspr(SPRN_PTCR,
363 __pa(partition_tb) | (PATB_SIZE_SHIFT - 12)); 368 __pa(partition_tb) | (PATB_SIZE_SHIFT - 12));