diff options
-rw-r--r-- | arch/powerpc/include/asm/ps3.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 14 | ||||
-rw-r--r-- | arch/powerpc/mm/pgtable-radix.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/setup.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/maple/setup.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/setup.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 15 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 7 |
11 files changed, 32 insertions, 26 deletions
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h index a1bc7e758422..a19f831a4cc9 100644 --- a/arch/powerpc/include/asm/ps3.h +++ b/arch/powerpc/include/asm/ps3.h | |||
@@ -526,4 +526,6 @@ void ps3_sync_irq(int node); | |||
526 | u32 ps3_get_hw_thread_id(int cpu); | 526 | u32 ps3_get_hw_thread_id(int cpu); |
527 | u64 ps3_get_spe_id(void *arg); | 527 | u64 ps3_get_spe_id(void *arg); |
528 | 528 | ||
529 | void ps3_early_mm_init(void); | ||
530 | |||
529 | #endif | 531 | #endif |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 2bd1784e65b3..bae3db791150 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -759,6 +759,12 @@ void __init early_init_devtree(void *params) | |||
759 | /* Now try to figure out if we are running on LPAR and so on */ | 759 | /* Now try to figure out if we are running on LPAR and so on */ |
760 | pseries_probe_fw_features(); | 760 | pseries_probe_fw_features(); |
761 | 761 | ||
762 | #ifdef CONFIG_PPC_PS3 | ||
763 | /* Identify PS3 firmware */ | ||
764 | if (of_flat_dt_is_compatible(of_get_flat_dt_root(), "sony,ps3")) | ||
765 | powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE; | ||
766 | #endif | ||
767 | |||
762 | DBG(" <- early_init_devtree()\n"); | 768 | DBG(" <- early_init_devtree()\n"); |
763 | } | 769 | } |
764 | 770 | ||
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 859ecaa928e9..336fad6524df 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <asm/firmware.h> | 58 | #include <asm/firmware.h> |
59 | #include <asm/tm.h> | 59 | #include <asm/tm.h> |
60 | #include <asm/trace.h> | 60 | #include <asm/trace.h> |
61 | #include <asm/ps3.h> | ||
61 | 62 | ||
62 | #ifdef DEBUG | 63 | #ifdef DEBUG |
63 | #define DBG(fmt...) udbg_printf(fmt) | 64 | #define DBG(fmt...) udbg_printf(fmt) |
@@ -872,6 +873,11 @@ static void __init htab_initialize(void) | |||
872 | #undef KB | 873 | #undef KB |
873 | #undef MB | 874 | #undef MB |
874 | 875 | ||
876 | void __init __weak hpte_init_lpar(void) | ||
877 | { | ||
878 | panic("FW_FEATURE_LPAR set but no LPAR support compiled\n"); | ||
879 | } | ||
880 | |||
875 | void __init hash__early_init_mmu(void) | 881 | void __init hash__early_init_mmu(void) |
876 | { | 882 | { |
877 | /* | 883 | /* |
@@ -908,6 +914,14 @@ void __init hash__early_init_mmu(void) | |||
908 | pci_io_base = ISA_IO_BASE; | 914 | pci_io_base = ISA_IO_BASE; |
909 | #endif | 915 | #endif |
910 | 916 | ||
917 | /* Select appropriate backend */ | ||
918 | if (firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
919 | ps3_early_mm_init(); | ||
920 | else if (firmware_has_feature(FW_FEATURE_LPAR)) | ||
921 | hpte_init_lpar(); | ||
922 | else | ||
923 | hpte_init_native(); | ||
924 | |||
911 | /* Initialize the MMU Hash table and create the linear mapping | 925 | /* Initialize the MMU Hash table and create the linear mapping |
912 | * of memory. Has to be done before SLB initialization as this is | 926 | * of memory. Has to be done before SLB initialization as this is |
913 | * currently where the page size encoding is obtained. | 927 | * currently where the page size encoding is obtained. |
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c index 4ea1094c9fc4..003ff48a11b6 100644 --- a/arch/powerpc/mm/pgtable-radix.c +++ b/arch/powerpc/mm/pgtable-radix.c | |||
@@ -345,6 +345,7 @@ void __init radix__early_init_mmu(void) | |||
345 | 345 | ||
346 | radix_init_page_sizes(); | 346 | radix_init_page_sizes(); |
347 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { | 347 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { |
348 | radix_init_native(); | ||
348 | lpcr = mfspr(SPRN_LPCR); | 349 | lpcr = mfspr(SPRN_LPCR); |
349 | mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR); | 350 | mtspr(SPRN_LPCR, lpcr | LPCR_UPRT | LPCR_HR); |
350 | radix_init_partition_table(); | 351 | radix_init_partition_table(); |
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 36cff28d0293..e342f7833db5 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -261,7 +261,6 @@ static int __init cell_probe(void) | |||
261 | !of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) | 261 | !of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) |
262 | return 0; | 262 | return 0; |
263 | 263 | ||
264 | hpte_init_native(); | ||
265 | pm_power_off = rtas_power_off; | 264 | pm_power_off = rtas_power_off; |
266 | 265 | ||
267 | return 1; | 266 | return 1; |
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 99b9b96ab059..b1ecd991a0fb 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -306,7 +306,6 @@ static int __init maple_probe(void) | |||
306 | !of_flat_dt_is_compatible(root, "Momentum,Apache")) | 306 | !of_flat_dt_is_compatible(root, "Momentum,Apache")) |
307 | return 0; | 307 | return 0; |
308 | 308 | ||
309 | hpte_init_native(); | ||
310 | pm_power_off = maple_power_off; | 309 | pm_power_off = maple_power_off; |
311 | 310 | ||
312 | return 1; | 311 | return 1; |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 7349644c9828..924d01d9b375 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -426,8 +426,6 @@ static int __init pas_probe(void) | |||
426 | !of_flat_dt_is_compatible(root, "pasemi,pwrficient")) | 426 | !of_flat_dt_is_compatible(root, "pasemi,pwrficient")) |
427 | return 0; | 427 | return 0; |
428 | 428 | ||
429 | hpte_init_native(); | ||
430 | |||
431 | alloc_iobmap_l2(); | 429 | alloc_iobmap_l2(); |
432 | 430 | ||
433 | return 1; | 431 | return 1; |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 4ad61687c670..795bf8cfddd9 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -599,10 +599,6 @@ static int __init pmac_probe(void) | |||
599 | !of_flat_dt_is_compatible(root, "MacRISC")) | 599 | !of_flat_dt_is_compatible(root, "MacRISC")) |
600 | return 0; | 600 | return 0; |
601 | 601 | ||
602 | #ifdef CONFIG_PPC64 | ||
603 | hpte_init_native(); | ||
604 | #endif | ||
605 | |||
606 | #ifdef CONFIG_PPC32 | 602 | #ifdef CONFIG_PPC32 |
607 | /* isa_io_base gets set in pmac_pci_init */ | 603 | /* isa_io_base gets set in pmac_pci_init */ |
608 | ISA_DMA_THRESHOLD = ~0L; | 604 | ISA_DMA_THRESHOLD = ~0L; |
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 8492bbbcfc08..f70ea83502b2 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c | |||
@@ -273,11 +273,6 @@ static int __init pnv_probe(void) | |||
273 | if (!of_flat_dt_is_compatible(root, "ibm,powernv")) | 273 | if (!of_flat_dt_is_compatible(root, "ibm,powernv")) |
274 | return 0; | 274 | return 0; |
275 | 275 | ||
276 | if (IS_ENABLED(CONFIG_PPC_RADIX_MMU) && radix_enabled()) | ||
277 | radix_init_native(); | ||
278 | else if (IS_ENABLED(CONFIG_PPC_STD_MMU_64)) | ||
279 | hpte_init_native(); | ||
280 | |||
281 | if (firmware_has_feature(FW_FEATURE_OPAL)) | 276 | if (firmware_has_feature(FW_FEATURE_OPAL)) |
282 | pnv_setup_machdep_opal(); | 277 | pnv_setup_machdep_opal(); |
283 | 278 | ||
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 486ecd017535..b7fdf88474e8 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -226,9 +226,17 @@ static void __init ps3_progress(char *s, unsigned short hex) | |||
226 | printk("*** %04x : %s\n", hex, s ? s : ""); | 226 | printk("*** %04x : %s\n", hex, s ? s : ""); |
227 | } | 227 | } |
228 | 228 | ||
229 | static int __init ps3_probe(void) | 229 | void __init ps3_early_mm_init(void) |
230 | { | 230 | { |
231 | unsigned long htab_size; | 231 | unsigned long htab_size; |
232 | |||
233 | ps3_mm_init(); | ||
234 | ps3_mm_vas_create(&htab_size); | ||
235 | ps3_hpte_init(htab_size); | ||
236 | } | ||
237 | |||
238 | static int __init ps3_probe(void) | ||
239 | { | ||
232 | unsigned long dt_root; | 240 | unsigned long dt_root; |
233 | 241 | ||
234 | DBG(" -> %s:%d\n", __func__, __LINE__); | 242 | DBG(" -> %s:%d\n", __func__, __LINE__); |
@@ -237,12 +245,7 @@ static int __init ps3_probe(void) | |||
237 | if (!of_flat_dt_is_compatible(dt_root, "sony,ps3")) | 245 | if (!of_flat_dt_is_compatible(dt_root, "sony,ps3")) |
238 | return 0; | 246 | return 0; |
239 | 247 | ||
240 | powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE; | ||
241 | |||
242 | ps3_os_area_save_params(); | 248 | ps3_os_area_save_params(); |
243 | ps3_mm_init(); | ||
244 | ps3_mm_vas_create(&htab_size); | ||
245 | ps3_hpte_init(htab_size); | ||
246 | pm_power_off = ps3_power_off; | 249 | pm_power_off = ps3_power_off; |
247 | 250 | ||
248 | DBG(" <- %s:%d\n", __func__, __LINE__); | 251 | DBG(" <- %s:%d\n", __func__, __LINE__); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index ba7dc126b5e5..240721348ebc 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -687,13 +687,6 @@ static int __init pSeries_probe(void) | |||
687 | of_flat_dt_is_compatible(root, "IBM,CBEA")) | 687 | of_flat_dt_is_compatible(root, "IBM,CBEA")) |
688 | return 0; | 688 | return 0; |
689 | 689 | ||
690 | pr_debug("pSeries detected, looking for LPAR capability...\n"); | ||
691 | |||
692 | if (firmware_has_feature(FW_FEATURE_LPAR)) | ||
693 | hpte_init_lpar(); | ||
694 | else | ||
695 | hpte_init_native(); | ||
696 | |||
697 | pm_power_off = pseries_power_off; | 690 | pm_power_off = pseries_power_off; |
698 | 691 | ||
699 | pr_debug("Machine is%s LPAR !\n", | 692 | pr_debug("Machine is%s LPAR !\n", |