Skip to content

Commit 756d08d

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm: Abstract early MMU init in preparation for radix
Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 6cc1a0e commit 756d08d

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

arch/powerpc/include/asm/book3s/64/mmu.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,25 @@ extern int mmu_vmalloc_psize;
9797
extern int mmu_vmemmap_psize;
9898
extern int mmu_io_psize;
9999

100+
/* MMU initialization */
101+
extern void hash__early_init_mmu(void);
102+
static inline void early_init_mmu(void)
103+
{
104+
return hash__early_init_mmu();
105+
}
106+
extern void hash__early_init_mmu_secondary(void);
107+
static inline void early_init_mmu_secondary(void)
108+
{
109+
return hash__early_init_mmu_secondary();
110+
}
111+
112+
extern void hash__setup_initial_memory_limit(phys_addr_t first_memblock_base,
113+
phys_addr_t first_memblock_size);
114+
static inline void setup_initial_memory_limit(phys_addr_t first_memblock_base,
115+
phys_addr_t first_memblock_size)
116+
{
117+
return hash__setup_initial_memory_limit(first_memblock_base,
118+
first_memblock_size);
119+
}
100120
#endif /* __ASSEMBLY__ */
101121
#endif /* _ASM_POWERPC_BOOK3S_64_MMU_H_ */

arch/powerpc/include/asm/mmu.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,6 @@ static inline void mmu_clear_feature(unsigned long feature)
122122

123123
extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup;
124124

125-
/* MMU initialization */
126-
extern void early_init_mmu(void);
127-
extern void early_init_mmu_secondary(void);
128-
129-
extern void setup_initial_memory_limit(phys_addr_t first_memblock_base,
130-
phys_addr_t first_memblock_size);
131-
132125
#ifdef CONFIG_PPC64
133126
/* This is our real memory area size on ppc64 server, on embedded, we
134127
* make it match the size our of bolted TLB area
@@ -185,6 +178,13 @@ static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
185178
#include <asm/book3s/64/mmu.h>
186179
#else /* CONFIG_PPC_BOOK3S_64 */
187180

181+
#ifndef __ASSEMBLY__
182+
/* MMU initialization */
183+
extern void early_init_mmu(void);
184+
extern void early_init_mmu_secondary(void);
185+
extern void setup_initial_memory_limit(phys_addr_t first_memblock_base,
186+
phys_addr_t first_memblock_size);
187+
#endif /* __ASSEMBLY__ */
188188
#endif
189189

190190
#if defined(CONFIG_PPC_STD_MMU_32)

arch/powerpc/mm/hash_utils_64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ static void __init htab_initialize(void)
868868
#undef KB
869869
#undef MB
870870

871-
void __init early_init_mmu(void)
871+
void __init hash__early_init_mmu(void)
872872
{
873873
/*
874874
* initialize page table size
@@ -893,7 +893,7 @@ void __init early_init_mmu(void)
893893
}
894894

895895
#ifdef CONFIG_SMP
896-
void early_init_mmu_secondary(void)
896+
void hash__early_init_mmu_secondary(void)
897897
{
898898
/* Initialize hash table for that CPU */
899899
if (!firmware_has_feature(FW_FEATURE_LPAR))
@@ -1635,7 +1635,7 @@ void __kernel_map_pages(struct page *page, int numpages, int enable)
16351635
}
16361636
#endif /* CONFIG_DEBUG_PAGEALLOC */
16371637

1638-
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
1638+
void hash__setup_initial_memory_limit(phys_addr_t first_memblock_base,
16391639
phys_addr_t first_memblock_size)
16401640
{
16411641
/* We don't currently support the first MEMBLOCK not mapping 0

0 commit comments

Comments
 (0)