Date: Sat, 11 Apr 1998 15:05:28 +0200 (MEST)
From: Bernd Harries <bharries@vossnet.de>
X-Sender: bharries@hexe.bis.uni-oldenburg.de
To: linux-m68k@lists.linux-m68k.org
Subject: L68K: 230400 & 460800 bps SCC diff
In-Reply-To: <Pine.LNX.3.96.980411020040.318A-100000@hexe.bis.uni-oldenburg.de>
Sender: owner-linux-m68k@phil.uni-sb.de

Hi Folks!

Here's a small Easter egg for speed junkies... ;-)

The patch enables 230400 bps on ttyS3 in Ataris and also 460800 bps on SCC
RS232 Ports of the MVME16x systems.

If your Computer get's into sweat at such high speed you could help
yourself by pulling the 8530 out and inserting a 85230 which has 8 FIFO
slots instead of 3. The device fits 1:1 into the 8530 socket.

I did it in my Medusa to operate my Speed Dragon with 230400 bps.

mgetty and pppd support that rate. Next thing to do is patch cu and
minicom to do so. When compiling minicom I experienced that termcap.h is
not on my system. Does anyone know which .deb package contains it?

The cu program compiled already but maybe I have to switch multiple config
variables: It doesn't see the config files in /etc/uucp/...

But here comes the diff:

-----------------------------------------
--- drivers/char/atari_SCC.c_orig	Sat Mar 28 19:42:52 1998
+++ drivers/char/atari_SCC.c	Sat Apr 11 14:25:02 1998
@@ -151,7 +151,7 @@
  * channel A and for both channels on the Mega STE/Falcon. (TRxC is unused)
  */
 
-static BAUD_ENTRY bdtab_norm[18] = {
+static BAUD_ENTRY bdtab_norm[20] = {
 	/* B0      */ { 0, 0 },
 	/* B50     */ { CLK_RTxC, 4590 },
 	/* B75     */ { CLK_RTxC, 3060 },
@@ -167,15 +167,17 @@
 	/* B4800   */ { CLK_RTxC, 48 },
 	/* B9600   */ { CLK_RTxC, 24 },
 	/* B19200  */ { CLK_RTxC, 12 },
-	/* B38400  */ { CLK_RTxC, 6 },
-	/* B57600  */ { CLK_RTxC, 4 },
-	/* B115200 */ { CLK_RTxC, 2 }
+	/* B38400  */ { CLK_RTxC, 6 },   /* #15 spd_extra */
+	/* B57600  */ { CLK_RTxC, 4 },   /* #16 spd_hi */
+	/* B115200 */ { CLK_RTxC, 2 },   /* #17 spd_vhi */
+	/* B230400 */ { CLK_RTxC, 1 },   /* #18 spd_shi */
+	/* B460800 */ { 0, 0 }           /* #19 spd_warp: Impossible */
 };
 
 /* This is a special table for the TT channel B with 307.2 kHz at RTxC
  * and 2.4576 MHz at TRxC
  */
-static BAUD_ENTRY bdtab_TTChB[18] = {
+static BAUD_ENTRY bdtab_TTChB[20] = {
 	/* B0      */ { 0, 0 },
 	/* B50     */ { CLK_RTxC, 384 },
 	/* B75     */ { CLK_RTxC, 256 },
@@ -193,14 +195,16 @@
 	/* B19200  */ { CLK_RTxC, 1 },
 	/* B38400  */ { CLK_TRxC, 4 },
 	/* B57600  */ { CLK_TRxC, 2 }, /* 57600 is not possible, use 76800 instead */
-	/* B115200 */ { CLK_TRxC, 1 }  /* 115200 is not possible, use 153600 instead */
+	/* B115200 */ { CLK_TRxC, 1 }, /* 115200 is not possible, use 153600 instead */
+	/* B230400 */ { 0, 0 },        /* #18 spd_shi: Impossible  */
+	/* B460800 */ { 0, 0 }         /* #19 spd_warp: Impossible */
 };
 #endif
 
 #ifdef CONFIG_MVME162_SCC
 /* This table is used if RTxC = pCLK = 10 MHz. This is the case for MVME162
  */
-static BAUD_ENTRY bdtab_mvme[18] = {
+static BAUD_ENTRY bdtab_mvme[20] = {
 	/* B0      */ { 0, 0 },
 	/* B50     */ { CLK_PCLK, 12500 },
 	/* B75     */ { CLK_PCLK, 8332 },
@@ -218,13 +222,15 @@
 	/* B19200  */ { CLK_PCLK, 32 },
 	/* B38400  */ { CLK_PCLK, 16 },
 	/* B57600  */ { CLK_PCLK, 8 },
-	/* B115200 */ { CLK_PCLK, 4 }
+	/* B115200 */ { CLK_PCLK, 4 },
+	/* B230400 */ { CLK_PCLK, 2 },   /* #18 spd_shi */
+	/* B460800 */ { CLK_PCLK, 1 }    /* #19 spd_warp */
 };
 #endif
 
 
 /* User settable tables */
-static BAUD_ENTRY bdtab_usr[2][18];
+static BAUD_ENTRY bdtab_usr[2][20];
 
 
 /*
@@ -1826,9 +1832,14 @@
 	}
 
 	if (!div) {
-		if (baud > 17) baud = 17;
+		if (baud > 19) baud = 19;
 		clksrc = SCC_baud_table[channel][baud].clksrc;
 		div = SCC_baud_table[channel][baud].div;
+		if(!div)
+		{
+			printk(" SCC_change_speed: divisor = 0 !!!");
+			return;
+		}
 	}
 
 	/* compute the SCC's clock source, clock mode, BRG mode and BRG

-----------------------------------------

Bernd Harries

bharries@freeyellow.com  http://www.freeyellow.com/members/bharries
bharries@vossnet.de      Tel.: +49 421 809 7351  priv.   Linux-m68k
harries@atlas.de               +49 421 457 3966  offi.   Medusa T40

