소스 검색

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>
Greg Ungerer 14 년 전
부모
커밋
0079fe7502
1개의 변경된 파일46개의 추가작업 그리고 1개의 파일을 삭제
  1. 46 1
      arch/m68k/platform/coldfire/head.S

+ 46 - 1
arch/m68k/platform/coldfire/head.S

@@ -3,7 +3,7 @@
 /*
 /*
  *	head.S -- common startup code for ColdFire CPUs.
  *	head.S -- common startup code for ColdFire CPUs.
  *
  *
- *	(C) Copyright 1999-2010, Greg Ungerer <gerg@snapgear.com>.
+ *	(C) Copyright 1999-2011, Greg Ungerer <gerg@snapgear.com>.
  */
  */
 
 
 /*****************************************************************************/
 /*****************************************************************************/
@@ -13,6 +13,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/asm-offsets.h>
 #include <asm/coldfire.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfsim.h>
+#include <asm/mcfmmu.h>
 #include <asm/thread_info.h>
 #include <asm/thread_info.h>
 
 
 /*****************************************************************************/
 /*****************************************************************************/
@@ -135,6 +136,14 @@ _init_sp:
 
 
 __HEAD
 __HEAD
 
 
+#ifdef CONFIG_MMU
+_start0:
+	jmp	_start
+.global kernel_pg_dir
+.equ	kernel_pg_dir,_start0
+.equ	.,_start0+0x1000
+#endif
+
 /*
 /*
  *	This is the codes first entry point. This is where it all
  *	This is the codes first entry point. This is where it all
  *	begins...
  *	begins...
@@ -193,6 +202,26 @@ _start:
 	movec	%d0,%CACR
 	movec	%d0,%CACR
 	nop
 	nop
 
 
+#ifdef CONFIG_MMU
+	/*
+	 *	Identity mapping for the kernel region.
+	 */
+	movel	#(MMUBASE+1),%d0		/* enable MMUBAR registers */
+	movec	%d0,%MMUBAR
+	movel	#MMUOR_CA,%d0			/* clear TLB entries */
+	movel	%d0,MMUOR
+	movel	#0,%d0				/* set ASID to 0 */
+	movec	%d0,%asid
+
+	movel	#MMUCR_EN,%d0			/* Enable the identity map */
+	movel	%d0,MMUCR
+	nop					/* sync i-pipeline */
+
+	movel	#_vstart,%a0			/* jump to "virtual" space */
+	jmp	%a0@
+_vstart:
+#endif /* CONFIG_MMU */
+
 #ifdef CONFIG_ROMFS_FS
 #ifdef CONFIG_ROMFS_FS
 	/*
 	/*
 	 *	Move ROM filesystem above bss :-)
 	 *	Move ROM filesystem above bss :-)
@@ -238,6 +267,22 @@ _clear_bss:
 	lea	init_thread_union,%a0
 	lea	init_thread_union,%a0
 	lea	THREAD_SIZE(%a0),%sp
 	lea	THREAD_SIZE(%a0),%sp
 
 
+#ifdef CONFIG_MMU
+.global m68k_cputype
+.global m68k_mmutype
+.global m68k_fputype
+.global m68k_machtype
+	movel	#CPU_COLDFIRE,%d0
+	movel	%d0,m68k_cputype		/* Mark us as a ColdFire */
+	movel	#MMU_COLDFIRE,%d0
+	movel	%d0,m68k_mmutype
+	movel	#FPU_COLDFIRE,%d0
+	movel	%d0,m68k_fputype
+	movel	#MACH_M54XX,%d0
+	movel	%d0,m68k_machtype		/* Mark us as a 54xx machine */
+	lea	init_task,%a2			/* Set "current" init task */
+#endif
+
 	/*
 	/*
 	 *	Assember start up done, start code proper.
 	 *	Assember start up done, start code proper.
 	 */
 	 */