aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2011-10-14 01:35:37 -0400
committerGreg Ungerer <gerg@uclinux.org>2011-12-29 19:20:23 -0500
commit0079fe7502b45c2dbec6d04541e637484191c393 (patch)
tree216f9938398b268bd0ea42c5e9fb2d7d68443483 /arch
parentfeb1ee759522eb67e7733fe5b59bd17420f4d2d8 (diff)
m68k: init the MMU hardware for the 54xx ColdFire
The 54xx ColdFire CPU family has an internal MMU. Up to now though we have only supported running on them with the MMU disabled. Add code to the 54xx ColdFire init sequence to initialize the bootmem used by the usual MMU m68k code for paging init. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Matt Waddel <mwaddel@yahoo.com> Acked-by: Kurt Mahan <kmahan@xmission.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/platform/coldfire/head.S47
1 files changed, 46 insertions, 1 deletions
diff --git a/arch/m68k/platform/coldfire/head.S b/arch/m68k/platform/coldfire/head.S
index 49666b4dd091..38f04a3f6207 100644
--- a/arch/m68k/platform/coldfire/head.S
+++ b/arch/m68k/platform/coldfire/head.S
@@ -3,7 +3,7 @@
3/* 3/*
4 * head.S -- common startup code for ColdFire CPUs. 4 * head.S -- common startup code for ColdFire CPUs.
5 * 5 *
6 * (C) Copyright 1999-2010, Greg Ungerer <gerg@snapgear.com>. 6 * (C) Copyright 1999-2011, Greg Ungerer <gerg@snapgear.com>.
7 */ 7 */
8 8
9/*****************************************************************************/ 9/*****************************************************************************/
@@ -13,6 +13,7 @@
13#include <asm/asm-offsets.h> 13#include <asm/asm-offsets.h>
14#include <asm/coldfire.h> 14#include <asm/coldfire.h>
15#include <asm/mcfsim.h> 15#include <asm/mcfsim.h>
16#include <asm/mcfmmu.h>
16#include <asm/thread_info.h> 17#include <asm/thread_info.h>
17 18
18/*****************************************************************************/ 19/*****************************************************************************/
@@ -135,6 +136,14 @@ _init_sp:
135 136
136__HEAD 137__HEAD
137 138
139#ifdef CONFIG_MMU
140_start0:
141 jmp _start
142.global kernel_pg_dir
143.equ kernel_pg_dir,_start0
144.equ .,_start0+0x1000
145#endif
146
138/* 147/*
139 * This is the codes first entry point. This is where it all 148 * This is the codes first entry point. This is where it all
140 * begins... 149 * begins...
@@ -193,6 +202,26 @@ _start:
193 movec %d0,%CACR 202 movec %d0,%CACR
194 nop 203 nop
195 204
205#ifdef CONFIG_MMU
206 /*
207 * Identity mapping for the kernel region.
208 */
209 movel #(MMUBASE+1),%d0 /* enable MMUBAR registers */
210 movec %d0,%MMUBAR
211 movel #MMUOR_CA,%d0 /* clear TLB entries */
212 movel %d0,MMUOR
213 movel #0,%d0 /* set ASID to 0 */
214 movec %d0,%asid
215
216 movel #MMUCR_EN,%d0 /* Enable the identity map */
217 movel %d0,MMUCR
218 nop /* sync i-pipeline */
219
220 movel #_vstart,%a0 /* jump to "virtual" space */
221 jmp %a0@
222_vstart:
223#endif /* CONFIG_MMU */
224
196#ifdef CONFIG_ROMFS_FS 225#ifdef CONFIG_ROMFS_FS
197 /* 226 /*
198 * Move ROM filesystem above bss :-) 227 * Move ROM filesystem above bss :-)
@@ -238,6 +267,22 @@ _clear_bss:
238 lea init_thread_union,%a0 267 lea init_thread_union,%a0
239 lea THREAD_SIZE(%a0),%sp 268 lea THREAD_SIZE(%a0),%sp
240 269
270#ifdef CONFIG_MMU
271.global m68k_cputype
272.global m68k_mmutype
273.global m68k_fputype
274.global m68k_machtype
275 movel #CPU_COLDFIRE,%d0
276 movel %d0,m68k_cputype /* Mark us as a ColdFire */
277 movel #MMU_COLDFIRE,%d0
278 movel %d0,m68k_mmutype
279 movel #FPU_COLDFIRE,%d0
280 movel %d0,m68k_fputype
281 movel #MACH_M54XX,%d0
282 movel %d0,m68k_machtype /* Mark us as a 54xx machine */
283 lea init_task,%a2 /* Set "current" init task */
284#endif
285
241 /* 286 /*
242 * Assember start up done, start code proper. 287 * Assember start up done, start code proper.
243 */ 288 */