Commit d6c88600 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman

powerpc/mm/radix: Update LPCR only if it is powernv

LPCR cannot be updated when running in guest mode.

Fixes: 2bfd65e4 ("powerpc/mm/radix: Add radix callbacks for early init routines")
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 8dd75ccb
...@@ -296,11 +296,6 @@ static void __init radix_init_page_sizes(void) ...@@ -296,11 +296,6 @@ static void __init radix_init_page_sizes(void)
void __init radix__early_init_mmu(void) void __init radix__early_init_mmu(void)
{ {
unsigned long lpcr; unsigned long lpcr;
/*
* setup LPCR UPRT based on mmu_features
*/
lpcr = mfspr(SPRN_LPCR);
mtspr(SPRN_LPCR, lpcr | LPCR_UPRT);
#ifdef CONFIG_PPC_64K_PAGES #ifdef CONFIG_PPC_64K_PAGES
/* PAGE_SIZE mappings */ /* PAGE_SIZE mappings */
...@@ -343,8 +338,11 @@ void __init radix__early_init_mmu(void) ...@@ -343,8 +338,11 @@ void __init radix__early_init_mmu(void)
__pte_frag_size_shift = H_PTE_FRAG_SIZE_SHIFT; __pte_frag_size_shift = H_PTE_FRAG_SIZE_SHIFT;
radix_init_page_sizes(); radix_init_page_sizes();
if (!firmware_has_feature(FW_FEATURE_LPAR)) if (!firmware_has_feature(FW_FEATURE_LPAR)) {
lpcr = mfspr(SPRN_LPCR);
mtspr(SPRN_LPCR, lpcr | LPCR_UPRT);
radix_init_partition_table(); radix_init_partition_table();
}
radix_init_pgtable(); radix_init_pgtable();
} }
...@@ -353,16 +351,15 @@ void radix__early_init_mmu_secondary(void) ...@@ -353,16 +351,15 @@ void radix__early_init_mmu_secondary(void)
{ {
unsigned long lpcr; unsigned long lpcr;
/* /*
* setup LPCR UPRT based on mmu_features * update partition table control register and UPRT
*/ */
lpcr = mfspr(SPRN_LPCR); if (!firmware_has_feature(FW_FEATURE_LPAR)) {
mtspr(SPRN_LPCR, lpcr | LPCR_UPRT); lpcr = mfspr(SPRN_LPCR);
/* mtspr(SPRN_LPCR, lpcr | LPCR_UPRT);
* update partition table control register, 64 K size.
*/
if (!firmware_has_feature(FW_FEATURE_LPAR))
mtspr(SPRN_PTCR, mtspr(SPRN_PTCR,
__pa(partition_tb) | (PATB_SIZE_SHIFT - 12)); __pa(partition_tb) | (PATB_SIZE_SHIFT - 12));
}
} }
void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base, void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment