diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-19 15:34:16 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-23 22:47:34 -0400 |
commit | 757c74d298dc8438760b8dea275c4c6e0ac8a77f (patch) | |
tree | 77c694ad28230b3714c039fe54ab5497febfd4ac /arch/powerpc/mm/hash_utils_64.c | |
parent | a033a487f8ae79800a15774cb6565cbbca685fc6 (diff) |
powerpc/mm: Introduce early_init_mmu() on 64-bit
This moves some MMU related init code out of setup_64.c into hash_utils_64.c
and calls it early_init_mmu() and early_init_mmu_secondary(). This will
make it easier to plug in a new MMU type.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/hash_utils_64.c')
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 86c00c885e68..db556d25c3a7 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -590,7 +590,7 @@ static void __init htab_finish_init(void) | |||
590 | make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp); | 590 | make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp); |
591 | } | 591 | } |
592 | 592 | ||
593 | void __init htab_initialize(void) | 593 | static void __init htab_initialize(void) |
594 | { | 594 | { |
595 | unsigned long table; | 595 | unsigned long table; |
596 | unsigned long pteg_count; | 596 | unsigned long pteg_count; |
@@ -732,11 +732,43 @@ void __init htab_initialize(void) | |||
732 | #undef KB | 732 | #undef KB |
733 | #undef MB | 733 | #undef MB |
734 | 734 | ||
735 | void htab_initialize_secondary(void) | 735 | void __init early_init_mmu(void) |
736 | { | 736 | { |
737 | /* Setup initial STAB address in the PACA */ | ||
738 | get_paca()->stab_real = __pa((u64)&initial_stab); | ||
739 | get_paca()->stab_addr = (u64)&initial_stab; | ||
740 | |||
741 | /* Initialize the MMU Hash table and create the linear mapping | ||
742 | * of memory. Has to be done before stab/slb initialization as | ||
743 | * this is currently where the page size encoding is obtained | ||
744 | */ | ||
745 | htab_initialize(); | ||
746 | |||
747 | /* Initialize stab / SLB management except on iSeries | ||
748 | */ | ||
749 | if (cpu_has_feature(CPU_FTR_SLB)) | ||
750 | slb_initialize(); | ||
751 | else if (!firmware_has_feature(FW_FEATURE_ISERIES)) | ||
752 | stab_initialize(get_paca()->stab_real); | ||
753 | } | ||
754 | |||
755 | #ifdef CONFIG_SMP | ||
756 | void __init early_init_mmu_secondary(void) | ||
757 | { | ||
758 | /* Initialize hash table for that CPU */ | ||
737 | if (!firmware_has_feature(FW_FEATURE_LPAR)) | 759 | if (!firmware_has_feature(FW_FEATURE_LPAR)) |
738 | mtspr(SPRN_SDR1, _SDR1); | 760 | mtspr(SPRN_SDR1, _SDR1); |
761 | |||
762 | /* Initialize STAB/SLB. We use a virtual address as it works | ||
763 | * in real mode on pSeries and we want a virutal address on | ||
764 | * iSeries anyway | ||
765 | */ | ||
766 | if (cpu_has_feature(CPU_FTR_SLB)) | ||
767 | slb_initialize(); | ||
768 | else | ||
769 | stab_initialize(get_paca()->stab_addr); | ||
739 | } | 770 | } |
771 | #endif /* CONFIG_SMP */ | ||
740 | 772 | ||
741 | /* | 773 | /* |
742 | * Called by asm hashtable.S for doing lazy icache flush | 774 | * Called by asm hashtable.S for doing lazy icache flush |