Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: move coldfire MMU initialization code

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>

+4 -6
-4
arch/m68k/coldfire/m54xx.c
··· 96 96 97 97 void __init config_BSP(char *commandp, int size) 98 98 { 99 - #ifdef CONFIG_MMU 100 - cf_bootmem_alloc(); 101 - mmu_context_init(); 102 - #endif 103 99 mach_reset = mcf54xx_reset; 104 100 mach_sched_init = hw_timer_init; 105 101 m54xx_uarts_init();
+1
arch/m68k/include/asm/mcfmmu.h
··· 106 106 } 107 107 108 108 void cf_bootmem_alloc(void); 109 + void cf_mmu_context_init(void); 109 110 int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word); 110 111 111 112 #endif
-1
arch/m68k/include/asm/mmu_context.h
··· 92 92 93 93 #define deactivate_mm(tsk, mm) do { } while (0) 94 94 95 - extern void mmu_context_init(void); 96 95 #define prepare_arch_switch(next) load_ksp_mmu(next) 97 96 98 97 static inline void load_ksp_mmu(struct task_struct *task)
+2
arch/m68k/kernel/setup_mm.c
··· 344 344 #ifdef CONFIG_COLDFIRE 345 345 case MACH_M54XX: 346 346 case MACH_M5441X: 347 + cf_bootmem_alloc(); 348 + cf_mmu_context_init(); 347 349 config_BSP(NULL, 0); 348 350 break; 349 351 #endif
+1 -1
arch/m68k/mm/mcfmmu.c
··· 184 184 * Initialize the context management stuff. 185 185 * The following was taken from arch/ppc/mmu_context.c 186 186 */ 187 - void __init mmu_context_init(void) 187 + void __init cf_mmu_context_init(void) 188 188 { 189 189 /* 190 190 * Some processors have too few contexts to reserve one for