[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] [PATCH] FreeMiNT for ColdFire: mfp.xdd



Here are the ColdFire patches for mfp.xdd.

Currently, the FireBee has no hardware SCC emulation, it only has an MFP serial port (as well as an additional ColdFire serial port). However that MFP serial port has not been tested yet on the FireBee, and I suspect some very low level support to be still lacking. As a result, I have not been able to test this patch. But it is simple enough to be bug-free, and it compiles well.

Also, mfp.xdd will require further changes to be installed correctly on the FireBee (Falcon hardware without SCC but with MFP serial port). We will do those minor changes later, after debugging on the FireBee, and when the cookies issues are solved.

To compile for ColdFire:
cd freemint/sys/xdd/mfp
make CPU=v4e mfp.xdd

Alan, please commit!

mfp.patch
Added ColdFire support. Contributed by Vincent Riviere.

--
Vincent Rivière
--- freemint.orig/sys/xdd/mfp/mfp.c	2007-07-14 00:48:36.000000000 +0200
+++ freemint/sys/xdd/mfp/mfp.c	2011-06-19 14:49:31.937500000 +0200
@@ -1718,10 +1718,10 @@
 	__asm__ volatile
 	(
 		 "_mfp1_dcdint:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp,%%a0\n\t" \
 		 "bsr     _mfp_dcdint\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1731,10 +1731,10 @@
 	asm volatile
 	(
 		"_mfp1_ctsint:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp,%%a0\n\t" \
 		 "bsr     _mfp_ctsint\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1744,10 +1744,10 @@
 	asm volatile
 	(
 		"_mfp1_txerror:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp,%%a0\n\t" \
 		 "bsr     _mfp_txerror\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1757,10 +1757,10 @@
 	asm volatile
 	(
 		"_mfp1_txempty:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp,%%a0\n\t" \
 		 "bsr     _mfp_txempty\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1770,10 +1770,10 @@
 	asm volatile
 	(
 		"_mfp1_rxerror:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp,%%a0\n\t" \
 		 "bsr     _mfp_rxerror\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1783,10 +1783,10 @@
 	asm volatile
 	(
 		"_mfp1_rxavail:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp,%%a0\n\t" \
 		 "bsr     _mfp_rxavail\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1801,10 +1801,10 @@
 	asm volatile
 	(
 		"_ttmfp1_txerror:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp_tt,%%a0\n\t" \
 		 "bsr     _mfp_txerror\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1814,10 +1814,10 @@
 	asm volatile
 	(
 		"_ttmfp1_txempty:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp_tt,%%a0\n\t" \
 		 "bsr     _mfp_txempty\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1827,10 +1827,10 @@
 	asm volatile
 	(
 		"_ttmfp1_rxerror:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp_tt,%%a0\n\t" \
 		 "bsr     _mfp_rxerror\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */
@@ -1840,10 +1840,10 @@
 	asm volatile
 	(
 		"_ttmfp1_rxavail:\n\t" \
-		 "movem.l %%a0-%%a2/%%d0-%%d2,-(%%sp)\n\t" \
+		 PUSH_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "move.l  _iovar_mfp_tt,%%a0\n\t" \
 		 "bsr     _mfp_rxavail\n\t" \
-		 "movem.l (%%sp)+,%%a0-%%a2/%%d0-%%d2\n\t" \
+		 POP_SP("%%a0-%%a2/%%d0-%%d2", 24) \
 		 "rte"
 		: 			/* output register */
 		:  			/* input registers */