]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/setup_64.c
Merge branch 'pm-devfreq'
[karo-tx-linux.git] / arch / powerpc / kernel / setup_64.c
index 4933909cc5c001045b57f8fffef44c2a42478985..fbe24377eda3e4f268d6074e0803dd0891c8c416 100644 (file)
@@ -74,7 +74,6 @@
 #define DBG(fmt...)
 #endif
 
-int boot_cpuid = 0;
 int spinning_secondaries;
 u64 ppc64_pft_size;
 
@@ -196,6 +195,19 @@ static void fixup_boot_paca(void)
        get_paca()->data_offset = 0;
 }
 
+static void cpu_ready_for_interrupts(void)
+{
+       /* Set IR and DR in PACA MSR */
+       get_paca()->kernel_msr = MSR_KERNEL;
+
+       /* Enable AIL if supported */
+       if (cpu_has_feature(CPU_FTR_HVMODE) &&
+           cpu_has_feature(CPU_FTR_ARCH_207S)) {
+               unsigned long lpcr = mfspr(SPRN_LPCR);
+               mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
+       }
+}
+
 /*
  * Early initialization entry point. This is called by head.S
  * with MMU translation disabled. We rely on the "feature" of
@@ -262,6 +274,14 @@ void __init early_setup(unsigned long dt_ptr)
        /* Initialize the hash table or TLB handling */
        early_init_mmu();
 
+       /*
+        * At this point, we can let interrupts switch to virtual mode
+        * (the MMU has been setup), so adjust the MSR in the PACA to
+        * have IR and DR set and enable AIL if it exists
+        */
+       cpu_ready_for_interrupts();
+
+       /* Reserve large chunks of memory for use by CMA for KVM */
        kvm_cma_reserve();
 
        /*
@@ -294,6 +314,13 @@ void early_setup_secondary(void)
 
        /* Initialize the hash table or TLB handling */
        early_init_mmu_secondary();
+
+       /*
+        * At this point, we can let interrupts switch to virtual mode
+        * (the MMU has been setup), so adjust the MSR in the PACA to
+        * have IR and DR set.
+        */
+       cpu_ready_for_interrupts();
 }
 
 #endif /* CONFIG_SMP */