Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 May 1997 16:16:40 -0400
From:      "Donald J. Maddox" <root@cola47.scsn.net>
To:        Wolfgang Helbig <helbig@MX.BA-Stuttgart.De>
Cc:        FreeBSD-current@FreeBSD.ORG
Subject:   Re: sio1: 64 events for device with no tp
Message-ID:  <19970525161640.02033@cola47.scsn.net>
In-Reply-To: <199705251951.VAA00443@helbig.informatik.ba-stuttgart.de>; from Wolfgang Helbig on Sun, May 25, 1997 at 09:51:22PM %2B0200
References:  <199705251951.VAA00443@helbig.informatik.ba-stuttgart.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 25, 1997 at 09:51:22PM +0200, Wolfgang Helbig wrote:
> Hi,
> 
> The above kernel message shows up during booting for both sio0 and sio1.
> Up to now its just annoying -- the messages are repeated once
> syslogd is started.
> 
> This behaviour seems buggy to me. These  messages were not  
> by the release 1.164 sio driver. The kernel is pretty current,
> using release 1.169 of sio.c. (FreeBSD-current)
> 
> Only the serial interface 0 is used on this system, connected to
> a mouse. It still works.
> 
> Maybe there is some bug in sio.c to be fixed ?

    The following is a patch from phk that will stop the messages...  If you
want to enable the COM_BIGFIFO stuff, set FLAGS=0x20000 in the sio lines in
your config file (COM_BIGFIFO doesn't work for my Motorola ModemSurfer Modem.
YMMV).

----------------------------CUT HERE-----------------------


Index: sio.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/sio.c,v
retrieving revision 1.167
diff -u -r1.167 sio.c
--- sio.c	1997/05/18 21:22:11	1.167
+++ sio.c	1997/05/22 06:50:53
@@ -121,6 +121,7 @@
 #define	COM_NOFIFO(dev)		((dev)->id_flags & 0x02)
 #define	COM_VERBOSE(dev)	((dev)->id_flags & 0x80)
 #define	COM_NOTST3(dev)		((dev)->id_flags & 0x10000)
+#define	COM_BIGFIFO(dev)	((dev)->id_flags & 0x20000)
 
 #define	com_scr		7	/* scratch register for 16450-16550 (R/W) */
 
@@ -884,45 +885,40 @@
 	case FIFO_RX_HIGH:
 		if (COM_NOFIFO(isdp)) {
 			printf(" 16550A fifo disabled");
+		} else if (!COM_BIGFIFO(isdp)) {
+			printf(" 16550A");
 		} else {
 			/* Detect the fifo size. */
 			int i, n;
 
 			/* Enable and reset the FIFO. */
-			outb (iobase+com_fifo, FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST);
+			outb(iobase+com_fifo, FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST);
 
-			/* Set the loopback mode, 57600 baud. */
-			outb (iobase+com_cfcr, CFCR_DLAB);
-			outb (iobase+com_dlbh, 0);
-			outb (iobase+com_dlbl, 2);
-			outb (iobase+com_cfcr, CFCR_8BITS);
-			outb (iobase+com_mcr, MCR_LOOPBACK);
-			inb (iobase+com_lsr);
+			/* Set the loopback mode, and very low baud. */
+			/* XXX: What happens if this is a serial console ? */
+			outb(iobase+com_cfcr, CFCR_DLAB);
+			outb(iobase+com_dlbh, 0xff);
+			outb(iobase+com_dlbl, 0xff);
+			outb(iobase+com_cfcr, CFCR_8BITS);
+			outb(iobase+com_mcr, MCR_LOOPBACK);
+			inb(iobase+com_lsr);
 
 			/* Put data into transmit FIFO and wait until overrun. */
 			for (i=n=0; i<20000; ++i) {
-				unsigned char lsr = inb (iobase+com_lsr);
+				unsigned char lsr = inb(iobase+com_lsr);
 				if (lsr & LSR_OE)
 					break;
 				if (lsr & LSR_TXRDY) {
-					outb (iobase+com_data, 0x5A);
-					++n;
+					outb(iobase+com_data, 0x5A);
+					n++;
 				}
 			}
-			outb (iobase+com_mcr, 0);
-			outb (iobase+com_fifo, 0);
+			outb(iobase+com_mcr, com->mcr_image);
+			outb(iobase+com_fifo, 0);
 
 			com->hasfifo = TRUE;
-			if (n > 40) {
-				com->tx_fifo_size = 64;
-				printf(" 16750");
-			} else if (n > 24) {
-				com->tx_fifo_size = 32;
-				printf(" 16650");
-			} else {
-				com->tx_fifo_size = 16;
-				printf(" 16550A");
-			}
+			com->tx_fifo_size = n;
+			printf(" 16550A lookalike with %d bytes xmit-FIFO",n);
 #ifdef COM_ESP
 			for (espp = likely_esp_ports; *espp != 0; espp++)
 				if (espattach(isdp, com, *espp)) {
@@ -931,31 +927,6 @@
 				}
 #endif
 		}
-#if 0
-		/*
-		 * Check for the Startech ST16C650 chip.
-		 * it has a shadow register under the com_iir,
-		 * which can only be accessed when cfcr == 0xff
-		 */
-		{
-		u_char i, j;
-
-		i = inb(iobase + com_iir);
-		outb(iobase + com_cfcr, 0xff);
-		outb(iobase + com_iir, 0x0);
-		outb(iobase + com_cfcr, CFCR_8BITS);
-		j = inb(iobase + com_iir);
-		outb(iobase + com_iir, i);
-		if (i != j) {
-			printf(" 16550A");
-		} else {
-			com->tx_fifo_size = 32;
-			printf(" 16650");
-		}
-		if (!com->tx_fifo_size)
-			printf(" fifo disabled");
-		}
-#endif
 		break;
 	}
 #ifdef COM_ESP



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970525161640.02033>