m68k: move coldfire MMU initialization code
authorGreg Ungerer <gerg@linux-m68k.org>
Tue, 5 Sep 2017 12:48:42 +0000 (22:48 +1000)
committerGreg Ungerer <gerg@linux-m68k.org>
Sun, 5 Nov 2017 22:25:20 +0000 (08:25 +1000)
The M54[78]x ColdFire parts are not the only members of the ColdFire family
that have an MMU. But currently some of the early MMU initialization code
is inside the startup code specific to only the ColdFire M54[78]x parts.
Move that early ColdFire MMU init code so that it is run for other ColdFire
parts running with MMU enabled.

Specifically this means that the MMU initialization code will now also be
run for the ColdFire M5441x parts when running with MMU enabled.

The code move meant that the extern definition for the mmu_context_init()
function had to be moved as well. To make it clear that is ColdFire specific
I have renamed that with a "cf_" in front of it and put its extern definition
in the mcfmmu.h (which is already included by the setup code).

Reported-by: Angelo Dureghello <angelo@sysam.it>
Tested-by: Angelo Dureghello <angelo@sysam.it>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
arch/m68k/coldfire/m54xx.c
arch/m68k/include/asm/mcfmmu.h
arch/m68k/include/asm/mmu_context.h
arch/m68k/kernel/setup_mm.c
arch/m68k/mm/mcfmmu.c

index e53ffed..adad03c 100644 (file)
@@ -96,10 +96,6 @@ static void mcf54xx_reset(void)
 
 void __init config_BSP(char *commandp, int size)
 {
-#ifdef CONFIG_MMU
-       cf_bootmem_alloc();
-       mmu_context_init();
-#endif
        mach_reset = mcf54xx_reset;
        mach_sched_init = hw_timer_init;
        m54xx_uarts_init();
index 10f9930..283352a 100644 (file)
@@ -106,6 +106,7 @@ static inline void mmu_write(u32 a, u32 v)
 }
 
 void cf_bootmem_alloc(void);
+void cf_mmu_context_init(void);
 int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word);
 
 #endif
index 836acea..f5b1852 100644 (file)
@@ -92,7 +92,6 @@ static inline void activate_mm(struct mm_struct *active_mm,
 
 #define deactivate_mm(tsk, mm) do { } while (0)
 
-extern void mmu_context_init(void);
 #define prepare_arch_switch(next) load_ksp_mmu(next)
 
 static inline void load_ksp_mmu(struct task_struct *task)
index 657a984..93ded52 100644 (file)
@@ -344,6 +344,8 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_COLDFIRE
        case MACH_M54XX:
        case MACH_M5441X:
+               cf_bootmem_alloc();
+               cf_mmu_context_init();
                config_BSP(NULL, 0);
                break;
 #endif
index 8d14085..11eb333 100644 (file)
@@ -184,7 +184,7 @@ void __init cf_bootmem_alloc(void)
  * Initialize the context management stuff.
  * The following was taken from arch/ppc/mmu_context.c
  */
-void __init mmu_context_init(void)
+void __init cf_mmu_context_init(void)
 {
        /*
         * Some processors have too few contexts to reserve one for