aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/hash_utils_64.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-07-05 01:03:51 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-21 04:56:38 -0400
commit166dd7d3fbf2df183926f0e4b4855f6cbd8da945 (patch)
tree5f13de87384d672c1ceeaba5ac7dc07d5eca6205 /arch/powerpc/mm/hash_utils_64.c
parent91b6fad5cf16c5fcf0ab2a08fcdbd1483d871d43 (diff)
powerpc/64: Move MMU backend selection out of platform code
We move it into early_mmu_init() based on firmware features. For PS3, we have to move the setting of these into early_init_devtree(). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/hash_utils_64.c')
-rw-r--r--arch/powerpc/mm/hash_utils_64.c14
1 files changed, 14 insertions, 0 deletions
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
876void __init __weak hpte_init_lpar(void)
877{
878 panic("FW_FEATURE_LPAR set but no LPAR support compiled\n");
879}
880
875void __init hash__early_init_mmu(void) 881void __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.