Date: Fri, 2 Jan 1998 13:01:48 -0800 (PST)
From: Michael Schmitz <SCHMITZ@LCBVAX.CCHEM.BERKELEY.EDU>
To: linux-m68k@lists.linux-m68k.org
Subject: L68K: Diffs from the Mac side (2.1.72)
Sender: owner-linux-m68k@phil.uni-sb.de

Hi,

the patches to Atari and Amiga code announced yesterday (sorry I couldn't
send it earlier but the network here in the Department of Chemistry went down
yesterday).

- Atari partition check: use correct hd_size

- lp drivers: hands off if not Atari or Amiga ...

- Atari interrupt code: don't reset the SCC if it's in use by the serial
  debug code, please ... 

More stuff follows as soon as Jes shows up again.. Question: console/video
related patches only to you, Geert?? 

All is well on the bleeding edge ...

	Michael


--- linux-2.1.72/arch/m68k/atari/stram.c.org	Tue Dec 30 05:19:28 1997
+++ linux-2.1.72/arch/m68k/atari/stram.c	Tue Dec 30 05:20:56 1997
@@ -1259,16 +1259,21 @@
 
 int stram_device_init( void )
 {
-	if (!max_swap_size)
-		/* swapping not enabled */
-		return( -ENXIO );
+
+    if (!MACH_IS_ATARI)
+    	/* no point in initializing this, I hope */
+	return( -ENXIO );
+
+    if (!max_swap_size)
+        /* swapping not enabled */
+	return( -ENXIO );
 	
     if (register_blkdev( STRAM_MAJOR, "stram", &stram_fops)) {
         printk( KERN_ERR "stram: Unable to get major %d\n", STRAM_MAJOR );
         return( -ENXIO );
     }
 
-	blk_dev[STRAM_MAJOR].request_fn = do_stram_request;
+    blk_dev[STRAM_MAJOR].request_fn = do_stram_request;
     blksize_size[STRAM_MAJOR] = stram_blocksizes;
 	stram_sizes[STRAM_MINOR] = (swap_end - swap_start)/1024;
     blk_size[STRAM_MAJOR] = stram_sizes;
--- linux-2.1.72/arch/m68k/atari/ataints.c.org	Fri Jan  2 04:34:23 1998
+++ linux-2.1.72/arch/m68k/atari/ataints.c	Fri Jan  2 04:33:38 1998
@@ -314,6 +314,8 @@
 
 extern void atari_microwire_cmd( int cmd );
 
+extern int atari_SCC_reset_done;
+
 /*
  * void atari_init_IRQ (void)
  *
@@ -358,7 +360,7 @@
 		tt_mfp.int_mk_b = 0xff;
 	}
 
-	if (ATARIHW_PRESENT(SCC)) {
+	if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) {
 		scc.cha_a_ctrl = 9;
 		MFPDELAY();
 		scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */
--- linux-2.1.72/drivers/char/lp_intern.c.org	Thu Jan  1 03:06:57 1998
+++ linux-2.1.72/drivers/char/lp_intern.c	Thu Jan  1 03:06:57 1998
@@ -193,6 +193,10 @@
       tab.type = LP_ATARI;
     }
 #endif
+#ifdef CONFIG_MAC
+    if (MACH_IS_MAC)
+    	return -ENODEV;
+#endif
 
   if ((minor = register_parallel(&tab, minor)) < 0) {
     printk("builtin lp init: cant get a minor\n");
--- linux-2.1.72/drivers/char/lp_mfc.c.org	Thu Jan  1 03:09:07 1998
+++ linux-2.1.72/drivers/char/lp_mfc.c	Thu Jan  1 03:08:49 1998
@@ -100,6 +100,9 @@
 unsigned int key = 0;
 const struct ConfigDev *cd;
 
+if (!MACH_IS_AMIGA)
+  return -ENODEV;
+
 pias = 0;
 while((key = zorro_find(ZORRO_PROD_BSC_MULTIFACE_III, 0 , key))) {
   cd = zorro_get_board( key );
--- linux-2.1.72/drivers/block/ataflop.c.org	Tue Dec 30 05:18:16 1997
+++ linux-2.1.72/drivers/block/ataflop.c	Tue Dec 30 05:18:16 1997
@@ -2026,6 +2026,10 @@
 {
 	int i;
 
+	if (!MACH_IS_ATARI)
+		/* Amiga, Mac, ... don't have Atari-compatible floppy :-) */
+		return -ENXIO;
+
 	if (MACH_IS_HADES)
 		/* Hades doesn't have Atari-compatible floppy */
 		return -ENXIO;
--- linux-2.1.72/drivers/block/partbl_atari.c.org	Thu Jan  1 05:48:24 1998
+++ linux-2.1.72/drivers/block/partbl_atari.c	Thu Jan  1 05:47:48 1998
@@ -56,7 +56,7 @@
     }
 
   rs = (struct rootsector *) bh->b_data;
-  hd_size = hd->part[0].nr_sects;
+  hd_size = hd->part[current_minor-1].nr_sects;
   if (!VALID_PARTITION( &rs->part[0], hd_size ) &&
       !VALID_PARTITION( &rs->part[1], hd_size ) &&
       !VALID_PARTITION( &rs->part[2], hd_size ) &&

