Resent-Date: Thu, 6 May 1999 13:10:30 +0200 (MET DST)
From: Richard Zidlicky <Richard.Zidlicky@stud.informatik.uni-erlangen.de>
Date: Thu, 6 May 1999 13:10:15 +0200 (METDST)
To: linux-m68k@lists.linux-m68k.org
Subject: 2.2.6 patches
Cc: Jes.Sorensen@cern.ch
Resent-From: linux-m68k@phil.uni-sb.de

Hello,

some patches for 2.2.6. Corrects a small typo in asm/setup.h and adds
Q40 SRAM debugging support to kernel/head.S

Bye
Richard

diff -u -r -N -B linux-2.2.6orig/include/asm-m68k/setup.h linux-q40-2.2.6/include/asm-m68k/setup.h
--- linux-2.2.6orig/include/asm-m68k/setup.h	Mon May  3 22:21:06 1999
+++ linux-q40-2.2.6/include/asm-m68k/setup.h	Mon May  3 23:27:25 1999
@@ -138,7 +138,7 @@
 	|| defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
 	|| defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
 	|| defined(CONFIG_SUN3X)
-#  define MAC_IS_HP300 (m68k_machtype == MACH_HP300)
+#  define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
 #else
 #  define MACH_HP300_ONLY
 #  define MACH_IS_HP300 (1)


diff -u -r -N -B linux-2.2.6orig/arch/m68k/kernel/head.S linux-q40-2.2.6/arch/m68k/kernel/head.S
--- linux-2.2.6orig/arch/m68k/kernel/head.S	Mon May  3 22:19:41 1999
+++ linux-q40-2.2.6/arch/m68k/kernel/head.S	Tue May  4 20:14:10 1999
@@ -307,6 +307,9 @@
 #ifdef CONFIG_MVME16x
 .globl SYMBOL_NAME(mvme_bdid_ptr)
 #endif
+#ifdef CONFIG_Q40
+.globl SYMBOL_NAME(q40_mem_cptr)	
+#endif		
 
 CPUTYPE_040	= 1	/* indicates an 040 */
 CPUTYPE_060	= 2	/* indicates an 060 */
@@ -2754,6 +2757,31 @@
 L(serial_init_not_mac):
 #endif	/* CONFIG_MAC */
 
+#ifdef CONFIG_Q40
+	is_not_q40(2f)
+/* debug output goes into SRAM, so we don't do it unless requested
+   - check for '%LX$' signature in SRAM   */
+	lea	%pc@(SYMBOL_NAME(q40_mem_cptr)),%a1
+	move.l	#0xff020010,%a1@  /* must be inited - also used by debug=mem */
+	move.l	#0xff020000,%a1   
+	cmp.b	#'%',%a1@
+	bne	2f	/*nodbg*/
+	addq.w	#4,%a1
+	cmp.b	#'L',%a1@
+	bne	2f	/*nodbg*/
+	addq.w	#4,%a1
+	cmp.b	#'X',%a1@
+	bne	2f	/*nodbg*/
+	addq.w	#4,%a1
+	cmp.b	#'$',%a1@
+	bne	2f	/*nodbg*/
+	/* signature OK */
+	lea	%pc@(L(q40_do_debug)),%a1
+	tas	%a1@
+/*nodbg: q40_do_debug is 0 by default*/	
+2:		
+#endif	
+	
 L(serial_init_done):
 func_return	serial_init
 
@@ -2870,6 +2898,18 @@
 2:
 #endif
 
+#ifdef CONFIG_Q40
+	is_not_q40(2f)
+	tst.l	%pc@(L(q40_do_debug))	/* only debug if requested */
+	beq	2f
+	lea	%pc@(SYMBOL_NAME(q40_mem_cptr)),%a1
+	move.l	%a1@,%a0
+	move.b	%d0,%a0@
+	addq.l	#4,%a0
+	move.l	%a0,%a1@
+2:		
+#endif	
+
 L(serial_putc_done):
 func_return	serial_putc
 
@@ -3560,3 +3600,9 @@
 SYMBOL_NAME_LABEL(mvme_bdid_ptr)
 	.long	0
 #endif
+#if defined(CONFIG_Q40)
+SYMBOL_NAME_LABEL(q40_mem_cptr)
+	.long 0
+L(q40_do_debug):	
+	.long 0	
+#endif


